From a40642fd0efcca88278a20f63af69d9a5a0d43fa Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 13 Apr 2009 16:50:42 +0100 Subject: [PATCH] Tidied up some loose ends on panel switching --- src/gui/panels/panel.cpp | 45 +++--------------------------- src/gui/panels/panel.hpp | 26 ++--------------- src/gui/panels/resources-panel.cpp | 2 +- src/gui/panels/timeline-panel.cpp | 2 +- src/gui/panels/viewer-panel.cpp | 2 +- 5 files changed, 10 insertions(+), 67 deletions(-) diff --git a/src/gui/panels/panel.cpp b/src/gui/panels/panel.cpp index 526ab5a7e..416f0d2a8 100644 --- a/src/gui/panels/panel.cpp +++ b/src/gui/panels/panel.cpp @@ -31,56 +31,19 @@ using namespace Gtk; namespace gui { namespace panels { -/*Panel::Panel(workspace::WorkspaceWindow &workspace_window, - const gchar *name, const gchar *long_name, - GdlDockItemBehavior behavior) : - workspace(workspace_window), - panelBar(*this, long_name) -{ - REQUIRE(name != NULL); - REQUIRE(long_name != NULL); - - dock_item = (GdlDockItem*)gdl_dock_item_new ( - name, long_name, behavior); - internal_setup(); - - ENSURE(dock_item != NULL); -} - -Panel::Panel(workspace::WorkspaceWindow &workspace_window, - const gchar *name, const gchar *long_name, const gchar *stock_id, - GdlDockItemBehavior behavior) : - workspace(workspace_window), - panelBar(*this, stock_id) -{ - REQUIRE(name != NULL); - REQUIRE(long_name != NULL); - REQUIRE(stock_id != NULL); - - dock_item = (GdlDockItem*)gdl_dock_item_new_with_stock ( - name, long_name, stock_id, behavior); - g_object_ref(dock_item); - internal_setup(); - - ENSURE(dock_item != NULL); -}*/ - Panel::Panel(workspace::PanelManager &panel_manager, - GdlDockItem *dock_item, const gchar *stock_id) : + GdlDockItem *dock_item, const gchar* long_name, + const gchar *stock_id) : panelManager(panel_manager), dockItem(dock_item), panelBar(*this, stock_id) { REQUIRE(dockItem); g_object_ref(dockItem); - - // Set the dock item title - StockItem stock_item; - REQUIRE(StockItem::lookup(Gtk::StockID(stock_id), stock_item)); - + Glib::Value val; val.init(val.value_type()); - val.set(stock_item.get_label()); + val.set(long_name); g_object_set_property (G_OBJECT (dockItem), "long-name", val.gobj()); // Set the grip handle diff --git a/src/gui/panels/panel.hpp b/src/gui/panels/panel.hpp index a78898b9c..a44f45643 100644 --- a/src/gui/panels/panel.hpp +++ b/src/gui/panels/panel.hpp @@ -46,37 +46,17 @@ namespace panels { class Panel : public Gtk::VBox { protected: - /** - * Constructs a panel object - * @param workspace_window The window that owns this panel. - * @param name The internal name of this panel - * @param long_name The name to display on the caption - * @param behavior The GDL behaviour of this item - */ - //Panel(workspace::WorkspaceWindow &workspace_window, - // const gchar *name, const gchar *long_name, - // GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); - - /** - * Constructs a panel object with a stock item for a caption - * @param owner_window The window that owns this panel. - * @param name The internal name of this panel - * @param long_name The name to display on the caption - * @param stock_id The id of the stock item to display on the caption - * @param behavior The GDL behaviour of this item - */ - //Panel(workspace::WorkspaceWindow &owner_window, - // const gchar *name, const gchar *long_name, const gchar *stock_id, - // GdlDockItemBehavior behavior = GDL_DOCK_ITEM_BEH_NORMAL); /** * Contructor. * @param panel_manager The owner panel manager widget. * @param dock_item The GdlDockItem that will host this panel. + * @param long_name This title of the panel * @param stock_id The stock_id of this panel. **/ Panel(workspace::PanelManager &panel_manager, - GdlDockItem *dock_item, const gchar *stock_id); + GdlDockItem *dock_item, const gchar* long_name, + const gchar *stock_id); public: /** diff --git a/src/gui/panels/resources-panel.cpp b/src/gui/panels/resources-panel.cpp index 33ce4fc45..1180ddd58 100644 --- a/src/gui/panels/resources-panel.cpp +++ b/src/gui/panels/resources-panel.cpp @@ -28,7 +28,7 @@ namespace panels { ResourcesPanel::ResourcesPanel(workspace::PanelManager &panel_manager, GdlDockItem *dock_item) : - Panel(panel_manager, dock_item, get_stock_id()) + Panel(panel_manager, dock_item, get_title(), get_stock_id()) { notebook.append_page(media, _("Media")); notebook.append_page(clips, _("Clips")); diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 1092dd251..11ef08f7f 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -48,7 +48,7 @@ const int TimelinePanel::ZoomToolSteps = 2; // 2 seems comfortable TimelinePanel::TimelinePanel(workspace::PanelManager &panel_manager, GdlDockItem *dock_item) : - Panel(panel_manager, dock_item, get_stock_id()), + Panel(panel_manager, dock_item, get_title(), get_stock_id()), timeIndicator(), timeIndicatorButton(), previousButton(Stock::MEDIA_PREVIOUS), diff --git a/src/gui/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp index f8ab93b4e..94c055a00 100644 --- a/src/gui/panels/viewer-panel.cpp +++ b/src/gui/panels/viewer-panel.cpp @@ -38,7 +38,7 @@ namespace panels { ViewerPanel::ViewerPanel(workspace::PanelManager &panel_manager, GdlDockItem *dock_item) : - Panel(panel_manager, dock_item, get_stock_id()) + Panel(panel_manager, dock_item, get_title(), get_stock_id()) { //----- Pack in the Widgets -----// pack_start(display, PACK_EXPAND_WIDGET);