diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2014-01-11 11:08:00 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2014-01-11 11:08:00 +0000 |
| commit | 5105f4e289edeb4d0528dff54dbd8e33f98b6cad (patch) | |
| tree | eab28095e2f1c9ef51ca0d35290a3fb76c0b4ca9 /src/widgets | |
| parent | suppress compiler warnings (diff) | |
| download | inkscape-5105f4e289edeb4d0528dff54dbd8e33f98b6cad.tar.gz inkscape-5105f4e289edeb4d0528dff54dbd8e33f98b6cad.zip | |
gtkmmification (seems there is more margin in desktop-widget.cpp)
(bzr r12915)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 25 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.h | 4 |
2 files changed, 10 insertions, 19 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index e5568787b..cf6a908b6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -71,6 +71,7 @@ #include "verbs.h" #include <gtkmm/paned.h> +#include <gtkmm/messagedialog.h> #include <gtk/gtk.h> @@ -1397,24 +1398,14 @@ bool SPDesktopWidget::showInfoDialog( Glib::ustring const &message ) return result; } -bool -SPDesktopWidget::warnDialog (gchar* text) +bool SPDesktopWidget::warnDialog (Glib::ustring const &text) { - GtkWindow *w =GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(this))); - if (w) - { - GtkWidget *dialog = gtk_message_dialog_new( - w, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_YES_NO, - "%s", text); - gint response = gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - if (response == GTK_RESPONSE_YES) - return true; - } - return false; + Gtk::MessageDialog dialog (*window, text, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK_CANCEL); + gint response = dialog.run(); + if (response == Gtk::RESPONSE_OK) + return true; + else + return false; } void diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 58739cf3b..a77d56fc3 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -212,7 +212,7 @@ struct SPDesktopWidget { return _dtw->showInfoDialog( message ); } - virtual bool warnDialog (gchar* text) + virtual bool warnDialog (Glib::ustring const &text) { return _dtw->warnDialog (text); } virtual Inkscape::UI::Widget::Dock* getDock () @@ -232,7 +232,7 @@ struct SPDesktopWidget { void setWindowTransient (void *p, int transient_policy); void presentWindow(); bool showInfoDialog( Glib::ustring const &message ); - bool warnDialog (gchar *text); + bool warnDialog (Glib::ustring const &text); void setToolboxFocusTo (gchar const *); void setToolboxAdjustmentValue (gchar const * id, double value); void setToolboxSelectOneValue (gchar const * id, gint value); |
