From 77f0bb7e0194cac7d13605dfeda33dd144ac5b47 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 8 Jul 2011 17:26:34 +0100 Subject: [PATCH] Preparing the service removal implementation --- src/moonshot-custom-vbox.vala | 1 + src/moonshot-window.vala | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/moonshot-custom-vbox.vala b/src/moonshot-custom-vbox.vala index d28cc3f..2740292 100644 --- a/src/moonshot-custom-vbox.vala +++ b/src/moonshot-custom-vbox.vala @@ -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) diff --git a/src/moonshot-window.vala b/src/moonshot-window.vala index 5986171..5092453 100644 --- a/src/moonshot-window.vala +++ b/src/moonshot-window.vala @@ -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++; -- 2.1.4