gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis-gtk] 05/05: fix method edit button


From: gnunet
Subject: [taler-anastasis-gtk] 05/05: fix method edit button
Date: Mon, 12 Oct 2020 20:35:00 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis-gtk.

commit 421995e2ba8567f80a488abf0985da96202f7c00
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Mon Oct 12 19:44:52 2020 +0200

    fix method edit button
---
 src/anastasis/anastasis-gtk_backup.c | 181 ++++++++++++++++++-----------------
 1 file changed, 91 insertions(+), 90 deletions(-)

diff --git a/src/anastasis/anastasis-gtk_backup.c 
b/src/anastasis/anastasis-gtk_backup.c
index 27d8f7e..14eca7b 100644
--- a/src/anastasis/anastasis-gtk_backup.c
+++ b/src/anastasis/anastasis-gtk_backup.c
@@ -37,69 +37,14 @@ guint g_signal_email;
 guint g_signal_post;
 guint g_signal_video;
 
-     
-/**
- * Callback invoked if the the "authentication methods edit"-button is clicked.
- *
- * @param object
- * @param user_data unused
- */
-void
-anastasis_gtk_b_auth_method_btn_edit_clicked_cb (GObject *object,
-                                                 gpointer user_data);
-
-
-/**
- * Callback invoked if the the "backup"-button is clicked.
- *
- * @param object
- * @param user_data unused
- */
-void
-anastasis_gtk_backup_button_clicked (GObject *object,
-                                     gpointer user_data)
-{
-     redux_state = ANASTASIS_backup_start (cfg);
-     GNUNET_assert (0 == persist_state (redux_state));
-
-     if (check_state (redux_state, ContinentSelectionState))
-     {
-          init_continent_list (redux_state);
-     
-          gtk_widget_hide (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_start_frame")));
-          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_main_control_vbox")));
-          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
-                                        "anastasis_gtk_continent_frame")));
-          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
-                                        
"anastasis_gtk_continent_selection_image")));
-     }
-}
-
-/**
- * Callback invoked if the the "backup"-button is clicked.
- *
- * @param object
- * @param user_data unused
- */
-void
-anastasis_gtk_btn_add_auth_edit_provider_clicked_cb ()
-{
-     gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
-                                        
"anastasis_gtk_b_edit_provider_dialog")));
-}
-
 
 /**
- * Callback invoked if the the "authentication methods delete"-button is 
clicked.
- *
- * @param object
- * @param user_data unused
- */
-void
-anastasis_gtk_b_auth_method_btn_delete_clicked_cb (GObject *object,
-                                                   gpointer user_data)
+ * Delete method from hbox.
+ * 
+ * @param user_data pointer to hbox containing method
+ */ 
+static void
+delete_auth_method (gpointer user_data)
 {
      if (GTK_IS_BOX (user_data))
      {
@@ -156,25 +101,91 @@ anastasis_gtk_b_auth_method_btn_delete_clicked_cb 
(GObject *object,
                                                       &action_cb,
                                                       NULL,
                                                       NULL);
-                              break;
                          }
                          index++;
                     }
+                    gtk_widget_destroy (iter->data);
                }
           }
-          gtk_widget_destroy (GTK_WIDGET (user_data));
           g_list_free (user_data_children);
+     }
+}
 
-          // if no methods, set sensitivity of forward button to false
-          GList *vbox_children = gtk_container_get_children (GTK_CONTAINER 
(GCG_get_main_window_object (
-                                                                      
"anastasis_gtk_b_authentication_vbox")));
-          if (NULL == vbox_children)
-               gtk_widget_set_sensitive (GTK_WIDGET 
(GCG_get_main_window_object (
-                                             
"anastasis_gtk_main_window_forward_button")), false);   
-          g_list_free (vbox_children);
+
+/**
+ * Callback invoked if the the "authentication methods edit"-button is clicked.
+ *
+ * @param object
+ * @param user_data unused
+ */
+void
+anastasis_gtk_b_auth_method_btn_edit_clicked_cb (GObject *object,
+                                                 gpointer user_data);
+
+
+/**
+ * Callback invoked if the the "backup"-button is clicked.
+ *
+ * @param object
+ * @param user_data unused
+ */
+void
+anastasis_gtk_backup_button_clicked (GObject *object,
+                                     gpointer user_data)
+{
+     redux_state = ANASTASIS_backup_start (cfg);
+     GNUNET_assert (0 == persist_state (redux_state));
+
+     if (check_state (redux_state, ContinentSelectionState))
+     {
+          init_continent_list (redux_state);
+     
+          gtk_widget_hide (GTK_WIDGET (GCG_get_main_window_object (
+                                        "anastasis_gtk_start_frame")));
+          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
+                                        "anastasis_gtk_main_control_vbox")));
+          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
+                                        "anastasis_gtk_continent_frame")));
+          gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
+                                        
"anastasis_gtk_continent_selection_image")));
      }
 }
 
+/**
+ * Callback invoked if the the "backup"-button is clicked.
+ *
+ * @param object
+ * @param user_data unused
+ */
+void
+anastasis_gtk_btn_add_auth_edit_provider_clicked_cb ()
+{
+     gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object (
+                                        
"anastasis_gtk_b_edit_provider_dialog")));
+}
+
+
+/**
+ * Callback invoked if the the "authentication methods delete"-button is 
clicked.
+ *
+ * @param object
+ * @param user_data unused
+ */
+void
+anastasis_gtk_b_auth_method_btn_delete_clicked_cb (GObject *object,
+                                                   gpointer user_data)
+{
+     delete_auth_method (user_data);
+
+     // if no methods, set sensitivity of forward button to false
+     GList *vbox_children = gtk_container_get_children (GTK_CONTAINER 
(GCG_get_main_window_object (
+                                                                 
"anastasis_gtk_b_authentication_vbox")));
+     if (NULL == vbox_children)
+          gtk_widget_set_sensitive (GTK_WIDGET (GCG_get_main_window_object (
+                                        
"anastasis_gtk_main_window_forward_button")), false);   
+     g_list_free (vbox_children);
+}
+
 
 /**
  * Callback invoked if the the "secure question OK"-button is clicked.
@@ -194,10 +205,8 @@ anastasis_gtk_b_question_dialog_btn_ok_clicked_cb (GObject 
*object,
      if (is_box)
      {
           hbox = (GtkHBox *) user_data;
-          GList *children, *iter;
-          children = gtk_container_get_children (GTK_CONTAINER (user_data));
-          for (iter = children; iter != NULL; iter = g_list_next (iter))
-               gtk_widget_destroy (iter->data);
+          // if is_box is true, we are editing and have to delete the old 
method
+          delete_auth_method (user_data);
      }
      else
           hbox = (GtkHBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -333,10 +342,8 @@ anastasis_gtk_b_post_dialog_btn_ok_clicked_cb (GObject 
*object,
      if (is_box)
      {
           hbox = (GtkHBox *) user_data;
-          GList *children, *iter;
-          children = gtk_container_get_children (GTK_CONTAINER (user_data));
-          for (iter = children; iter != NULL; iter = g_list_next (iter))
-               gtk_widget_destroy (iter->data);
+          // if is_box is true, we are editing and have to delete the old 
method
+          delete_auth_method (user_data);
      }
      else
           hbox = (GtkHBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -501,10 +508,8 @@ anastasis_gtk_b_video_dialog_btn_ok_clicked_cb (GObject 
*object,
      if (is_box)
      {
           hbox = (GtkHBox *) user_data;
-          GList *children, *iter;
-          children = gtk_container_get_children (GTK_CONTAINER (user_data));
-          for (iter = children; iter != NULL; iter = g_list_next (iter))
-               gtk_widget_destroy (iter->data);
+          // if is_box is true, we are editing and have to delete the old 
method
+          delete_auth_method (user_data);
      }
      else
           hbox = (GtkHBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -629,10 +634,8 @@ anastasis_gtk_b_sms_dialog_btn_ok_clicked_cb (GObject 
*object,
      if (is_box)
      {
           hbox = (GtkHBox *) user_data;
-          GList *children, *iter;
-          children = gtk_container_get_children (GTK_CONTAINER (user_data));
-          for (iter = children; iter != NULL; iter = g_list_next (iter))
-               gtk_widget_destroy (iter->data);
+          // if is_box is true, we are editing and have to delete the old 
method
+          delete_auth_method (user_data);
      }
      else
           hbox = (GtkHBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -757,10 +760,8 @@ anastasis_gtk_b_email_dialog_btn_ok_clicked_cb (GObject 
*object,
      if (is_box)
      {
           hbox = (GtkHBox *) user_data;
-          GList *children, *iter;
-          children = gtk_container_get_children (GTK_CONTAINER (user_data));
-          for (iter = children; iter != NULL; iter = g_list_next (iter))
-               gtk_widget_destroy (iter->data);
+          // if is_box is true, we are editing and have to delete the old 
method
+          delete_auth_method (user_data);
      }
      else
           hbox = (GtkHBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]