app-menu: add a Calendars... item in the app menu

I won't hurt to have 2 ways to access this dialog and,
appearently, the current behavior happens to bother
some users.

https://bugzilla.gnome.org/show_bug.cgi?id=762705
This commit is contained in:
Georges Basile Stavracas Neto
2016-05-20 22:33:35 -03:00
parent 9c150de822
commit 46deb620e7
3 changed files with 26 additions and 18 deletions
+6
View File
@@ -13,6 +13,12 @@
<attribute name="accel">&lt;Primary&gt;f</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Calendars…</attribute>
<attribute name="action">win.show-calendars</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+1 -1
View File
@@ -315,7 +315,7 @@
<property name="can_focus">True</property>
<property name="relief">none</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="show_source_dialog" object="GcalWindow" swapped="no"/>
<property name="action_name">win.show-calendars</property>
<child>
<object class="GtkLabel" id="calendar_settings_label">
<property name="visible">True</property>
+19 -17
View File
@@ -137,6 +137,10 @@ enum
}
static void on_show_calendars_action_activated (GSimpleAction *action,
GVariant *param,
gpointer user_data);
static void on_date_action_activated (GSimpleAction *action,
GVariant *param,
gpointer user_data);
@@ -204,9 +208,6 @@ static void remove_source (GcalManager *m
ESource *source,
gpointer user_data);
static void show_source_dialog (GtkButton *button,
gpointer user_data);
static void source_row_activated (GtkListBox *listbox,
GtkListBoxRow *row,
gpointer user_data);
@@ -280,8 +281,23 @@ static const GActionEntry actions[] = {
{"previous", on_date_action_activated },
{"today", on_date_action_activated },
{"change-view", on_view_action_activated, "i" },
{"show-calendars", on_show_calendars_action_activated },
};
static void
on_show_calendars_action_activated (GSimpleAction *action,
GVariant *param,
gpointer user_data)
{
GcalWindow *window = GCAL_WINDOW (user_data);
gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (window->source_dialog), GCAL_SOURCE_DIALOG_MODE_NORMAL);
gtk_widget_hide (window->calendar_popover);
gtk_widget_show (window->source_dialog);
}
static void
on_date_action_activated (GSimpleAction *action,
GVariant *param,
@@ -886,19 +902,6 @@ remove_source (GcalManager *manager,
g_list_free (children);
}
static void
show_source_dialog (GtkButton *button,
gpointer user_data)
{
GcalWindow *window = GCAL_WINDOW (user_data);
gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (window->source_dialog), GCAL_SOURCE_DIALOG_MODE_NORMAL);
gtk_widget_hide (window->calendar_popover);
gtk_widget_show (window->source_dialog);
}
static void
source_row_activated (GtkListBox *listbox,
GtkListBoxRow *row,
@@ -1324,7 +1327,6 @@ gcal_window_class_init(GcalWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalWindow, notification_action_button);
gtk_widget_class_bind_template_child (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);