Revision
46
Author
emsmith
Date
2006-12-01 11:30:38 -0800 (Fri, 01 Dec 2006)

Log Message

Start integrating features back in, move around project

Modified Paths

Added Paths

Removed Paths

Diff

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


--- desktop/trunk/lib/window.class.php	2006-12-01 19:17:03 UTC (rev 45)
+++ desktop/trunk/lib/window.class.php	2006-12-01 19:30:38 UTC (rev 46)
@@ -73,7 +73,7 @@
 			$this->move($x, $y);
 		}
 
-		//$this->buildActions();
+		$this->buildActions();
 		//$this->buildMenu();
 		//$this->buildToolbar();
 		$this->buildStatusbar();
@@ -157,5 +157,83 @@
 		$this->destroy();
 		return;
 	}
+
+	/**
+	 * public function styleToolbar
+	 *
+	 * change toolbar display type
+	 *
+	 * @param string $style text|icon|both
+	 * @return void
+	 */
+	public function styleToolbar($style)
+	{
+		$config = Config::instance();
+		switch($style)
+		{
+			case 'both':
+			{
+				$config->{$this->name . '_toolbar_style'} = 'both';
+				$this->toolbar->set_toolbar_style(Gtk::TOOLBAR_BOTH);
+				break;
+			}
+			case 'text':
+			{
+				$config->{$this->name . '_toolbar_style'} = 'text';
+				$this->toolbar->set_toolbar_style(Gtk::TOOLBAR_TEXT);
+				break;
+			}
+			default:
+			{
+				$config->{$this->name . '_toolbar_style'} = 'icon';
+				$this->toolbar->set_toolbar_style(Gtk::TOOLBAR_ICONS);
+			}
+		}
+		if(!is_null($this->statusbar))
+		{
+			$this->statusbar->label->set_label(CC_Main::i18n('Toolbar style changed'));
+		}
+		unset($config, $style);
+		return;
+	}
+
+	/**
+	 * public function sizeToolbar
+	 *
+	 * change toolbar icon display size
+	 *
+	 * @param int $size icon size to change toolbar to
+	 * @return void
+	 */
+	public function sizeToolbar($size)
+	{
+		$config = Config::instance();
+		switch($size)
+		{
+			case 'large':
+			{
+				$config->{$this->name . '_toolbar_size'} = 'large';
+				$this->toolbar->set_icon_size(Writer::$DND);
+				break;
+			}
+			case 'medium':
+			{
+				$config->{$this->name . '_toolbar_size'} = 'medium';
+				$this->toolbar->set_icon_size(Writer::$LARGE_TOOLBAR);
+				break;
+			}
+			default:
+			{
+				$config->{$this->name . '_toolbar_size'} = 'small';
+				$this->toolbar->set_icon_size(Writer::$BUTTON);
+			}
+		}
+		if(!is_null($this->statusbar))
+		{
+			$this->statusbar->label->set_label(Writer::i18n('<b>Toolbar icon size changed</b>'));
+		}
+		unset($config, $size);
+		return;
+	}
 }
 ?>
\ No newline at end of file

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


--- desktop/trunk/programs/writer/lib/project/project.class.php	2006-12-01 19:17:03 UTC (rev 45)
+++ desktop/trunk/programs/writer/lib/project/project.class.php	2006-12-01 19:30:38 UTC (rev 46)
@@ -1,138 +0,0 @@
-<?php
-/**
- * db.class.php - wrapper for pdo and sqlite to manage open project
- *
- * extends pdo class, forces singleton instance
- *
- * 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
- */
-
-/**
- * Db - pdo wrapper class for easy pdo management
- *
- * forces pdo as a singleton
- */
-class Db extends PDO
-{
-	/**
-	 * sql definition
-	 * @var $sql string
-	 */
-	protected $sql =
-'CREATE TABLE "character" (
-  "id" INTEGER PRIMARY KEY,
-  "name" TEXT UNIQUE,
-  "order" INTEGER,
-  "date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  "date_edited" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
-CREATE TABLE "character_meta" (
-  "id" INTEGER PRIMARY KEY,
-  "name" TEXT UNIQUE,
-  "display" TEXT,
-  "default" TEXT,
-  "order" INTEGER,
-  "character_meta_type_id_fk" INTEGER NOT NULL DEFAULT 0,
-  "date_created" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  "date_edited" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
-);
-
-CREATE TABLE "character_meta_type" (
-  "id" INTEGER PRIMARY KEY,
-  "name" TEXT UNIQUE,
-  "list" TEXT
-);
-
-INSERT INTO "character_meta_type"("name", "list") VALUES (\'entry\', \'TEXT\');
-INSERT INTO "character_meta_type"("name", "list") VALUES (\'text\', NULL);
-INSERT INTO "character_meta_type"("name", "list") VALUES (\'toggle\', \'TOGGLE\');
-INSERT INTO "character_meta_type"("name", "list") VALUES (\'choice\', NULL);
-INSERT INTO "character_meta_type"("name", "list") VALUES (\'image\', \'PIXBUF\');
-
-CREATE TABLE "character_meta_option" (
-  "id" INTEGER PRIMARY KEY,
-  "name" TEXT UNIQUE,
-  "display" TEXT,
-  "value" TEXT,
-  "character_meta_id_fk" INTEGER NOT NULL DEFAULT 0
-);
-
-CREATE TABLE "character_has_character_meta" (
-  "id" INTEGER PRIMARY KEY,
-  "value" TEXT,
-  "character_id_fk" INTEGER NOT NULL DEFAULT 0,
-  "character_meta_id_fk" INTEGER NOT NULL DEFAULT 0,
-  "character_meta_option_id_fk" INTEGER
-);
-
-INSERT INTO "character"("name", "order") VALUES (\'NONE\', 1);
-';
-
-	/**
-	 * public function __construct
-	 *
-	 * constructor will throw an exception if a class already exists - use
-	 * instance to create the class
-	 *
-	 * @param string $file file to open
-	 * @return void
-	 */
-	public function __construct($file)
-	{
-		if(self::$check == FALSE)
-		{
-			throw new Exception(Writer::i18n(
-			'%1$s is a singleton class - use %1$s::instance() to retrieve the current object',
-			'Db'));
-		}
-		self::$singleton = $this;
-
-		$new = file_exists($file) ? FALSE : TRUE;
-		parent::__construct('sqlite:' . $file);
-		$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-		if($new == TRUE)
-		{
-			$this->beginTransaction();
-			try
-			{
-				$create = $this->exec($this->sql);
-			}
-			catch(PDOException $e)
-			{
-				$this->rollback();
-				$info = $this->errorInfo();
-				unset($file, $new, $e);
-				throw new Exception(Writer::i18n('Creating character storage failed: "%s"', $info[2]));
-			}
-			$this->commit();
-		}
-		unset($file, $new);
-		return;
-	}
-
-	/**
-	 * public function identify
-	 *
-	 * quote identifier
-	 *
-	 * @param string $string string to quote
-	 * @return string
-	 */
-	public function identify($string)
-	{
-		return '"' . $string . '"';
-	}
-}
-?>
\ No newline at end of file

Copied: desktop/trunk/programs/writer/lib/project.class.php (from rev 40, desktop/trunk/programs/writer/lib/project/project.class.php) ( => )


Modified: desktop/trunk/programs/writer/lib/writer.class.php
===================================================================
--- desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 19:17:03 UTC (rev 45)
+++ desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 19:30:38 UTC (rev 46)
@@ -80,7 +80,9 @@
 		CC_Main::setDefaultIcon('cc-writer-icon');
 
 
+//self::$project = new ProjectFile($file);
 
+		$this->set_title('Project Title goes here');
 
 
 		$this->connect_simple('destroy', array('Gtk', 'main_quit'));