window: show source dialog when a calendar is activated
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
dafdff6326
commit
143444ddd5
@@ -348,6 +348,7 @@
|
|||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="vexpand">True</property>
|
<property name="vexpand">True</property>
|
||||||
<property name="selection_mode">none</property>
|
<property name="selection_mode">none</property>
|
||||||
|
<signal name="row-activated" handler="source_row_activated" object="GcalWindow" swapped="no" />
|
||||||
<style>
|
<style>
|
||||||
<class name="calendar-list" />
|
<class name="calendar-list" />
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ static void add_source (GcalManager *m
|
|||||||
gboolean enabled,
|
gboolean enabled,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
|
||||||
static GtkWidget* make_row_for_source (GcalWindow *window,
|
static GtkWidget* make_row_for_source (GcalWindow *window,
|
||||||
ESource *source);
|
ESource *source);
|
||||||
|
|
||||||
@@ -199,6 +200,10 @@ static void remove_source (GcalManager *m
|
|||||||
static void show_source_dialog (GtkButton *button,
|
static void show_source_dialog (GtkButton *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
static void source_row_activated (GtkListBox *listbox,
|
||||||
|
GtkListBoxRow *row,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
static void on_calendar_toggled (GObject *object,
|
static void on_calendar_toggled (GObject *object,
|
||||||
GParamSpec *pspec,
|
GParamSpec *pspec,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -866,6 +871,18 @@ show_source_dialog (GtkButton *button,
|
|||||||
gtk_window_present (GTK_WINDOW (priv->source_dialog));
|
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
|
static void
|
||||||
on_calendar_toggled (GObject *object,
|
on_calendar_toggled (GObject *object,
|
||||||
GParamSpec *pspec,
|
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_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, 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, key_pressed);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, search_toggled);
|
gtk_widget_class_bind_template_callback (widget_class, search_toggled);
|
||||||
|
|||||||
Reference in New Issue
Block a user