Revision
49
Author
emsmith
Date
2006-12-01 13:17:47 -0800 (Fri, 01 Dec 2006)

Log Message

Action building now works properly

Modified Paths

Removed Paths

Diff

Modified: desktop/trunk/programs/writer/lib/writer.class.php (48 => 49)


--- desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 20:18:28 UTC (rev 48)
+++ desktop/trunk/programs/writer/lib/writer.class.php	2006-12-01 21:17:47 UTC (rev 49)
@@ -95,6 +95,187 @@
 	}
 
 	//----------------------------------------------------------------
+	//             Building Items
+	//----------------------------------------------------------------
+
+	/**
+	 * protected function buildActions
+	 *
+	 * creates generic window actions
+	 *
+	 * @todo add additional generic actions
+	 * @return void
+	 */
+	protected function buildActions()
+	{
+		parent::buildActions();
+		$actions = CC_Actions::instance();
+
+		$actions->add_actions('file', array(
+		array(
+			'type' => 'action',
+			'name' => 'new',
+			'label' => '_New...',
+			'short-label' => '_New',
+			'tooltip' => 'Create new project',
+			'accel' => '<Ctrl>n',
+			'callback' => array($this, 'onNew'),
+			'image' => 'gtk-new',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'open',
+			'label' => '_Open...',
+			'short-label' => '_Open',
+			'tooltip' => 'Open new project',
+			'accel' => '<Ctrl>o',
+			'callback' => array($this, 'onOpen'),
+			'image' => 'gtk-open',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'close',
+			'label' => '_Close',
+			'short-label' => '_Close',
+			'tooltip' => 'Close current project',
+			'callback' => array($this, 'onClose'),
+			'image' => 'gtk-close',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'delete',
+			'label' => '_Delete',
+			'short-label' => '_Delete',
+			'tooltip' => 'Delete current project',
+			'callback' => array($this, 'onDelete'),
+			'image' => 'gtk-delete',
+			'accel' => 'Delete',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'save',
+			'label' => '_Save',
+			'short-label' => '_Save',
+			'tooltip' => 'Save current project',
+			'callback' => array($this, 'onSave'),
+			'image' => 'gtk-save',
+			'accel' => '<Ctrl>s',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'save',
+			'label' => 'Save _As...',
+			'short-label' => 'Save _As',
+			'tooltip' => 'Save current project',
+			'callback' => array($this, 'onSaveAs'),
+			'image' => 'gtk-save-as',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'revert',
+			'label' => 'Re_vert',
+			'short-label' => 'Re_vert',
+			'tooltip' => 'Rever current project to last save',
+			'callback' => array($this, 'onRevert'),
+			'image' => 'cc-revert',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'print',
+			'label' => '_Print',
+			'short-label' => '_Print',
+			'tooltip' => 'Print current project',
+			'callback' => array($this, 'onPrint'),
+			'image' => 'gtk-print',
+			'accel' => '<Ctrl>p',
+			),
+		));
+
+		$actions->add_actions('manage', array(
+		array(
+			'type' => 'action',
+			'name' => 'wizard',
+			'label' => '_Wizard...',
+			'short-label' => '_Wizard',
+			'tooltip' => 'Create project using wizard',
+			'callback' => array($this, 'onWizard'),
+			'image' => 'cc-wizard',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'import',
+			'label' => '_Import...',
+			'short-label' => '_Import',
+			'tooltip' => 'Import project from another format',
+			'callback' => array($this, 'onImport'),
+			'image' => 'gtk-convert',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'export',
+			'label' => '_Export...',
+			'short-label' => '_Export',
+			'tooltip' => 'Export project to another format',
+			'callback' => array($this, 'onExport'),
+			'image' => 'cc-save-all',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'properties',
+			'label' => '_Properties...',
+			'short-label' => '_Properties',
+			'tooltip' => 'View and edit project properties',
+			'callback' => array($this, 'onProperties'),
+			'image' => 'gtk-execute',
+			),
+		));
+
+		$actions->add_actions('tools', array(
+		array(
+			'type' => 'action',
+			'name' => 'characters',
+			'label' => '_Characters...',
+			'short-label' => '_Characters',
+			'tooltip' => 'Characters management',
+			'callback' => array($this, 'onCharacters'),
+			'image' => 'cc-users',
+			'accel' => 'F2',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'places',
+			'label' => '_Places...',
+			'short-label' => '_Places',
+			'tooltip' => 'Places management',
+			'callback' => array($this, 'onPlaces'),
+			'image' => 'cc-folder-home',
+			'accel' => 'F3',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'notes',
+			'label' => '_Notes...',
+			'short-label' => '_Notes',
+			'tooltip' => 'Project notes',
+			'callback' => array($this, 'onNotes'),
+			'image' => 'cc-notes',
+			'accel' => 'F4',
+			),
+		array(
+			'type' => 'action',
+			'name' => 'preferences',
+			'label' => '_Preferences...',
+			'short-label' => '_Preferences',
+			'tooltip' => 'View and edit writer preferences',
+			'callback' => array($this, 'onPreferences'),
+			'image' => 'gtk-preferences',
+			),
+		));
+		return;
+	}
+
+
+	//----------------------------------------------------------------
 	//             Callbacks
 	//----------------------------------------------------------------