← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n] Rev 413: Use GtkMessageDialog for non-input dialogs

 

------------------------------------------------------------
revno: 413
committer: Steven Sheehy <steven.sheehy@xxxxxxxxx>
branch nick: linuxdcpp-i18n
timestamp: Wed 2010-12-22 22:31:25 -0600
message:
  Use GtkMessageDialog for non-input dialogs
modified:
  glade/favoritehubs.glade
  glade/mainwindow.glade
  linux/favoritehubs.cc


--
lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n
https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n

Your team LinuxDC++ Team is subscribed to branch lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n.
To unsubscribe from this branch go to https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n/+edit-subscription
=== modified file 'glade/favoritehubs.glade'
--- glade/favoritehubs.glade	2010-12-23 04:10:02 +0000
+++ glade/favoritehubs.glade	2010-12-23 04:31:25 +0000
@@ -419,6 +419,15 @@
       </widget>
     </child>
   </widget>
+  <widget class="GtkMessageDialog" id="confirmDeletionDialog">
+    <property name="border_width">5</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="type_hint">dialog</property>
+    <property name="skip_taskbar_hint">True</property>
+    <property name="message_type">warning</property>
+    <property name="buttons">ok-cancel</property>
+    <property name="text" translatable="yes">Are you sure you want to delete the selected favorite hub?</property>
+  </widget>
   <widget class="GtkMenu" id="menu">
     <child>
       <widget class="GtkImageMenuItem" id="addMenuItem">

=== modified file 'glade/mainwindow.glade'
--- glade/mainwindow.glade	2010-12-23 04:10:02 +0000
+++ glade/mainwindow.glade	2010-12-23 04:31:25 +0000
@@ -693,62 +693,14 @@
       </widget>
     </child>
   </widget>
-  <widget class="GtkDialog" id="exitDialog">
-    <property name="title" translatable="yes">Exit LinuxDC++?</property>
-    <property name="resizable">False</property>
+  <widget class="GtkMessageDialog" id="exitDialog">
+    <property name="border_width">5</property>
     <property name="destroy_with_parent">True</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkLabel" id="label3">
-            <property name="visible">True</property>
-            <property name="label" translatable="yes">Do you really want to exit?</property>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="cancelbutton1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-6</property>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkButton" id="okbutton1">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-5</property>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
+    <property name="type_hint">dialog</property>
+    <property name="skip_taskbar_hint">True</property>
+    <property name="message_type">warning</property>
+    <property name="buttons">ok-cancel</property>
+    <property name="text" translatable="yes">Are you sure you want to exit the application?</property>
   </widget>
   <widget class="GtkDialog" id="connectDialog">
     <property name="title" translatable="yes">Quick Connect</property>

=== modified file 'linux/favoritehubs.cc'
--- linux/favoritehubs.cc	2010-12-23 04:10:02 +0000
+++ linux/favoritehubs.cc	2010-12-23 04:31:25 +0000
@@ -375,17 +375,11 @@
 	{
 		if (BOOLSETTING(CONFIRM_HUB_REMOVAL))
 		{
-			string name = fh->favoriteView.getString(&iter, "Name").c_str();
-			GtkWindow* parent = GTK_WINDOW(WulforManager::get()->getMainWindow()->getContainer());
-			GtkWidget* dialog = gtk_message_dialog_new(parent,
-				GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
-				_("Are you sure you want to delete the selected favorite hub?"));
-			gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_REMOVE, GTK_RESPONSE_YES, NULL);
-			gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog), GTK_RESPONSE_YES, GTK_RESPONSE_CANCEL, -1);
-			gint response = gtk_dialog_run(GTK_DIALOG(dialog));
-			gtk_widget_destroy(dialog);
+			GtkWidget *confirmDeletionDialog = fh->getWidget("confirmDeletionDialog");
+			gint response = gtk_dialog_run(GTK_DIALOG(confirmDeletionDialog));
+			gtk_widget_hide(fh->getWidget("confirmDeletionDialog"));
 
-			if (response != GTK_RESPONSE_YES)
+			if (response != GTK_RESPONSE_OK)
 				return;
 		}