Revision
57
Author
emsmith
Date
2006-12-03 11:06:48 -0800 (Sun, 03 Dec 2006)

Log Message

CC_Main -> CC change (and removed leftover debugging in window, oops)

Modified Paths

Added Paths

Removed Paths

Diff

Modified: desktop/trunk/lib/actions.class.php (56 => 57)


--- desktop/trunk/lib/actions.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/actions.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -55,7 +55,7 @@
 	{
 		if(!is_null(self::$singleton))
 		{
-			throw new Exception(CC_Main::i18n(
+			throw new Exception(CC::i18n(
 			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
 			'CC_Actions'));
 		}
@@ -231,18 +231,18 @@
 			switch($def['type'])
 			{
 				case 'radio':
-					$action = new GtkRadioAction($def['name'], CC_Main::i18n($def['label']), CC_Main::i18n($def['tooltip']),$def['image'],$def['value']);
+					$action = new GtkRadioAction($def['name'], CC::i18n($def['label']), CC::i18n($def['tooltip']),$def['image'],$def['value']);
 					$signal = 'toggled';
 					break;
 				case 'toggle':
-					$action = new GtkToggleAction($def['name'], CC_Main::i18n($def['label']), CC_Main::i18n($def['tooltip']),$def['image']);
+					$action = new GtkToggleAction($def['name'], CC::i18n($def['label']), CC::i18n($def['tooltip']),$def['image']);
 					$signal = 'toggled';
 					break;
 				default:
-					$action = new GtkAction($def['name'], CC_Main::i18n($def['label']), CC_Main::i18n($def['tooltip']),$def['image']);
+					$action = new GtkAction($def['name'], CC::i18n($def['label']), CC::i18n($def['tooltip']),$def['image']);
 					$signal = 'activate';
 			}
-			$action->set_property('short-label', isset($def['short-label']) ? CC_Main::i18n($def['short-label']) : NULL);
+			$action->set_property('short-label', isset($def['short-label']) ? CC::i18n($def['short-label']) : NULL);
 			if(isset($def['callback']))
 			{
 				$action->connect($signal, $def['callback']);
@@ -290,7 +290,7 @@
 	 */
 	public function __clone()
 	{
-		throw new Exception(CC_Main::i18n('Cannot clone singleton object %s', 'CC_Actions'));
+		throw new Exception(CC::i18n('Cannot clone singleton object %s', 'CC_Actions'));
 		return;
 	}
 }

Copied: desktop/trunk/lib/cc.class.php (from rev 54, desktop/trunk/lib/main.class.php) (54 => 57)


--- desktop/trunk/lib/main.class.php	2006-12-02 03:09:08 UTC (rev 54)
+++ desktop/trunk/lib/cc.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -0,0 +1,242 @@
+<?php
+/**
+ * cc.class.php - callicore's base class
+ *
+ * handles a few base functions - run decides which program to run and
+ * starts it, i18n is used for translation, requirements checked and
+ * autoloading is set up
+ *
+ * This is released under the GPL, see docs/gpl.txt for details
+ *
+ * @author       Elizabeth Smith <emsmith@callicore.net>
+ * @copyright    Elizabeth Smith (c)2006
+ * @link         http://callicore.net/desktop
+ * @license      http://www.opensource.org/licenses/gpl-license.php GPL
+ * @version      $Id$
+ * @since        Php 5.2.0
+ * @package      callicore
+ * @subpackage   desktop
+ * @category     lib
+ * @filesource
+ */
+$gtk = new Gtk();
+/**
+ * CC - checks settings and manages common properties
+ *
+ * Basically a wrapper for important callicore functions
+ * STATIC ONLY
+ */
+class CC
+{
+	/**
+	 * @const VERSION app version number
+	 */
+	const VERSION = '1.0.0-alpha';
+
+	/**
+	 * Icon sizes - these SHOULD be constants - but
+	 * you can't set class constants after the class is defined
+	 * so they're static vars instead - annoying
+	 *
+	 * sizes are 16, 18, 20, 14, 32, 48, 64 and 128 px square
+	 *
+	 * @var GtkEnum
+	 */
+	static public $MENU = Gtk::ICON_SIZE_MENU;
+	static public $SMALL_TOOLBAR = Gtk::ICON_SIZE_SMALL_TOOLBAR;
+	static public $BUTTON = Gtk::ICON_SIZE_BUTTON;
+	static public $LARGE_TOOLBAR = Gtk::ICON_SIZE_LARGE_TOOLBAR;
+	static public $DND = Gtk::ICON_SIZE_DND;
+	static public $DIALOG = Gtk::ICON_SIZE_DIALOG;
+	static public $LARGE;
+	static public $IMAGE;
+
+	/**
+	 * @var string program to run
+	 */
+	static protected $program;
+
+	/**
+	 * public function __construct
+	 *
+	 * forces only static calls
+	 *
+	 * @return void
+	 */
+	public function __construct()
+	{
+		throw new Exception(CC::i18n(
+			'CC contains only static methods can cannot be constructed'));
+	}
+
+	/**
+	 * static public function run
+	 *
+	 * checks for requirements, figures out the right program to run, registers
+	 * base autoload, and does basic theme setup
+	 *
+	 * @param string $program 
+	 * @return void
+	 */
+	static public function run($program = NULL)
+	{
+		// set up translation
+		if(extension_loaded('gettext'))
+		{
+			// we use system locale
+			bindtextdomain('Callicore', DIR . 'locale');
+			textdomain('Callicore');
+		}
+		if(version_compare(PHP_VERSION, '5.1.0', '<'))
+		{
+			trigger_error(self::i18n('You must use php 5.1.0 or higher'), E_USER_ERROR);
+		}
+		$have = get_loaded_extensions();
+		$needed = array('standard', 'pcre', 'date', 'PDO', 'pdo_sqlite', 'php-gtk');
+		$diff = array_diff($needed, $have);
+		if(!empty($diff))
+		{
+			trigger_error(self::i18n('%s : %s', 'The following extensions must be loaded in your php.ini for Callicore to function', implode(', ', $diff)), E_USER_ERROR);
+		}
+		unset($have, $needed, $diff);
+
+		self::$LARGE = Gtk::icon_size_register('gtk-large',64, 64);
+		self::$IMAGE = Gtk::icon_size_register('gtk-image',128, 128);
+		Gtk::rc_parse(DIR . 'stock_icons' . DS . 'stock.rc');
+		Gtk::rc_parse(DIR . 'cc_icons' . DS . 'callicore.rc');
+
+		if(is_null($program))
+		{
+			if(isset($_SERVER['argv']) && isset($_SERVER['argv'][1]))
+			{
+				$program = (string) $_SERVER['argv'][1];
+			}
+		}
+		if(is_null($program))
+		{
+			trigger_error(self::i18n('You must supply a program to run'), E_USER_ERROR);
+		}
+		self::$program = $program;
+		spl_autoload_register(array(__CLASS__, 'autoload'));
+
+		$class = 'CC_' . ucfirst(strtolower($program));
+		new $class();
+
+		unset($class, $program);
+		return;
+	}
+
+	//----------------------------------------------------------------
+	//             static helper functions
+	//----------------------------------------------------------------
+
+	/**
+	 * public static function i18n
+	 *
+	 * wrapper for gettext + sprintf/vsprintf
+	 *
+	 * @param string $string string to translate
+	 * @return string translated string
+	 */
+	public static function i18n($string)
+	{
+		$args = func_get_args();
+		array_shift($args);
+		if(!empty($args) && count($args) == 1 && is_array($args[0]))
+		{
+			$args = $args[0];
+		}
+		if(function_exists('gettext'))
+		{
+			// if we have args, the first item is format only and not translated
+			if(is_array($args) && !empty($args))
+			{
+				$args = array_map('gettext', $args);
+			}
+			else
+			{
+				$string = gettext($string);
+			}
+		}
+		return vsprintf($string, $args);
+	}
+
+	/**
+	 * public static function setDefaultIcon
+	 *
+	 * uses add_builtin_icon and render_icon to make set_default_icon_name work
+	 *
+	 * @param string $icon icon name to use as default
+	 * @return void
+	 */
+	public static function setDefaultIcon($icon)
+	{
+		$theme = GtkIconTheme::get_for_screen(GdkScreen::get_default());
+		$window = new GtkWindow();
+
+		$theme->add_builtin_icon($icon, self::$MENU,
+			$window->render_icon($icon, self::$MENU));
+		$theme->add_builtin_icon($icon, self::$SMALL_TOOLBAR,
+			$window->render_icon($icon, self::$SMALL_TOOLBAR));
+		$theme->add_builtin_icon($icon, self::$BUTTON,
+			$window->render_icon($icon, self::$BUTTON));
+		$theme->add_builtin_icon($icon, self::$LARGE_TOOLBAR,
+			$window->render_icon($icon, self::$LARGE_TOOLBAR));
+		$theme->add_builtin_icon($icon, self::$DND,
+			$window->render_icon($icon, self::$DND));
+		$theme->add_builtin_icon($icon, self::$DIALOG,
+			$window->render_icon($icon, self::$DIALOG));
+		$theme->add_builtin_icon($icon, self::$LARGE,
+			$window->render_icon($icon, self::$LARGE));
+		$theme->add_builtin_icon($icon, self::$IMAGE,
+			$window->render_icon($icon, self::$IMAGE));
+
+		GtkWindow::set_default_icon_name($icon);
+		unset($window, $theme, $icon);
+		return;
+	}
+
+	/**
+	 * static public function autoload
+	 *
+	 * if you have a program class the same name as a base class the program
+	 * one will always be loaded first (as long as it wasn't previously loaded)
+	 * you can add additional autoloads with your programs via spl_register_autoload
+	 *
+	 * @param string $class class to include
+	 * @return bool
+	 */
+	static public function autoload($class)
+	{
+		preg_match_all('/[A-Z][a-z0-9_]*/', str_replace('CC_', '', $class), $matches);
+		$array = array_map('strtolower', $matches[0]);
+		unset($matches, $class);
+		$file = array_pop($array) . '.class.php';
+		if(!empty($array))
+		{
+			$array[] = '';
+		}
+
+		$program = DIR . 'programs' . DS . self::$program . DS . 'lib' . DS . implode(DS, $array) . $file;
+		$lib = DIR . 'lib' . DS . implode(DS, $array) . $file;
+
+		if(file_exists($program))
+		{
+			include $program;
+			$return = TRUE;
+		}
+		elseif(file_exists($lib))
+		{
+			include $lib;
+			$return = TRUE;
+		}
+		else
+		{
+			$return = FALSE;
+		}
+
+		unset($lib, $file, $array, $class, $matches, $program);
+		return $return;
+	}
+}
+?>
\ No newline at end of file

Modified: desktop/trunk/lib/config.class.php (56 => 57)


--- desktop/trunk/lib/config.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/config.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -62,7 +62,7 @@
 	{
 		if(!is_null(self::$singleton))
 		{
-			throw new Exception(CC_Main::i18n(
+			throw new Exception(CC::i18n(
 			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
 			'CC_Config'));
 		}
@@ -202,7 +202,7 @@
 	 */
 	public function __clone()
 	{
-		throw new Exception(CC_Main::i18n('Cannot clone singleton object %s', 'CC_Config'));
+		throw new Exception(CC::i18n('Cannot clone singleton object %s', 'CC_Config'));
 		return;
 	}
 }

Modified: desktop/trunk/lib/folders.class.php (56 => 57)


--- desktop/trunk/lib/folders.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/folders.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -120,7 +120,7 @@
 	{
 		if(!is_null(self::$singleton))
 		{
-			throw new Exception(CC_Main::i18n(
+			throw new Exception(CC::i18n(
 			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
 			'CC_Folders'));
 		}
@@ -428,7 +428,7 @@
 	 */
 	public function __clone()
 	{
-		throw new Exception(CC_Main::i18n('Cannot clone singleton object %s', 'CC_Folders'));
+		throw new Exception(CC::i18n('Cannot clone singleton object %s', 'CC_Folders'));
 		return;
 	}
 

Deleted: desktop/trunk/lib/main.class.php (56 => 57)


--- desktop/trunk/lib/main.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/main.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -1,228 +0,0 @@
-<?php
-/**
- * main.class.php - callicore's base class
- *
- * handles a few base functions - run decides which program to run and
- * starts it, i18n is used for translation, requirements checked and
- * autoloading is set up
- *
- * This is released under the GPL, see docs/gpl.txt for details
- *
- * @author       Elizabeth Smith <emsmith@callicore.net>
- * @copyright    Elizabeth Smith (c)2006
- * @link         http://callicore.net/desktop
- * @license      http://www.opensource.org/licenses/gpl-license.php GPL
- * @version      $Id$
- * @since        Php 5.2.0
- * @package      callicore
- * @subpackage   desktop
- * @category     lib
- * @filesource
- */
-
-/**
- * CC_Main - checks settings and manages common properties
- *
- * Basically a wrapper for important callicore functions
- */
-class CC_Main
-{
-	/**
-	 * @const VERSION app version number
-	 */
-	const VERSION = '1.0.0-alpha';
-
-	/**
-	 * Icon sizes - these SHOULD be constants - but
-	 * you can't set class constants after the class is defined
-	 * so they're static vars instead - annoying
-	 *
-	 * sizes are 16, 18, 20, 14, 32, 48, 64 and 128 px square
-	 *
-	 * @var GtkEnum
-	 */
-	static public $MENU = Gtk::ICON_SIZE_MENU;
-	static public $SMALL_TOOLBAR = Gtk::ICON_SIZE_SMALL_TOOLBAR;
-	static public $BUTTON = Gtk::ICON_SIZE_BUTTON;
-	static public $LARGE_TOOLBAR = Gtk::ICON_SIZE_LARGE_TOOLBAR;
-	static public $DND = Gtk::ICON_SIZE_DND;
-	static public $DIALOG = Gtk::ICON_SIZE_DIALOG;
-	static public $LARGE;
-	static public $IMAGE;
-
-	/**
-	 * @var string program to run
-	 */
-	static protected $program;
-
-	/**
-	 * static public function run
-	 *
-	 * checks for requirements, figures out the right program to run, registers
-	 * base autoload, and does basic theme setup
-	 *
-	 * @param string $program 
-	 * @return void
-	 */
-	static public function run($program = NULL)
-	{
-		// set up translation
-		if(extension_loaded('gettext'))
-		{
-			// we use system locale
-			bindtextdomain('Callicore', DIR . 'locale');
-			textdomain('Callicore');
-		}
-		if(version_compare(PHP_VERSION, '5.1.0', '<'))
-		{
-			trigger_error(self::i18n('You must use php 5.1.0 or higher'), E_USER_ERROR);
-		}
-		$have = get_loaded_extensions();
-		$needed = array('standard', 'pcre', 'date', 'PDO', 'pdo_sqlite', 'php-gtk');
-		$diff = array_diff($needed, $have);
-		if(!empty($diff))
-		{
-			trigger_error(self::i18n('%s : %s', 'The following extensions must be loaded in your php.ini for Callicore to function', implode(', ', $diff)), E_USER_ERROR);
-		}
-		unset($have, $needed, $diff);
-
-		self::$LARGE = Gtk::icon_size_register('gtk-large',64, 64);
-		self::$IMAGE = Gtk::icon_size_register('gtk-image',128, 128);
-		Gtk::rc_parse(DIR . 'stock_icons' . DS . 'stock.rc');
-		Gtk::rc_parse(DIR . 'cc_icons' . DS . 'callicore.rc');
-
-		if(is_null($program))
-		{
-			if(isset($_SERVER['argv']) && isset($_SERVER['argv'][1]))
-			{
-				$program = (string) $_SERVER['argv'][1];
-			}
-		}
-		if(is_null($program))
-		{
-			trigger_error(self::i18n('You must supply a program to run'), E_USER_ERROR);
-		}
-		self::$program = $program;
-		spl_autoload_register(array(__CLASS__, 'autoload'));
-
-		$class = 'CC_' . ucfirst(strtolower($program));
-		new $class();
-
-		unset($class, $program);
-		return;
-	}
-
-	//----------------------------------------------------------------
-	//             static helper functions
-	//----------------------------------------------------------------
-
-	/**
-	 * public static function i18n
-	 *
-	 * wrapper for gettext + sprintf/vsprintf
-	 *
-	 * @param string $string string to translate
-	 * @return string translated string
-	 */
-	public static function i18n($string)
-	{
-		$args = func_get_args();
-		array_shift($args);
-		if(!empty($args) && count($args) == 1 && is_array($args[0]))
-		{
-			$args = $args[0];
-		}
-		if(function_exists('gettext'))
-		{
-			// if we have args, the first item is format only and not translated
-			if(is_array($args) && !empty($args))
-			{
-				$args = array_map('gettext', $args);
-			}
-			else
-			{
-				$string = gettext($string);
-			}
-		}
-		return vsprintf($string, $args);
-	}
-
-	/**
-	 * public static function setDefaultIcon
-	 *
-	 * uses add_builtin_icon and render_icon to make set_default_icon_name work
-	 *
-	 * @param string $icon icon name to use as default
-	 * @return void
-	 */
-	public static function setDefaultIcon($icon)
-	{
-		$theme = GtkIconTheme::get_for_screen(GdkScreen::get_default());
-		$window = new GtkWindow();
-
-		$theme->add_builtin_icon($icon, self::$MENU,
-			$window->render_icon($icon, self::$MENU));
-		$theme->add_builtin_icon($icon, self::$SMALL_TOOLBAR,
-			$window->render_icon($icon, self::$SMALL_TOOLBAR));
-		$theme->add_builtin_icon($icon, self::$BUTTON,
-			$window->render_icon($icon, self::$BUTTON));
-		$theme->add_builtin_icon($icon, self::$LARGE_TOOLBAR,
-			$window->render_icon($icon, self::$LARGE_TOOLBAR));
-		$theme->add_builtin_icon($icon, self::$DND,
-			$window->render_icon($icon, self::$DND));
-		$theme->add_builtin_icon($icon, self::$DIALOG,
-			$window->render_icon($icon, self::$DIALOG));
-		$theme->add_builtin_icon($icon, self::$LARGE,
-			$window->render_icon($icon, self::$LARGE));
-		$theme->add_builtin_icon($icon, self::$IMAGE,
-			$window->render_icon($icon, self::$IMAGE));
-
-		GtkWindow::set_default_icon_name($icon);
-		unset($window, $theme, $icon);
-		return;
-	}
-
-	/**
-	 * static public function autoload
-	 *
-	 * if you have a program class the same name as a base class the program
-	 * one will always be loaded first (as long as it wasn't previously loaded)
-	 * you can add additional autoloads with your programs via spl_register_autoload
-	 *
-	 * @param string $class class to include
-	 * @return bool
-	 */
-	static public function autoload($class)
-	{
-		preg_match_all('/[A-Z][a-z0-9_]*/', str_replace('CC_', '', $class), $matches);
-		$array = array_map('strtolower', $matches[0]);
-		unset($matches, $class);
-		$file = array_pop($array) . '.class.php';
-		if(!empty($array))
-		{
-			$array[] = '';
-		}
-
-		$program = DIR . 'programs' . DS . self::$program . DS . 'lib' . DS . implode(DS, $array) . $file;
-		$lib = DIR . 'lib' . DS . implode(DS, $array) . $file;
-
-		if(file_exists($program))
-		{
-			include $program;
-			$return = TRUE;
-		}
-		elseif(file_exists($lib))
-		{
-			include $lib;
-			$return = TRUE;
-		}
-		else
-		{
-			$return = FALSE;
-		}
-
-		unset($lib, $file, $array, $class, $matches, $program);
-		return $return;
-	}
-}
-?>
\ No newline at end of file

Modified: desktop/trunk/lib/message.class.php (56 => 57)


--- desktop/trunk/lib/message.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/message.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -76,14 +76,14 @@
 
 		parent::__construct(NULL, 0, $type, Gtk::BUTTONS_CLOSE);
 		$this->set_position(Gtk::WIN_POS_CENTER);
-		$this->set_title(CC_Main::i18n('%s : %s', $program, $title));
+		$this->set_title(CC::i18n('%s : %s', $program, $title));
 		if(is_array($message))
 		{
-			$this->set_markup(CC_Main::i18n(array_shift($message), $message));
+			$this->set_markup(CC::i18n(array_shift($message), $message));
 		}
 		else
 		{
-			$this->set_markup(CC_Main::i18n($message));
+			$this->set_markup(CC::i18n($message));
 		}
 
 		unset($message, $title, $type, $program);

Modified: desktop/trunk/lib/splash.class.php (56 => 57)


--- desktop/trunk/lib/splash.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/splash.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -67,7 +67,7 @@
 		// Window Features
 		parent::__construct();
 		$this->set_position(Gtk::WIN_POS_CENTER);
-		$this->set_title(CC_Main::i18n('%s :: %s', $program, 'Loading'));
+		$this->set_title(CC::i18n('%s :: %s', $program, 'Loading'));
 		$this->set_resizable(FALSE);
 		$this->set_decorated(FALSE);
 		$this->set_skip_taskbar_hint(TRUE);
@@ -85,7 +85,7 @@
 
 		// Progressbar on Bottom
 		$this->progressbar = new GtkProgressBar();
-		$this->progressbar->set_text(CC_Main::i18n('Loading...'));
+		$this->progressbar->set_text(CC::i18n('Loading...'));
 		$this->progressbar->set_fraction(0);
 		$vbox->pack_end($this->progressbar, FALSE, FALSE);
 
@@ -148,7 +148,7 @@
 	{
 		// License info just above progressbar
 		$hbox = new GtkHBox();
-		$hbox->pack_start(new GtkLabel(CC_Main::i18n($license)), FALSE, FALSE);
+		$hbox->pack_start(new GtkLabel(CC::i18n($license)), FALSE, FALSE);
 		$this->vbox->pack_end($hbox, FALSE, FALSE);
 		unset($hbox, $license, $this);
 		return;
@@ -166,9 +166,9 @@
 	{
 		if(is_null($version))
 		{
-			$verion = 'version ' . CC_Main::VERSION;
+			$verion = 'version ' . CC::VERSION;
 		}
-		$this->hbox->pack_end(new GtkLabel(CC_Main::i18n($version)), FALSE, FALSE);
+		$this->hbox->pack_end(new GtkLabel(CC::i18n($version)), FALSE, FALSE);
 		unset($version ,$this);
 		return;
 	}
@@ -183,7 +183,7 @@
 	 */
 	public function setCopyright($copyright = 'Copyright (c) 2006')
 	{
-		$this->hbox->pack_start(new GtkLabel(CC_Main::i18n($copyright)), FALSE, FALSE);
+		$this->hbox->pack_start(new GtkLabel(CC::i18n($copyright)), FALSE, FALSE);
 		unset($copyright, $this);
 		return;
 	}
@@ -198,7 +198,7 @@
 	 */
 	public function update($text)
 	{
-		$this->progressbar->set_text(CC_Main::i18n($text));
+		$this->progressbar->set_text(CC::i18n($text));
 		$this->progressbar->set_fraction($this->progressbar->get_fraction() + (1 / $this->steps));
 		unset($text);
 		while (Gtk::events_pending())

Modified: desktop/trunk/lib/toolbar.class.php (56 => 57)


--- desktop/trunk/lib/toolbar.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/toolbar.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -97,7 +97,7 @@
 		}
 		$menu->append($actions->create_menu_item('toolbar', 'toggle'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('Toolbar S_tyle'));
+		$item = new GtkMenuItem(CC::i18n('Toolbar S_tyle'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -120,7 +120,7 @@
 		}
 		$submenu->append($actions->create_menu_item('toolbar', 'both'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('Toolbar Si_ze'));
+		$item = new GtkMenuItem(CC::i18n('Toolbar Si_ze'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -205,7 +205,7 @@
 		$statusbar = CC_Writer::instance()->statusbar;
 		if(!is_null($statusbar))
 		{
-			$statusbar->label->set_label(CC_Main::i18n('Toolbar visibility changed'));
+			$statusbar->label->set_label(CC::i18n('Toolbar visibility changed'));
 		}
 		unset($state, $action, $statusbar);
 		return;
@@ -244,7 +244,7 @@
 		$statusbar = CC_Writer::instance()->statusbar;
 		if(!is_null($statusbar))
 		{
-			$statusbar->label->set_label(CC_Main::i18n('Toolbar style changed'));
+			$statusbar->label->set_label(CC::i18n('Toolbar style changed'));
 		}
 		unset($config, $action, $statusbar);
 		return;
@@ -265,25 +265,25 @@
 			case 3:
 			{
 				$config->{$this->name . '_toolbar_size'} = 'large';
-				$this->set_icon_size(CC_Main::$DND);
+				$this->set_icon_size(CC::$DND);
 				break;
 			}
 			case 2:
 			{
 				$config->{$this->name . '_toolbar_size'} = 'medium';
-				$this->set_icon_size(CC_Main::$LARGE_TOOLBAR);
+				$this->set_icon_size(CC::$LARGE_TOOLBAR);
 				break;
 			}
 			default:
 			{
 				$config->{$this->name . '_toolbar_size'} = 'small';
-				$this->set_icon_size(CC_Main::$BUTTON);
+				$this->set_icon_size(CC::$BUTTON);
 			}
 		}
 		$statusbar = CC_Writer::instance()->statusbar;
 		if(!is_null($statusbar))
 		{
-			$statusbar->label->set_label(CC_Main::i18n('Toolbar icon size changed'));
+			$statusbar->label->set_label(CC::i18n('Toolbar icon size changed'));
 		}
 		unset($config, $action, $statusbar);
 		return;

Modified: desktop/trunk/lib/tooltips.class.php (56 => 57)


--- desktop/trunk/lib/tooltips.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/tooltips.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -43,7 +43,7 @@
 	{
 		if(!is_null(self::$singleton))
 		{
-			throw new Exception(CC_Main::i18n(
+			throw new Exception(CC::i18n(
 			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
 			'CC_Tooltips'));
 		}
@@ -101,7 +101,7 @@
 	 */
 	public function __clone()
 	{
-		throw new Exception(CC_Main::i18n('Cannot clone singleton object %s', 'CC_Tooltips'));
+		throw new Exception(CC::i18n('Cannot clone singleton object %s', 'CC_Tooltips'));
 		return;
 	}
 }

Modified: desktop/trunk/lib/window.class.php (56 => 57)


--- desktop/trunk/lib/window.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/lib/window.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -107,8 +107,6 @@
 
 		$this->connect('window-state-event', array($this, 'windowState'));
 		$this->connect_simple('delete-event', array($this, 'saveWindowState'));
-		//$this->connect_simple('hide', array($this, 'saveWindowState'));
-		//$this->connect_simple('show', array($this, 'restoreWindowState'));
 		unset($config, $height, $width, $x, $y, $name, $vbox, $this);
 		$this->restoreWindowState();
 		return;
@@ -124,7 +122,7 @@
 	 */
 	public function set_title($title, $program = 'Callicore')
 	{
-		parent::set_title(CC_Main::i18n('%s :: %s', $program, $title));
+		parent::set_title(CC::i18n('%s :: %s', $program, $title));
 		unset($title, $program);
 		return;
 	}
@@ -293,14 +291,14 @@
 		$this->menu = $menu = is_null($this->menu) ? new GtkMenuBar() : $this->menu;
 		$actions = CC_Actions::instance();
 
-		$item = new GtkMenuItem(CC_Main::i18n('_File'));
+		$item = new GtkMenuItem(CC::i18n('_File'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
 
 		$submenu->append($actions->create_menu_item('file', 'quit'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('_View'));
+		$item = new GtkMenuItem(CC::i18n('_View'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -308,7 +306,7 @@
 		$submenu->append($actions->create_menu_item('toolbar', 'toggle'));
 		$submenu->append($actions->create_menu_item('toolbar', 'customize'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('_Help'));
+		$item = new GtkMenuItem(CC::i18n('_Help'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -361,7 +359,7 @@
 		$children = $status->get_children();
 		$status->label = $children[0]->child;
 		$status->label->set_padding(3, 0);
-		$status->label->set_label(CC_Main::i18n('Ready'));
+		$status->label->set_label(CC::i18n('Ready'));
 		$status->label->set_use_markup(TRUE);
 		unset($status, $children);
 		return;
@@ -403,15 +401,11 @@
 
 		// size
 		list($height, $width) = $this->get_size();
-		echo "height is $height\n";
-		echo "width is $width\n";
 		$config->{$name . '_height'} = $height;
 		$config->{$name . '_width'} = $width;
 
 		// position
 		list($x, $y) = $this->get_position();
-		echo "x is $x\n";
-		echo "y is $y\n";
 		$config->{$name . '_x'} = $x;
 		$config->{$name . '_y'} = $y;
 

Modified: desktop/trunk/programs/writer/lib/writer.class.php (56 => 57)


--- desktop/trunk/programs/writer/lib/writer.class.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/programs/writer/lib/writer.class.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -51,7 +51,7 @@
 
 		if(!is_null(self::$singleton))
 		{
-			throw new Exception(CC_Main::i18n(
+			throw new Exception(CC::i18n(
 			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
 			'CC_Writer'));
 		}
@@ -77,7 +77,7 @@
 		parent::__construct();
 		$splash->parent($this);
 
-		CC_Main::setDefaultIcon('cc-writer-icon');
+		CC::setDefaultIcon('cc-writer-icon');
 
 
 //self::$project = new ProjectFile($file);
@@ -289,7 +289,7 @@
 		$actions = CC_Actions::instance();
 		$config = CC_Config::instance();
 
-		$item = new GtkMenuItem(CC_Main::i18n('_File'));
+		$item = new GtkMenuItem(CC::i18n('_File'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -305,7 +305,7 @@
 		$submenu->append($actions->create_menu_item('file', 'print'));
 		$submenu->append(new GtkSeparatorMenuItem());
 
-		$item = new GtkMenuItem(CC_Main::i18n('Recent'));
+		$item = new GtkMenuItem(CC::i18n('Recent'));
 		$submenu->append($item);
 		$subitem = new GtkMenu();
 		$item->set_submenu($subitem);
@@ -327,7 +327,7 @@
 		$submenu->append(new GtkSeparatorMenuItem());
 		$submenu->append($actions->create_menu_item('file', 'quit'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('_Manage'));
+		$item = new GtkMenuItem(CC::i18n('_Manage'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -338,7 +338,7 @@
 		$submenu->append(new GtkSeparatorMenuItem());
 		$submenu->append($actions->create_menu_item('manage', 'properties'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('_Tools'));
+		$item = new GtkMenuItem(CC::i18n('_Tools'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -352,7 +352,7 @@
 		$submenu->append($actions->create_menu_item('tools', 'preferences'));
 		$submenu->append($actions->create_menu_item('toolbar', 'customize'));
 
-		$item = new GtkMenuItem(CC_Main::i18n('_Help'));
+		$item = new GtkMenuItem(CC::i18n('_Help'));
 		$menu->add($item);
 		$submenu = new GtkMenu();
 		$item->set_submenu($submenu);
@@ -438,7 +438,7 @@
 	 */
 	public function __clone()
 	{
-		throw new Exception(CC_Main::i18n('Cannot clone singleton object %s', 'CC_Writer'));
+		throw new Exception(CC::i18n('Cannot clone singleton object %s', 'CC_Writer'));
 		return;
 	}
 }

Modified: desktop/trunk/run.php (56 => 57)


--- desktop/trunk/run.php	2006-12-03 01:08:46 UTC (rev 56)
+++ desktop/trunk/run.php	2006-12-03 19:06:48 UTC (rev 57)
@@ -33,8 +33,8 @@
 define('EOL', PHP_EOL, TRUE);
 define('DIR', dirname(__FILE__) . DS, TRUE);
 
-include(DIR . 'lib' . DS . 'main.class.php');
+include(DIR . 'lib' . DS . 'cc.class.php');
 
-CC_Main::run();
+CC::run();
 Gtk::main();
 ?>
\ No newline at end of file