cvs: pear /PEAR_Frontend_Gtk Gtk.php /PEAR_Frontend_Gtk/Gtk Install.php installer.glade
| From: | Alan Knowles | Date: | Wed, 29 May 2002 10:55:08 +0000 |
| Subject: | cvs: pear /PEAR_Frontend_Gtk Gtk.php /PEAR_Frontend_Gtk/Gtk Install.php installer.glade | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4251@lists.php.net to get a copy of this message | ||
alan_k Wed May 29 06:55:08 2002 EDT
Modified files:
/pear/PEAR_Frontend_Gtk Gtk.php
/pear/PEAR_Frontend_Gtk/Gtk Install.php installer.glade
Log:
Install now works, still having issues with dependancies,
Simplified the logos, connected expand/collapse all and quit menu items
Index: pear/PEAR_Frontend_Gtk/Gtk.php diff -u pear/PEAR_Frontend_Gtk/Gtk.php:1.2 pear/PEAR_Frontend_Gtk/Gtk.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk.php:1.2 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk.php Wed May 29 06:55:07 2002 @@ -16,7 +16,7 @@ | Author: Stig Sæther Bakken <ssb@fast.no> | +----------------------------------------------------------------------+ - $Id: Gtk.php,v 1.2 2002/05/28 09:57:54 alan_k Exp $ + $Id: Gtk.php,v 1.3 2002/05/29 10:55:07 alan_k Exp $ */ require_once "PEAR.php"; @@ -77,6 +77,15 @@ $varname = "_widget_".$widgetname; $this->$varname = $this->_glade->get_widget($widgetname); } + $items = array(); + preg_match_all('/\<handler\>([^\<]+)\<\/handler\>/',$data,$items); + //print_r($items[1]); + foreach ($items[1] as $handler) + if (method_exists($this,$handler)) + $this->_glade->signal_connect( $handler ,array(&$this,$handler)); + + + } /** * the class that manages the class list @@ -129,19 +138,7 @@ $this->_widget_window->connect_after('realize',array(&$this,'_callbackWindowConfigure')); $this->_widget_window->connect_after('configure_event',array(&$this,'_callbackWindowConfigure')); - - - - $this->_widget_installer_logo = & new GtkDrawingArea(); - $this->_widget_installer_logo->size( 486, 48); - - $this->_widget_installer_logo->connect( - 'configure_event',array(&$this,'_callbackInstallerLogoConfigure')); - - $this->_widget_installer_logo->connect( - 'expose_event',array(&$this, '_callbackInstallerLogoExpose')); - $this->_widget_installer_logo_holder->add($this->_widget_installer_logo); - $this->_widget_installer_logo->show(); + $this->_widget_details_area->hide(); $this->_widget_window->show(); @@ -189,6 +186,16 @@ $this->_loadButton('config_button' , 'nav_configuration.xpm'); $this->_loadButton('documentation_button' , 'nav_documentation.xpm'); $this->_loadButton('close_details' , 'black_close_icon.xpm'); + + $this->_setStyle('package_logo','#000000','#339900',TRUE); + $this->_setStyle('package_logo_text','#FFFFFF','#339900'); + + $package_logo = &new GtkPixmap( + $this->_pixmaps['pear.xpm'][0], + $this->_pixmaps['pear.xpm'][1]); + $this->_widget_package_logo->put($package_logo,0,0); + $package_logo->show(); + /* downloding tab */ $this->_setStyle('white_bg1','#000000','#FFFFFF',TRUE); @@ -299,61 +306,60 @@ var $_logo_pixmap; // the base to draw pixmaps onto... + - function _callbackInstallerLogoConfigure($widget,$event) { - //echo "Configure event"; - //if (@$this->_logo_pixmap) return; - - $this->_logo_pixmap = &new GdkPixmap($widget->window, - $widget->allocation->width, - $widget->allocation->height, - -1); - - $current_style=$widget->get_style(); - $new_style = $current_style->copy(); - $new_style->bg[GTK_STATE_NORMAL]=new GdkColor('#339900'); - $new_style->bg[GTK_STATE_NORMAL]=new GdkColor('#339900'); - $widget->set_style($new_style); - - gdk::draw_rectangle($this->_logo_pixmap, - $widget->style->bg_gc[GTK_STATE_NORMAL], - true, 0, 0, - $widget->allocation->width, - $widget->allocation->height); - // draw somethin on it. - //$this->_initPixmaps($widget); - - //print_r(array($this->_logo_pixmap,$this->_pixmaps)); - gdk::draw_pixmap($this->_logo_pixmap, - $widget->style->fg_gc[$widget->state], - $this->_pixmaps['installer_logo.xpm'][0], - 0,0, - 0,0, - 486, 48); - - $widget->realize(); - return true; - } - - - - - - function _callbackInstallerLogoExpose($widget,$event) { - // echo "Expose event"; + var $_activeDownloadSize =0; + var $_downloadTotal=1; + var $_downloadPos=0; + function _downloadCallback($msg, $params) { + + switch ($msg) { + case 'setup': + return; + case 'saveas': + $this->_widget_downloading_filename->set_text("Downloading {$params}"); + $this->_widget_downloading_total_progressbar->set_percentage($this->_downloadPos/$this->_downloadTotal); + $this->_downloadPos++; + $this->_widget_downloading_total->set_text("Total {$this->_downloadPos}/{$this->_downloadTotal}"); + while(gtk::events_pending()) gtk::main_iteration(); - gdk::draw_pixmap($widget->window, - $widget->style->fg_gc[$widget->state], - $this->_logo_pixmap, - $event->area->x, $event->area->y, - $event->area->x, $event->area->y, - $event->area->width, $event->area->height); - return false; + return; + case 'start': + $this->_activeDownloadSize = $params; + $this->_widget_downloading_file_progressbar->set_percentage(0); + while(gtk::events_pending()) gtk::main_iteration(); + return; + case 'bytesread': + $this->_widget_downloading_file_progressbar->set_percentage($params / $this->_activeDownloadSize); + while(gtk::events_pending()) gtk::main_iteration(); + return; + case 'done': + + $this->_widget_downloading_total_progressbar->set_percentage($this->_downloadPos/$this->_downloadTotal); + + default: + if (is_object($params)) $params="OBJECT"; + echo "MSG: $msg ". serialize($params) . "\n"; + } + } - + function on_expand_all_activate() { + $this->_package_list->widget->expand_recursive(); + } + + function on_collapse_all_activate() { + $this->_package_list->widget->collapse_recursive(); + } + + function on_quit() { + gtk::main_quit(); + exit; + } + + //-------------------------- BASE Installer methods -------------------------- // {{{ displayLine(text) @@ -372,7 +378,7 @@ function displayError($eobj) { - echo "ERROR:"; + return $this->displayLine($eobj->getMessage()); } @@ -381,9 +387,8 @@ function displayFatalError($eobj) { - echo "FATAL ERROR"; - echo serialize($eobj); - exit; + $this->displayError($eobj); + //exit(1); } // }}} Index: pear/PEAR_Frontend_Gtk/Gtk/Install.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.1 pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 --- pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.1 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Install.php Wed May 29 06:55:07 2002 @@ -1,7 +1,7 @@ <? /* * This class deals with the installing of packages -* +* Currently it extneds the installer so that it can do the download mettering * */ @@ -16,23 +16,42 @@ $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(0,TRUE); $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(1,TRUE); $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(2,TRUE); + $this->Frontend_Gtk->_widget_done_button->connect('pressed',array(&$this,'_callbackDone')); } function start($list) { + $this->Frontend_Gtk->_widget_pages->set_page(1); + $this->Frontend_Gtk->_widget_done_button->set_sensitive(0); // load up the list into the download list.. $this->Frontend_Gtk->_widget_download_list->clear(); $i=0; - foreach ($list as $package) { + $install = array(); + if ($list) foreach ($list as $package) { + print_r($package); $this->Frontend_Gtk->_widget_download_list->append(array('',$package['package'],$package['summary'])); $this->Frontend_Gtk->_widget_download_list->set_pixmap($i,0, $this->Frontend_Gtk->_pixmaps['package.xpm'][0], $this->Frontend_Gtk->_pixmaps['package.xpm'][1] ); $i++; + $install[] = $package['package']; } + while(gtk::events_pending()) gtk::main_iteration(); + $this->Frontend_Gtk->_downloadTotal = $i; + + $this->Frontend_Gtk->_downloadPos=0; + $cmd = PEAR_Command::factory('install',$this->Frontend_Gtk->config); + $cmd->run('install' ,'', $install); + $this->Frontend_Gtk->_widget_done_button->set_sensitive(1); + + } + function _callbackDone() { + $this->Frontend_Gtk->_package_list->loadList(); + $this->Frontend_Gtk->_widget_pages->set_page(0); } + } Index: pear/PEAR_Frontend_Gtk/Gtk/installer.glade diff -u pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.3 pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.4 --- pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.3 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/installer.glade Wed May 29 06:55:07 2002 @@ -18,6 +18,16 @@ <width>600</width> <height>400</height> <visible>False</visible> + <signal> + <name>destroy</name> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:52:35 GMT</last_modification_time> + </signal> + <signal> + <name>delete_event</name> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:52:17 GMT</last_modification_time> + </signal> <title>PEAR Package Manager</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> @@ -92,12 +102,17 @@ <widget> <class>GtkMenuItem</class> <name>quit</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_Q</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> - <handler>on_quit_activate</handler> - <last_modification_time>Mon, 27 May 2002 09:19:21 GMT</last_modification_time> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:51:12 GMT</last_modification_time> </signal> - <label>Quit</label> + <label>_Quit</label> <right_justify>False</right_justify> </widget> </widget> @@ -106,7 +121,7 @@ <widget> <class>GtkMenuItem</class> <name>edit1</name> - <label>Edit</label> + <label>_Edit</label> <right_justify>False</right_justify> <widget> @@ -116,6 +131,11 @@ <widget> <class>GtkMenuItem</class> <name>expand_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_+</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_expand_all_activate</handler> @@ -128,10 +148,15 @@ <widget> <class>GtkMenuItem</class> <name>expand_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_-</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> - <handler>on_expand_all_activate</handler> - <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> + <handler>on_collapse_all_activate</handler> + <last_modification_time>Wed, 29 May 2002 10:46:10 GMT</last_modification_time> </signal> <label>Collapse All</label> <right_justify>False</right_justify> @@ -146,24 +171,34 @@ <widget> <class>GtkMenuItem</class> <name>select_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_A</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_select_all_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Select All</label> + <label>Select _All</label> <right_justify>False</right_justify> </widget> <widget> <class>GtkMenuItem</class> <name>select_none</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_N</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_select_none_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Select None</label> + <label>Select _None</label> <right_justify>False</right_justify> </widget> </widget> @@ -172,7 +207,7 @@ <widget> <class>GtkMenuItem</class> <name>view1</name> - <label>View</label> + <label>_View</label> <right_justify>False</right_justify> <widget> @@ -182,6 +217,11 @@ <widget> <class>GtkMenuItem</class> <name>refresh</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F5</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_refresh_activate</handler> @@ -194,6 +234,11 @@ <widget> <class>GtkMenuItem</class> <name>search</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F3</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_search_activate</handler> @@ -208,7 +253,7 @@ <widget> <class>GtkMenuItem</class> <name>settings</name> - <label>Settings</label> + <label>_Settings</label> <right_justify>False</right_justify> <widget> @@ -223,7 +268,7 @@ <handler>on_preferences_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Preferences</label> + <label>_Preferences</label> <right_justify>False</right_justify> </widget> </widget> @@ -232,7 +277,7 @@ <widget> <class>GtkMenuItem</class> <name>help1</name> - <label>Help</label> + <label>_Help</label> <right_justify>False</right_justify> <widget> @@ -242,12 +287,17 @@ <widget> <class>GtkMenuItem</class> <name>about</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F1</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_about_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>About</label> + <label>_About</label> <right_justify>False</right_justify> </widget> </widget> @@ -396,7 +446,8 @@ <widget> <class>GtkVBox</class> - <name>installer_logo_holder</name> + <name>vbox14</name> + <height>47</height> <homogeneous>False</homogeneous> <spacing>0</spacing> <child> @@ -406,7 +457,54 @@ </child> <widget> - <class>Placeholder</class> + <class>GtkScrolledWindow</class> + <name>scrolledwindow13</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_NEVER</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLayout</class> + <name>package_logo</name> + <area_width>400</area_width> + <area_height>400</area_height> + <hstep>10</hstep> + <vstep>10</vstep> + + <widget> + <class>GtkHBox</class> + <name>hbox8</name> + <x>136</x> + <y>8</y> + <width>570</width> + <height>27</height> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + + <widget> + <class>GtkLabel</class> + <name>package_logo_text</name> + <label>Install / Upgrade / Remove PEAR Packages</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + </widget> + </widget> </widget> </widget> @@ -583,7 +681,7 @@ <widget> <class>GtkScrolledWindow</class> <name>scrolledwindow6</name> - <width>140</width> + <width>160</width> <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> <vscrollbar_policy>GTK_POLICY_NEVER</vscrollbar_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> @@ -685,7 +783,7 @@ <widget> <class>GtkLabel</class> <name>downloading_logo_text</name> - <label>Download and Installing Package</label> + <label>Download and Installing Packages</label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> <xalign>0.5</xalign> @@ -859,7 +957,7 @@ <widget> <class>GtkLabel</class> - <name>label42</name> + <name>downloading_filename</name> <label>Downloading XXXXXXXX</label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> @@ -876,7 +974,7 @@ <widget> <class>GtkProgressBar</class> - <name>progressbar1</name> + <name>downloading_file_progressbar</name> <value>0</value> <lower>0</lower> <upper>100</upper> @@ -896,7 +994,7 @@ <widget> <class>GtkLabel</class> - <name>label43</name> + <name>downloading_total</name> <label>Total</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> @@ -913,7 +1011,7 @@ <widget> <class>GtkProgressBar</class> - <name>progressbar2</name> + <name>downloading_total_progressbar</name> <value>0</value> <lower>0</lower> <upper>100</upper> @@ -949,19 +1047,11 @@ <widget> <class>GtkButton</class> - <name>button17</name> - <can_default>True</can_default> - <can_focus>True</can_focus> - <label>Pause</label> - <relief>GTK_RELIEF_NORMAL</relief> - </widget> - - <widget> - <class>GtkButton</class> - <name>button18</name> + <name>done_button</name> + <sensitive>False</sensitive> <can_default>True</can_default> <can_focus>True</can_focus> - <label>Cancel</label> + <label>Done</label> <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget>
Index: pear/PEAR_Frontend_Gtk/Gtk.php diff -u pear/PEAR_Frontend_Gtk/Gtk.php:1.2 pear/PEAR_Frontend_Gtk/Gtk.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk.php:1.2 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk.php Wed May 29 06:55:07 2002 @@ -16,7 +16,7 @@ | Author: Stig Sæther Bakken <ssb@fast.no> | +----------------------------------------------------------------------+ - $Id: Gtk.php,v 1.2 2002/05/28 09:57:54 alan_k Exp $ + $Id: Gtk.php,v 1.3 2002/05/29 10:55:07 alan_k Exp $ */ require_once "PEAR.php"; @@ -77,6 +77,15 @@ $varname = "_widget_".$widgetname; $this->$varname = $this->_glade->get_widget($widgetname); } + $items = array(); + preg_match_all('/\<handler\>([^\<]+)\<\/handler\>/',$data,$items); + //print_r($items[1]); + foreach ($items[1] as $handler) + if (method_exists($this,$handler)) + $this->_glade->signal_connect( $handler ,array(&$this,$handler)); + + + } /** * the class that manages the class list @@ -129,19 +138,7 @@ $this->_widget_window->connect_after('realize',array(&$this,'_callbackWindowConfigure')); $this->_widget_window->connect_after('configure_event',array(&$this,'_callbackWindowConfigure')); - - - - $this->_widget_installer_logo = & new GtkDrawingArea(); - $this->_widget_installer_logo->size( 486, 48); - - $this->_widget_installer_logo->connect( - 'configure_event',array(&$this,'_callbackInstallerLogoConfigure')); - - $this->_widget_installer_logo->connect( - 'expose_event',array(&$this, '_callbackInstallerLogoExpose')); - $this->_widget_installer_logo_holder->add($this->_widget_installer_logo); - $this->_widget_installer_logo->show(); + $this->_widget_details_area->hide(); $this->_widget_window->show(); @@ -189,6 +186,16 @@ $this->_loadButton('config_button' , 'nav_configuration.xpm'); $this->_loadButton('documentation_button' , 'nav_documentation.xpm'); $this->_loadButton('close_details' , 'black_close_icon.xpm'); + + $this->_setStyle('package_logo','#000000','#339900',TRUE); + $this->_setStyle('package_logo_text','#FFFFFF','#339900'); + + $package_logo = &new GtkPixmap( + $this->_pixmaps['pear.xpm'][0], + $this->_pixmaps['pear.xpm'][1]); + $this->_widget_package_logo->put($package_logo,0,0); + $package_logo->show(); + /* downloding tab */ $this->_setStyle('white_bg1','#000000','#FFFFFF',TRUE); @@ -299,61 +306,60 @@ var $_logo_pixmap; // the base to draw pixmaps onto... + - function _callbackInstallerLogoConfigure($widget,$event) { - //echo "Configure event"; - //if (@$this->_logo_pixmap) return; - - $this->_logo_pixmap = &new GdkPixmap($widget->window, - $widget->allocation->width, - $widget->allocation->height, - -1); - - $current_style=$widget->get_style(); - $new_style = $current_style->copy(); - $new_style->bg[GTK_STATE_NORMAL]=new GdkColor('#339900'); - $new_style->bg[GTK_STATE_NORMAL]=new GdkColor('#339900'); - $widget->set_style($new_style); - - gdk::draw_rectangle($this->_logo_pixmap, - $widget->style->bg_gc[GTK_STATE_NORMAL], - true, 0, 0, - $widget->allocation->width, - $widget->allocation->height); - // draw somethin on it. - //$this->_initPixmaps($widget); - - //print_r(array($this->_logo_pixmap,$this->_pixmaps)); - gdk::draw_pixmap($this->_logo_pixmap, - $widget->style->fg_gc[$widget->state], - $this->_pixmaps['installer_logo.xpm'][0], - 0,0, - 0,0, - 486, 48); - - $widget->realize(); - return true; - } - - - - - - function _callbackInstallerLogoExpose($widget,$event) { - // echo "Expose event"; + var $_activeDownloadSize =0; + var $_downloadTotal=1; + var $_downloadPos=0; + function _downloadCallback($msg, $params) { + + switch ($msg) { + case 'setup': + return; + case 'saveas': + $this->_widget_downloading_filename->set_text("Downloading {$params}"); + $this->_widget_downloading_total_progressbar->set_percentage($this->_downloadPos/$this->_downloadTotal); + $this->_downloadPos++; + $this->_widget_downloading_total->set_text("Total {$this->_downloadPos}/{$this->_downloadTotal}"); + while(gtk::events_pending()) gtk::main_iteration(); - gdk::draw_pixmap($widget->window, - $widget->style->fg_gc[$widget->state], - $this->_logo_pixmap, - $event->area->x, $event->area->y, - $event->area->x, $event->area->y, - $event->area->width, $event->area->height); - return false; + return; + case 'start': + $this->_activeDownloadSize = $params; + $this->_widget_downloading_file_progressbar->set_percentage(0); + while(gtk::events_pending()) gtk::main_iteration(); + return; + case 'bytesread': + $this->_widget_downloading_file_progressbar->set_percentage($params / $this->_activeDownloadSize); + while(gtk::events_pending()) gtk::main_iteration(); + return; + case 'done': + + $this->_widget_downloading_total_progressbar->set_percentage($this->_downloadPos/$this->_downloadTotal); + + default: + if (is_object($params)) $params="OBJECT"; + echo "MSG: $msg ". serialize($params) . "\n"; + } + } - + function on_expand_all_activate() { + $this->_package_list->widget->expand_recursive(); + } + + function on_collapse_all_activate() { + $this->_package_list->widget->collapse_recursive(); + } + + function on_quit() { + gtk::main_quit(); + exit; + } + + //-------------------------- BASE Installer methods -------------------------- // {{{ displayLine(text) @@ -372,7 +378,7 @@ function displayError($eobj) { - echo "ERROR:"; + return $this->displayLine($eobj->getMessage()); } @@ -381,9 +387,8 @@ function displayFatalError($eobj) { - echo "FATAL ERROR"; - echo serialize($eobj); - exit; + $this->displayError($eobj); + //exit(1); } // }}} Index: pear/PEAR_Frontend_Gtk/Gtk/Install.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.1 pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 --- pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.1 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Install.php Wed May 29 06:55:07 2002 @@ -1,7 +1,7 @@ <? /* * This class deals with the installing of packages -* +* Currently it extneds the installer so that it can do the download mettering * */ @@ -16,23 +16,42 @@ $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(0,TRUE); $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(1,TRUE); $this->Frontend_Gtk->_widget_download_list->set_column_auto_resize(2,TRUE); + $this->Frontend_Gtk->_widget_done_button->connect('pressed',array(&$this,'_callbackDone')); } function start($list) { + $this->Frontend_Gtk->_widget_pages->set_page(1); + $this->Frontend_Gtk->_widget_done_button->set_sensitive(0); // load up the list into the download list.. $this->Frontend_Gtk->_widget_download_list->clear(); $i=0; - foreach ($list as $package) { + $install = array(); + if ($list) foreach ($list as $package) { + print_r($package); $this->Frontend_Gtk->_widget_download_list->append(array('',$package['package'],$package['summary'])); $this->Frontend_Gtk->_widget_download_list->set_pixmap($i,0, $this->Frontend_Gtk->_pixmaps['package.xpm'][0], $this->Frontend_Gtk->_pixmaps['package.xpm'][1] ); $i++; + $install[] = $package['package']; } + while(gtk::events_pending()) gtk::main_iteration(); + $this->Frontend_Gtk->_downloadTotal = $i; + + $this->Frontend_Gtk->_downloadPos=0; + $cmd = PEAR_Command::factory('install',$this->Frontend_Gtk->config); + $cmd->run('install' ,'', $install); + $this->Frontend_Gtk->_widget_done_button->set_sensitive(1); + + } + function _callbackDone() { + $this->Frontend_Gtk->_package_list->loadList(); + $this->Frontend_Gtk->_widget_pages->set_page(0); } + } Index: pear/PEAR_Frontend_Gtk/Gtk/installer.glade diff -u pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.3 pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.4 --- pear/PEAR_Frontend_Gtk/Gtk/installer.glade:1.3 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/installer.glade Wed May 29 06:55:07 2002 @@ -18,6 +18,16 @@ <width>600</width> <height>400</height> <visible>False</visible> + <signal> + <name>destroy</name> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:52:35 GMT</last_modification_time> + </signal> + <signal> + <name>delete_event</name> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:52:17 GMT</last_modification_time> + </signal> <title>PEAR Package Manager</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> @@ -92,12 +102,17 @@ <widget> <class>GtkMenuItem</class> <name>quit</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_Q</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> - <handler>on_quit_activate</handler> - <last_modification_time>Mon, 27 May 2002 09:19:21 GMT</last_modification_time> + <handler>on_quit</handler> + <last_modification_time>Wed, 29 May 2002 10:51:12 GMT</last_modification_time> </signal> - <label>Quit</label> + <label>_Quit</label> <right_justify>False</right_justify> </widget> </widget> @@ -106,7 +121,7 @@ <widget> <class>GtkMenuItem</class> <name>edit1</name> - <label>Edit</label> + <label>_Edit</label> <right_justify>False</right_justify> <widget> @@ -116,6 +131,11 @@ <widget> <class>GtkMenuItem</class> <name>expand_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_+</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_expand_all_activate</handler> @@ -128,10 +148,15 @@ <widget> <class>GtkMenuItem</class> <name>expand_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_-</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> - <handler>on_expand_all_activate</handler> - <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> + <handler>on_collapse_all_activate</handler> + <last_modification_time>Wed, 29 May 2002 10:46:10 GMT</last_modification_time> </signal> <label>Collapse All</label> <right_justify>False</right_justify> @@ -146,24 +171,34 @@ <widget> <class>GtkMenuItem</class> <name>select_all</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_A</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_select_all_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Select All</label> + <label>Select _All</label> <right_justify>False</right_justify> </widget> <widget> <class>GtkMenuItem</class> <name>select_none</name> + <accelerator> + <modifiers>GDK_CONTROL_MASK</modifiers> + <key>GDK_N</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_select_none_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Select None</label> + <label>Select _None</label> <right_justify>False</right_justify> </widget> </widget> @@ -172,7 +207,7 @@ <widget> <class>GtkMenuItem</class> <name>view1</name> - <label>View</label> + <label>_View</label> <right_justify>False</right_justify> <widget> @@ -182,6 +217,11 @@ <widget> <class>GtkMenuItem</class> <name>refresh</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F5</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_refresh_activate</handler> @@ -194,6 +234,11 @@ <widget> <class>GtkMenuItem</class> <name>search</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F3</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_search_activate</handler> @@ -208,7 +253,7 @@ <widget> <class>GtkMenuItem</class> <name>settings</name> - <label>Settings</label> + <label>_Settings</label> <right_justify>False</right_justify> <widget> @@ -223,7 +268,7 @@ <handler>on_preferences_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>Preferences</label> + <label>_Preferences</label> <right_justify>False</right_justify> </widget> </widget> @@ -232,7 +277,7 @@ <widget> <class>GtkMenuItem</class> <name>help1</name> - <label>Help</label> + <label>_Help</label> <right_justify>False</right_justify> <widget> @@ -242,12 +287,17 @@ <widget> <class>GtkMenuItem</class> <name>about</name> + <accelerator> + <modifiers>0</modifiers> + <key>GDK_F1</key> + <signal>activate</signal> + </accelerator> <signal> <name>activate</name> <handler>on_about_activate</handler> <last_modification_time>Mon, 27 May 2002 04:09:37 GMT</last_modification_time> </signal> - <label>About</label> + <label>_About</label> <right_justify>False</right_justify> </widget> </widget> @@ -396,7 +446,8 @@ <widget> <class>GtkVBox</class> - <name>installer_logo_holder</name> + <name>vbox14</name> + <height>47</height> <homogeneous>False</homogeneous> <spacing>0</spacing> <child> @@ -406,7 +457,54 @@ </child> <widget> - <class>Placeholder</class> + <class>GtkScrolledWindow</class> + <name>scrolledwindow13</name> + <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> + <vscrollbar_policy>GTK_POLICY_NEVER</vscrollbar_policy> + <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> + <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + + <widget> + <class>GtkLayout</class> + <name>package_logo</name> + <area_width>400</area_width> + <area_height>400</area_height> + <hstep>10</hstep> + <vstep>10</vstep> + + <widget> + <class>GtkHBox</class> + <name>hbox8</name> + <x>136</x> + <y>8</y> + <width>570</width> + <height>27</height> + <homogeneous>False</homogeneous> + <spacing>0</spacing> + + <widget> + <class>GtkLabel</class> + <name>package_logo_text</name> + <label>Install / Upgrade / Remove PEAR Packages</label> + <justify>GTK_JUSTIFY_LEFT</justify> + <wrap>False</wrap> + <xalign>0.5</xalign> + <yalign>0.5</yalign> + <xpad>0</xpad> + <ypad>0</ypad> + <child> + <padding>0</padding> + <expand>False</expand> + <fill>True</fill> + </child> + </widget> + </widget> + </widget> </widget> </widget> @@ -583,7 +681,7 @@ <widget> <class>GtkScrolledWindow</class> <name>scrolledwindow6</name> - <width>140</width> + <width>160</width> <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> <vscrollbar_policy>GTK_POLICY_NEVER</vscrollbar_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> @@ -685,7 +783,7 @@ <widget> <class>GtkLabel</class> <name>downloading_logo_text</name> - <label>Download and Installing Package</label> + <label>Download and Installing Packages</label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> <xalign>0.5</xalign> @@ -859,7 +957,7 @@ <widget> <class>GtkLabel</class> - <name>label42</name> + <name>downloading_filename</name> <label>Downloading XXXXXXXX</label> <justify>GTK_JUSTIFY_LEFT</justify> <wrap>False</wrap> @@ -876,7 +974,7 @@ <widget> <class>GtkProgressBar</class> - <name>progressbar1</name> + <name>downloading_file_progressbar</name> <value>0</value> <lower>0</lower> <upper>100</upper> @@ -896,7 +994,7 @@ <widget> <class>GtkLabel</class> - <name>label43</name> + <name>downloading_total</name> <label>Total</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> @@ -913,7 +1011,7 @@ <widget> <class>GtkProgressBar</class> - <name>progressbar2</name> + <name>downloading_total_progressbar</name> <value>0</value> <lower>0</lower> <upper>100</upper> @@ -949,19 +1047,11 @@ <widget> <class>GtkButton</class> - <name>button17</name> - <can_default>True</can_default> - <can_focus>True</can_focus> - <label>Pause</label> - <relief>GTK_RELIEF_NORMAL</relief> - </widget> - - <widget> - <class>GtkButton</class> - <name>button18</name> + <name>done_button</name> + <sensitive>False</sensitive> <can_default>True</can_default> <can_focus>True</can_focus> - <label>Cancel</label> + <label>Done</label> <relief>GTK_RELIEF_NORMAL</relief> </widget> </widget>