Modified: desktop/trunk/lib/toolbar.class.php (52 => 53)
--- desktop/trunk/lib/toolbar.class.php 2006-12-02 02:07:45 UTC (rev 52)
+++ desktop/trunk/lib/toolbar.class.php 2006-12-02 02:29:50 UTC (rev 53)
@@ -52,6 +52,22 @@
public $menu;
/**
+ * public function __construct
+ *
+ * just sets a name for the toolbar, should be unique
+ *
+ * @param string $name name of specific toolbar
+ * @return void
+ */
+ public function __construct($name = 'Callicore')
+ {
+ parent::__construct();
+ $this->set_name($name);
+ unset($name);
+ return;
+ }
+
+ /**
* public function buildToolbar
*
* takes current settings and recreates the toolbar
@@ -64,8 +80,9 @@
$config = CC_Config::instance();
$actions = CC_Actions::instance();
- $size = isset($config->{$this->name . '_toolbar_size'}) ? (string) $config->{$this->name . '_toolbar_size'} : 'small';
+ $size = isset($config->{$name . '_toolbar_size'}) ? (string) $config->{$name . '_toolbar_size'} : 'small';
$style = isset($config->{$name . '_toolbar_style'}) ? (string) $config->{$name . '_toolbar_style'} : 'icon';
+ $active = isset($config->{$name . '_show_toolbar'}) ? $config->{$name . '_show_toolbar'} : TRUE;
$toolitems = $this->current = isset($config->{$name . 'toolbar_items'}) ? $config->{$name . 'toolbar_items'} : $this->default;
$actions = CC_Actions::instance();
@@ -73,6 +90,11 @@
// Create the popup menu
$menu = $this->menu = new GtkMenu();
+ $this->set_no_show_all(TRUE);
+ if($active == TRUE)
+ {
+ $actions->get_action('toolbar', 'toggle')->set_active(TRUE);
+ }
$menu->append($actions->create_menu_item('toolbar', 'toggle'));
$item = new GtkMenuItem(CC_Main::i18n('Toolbar S_tyle'));
@@ -143,6 +165,8 @@
$this->insert($actions->create_tool_item($group, $name), -1);
}
}
+ unset($group, $name, $item, $actions, $this, $toolitems, $menu, $submenu,
+ $name, $config, $size, $style, $active);
return;
}
@@ -174,15 +198,16 @@
*/
public function onToggleToolbar($action)
{
- return;
- $state = !$this->toolbar->is_visible();
- $this->toolbar->set_visible($state);
- CC_Config::instance()->{$this->name . '_show_toolbar'} = $state;
- if(!is_null($this->statusbar))
+ $this->set_no_show_all(FALSE);
+ $state = $action->get_active();
+ $this->set_visible($state);
+ CC_Config::instance()->{$this->name . '_show_toolbar'} = (bool) $state;
+ $statusbar = CC_Writer::instance()->statusbar;
+ if(!is_null($statusbar))
{
- $this->statusbar->label->set_label(Writer::i18n('<b>Toolbar visibility changed</b>'));
+ $statusbar->label->set_label(CC_Main::i18n('Toolbar visibility changed'));
}
- unset($state);
+ unset($state, $action, $statusbar);
return;
}
Modified: desktop/trunk/lib/window.class.php (52 => 53)
--- desktop/trunk/lib/window.class.php 2006-12-02 02:07:45 UTC (rev 52)
+++ desktop/trunk/lib/window.class.php 2006-12-02 02:29:50 UTC (rev 53)
@@ -85,7 +85,7 @@
$this->move($x, $y);
}
- $this->toolbar = new CC_Toolbar();
+ $this->toolbar = new CC_Toolbar($this->name);
$this->buildActions();
$this->buildMenu();
$this->buildToolbar();
Modified: desktop/trunk/programs/writer/lib/writer.class.php (52 => 53)
--- desktop/trunk/programs/writer/lib/writer.class.php 2006-12-02 02:07:45 UTC (rev 52)
+++ desktop/trunk/programs/writer/lib/writer.class.php 2006-12-02 02:29:50 UTC (rev 53)
@@ -407,7 +407,7 @@
public function onDeleteEvent()
{
$config = CC_Config::instance();
- $config->last_open_file = CC_Project::instance()->getFilename();
+ //$config->last_open_file = CC_Project::instance()->getFilename();
unset($config);
parent::onDeleteEvent();
return;