[gnome-calendar/calendar-editor] source-dialog: spawns GCC when gear button is clicked



commit 78d9a432a6aae974705777db783a07a01ea7f0c0
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Apr 9 00:37:35 2015 -0300

    source-dialog: spawns GCC when gear button is clicked

 data/ui/source-dialog.ui |    1 +
 src/gcal-source-dialog.c |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/source-dialog.ui b/data/ui/source-dialog.ui
index 6e2c39c..db9d794 100644
--- a/data/ui/source-dialog.ui
+++ b/data/ui/source-dialog.ui
@@ -81,6 +81,7 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
                                 <property name="tooltip_text" translatable="yes">Open online account 
settings</property>
+                                <signal name="clicked" handler="online_accounts_settings_button_clicked" 
object="GcalSourceDialog" swapped="no" />
                                 <child>
                                   <object class="GtkImage" id="online_accounts_settings_button_image">
                                     <property name="visible">True</property>
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 6944d80..ba118ff 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -140,6 +140,9 @@ static void       new_name_entry_text_changed           (GObject             *ob
                                                          GParamSpec          *pspec,
                                                          gpointer             user_data);
 
+static void       online_accounts_settings_button_clicked (GtkWidget         *button,
+                                                          gpointer            user_data);
+
 static void       on_file_activated                     (GSimpleAction       *action,
                                                          GVariant            *param,
                                                          gpointer             user_data);
@@ -874,6 +877,22 @@ url_entry_text_changed (GObject    *object,
     }
 }
 
+/**
+ * online_accounts_settings_button_clicked:
+ *
+ * Spawns the GNOME Control Center app
+ * with Online Accounts openned.
+ *
+ * Returns:
+ */
+static void
+online_accounts_settings_button_clicked (GtkWidget *button,
+                                         gpointer   user_data)
+{
+  gchar *command[] = {"gnome-control-center", "online-accounts", NULL};
+  g_spawn_async (NULL, command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
+}
+
 static void
 on_file_activated (GSimpleAction *action,
                    GVariant      *param,
@@ -1391,6 +1410,7 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, description_label_link_activated);
   gtk_widget_class_bind_template_callback (widget_class, name_entry_text_changed);
   gtk_widget_class_bind_template_callback (widget_class, new_name_entry_text_changed);
+  gtk_widget_class_bind_template_callback (widget_class, online_accounts_settings_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, response_signal);
   gtk_widget_class_bind_template_callback (widget_class, stack_visible_child_name_changed);
   gtk_widget_class_bind_template_callback (widget_class, url_entry_text_changed);


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