From: cilix42 Date: Sat, 22 Mar 2008 00:17:46 +0000 (+0000) Subject: Really fix compile (patch by Krzysztof Kosiński) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b909487af57677f53f97752ad481c1da79d4b31d;p=inkscape.git Really fix compile (patch by Krzysztof Kosiński) --- diff --git a/src/dialogs/Makefile_insert b/src/dialogs/Makefile_insert index 2f687ea46..4b1d42abb 100644 --- a/src/dialogs/Makefile_insert +++ b/src/dialogs/Makefile_insert @@ -63,9 +63,7 @@ dialogs_libspdialogs_a_SOURCES = \ dialogs/unclump.cpp \ dialogs/unclump.h \ dialogs/iconpreview.cpp \ - dialogs/iconpreview.h \ - dialogs/calligraphic-profile-rename.h \ - dialogs/calligraphic-profile-rename.cpp + dialogs/iconpreview.h # dialogs/sp-widget.c \ # dialogs/sp-widget.h \ diff --git a/src/dialogs/calligraphic-profile-rename.cpp b/src/dialogs/calligraphic-profile-rename.cpp deleted file mode 100755 index ae9a31c0e..000000000 --- a/src/dialogs/calligraphic-profile-rename.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/** - * - * \brief Dialog for naming calligraphic profiles - * - * Author: - * Aubanel MONNIER - * - * Copyright (C) 2007 Aubanel MONNIER - * - * Released under GNU GPL. Read the file 'COPYING' for more information - */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include "desktop.h" -#include "calligraphic-profile-rename.h" - - -namespace Inkscape { -namespace UI { -namespace Dialogs { -CalligraphicProfileDialog::CalligraphicProfileDialog(): _applied(false){ - Gtk::VBox *mainVBox = get_vbox(); - _layout_table.set_spacings(4); - _layout_table.resize (1, 2); - - _profile_name_entry.set_activates_default(true); - - _profile_name_label.set_label(_("Profile name:")); - _profile_name_label.set_alignment(1.0, 0.5); - - _layout_table.attach(_profile_name_label, - 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); - _layout_table.attach(_profile_name_entry, - 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); - mainVBox->pack_start(_layout_table, false, false, 4); - // Buttons - _close_button.set_use_stock(true); - _close_button.set_label(Gtk::Stock::CANCEL.id); - _close_button.set_flags(Gtk::CAN_DEFAULT); - - _apply_button.set_use_underline(true); - _apply_button.set_label(_("Save")); - _apply_button.set_flags(Gtk::CAN_DEFAULT); - - _close_button.signal_clicked() - .connect(sigc::mem_fun(*this, &CalligraphicProfileDialog::_close)); - _apply_button.signal_clicked() - .connect(sigc::mem_fun(*this, &CalligraphicProfileDialog::_apply)); - - signal_delete_event().connect( - sigc::bind_return( - sigc::hide(sigc::mem_fun(*this, &CalligraphicProfileDialog::_close)), - true - ) - ); - - add_action_widget(_close_button, Gtk::RESPONSE_CLOSE); - add_action_widget(_apply_button, Gtk::RESPONSE_APPLY); - - _apply_button.grab_default(); - - show_all_children(); - -} - -void -CalligraphicProfileDialog::_apply() -{ - _profile_name = _profile_name_entry.get_text(); - _applied = true; - _close(); -} - -void -CalligraphicProfileDialog::_close() -{ - this->Gtk::Dialog::hide(); - -} - -void CalligraphicProfileDialog::show(SPDesktop *desktop){ - CalligraphicProfileDialog &dial = instance(); - dial._applied=false; - dial.set_modal(true); - desktop->setWindowTransient (dial.gobj()); - dial.property_destroy_with_parent() = true; - // dial.Gtk::Dialog::show(); - //dial.present(); - dial.run(); -} - - -}}} diff --git a/src/dialogs/calligraphic-profile-rename.h b/src/dialogs/calligraphic-profile-rename.h deleted file mode 100755 index 133d94a28..000000000 --- a/src/dialogs/calligraphic-profile-rename.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * \brief Dialog for naming calligraphic profiles - * - * Author: - * Aubanel MONNIER - * - * Copyright (C) 2007 Aubanel MONNIER - * - * Released under GNU GPL. Read the file 'COPYING' for more information - */ - -#ifndef INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H -#define INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H - -#include -#include -#include -#include - -namespace Inkscape { - namespace UI { - namespace Dialogs { - - class CalligraphicProfileDialog: public Gtk::Dialog { - public: - CalligraphicProfileDialog(); - virtual ~CalligraphicProfileDialog(){} ; - static void show(SPDesktop *desktop); - static bool applied(){return instance()._applied;} - static Glib::ustring getProfileName() { return instance()._profile_name;} - - Glib::ustring getName() const { return "CalligraphicProfileDialog"; } - - - protected: - void _close(); - void _apply(); - - Gtk::Label _profile_name_label; - Gtk::Entry _profile_name_entry; - Gtk::Table _layout_table; - Gtk::Button _close_button; - Gtk::Button _apply_button; - Glib::ustring _profile_name; - bool _applied; - private: - static CalligraphicProfileDialog &instance(){static CalligraphicProfileDialog instance; return instance;} - CalligraphicProfileDialog(CalligraphicProfileDialog const &); // no copy - CalligraphicProfileDialog &operator=(CalligraphicProfileDialog const &); // no assign - }; - } - } -} - -#endif INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H diff --git a/src/widgets/Makefile_insert b/src/widgets/Makefile_insert index d46037157..6cc3bb1f0 100644 --- a/src/widgets/Makefile_insert +++ b/src/widgets/Makefile_insert @@ -13,6 +13,8 @@ widgets/clean: widgets_libspwidgets_a_SOURCES = \ widgets/button.cpp \ widgets/button.h \ + widgets/calligraphic-profile-rename.cpp \ + widgets/calligraphic-profile-rename.h \ widgets/dash-selector.cpp \ widgets/dash-selector.h \ widgets/desktop-widget.cpp \ diff --git a/src/widgets/calligraphic-profile-rename.cpp b/src/widgets/calligraphic-profile-rename.cpp new file mode 100755 index 000000000..ae9a31c0e --- /dev/null +++ b/src/widgets/calligraphic-profile-rename.cpp @@ -0,0 +1,99 @@ +/** + * + * \brief Dialog for naming calligraphic profiles + * + * Author: + * Aubanel MONNIER + * + * Copyright (C) 2007 Aubanel MONNIER + * + * Released under GNU GPL. Read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "desktop.h" +#include "calligraphic-profile-rename.h" + + +namespace Inkscape { +namespace UI { +namespace Dialogs { +CalligraphicProfileDialog::CalligraphicProfileDialog(): _applied(false){ + Gtk::VBox *mainVBox = get_vbox(); + _layout_table.set_spacings(4); + _layout_table.resize (1, 2); + + _profile_name_entry.set_activates_default(true); + + _profile_name_label.set_label(_("Profile name:")); + _profile_name_label.set_alignment(1.0, 0.5); + + _layout_table.attach(_profile_name_label, + 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); + _layout_table.attach(_profile_name_entry, + 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); + mainVBox->pack_start(_layout_table, false, false, 4); + // Buttons + _close_button.set_use_stock(true); + _close_button.set_label(Gtk::Stock::CANCEL.id); + _close_button.set_flags(Gtk::CAN_DEFAULT); + + _apply_button.set_use_underline(true); + _apply_button.set_label(_("Save")); + _apply_button.set_flags(Gtk::CAN_DEFAULT); + + _close_button.signal_clicked() + .connect(sigc::mem_fun(*this, &CalligraphicProfileDialog::_close)); + _apply_button.signal_clicked() + .connect(sigc::mem_fun(*this, &CalligraphicProfileDialog::_apply)); + + signal_delete_event().connect( + sigc::bind_return( + sigc::hide(sigc::mem_fun(*this, &CalligraphicProfileDialog::_close)), + true + ) + ); + + add_action_widget(_close_button, Gtk::RESPONSE_CLOSE); + add_action_widget(_apply_button, Gtk::RESPONSE_APPLY); + + _apply_button.grab_default(); + + show_all_children(); + +} + +void +CalligraphicProfileDialog::_apply() +{ + _profile_name = _profile_name_entry.get_text(); + _applied = true; + _close(); +} + +void +CalligraphicProfileDialog::_close() +{ + this->Gtk::Dialog::hide(); + +} + +void CalligraphicProfileDialog::show(SPDesktop *desktop){ + CalligraphicProfileDialog &dial = instance(); + dial._applied=false; + dial.set_modal(true); + desktop->setWindowTransient (dial.gobj()); + dial.property_destroy_with_parent() = true; + // dial.Gtk::Dialog::show(); + //dial.present(); + dial.run(); +} + + +}}} diff --git a/src/widgets/calligraphic-profile-rename.h b/src/widgets/calligraphic-profile-rename.h new file mode 100755 index 000000000..133d94a28 --- /dev/null +++ b/src/widgets/calligraphic-profile-rename.h @@ -0,0 +1,56 @@ +/** + * + * \brief Dialog for naming calligraphic profiles + * + * Author: + * Aubanel MONNIER + * + * Copyright (C) 2007 Aubanel MONNIER + * + * Released under GNU GPL. Read the file 'COPYING' for more information + */ + +#ifndef INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H +#define INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H + +#include +#include +#include +#include + +namespace Inkscape { + namespace UI { + namespace Dialogs { + + class CalligraphicProfileDialog: public Gtk::Dialog { + public: + CalligraphicProfileDialog(); + virtual ~CalligraphicProfileDialog(){} ; + static void show(SPDesktop *desktop); + static bool applied(){return instance()._applied;} + static Glib::ustring getProfileName() { return instance()._profile_name;} + + Glib::ustring getName() const { return "CalligraphicProfileDialog"; } + + + protected: + void _close(); + void _apply(); + + Gtk::Label _profile_name_label; + Gtk::Entry _profile_name_entry; + Gtk::Table _layout_table; + Gtk::Button _close_button; + Gtk::Button _apply_button; + Glib::ustring _profile_name; + bool _applied; + private: + static CalligraphicProfileDialog &instance(){static CalligraphicProfileDialog instance; return instance;} + CalligraphicProfileDialog(CalligraphicProfileDialog const &); // no copy + CalligraphicProfileDialog &operator=(CalligraphicProfileDialog const &); // no assign + }; + } + } +} + +#endif INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index c59447b78..d3fef1f8d 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -103,7 +103,7 @@ #include "svg/css-ostringstream.h" -#include "../dialogs/calligraphic-profile-rename.h" +#include "widgets/calligraphic-profile-rename.h" using Inkscape::UnitTracker;