summaryrefslogtreecommitdiffstats
path: root/src/widgets/calligraphic-profile-rename.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-03-22 00:17:46 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-03-22 00:17:46 +0000
commita12a4f53de50adadebc280a558e76d3ced2b6e5d (patch)
tree0bc402a221d8b0d9913c06136567738e6aad4300 /src/widgets/calligraphic-profile-rename.cpp
parenttemporary fix. removed LPE context verb. now toolbar is normal again in windows. (diff)
downloadinkscape-a12a4f53de50adadebc280a558e76d3ced2b6e5d.tar.gz
inkscape-a12a4f53de50adadebc280a558e76d3ced2b6e5d.zip
Really fix compile (patch by Krzysztof KosiƄski)
(bzr r5154)
Diffstat (limited to 'src/widgets/calligraphic-profile-rename.cpp')
-rwxr-xr-xsrc/widgets/calligraphic-profile-rename.cpp99
1 files changed, 99 insertions, 0 deletions
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 <config.h>
+#endif
+
+#include <glibmm/i18n.h>
+#include <gtkmm/stock.h>
+
+#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();
+}
+
+
+}}}