[gnome-calendar] window: show source dialog when a calendar is activated
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: show source dialog when a calendar is activated
- Date: Mon, 25 May 2015 16:46:44 +0000 (UTC)
commit 143444ddd58a0164fac6060872081c3fccc31e1f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Feb 9 12:48:06 2015 -0200
window: show source dialog when a calendar is activated
data/ui/window.ui | 1 +
src/gcal-window.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/window.ui b/data/ui/window.ui
index cb5bf68..c5065e0 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -348,6 +348,7 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="selection_mode">none</property>
+ <signal name="row-activated" handler="source_row_activated" object="GcalWindow" swapped="no" />
<style>
<class name="calendar-list" />
</style>
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 6966bc2..3864884 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -189,6 +189,7 @@ static void add_source (GcalManager *m
gboolean enabled,
gpointer user_data);
+
static GtkWidget* make_row_for_source (GcalWindow *window,
ESource *source);
@@ -199,6 +200,10 @@ static void remove_source (GcalManager *m
static void show_source_dialog (GtkButton *button,
gpointer user_data);
+static void source_row_activated (GtkListBox *listbox,
+ GtkListBoxRow *row,
+ gpointer user_data);
+
static void on_calendar_toggled (GObject *object,
GParamSpec *pspec,
gpointer user_data);
@@ -867,6 +872,18 @@ show_source_dialog (GtkButton *button,
}
static void
+source_row_activated (GtkListBox *listbox,
+ GtkListBoxRow *row,
+ gpointer user_data)
+{
+ GcalWindowPrivate *priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
+
+ gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (priv->source_dialog), GCAL_SOURCE_DIALOG_MODE_EDIT);
+
+ gtk_window_present (GTK_WINDOW (priv->source_dialog));
+}
+
+static void
on_calendar_toggled (GObject *object,
GParamSpec *pspec,
gpointer user_data)
@@ -1328,6 +1345,7 @@ gcal_window_class_init(GcalWindowClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GcalWindow, notification_close_button);
gtk_widget_class_bind_template_callback (widget_class, show_source_dialog);
+ gtk_widget_class_bind_template_callback (widget_class, source_row_activated);
gtk_widget_class_bind_template_callback (widget_class, key_pressed);
gtk_widget_class_bind_template_callback (widget_class, search_toggled);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]