cvs: pear /PEAR_Frontend_Gtk Gtk.php /PEAR_Frontend_Gtk/Gtk Install.php Packages.php Summary.php
| From: | Alan Knowles | Date: | Sun, 02 Jun 2002 03:01:56 +0000 |
| Subject: | cvs: pear /PEAR_Frontend_Gtk Gtk.php /PEAR_Frontend_Gtk/Gtk Install.php Packages.php Summary.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4346@lists.php.net to get a copy of this message | ||
alan_k Sat Jun 1 23:01:56 2002 EDT
Modified files:
/pear/PEAR_Frontend_Gtk Gtk.php
/pear/PEAR_Frontend_Gtk/Gtk Install.php Packages.php Summary.php
Log:
Changing child modules to use standard 'this->ui' for interface, adding in file
copyright etc.
Index: pear/PEAR_Frontend_Gtk/Gtk.php diff -u pear/PEAR_Frontend_Gtk/Gtk.php:1.8 pear/PEAR_Frontend_Gtk/Gtk.php:1.9 --- pear/PEAR_Frontend_Gtk/Gtk.php:1.8 Sat Jun 1 12:11:07 2002 +++ pear/PEAR_Frontend_Gtk/Gtk.php Sat Jun 1 23:01:56 2002 @@ -16,7 +16,7 @@ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ - $Id: Gtk.php,v 1.8 2002/06/01 16:11:07 alan_k Exp $ + $Id: Gtk.php,v 1.9 2002/06/02 03:01:56 alan_k Exp $ */ require_once "PEAR.php"; @@ -24,6 +24,14 @@ require_once "PEAR/Frontend/Gtk/Summary.php"; require_once "PEAR/Frontend/Gtk/Install.php"; + +/** + * Core Gtk Frontend Class + * All the real work is done in the child classes (Gtk/*.php) + * + * @author Alan Knowles <alan@akbkhome.com> + */ + class PEAR_Frontend_Gtk extends PEAR { // {{{ properties @@ -112,7 +120,7 @@ * @var object PEAR_Frontend_Gtk_Packages * @access private */ - var $_package_list; + var $_packages; /** * the class that manages the Package summary @@ -137,15 +145,9 @@ // initialize child objects - $this->_package_list = &new PEAR_Frontend_Gtk_Packages; - $this->_package_list->Frontend_Gtk = &$this; - $this->_package_list->init(); - $this->_summary = &new PEAR_Frontend_Gtk_Summary; - $this->_summary->Frontend_Gtk = &$this; - $this->_summary->init(); - $this->_install = &new PEAR_Frontend_Gtk_Install; - $this->_install->Frontend_Gtk = &$this; - $this->_install->init(); + $this->_packages = &new PEAR_Frontend_Gtk_Packages($this); + $this->_summary = &new PEAR_Frontend_Gtk_Summary($this); + $this->_install = &new PEAR_Frontend_Gtk_Install($this); $this->_widget_window->connect_after('realize',array(&$this,'_callbackWindowConfigure')); $this->_widget_window->connect_after('configure_event',array(&$this,'_callbackWindowConfigure')); @@ -352,13 +354,13 @@ * Menu Callback - expand all */ function on_expand_all_activate() { - $this->_package_list->widget->expand_recursive(); + $this->_packages->widget->expand_recursive(); } /* * Menu Callback - colllapse all */ function on_collapse_all_activate() { - $this->_package_list->widget->collapse_recursive(); + $this->_packages->widget->collapse_recursive(); } /* * Menu Callback - Exit/Quit Index: pear/PEAR_Frontend_Gtk/Gtk/Install.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 Wed May 29 06:55:07 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Install.php Sat Jun 1 23:01:56 2002 @@ -1,55 +1,80 @@ <? + /* -* This class deals with the installing of packages -* Currently it extneds the installer so that it can do the download mettering -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Install.php,v 1.3 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend -This class deals with the installing of packages + * + * #TODO : make the textbox display more information in a 'friendlier way' + * + * + * @author Alan Knowles <alan@akbkhome.com> + */ + + class PEAR_Frontend_Gtk_Install { - var $Frontend_Gtk; // main interface + var $ui; // main interface - function init() { + function PEAR_Frontend_Gtk_Install(&$ui) { // connect buttons? - - $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')); + $this->ui = &$ui; + $this->ui->_widget_download_list->set_column_auto_resize(0,TRUE); + $this->ui->_widget_download_list->set_column_auto_resize(1,TRUE); + $this->ui->_widget_download_list->set_column_auto_resize(2,TRUE); + $this->ui->_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); + $this->ui->_widget_pages->set_page(1); + $this->ui->_widget_done_button->set_sensitive(0); // load up the list into the download list.. - $this->Frontend_Gtk->_widget_download_list->clear(); + $this->ui->_widget_download_list->clear(); $i=0; $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] + $this->ui->_widget_download_list->append(array('',$package['package'],$package['summary'])); + $this->ui->_widget_download_list->set_pixmap($i,0, + $this->ui->_pixmaps['package.xpm'][0], + $this->ui->_pixmaps['package.xpm'][1] ); $i++; $install[] = $package['package']; } while(gtk::events_pending()) gtk::main_iteration(); - $this->Frontend_Gtk->_downloadTotal = $i; + $this->ui->_downloadTotal = $i; - $this->Frontend_Gtk->_downloadPos=0; - $cmd = PEAR_Command::factory('install',$this->Frontend_Gtk->config); + $this->ui->_downloadPos=0; + $cmd = PEAR_Command::factory('install',$this->ui->config); $cmd->run('install' ,'', $install); - $this->Frontend_Gtk->_widget_done_button->set_sensitive(1); + $this->ui->_widget_done_button->set_sensitive(1); } function _callbackDone() { - $this->Frontend_Gtk->_package_list->loadList(); - $this->Frontend_Gtk->_widget_pages->set_page(0); + $this->ui->_package_list->loadList(); + $this->ui->_widget_pages->set_page(0); } Index: pear/PEAR_Frontend_Gtk/Gtk/Packages.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.4 pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.5 --- pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.4 Sat Jun 1 09:05:09 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Packages.php Sat Jun 1 23:01:56 2002 @@ -1,19 +1,39 @@ <? /* -* This class deals with the list of packages -* - select one and it passes on data to the summary class -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Packages.php,v 1.5 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend - Section that deals with package lists + * + * @author Alan Knowles <alan@akbkhome.com> + */ + class PEAR_Frontend_Gtk_Packages { - var $Frontend_Gtk; // main interface + var $ui; // main interface var $widget; // the list widget var $config; // reference to config; - function init() { - + function PEAR_Frontend_Gtk_Packages(&$ui) { + $this->ui = &$ui; $this->_loadPackageData(); $cols = array('Package','Version','','','Summary'); $this->widget = &new GtkCTree(5,0,$cols); @@ -27,14 +47,14 @@ $this->widget->set_column_auto_resize($i,TRUE); $this->widget->show(); - $this->Frontend_Gtk->_widget_package_list_holder->add($this->widget); + $this->ui->_widget_package_list_holder->add($this->widget); - $this->Frontend_Gtk->_widget_packages_install->connect('pressed',array(&$this,'_callbackInstall')); + $this->ui->_widget_packages_install->connect('pressed',array(&$this,'_callbackInstall')); } function _loadPackageData() { - $reg = new PEAR_Registry($this->Frontend_Gtk->config->get('php_dir')); + $reg = new PEAR_Registry($this->ui->config->get('php_dir')); $installed = $reg->packageInfo(); @@ -45,7 +65,7 @@ // get available if (!$this->_available_packages) { - $r = new PEAR_Remote($this->Frontend_Gtk->config); + $r = new PEAR_Remote($this->ui->config); $this->_available_packages = $r->call('package.listAll', true); if (PEAR::isError($this->_available_packages)) { // whats the official way to hanlde this? @@ -224,7 +244,7 @@ case 2: // install/ toggled //case 4: - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); if (!$package) return; $this->_setPackageStatus(&$node, !$this->_package_status[$package]['install']); @@ -232,19 +252,19 @@ break; case 3: // info selected if (!$package) { - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); return; } if ($this->_moveto_flag) $this->widget->node_moveto($node,0,0,0); $this->_moveto_flag=FALSE; - $this->Frontend_Gtk->_summary->toggle($this->_package_status[$package]); + $this->ui->_summary->toggle($this->_package_status[$package]); break; case -1: // startup! return; default: - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); break; } @@ -285,7 +305,7 @@ if ($package['install'] & !$package['installed']) $install[] = $package; - $this->Frontend_Gtk->_install->start($install); + $this->ui->_install->start($install); Index: pear/PEAR_Frontend_Gtk/Gtk/Summary.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.2 pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.2 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Summary.php Sat Jun 1 23:01:56 2002 @@ -1,23 +1,44 @@ <? /* -* This class deals with the list of packages -* - select one and it passes on data to the summary class -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Summary.php,v 1.3 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend - Section that deals displaying summary details about a class + * + * #TODO : make the textbox display more information in a 'friendlier way' + * + * + * @author Alan Knowles <alan@akbkhome.com> + */ + + class PEAR_Frontend_Gtk_Summary { - var $Frontend_Gtk; // main interface + var $ui; // main interface var $widget; // the list widget var $config; // reference to config; var $active_package=""; // currently selected package - function init() { - - $this->Frontend_Gtk->_widget_close_details->connect_object('pressed',array(&$this,'hide')); - - - + function PEAR_Frontend_Gtk_Summary(&$ui) { + $this->ui = &$ui; + $this->ui->_widget_close_details->connect_object('pressed',array(&$this,'hide')); } /* @@ -44,14 +65,14 @@ * show the details tab */ function show(&$package_info) { - $this->Frontend_Gtk->_widget_details_area->show(); + $this->ui->_widget_details_area->show(); $this->active_package = $package_info; - //$this->Frontend_Gtk->_widget_install->set_sensitive(1); + //$this->ui->_widget_install->set_sensitive(1); foreach($package_info as $k=>$v) { $v = str_replace("\r", '',$v); $var = "_widget_".strtolower($k); - if (!is_object(@$this->Frontend_Gtk->$var)) continue; - $w = &$this->Frontend_Gtk->$var; + if (!is_object(@$this->ui->$var)) continue; + $w = &$this->ui->$var; switch (get_class($w)) { case 'GtkLabel': case 'GtkEntry': @@ -80,7 +101,7 @@ function hide() { - $this->Frontend_Gtk->_widget_details_area->hide(); + $this->ui->_widget_details_area->hide(); $this->_detailsVisableFlag = ''; } @@ -92,10 +113,10 @@ $ui = 'Gtk'; $this->installer = &new PEAR_Installer($ui); $options = array(); - $info = $this->installer->install($this->active_package['package'], $options , $this->Frontend_Gtk->config); + $info = $this->installer->install($this->active_package['package'], $options , $this->ui->config); // refresh list? - $this->Frontend_Gtk->_package_list->loadList(); - $this->Frontend_Gtk->_package_list->selectPackage($this->active_package['package']); + $this->ui->_packages->loadList(); + $this->ui->_packages->selectPackage($this->active_package['package']); }
Index: pear/PEAR_Frontend_Gtk/Gtk.php diff -u pear/PEAR_Frontend_Gtk/Gtk.php:1.8 pear/PEAR_Frontend_Gtk/Gtk.php:1.9 --- pear/PEAR_Frontend_Gtk/Gtk.php:1.8 Sat Jun 1 12:11:07 2002 +++ pear/PEAR_Frontend_Gtk/Gtk.php Sat Jun 1 23:01:56 2002 @@ -16,7 +16,7 @@ | Author: Alan Knowles <alan@akbkhome.com> | +----------------------------------------------------------------------+ - $Id: Gtk.php,v 1.8 2002/06/01 16:11:07 alan_k Exp $ + $Id: Gtk.php,v 1.9 2002/06/02 03:01:56 alan_k Exp $ */ require_once "PEAR.php"; @@ -24,6 +24,14 @@ require_once "PEAR/Frontend/Gtk/Summary.php"; require_once "PEAR/Frontend/Gtk/Install.php"; + +/** + * Core Gtk Frontend Class + * All the real work is done in the child classes (Gtk/*.php) + * + * @author Alan Knowles <alan@akbkhome.com> + */ + class PEAR_Frontend_Gtk extends PEAR { // {{{ properties @@ -112,7 +120,7 @@ * @var object PEAR_Frontend_Gtk_Packages * @access private */ - var $_package_list; + var $_packages; /** * the class that manages the Package summary @@ -137,15 +145,9 @@ // initialize child objects - $this->_package_list = &new PEAR_Frontend_Gtk_Packages; - $this->_package_list->Frontend_Gtk = &$this; - $this->_package_list->init(); - $this->_summary = &new PEAR_Frontend_Gtk_Summary; - $this->_summary->Frontend_Gtk = &$this; - $this->_summary->init(); - $this->_install = &new PEAR_Frontend_Gtk_Install; - $this->_install->Frontend_Gtk = &$this; - $this->_install->init(); + $this->_packages = &new PEAR_Frontend_Gtk_Packages($this); + $this->_summary = &new PEAR_Frontend_Gtk_Summary($this); + $this->_install = &new PEAR_Frontend_Gtk_Install($this); $this->_widget_window->connect_after('realize',array(&$this,'_callbackWindowConfigure')); $this->_widget_window->connect_after('configure_event',array(&$this,'_callbackWindowConfigure')); @@ -352,13 +354,13 @@ * Menu Callback - expand all */ function on_expand_all_activate() { - $this->_package_list->widget->expand_recursive(); + $this->_packages->widget->expand_recursive(); } /* * Menu Callback - colllapse all */ function on_collapse_all_activate() { - $this->_package_list->widget->collapse_recursive(); + $this->_packages->widget->collapse_recursive(); } /* * Menu Callback - Exit/Quit Index: pear/PEAR_Frontend_Gtk/Gtk/Install.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk/Install.php:1.2 Wed May 29 06:55:07 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Install.php Sat Jun 1 23:01:56 2002 @@ -1,55 +1,80 @@ <? + /* -* This class deals with the installing of packages -* Currently it extneds the installer so that it can do the download mettering -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Install.php,v 1.3 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend -This class deals with the installing of packages + * + * #TODO : make the textbox display more information in a 'friendlier way' + * + * + * @author Alan Knowles <alan@akbkhome.com> + */ + + class PEAR_Frontend_Gtk_Install { - var $Frontend_Gtk; // main interface + var $ui; // main interface - function init() { + function PEAR_Frontend_Gtk_Install(&$ui) { // connect buttons? - - $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')); + $this->ui = &$ui; + $this->ui->_widget_download_list->set_column_auto_resize(0,TRUE); + $this->ui->_widget_download_list->set_column_auto_resize(1,TRUE); + $this->ui->_widget_download_list->set_column_auto_resize(2,TRUE); + $this->ui->_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); + $this->ui->_widget_pages->set_page(1); + $this->ui->_widget_done_button->set_sensitive(0); // load up the list into the download list.. - $this->Frontend_Gtk->_widget_download_list->clear(); + $this->ui->_widget_download_list->clear(); $i=0; $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] + $this->ui->_widget_download_list->append(array('',$package['package'],$package['summary'])); + $this->ui->_widget_download_list->set_pixmap($i,0, + $this->ui->_pixmaps['package.xpm'][0], + $this->ui->_pixmaps['package.xpm'][1] ); $i++; $install[] = $package['package']; } while(gtk::events_pending()) gtk::main_iteration(); - $this->Frontend_Gtk->_downloadTotal = $i; + $this->ui->_downloadTotal = $i; - $this->Frontend_Gtk->_downloadPos=0; - $cmd = PEAR_Command::factory('install',$this->Frontend_Gtk->config); + $this->ui->_downloadPos=0; + $cmd = PEAR_Command::factory('install',$this->ui->config); $cmd->run('install' ,'', $install); - $this->Frontend_Gtk->_widget_done_button->set_sensitive(1); + $this->ui->_widget_done_button->set_sensitive(1); } function _callbackDone() { - $this->Frontend_Gtk->_package_list->loadList(); - $this->Frontend_Gtk->_widget_pages->set_page(0); + $this->ui->_package_list->loadList(); + $this->ui->_widget_pages->set_page(0); } Index: pear/PEAR_Frontend_Gtk/Gtk/Packages.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.4 pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.5 --- pear/PEAR_Frontend_Gtk/Gtk/Packages.php:1.4 Sat Jun 1 09:05:09 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Packages.php Sat Jun 1 23:01:56 2002 @@ -1,19 +1,39 @@ <? /* -* This class deals with the list of packages -* - select one and it passes on data to the summary class -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Packages.php,v 1.5 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend - Section that deals with package lists + * + * @author Alan Knowles <alan@akbkhome.com> + */ + class PEAR_Frontend_Gtk_Packages { - var $Frontend_Gtk; // main interface + var $ui; // main interface var $widget; // the list widget var $config; // reference to config; - function init() { - + function PEAR_Frontend_Gtk_Packages(&$ui) { + $this->ui = &$ui; $this->_loadPackageData(); $cols = array('Package','Version','','','Summary'); $this->widget = &new GtkCTree(5,0,$cols); @@ -27,14 +47,14 @@ $this->widget->set_column_auto_resize($i,TRUE); $this->widget->show(); - $this->Frontend_Gtk->_widget_package_list_holder->add($this->widget); + $this->ui->_widget_package_list_holder->add($this->widget); - $this->Frontend_Gtk->_widget_packages_install->connect('pressed',array(&$this,'_callbackInstall')); + $this->ui->_widget_packages_install->connect('pressed',array(&$this,'_callbackInstall')); } function _loadPackageData() { - $reg = new PEAR_Registry($this->Frontend_Gtk->config->get('php_dir')); + $reg = new PEAR_Registry($this->ui->config->get('php_dir')); $installed = $reg->packageInfo(); @@ -45,7 +65,7 @@ // get available if (!$this->_available_packages) { - $r = new PEAR_Remote($this->Frontend_Gtk->config); + $r = new PEAR_Remote($this->ui->config); $this->_available_packages = $r->call('package.listAll', true); if (PEAR::isError($this->_available_packages)) { // whats the official way to hanlde this? @@ -224,7 +244,7 @@ case 2: // install/ toggled //case 4: - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); if (!$package) return; $this->_setPackageStatus(&$node, !$this->_package_status[$package]['install']); @@ -232,19 +252,19 @@ break; case 3: // info selected if (!$package) { - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); return; } if ($this->_moveto_flag) $this->widget->node_moveto($node,0,0,0); $this->_moveto_flag=FALSE; - $this->Frontend_Gtk->_summary->toggle($this->_package_status[$package]); + $this->ui->_summary->toggle($this->_package_status[$package]); break; case -1: // startup! return; default: - $this->Frontend_Gtk->_summary->hide(); + $this->ui->_summary->hide(); break; } @@ -285,7 +305,7 @@ if ($package['install'] & !$package['installed']) $install[] = $package; - $this->Frontend_Gtk->_install->start($install); + $this->ui->_install->start($install); Index: pear/PEAR_Frontend_Gtk/Gtk/Summary.php diff -u pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.2 pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.3 --- pear/PEAR_Frontend_Gtk/Gtk/Summary.php:1.2 Tue May 28 05:57:54 2002 +++ pear/PEAR_Frontend_Gtk/Gtk/Summary.php Sat Jun 1 23:01:56 2002 @@ -1,23 +1,44 @@ <? /* -* This class deals with the list of packages -* - select one and it passes on data to the summary class -* + +----------------------------------------------------------------------+ + | PHP Version 4 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2002 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.02 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/2_02.txt. | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Alan Knowles <alan@akbkhome.com> | + +----------------------------------------------------------------------+ + + $Id: Summary.php,v 1.3 2002/06/02 03:01:56 alan_k Exp $ */ +/** + * Gtk Frontend - Section that deals displaying summary details about a class + * + * #TODO : make the textbox display more information in a 'friendlier way' + * + * + * @author Alan Knowles <alan@akbkhome.com> + */ + + class PEAR_Frontend_Gtk_Summary { - var $Frontend_Gtk; // main interface + var $ui; // main interface var $widget; // the list widget var $config; // reference to config; var $active_package=""; // currently selected package - function init() { - - $this->Frontend_Gtk->_widget_close_details->connect_object('pressed',array(&$this,'hide')); - - - + function PEAR_Frontend_Gtk_Summary(&$ui) { + $this->ui = &$ui; + $this->ui->_widget_close_details->connect_object('pressed',array(&$this,'hide')); } /* @@ -44,14 +65,14 @@ * show the details tab */ function show(&$package_info) { - $this->Frontend_Gtk->_widget_details_area->show(); + $this->ui->_widget_details_area->show(); $this->active_package = $package_info; - //$this->Frontend_Gtk->_widget_install->set_sensitive(1); + //$this->ui->_widget_install->set_sensitive(1); foreach($package_info as $k=>$v) { $v = str_replace("\r", '',$v); $var = "_widget_".strtolower($k); - if (!is_object(@$this->Frontend_Gtk->$var)) continue; - $w = &$this->Frontend_Gtk->$var; + if (!is_object(@$this->ui->$var)) continue; + $w = &$this->ui->$var; switch (get_class($w)) { case 'GtkLabel': case 'GtkEntry': @@ -80,7 +101,7 @@ function hide() { - $this->Frontend_Gtk->_widget_details_area->hide(); + $this->ui->_widget_details_area->hide(); $this->_detailsVisableFlag = ''; } @@ -92,10 +113,10 @@ $ui = 'Gtk'; $this->installer = &new PEAR_Installer($ui); $options = array(); - $info = $this->installer->install($this->active_package['package'], $options , $this->Frontend_Gtk->config); + $info = $this->installer->install($this->active_package['package'], $options , $this->ui->config); // refresh list? - $this->Frontend_Gtk->_package_list->loadList(); - $this->Frontend_Gtk->_package_list->selectPackage($this->active_package['package']); + $this->ui->_packages->loadList(); + $this->ui->_packages->selectPackage($this->active_package['package']); }