Revision
74
Author
emsmith
Date
2006-12-13 15:47:36 -0800 (Wed, 13 Dec 2006)

Log Message

Fixes for things that bugged Leon - raw mode for titles, connect_after for the save state callback, and make sure the restore is only called on show ONCE

Modified Paths

Diff

Modified: desktop/trunk/lib/window.class.php (73 => 74)


--- desktop/trunk/lib/window.class.php	2006-12-12 22:03:38 UTC (rev 73)
+++ desktop/trunk/lib/window.class.php	2006-12-13 23:47:36 UTC (rev 74)
@@ -51,6 +51,13 @@
 	 */
 	protected $modal = false;
 
+	/**
+	 * we keep track of our restore state event and remove the signal after
+	 * using it once, we really don't want to be messing with state on every show
+	 * @var $id bool
+	 */
+	private $id;
+
 	//----------------------------------------------------------------
 	//             Setup
 	//----------------------------------------------------------------
@@ -93,8 +100,8 @@
 		$this->minimized = isset($config->{$name . '_minimized'}) ? (bool) $config->{$name . '_minimized'} : false;
 
 		$this->connect('window-state-event', array($this, 'on_state_event'));
-		$this->connect_simple('delete-event', array($this, 'on_state_save'));
-		$this->connect_simple('show', array($this, 'on_state_restore'));
+		$this->connect_simple_after('delete-event', array($this, 'on_state_save'));
+		$this->id = $this->connect_simple('show', array($this, 'on_state_restore'));
 		return;
 	}
 
@@ -106,9 +113,16 @@
 	 * @param string $name title to set
 	 * @return void
 	 */
-	public function set_title($title)
+	public function set_title($title, $raw = false)
 	{
-		parent::set_title(CC::i18n('%s :: %s', CC::$program, $title));
+		if ($raw == false)
+		{
+			parent::set_title($title);
+		}
+		else
+		{
+			parent::set_title(CC::i18n('%s :: %s', CC::$program, $title));
+		}
 		return;
 	}
 
@@ -230,6 +244,7 @@
 		{
 			$this->iconify();
 		}
+		$this->disconnect($this->id);
 		return;
 	}