X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fwidget%2Fpanel.cpp;h=a591e76640acd8ec51b69f63d4c79327079483c9;hb=fd5e7b511a23f6228ce4cd3ef54795664811e615;hp=1e868191d80eee02bf7070acb842048adcb45280;hpb=963f23115db07f460bdd862b957f8bd9dba88b9b;p=inkscape.git diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 1e868191d..a591e7664 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -4,9 +4,11 @@ * Authors: * Bryce Harrington * Jon A. Cruz + * Gustav Broberg * * Copyright (C) 2004 Bryce Harrington * Copyright (C) 2005 Jon A. Cruz + * Copyright (C) 2007 Gustav Broberg * * Released under GNU GPL. Read the file 'COPYING' for more information */ @@ -39,11 +41,12 @@ static const int PANEL_SETTING_NEXTFREE = 3; * Construct a Panel */ -Panel::Panel(Glib::ustring const &label, gchar const *prefs_path, +Panel::Panel(Glib::ustring const &label, gchar const *prefs_path, int verb_num, Glib::ustring const &apply_label, bool menu_desired) : _prefs_path(prefs_path), _menu_desired(menu_desired), + _desktop(SP_ACTIVE_DESKTOP), _label(label), _apply_label(apply_label), _verb_num(verb_num), @@ -181,6 +184,8 @@ void Panel::_init() signalResponse().connect(sigc::mem_fun(*this, &Panel::_handleResponse)); + signalActivateDesktop().connect(sigc::hide<0>(sigc::mem_fun(*this, &Panel::setDesktop))); + show_all_children(); _bounceCall(PANEL_SETTING_SIZE, panel_size); @@ -383,6 +388,11 @@ Glib::ustring const &Panel::getApplyLabel() const return _apply_label; } +void Panel::setDesktop(SPDesktop *desktop) +{ + _desktop = desktop; +} + void Panel::_setTargetFillable(PreviewFillable *target) { _fillable = target; @@ -395,7 +405,7 @@ void Panel::_regItem(Gtk::MenuItem* item, int group, int id) item->show(); } -void Panel::_handleAction(int set_id, int item_id) +void Panel::_handleAction(int /*set_id*/, int /*item_id*/) { // for subclasses to override } @@ -406,7 +416,7 @@ Panel::_apply() g_warning("Apply button clicked for panel [Panel::_apply()]"); } -Gtk::Button * +Gtk::Button * Panel::addResponseButton(const Glib::ustring &button_text, int response_id) { Gtk::Button *button = new Gtk::Button(button_text); @@ -461,6 +471,24 @@ Panel::setResponseSensitive(int response_id, bool setting) _response_map[response_id]->set_sensitive(setting); } +sigc::signal & +Panel::signalDocumentReplaced() +{ + return _signal_document_replaced; +} + +sigc::signal & +Panel::signalActivateDesktop() +{ + return _signal_activate_desktop; +} + +sigc::signal & +Panel::signalDeactiveDesktop() +{ + return _signal_deactive_desktop; +} + void Panel::_handleResponse(int response_id) { @@ -474,7 +502,7 @@ Panel::_handleResponse(int response_id) Inkscape::Selection *Panel::_getSelection() { - return sp_desktop_selection(SP_ACTIVE_DESKTOP); + return sp_desktop_selection(_desktop); } } // namespace Widget