window: show source dialog when a calendar is activated

This commit is contained in:
Georges Basile Stavracas Neto
2015-05-25 12:31:05 -04:00
committed by Erick Pérez Castellanos
parent dafdff6326
commit 143444ddd5
2 changed files with 19 additions and 0 deletions
+1
View File
@@ -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>
+18
View File
@@ -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);
@@ -866,6 +871,18 @@ show_source_dialog (GtkButton *button,
gtk_window_present (GTK_WINDOW (priv->source_dialog));
}
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,
@@ -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);