Revision
45
Author
emsmith
Date
2006-12-01 11:17:03 -0800 (Fri, 01 Dec 2006)

Log Message

There, writer actually does something now

Modified Paths

Removed Paths

Diff

Modified: desktop/trunk/lib/window.class.php (44 => 45)


--- desktop/trunk/lib/window.class.php	2006-12-01 18:45:58 UTC (rev 44)
+++ desktop/trunk/lib/window.class.php	2006-12-01 19:17:03 UTC (rev 45)
@@ -84,6 +84,7 @@
 		$vbox->pack_end($this->statusbar, 0, 0);
 		$this->add($vbox);
 
+		$this->connect_simple('delete-event', array($this, 'onDeleteEvent'));
 		unset($config, $height, $width, $x, $y, $name, $vbox, $this);
 		return;
 	}

Deleted: desktop/trunk/programs/writer/lib/project/window.class.php (44 => 45)


--- desktop/trunk/programs/writer/lib/project/window.class.php	2006-12-01 18:45:58 UTC (rev 44)
+++ desktop/trunk/programs/writer/lib/project/window.class.php	2006-12-01 19:17:03 UTC (rev 45)
@@ -1,54 +0,0 @@
-<?php
-/**
- * window.class.php - project window main class
- *
- * main window for the application, opens up last used project or creates a new
- * blank project if no "last" is available to use
- *
- * This is released under the GPL, see license.txt for details
- *
- * @author       Elizabeth Smith <emsmith@callicore.net>
- * @copyright    Elizabeth Smith (c)2006
- * @link         http://callicore.net/writer
- * @license      http://www.opensource.org/licenses/gpl-license.php GPL
- * @version      $Id$
- * @since        Php 5.2.0
- * @package      callicore
- * @subpackage   writer
- * @category     lib
- * @filesource
- */
-
-/**
- * ProjectWindow - character window - list view looks a lot like main window
- *
- * Main project window, holds project object
- */
-class ProjectWindow extends Window
-{
-
-	/**
-	 * public function __construct
-	 *
-	 * Create a new ProjectWindow instance and build internal gui items
-	 *
-	 * @return void
-	 */
-	public function __construct()
-	{
-
-		parent::__construct();
-
-		//Db::instance('test.cwp');
-		//$this->set_title('Test');
-
-		//$this->characters = new CharacterWindow();
-
-		// remove when character testing is done
-		//$this->connect_simple('show', array($this->characters, 'show_all'));
-		$this->connect_simple('delete-event', array($this, 'onDeleteEvent'));
-		$this->connect_simple('destroy', array('Gtk', 'main_quit'));
-		return;
-	}
-}
-?>
\ No newline at end of file

Modified: desktop/trunk/programs/writer/lib/writer.class.php (44 => 45)


--- desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 18:45:58 UTC (rev 44)
+++ desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 19:17:03 UTC (rev 45)
@@ -57,7 +57,7 @@
 		}
 		self::$singleton = $this;
 
-		$splash = new CC_Splash(7, 'Writer');
+		$splash = new CC_Splash(5, 'Writer');
 		$splash->setImage(DIR . 'programs' . DS . 'writer' . DS . 'images' . DS . 'splash.png');
 		$splash->setCopyright('Copyright (c) E. M. Smith 2006');
 		$splash->setVersion('version ' . self::VERSION);
@@ -76,16 +76,43 @@
 		$splash->update('Loading Project');
 		parent::__construct();
 		$splash->parent($this);
+
+		CC_Main::setDefaultIcon('cc-writer-icon');
+
+
+
+
+
+		$this->connect_simple('destroy', array('Gtk', 'main_quit'));
 		$this->show_all();
 
 		$splash->update('Loaded');
-		//$splash->destroy();
+		$splash->destroy();
 		unset($splash, $window);
 		return;
 	}
 
+	//----------------------------------------------------------------
+	//             Callbacks
+	//----------------------------------------------------------------
 
 	/**
+	 * public function onDeleteEvent
+	 *
+	 * callback for delete-event, saves window size and position
+	 *
+	 * @return void
+	 */
+	public function onDeleteEvent()
+	{
+		$config = CC_Config::instance();
+		$config->last_open_file = CC_Project::instance()->getFilename();
+		unset($config);
+		parent::onDeleteEvent();
+		return;
+	}
+
+	/**
 	 * static public function instance
 	 *
 	 * this is how items can access the main window instance

Modified: desktop/trunk/run.php (44 => 45)


--- desktop/trunk/run.php	2006-12-01 18:45:58 UTC (rev 44)
+++ desktop/trunk/run.php	2006-12-01 19:17:03 UTC (rev 45)
@@ -35,6 +35,6 @@
 
 include(DIR . 'lib' . DS . 'main.class.php');
 
-new CC_Main();
+CC_Main::run();
 Gtk::main();
 ?>
\ No newline at end of file