Preparing the service removal implementation
authorAlberto Ruiz <aruiz@gnome.org>
Fri, 8 Jul 2011 16:26:34 +0000 (17:26 +0100)
committerAlberto Ruiz <aruiz@gnome.org>
Fri, 8 Jul 2011 16:26:34 +0000 (17:26 +0100)
src/moonshot-custom-vbox.vala
src/moonshot-window.vala

index d28cc3f..2740292 100644 (file)
@@ -18,6 +18,7 @@ class CustomVBox : VBox
             if (id_card != id_card_widget)
                 ((IdCardWidget) id_card).collapse ();
         }
+        current_idcard = id_card_widget;
     }
 
     public void add_id_card_widget (IdCardWidget id_card_widget)
index 5986171..5092453 100644 (file)
@@ -403,6 +403,8 @@ class MainWindow : Window
          */
         label.modify_font (font_desc);
     }
+    
+
 
     private void fill_services_vbox (IdCard id_card)
     {
@@ -423,6 +425,24 @@ class MainWindow : Window
 #else
             var remove_button = new Button.from_stock (STOCK_REMOVE);
 #endif
+
+            remove_button.clicked.connect (() =>
+            {
+              var dialog = new Gtk.MessageDialog (this,
+                                      Gtk.DialogFlags.DESTROY_WITH_PARENT,
+                                      Gtk.MessageType.QUESTION,
+                                      Gtk.ButtonsType.YES_NO,
+                                      _("Are you sure you want to stop '%s' ID Card to use %s?"),
+                                      custom_vbox.current_idcard.id_card.display_name);
+              var ret = dialog.run();
+              dialog.hide();
+              
+              if (ret == Gtk.ResponseType.YES)
+              {
+                return;
+              }
+              
+            });
             services_table.attach_defaults (label, 0, 1, i, i+1);
             services_table.attach_defaults (remove_button, 1, 2, i, i+1);
             i++;