From 5105f4e289edeb4d0528dff54dbd8e33f98b6cad Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 11 Jan 2014 12:08:00 +0100 Subject: gtkmmification (seems there is more margin in desktop-widget.cpp) (bzr r12915) --- src/widgets/desktop-widget.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src/widgets/desktop-widget.cpp') 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 +#include #include @@ -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 -- cgit v1.2.3