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:
@@ -13,6 +13,12 @@
|
|||||||
<attribute name="accel"><Primary>f</attribute>
|
<attribute name="accel"><Primary>f</attribute>
|
||||||
</item>
|
</item>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">_Calendars…</attribute>
|
||||||
|
<attribute name="action">win.show-calendars</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||||
|
|||||||
+1
-1
@@ -315,7 +315,7 @@
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="relief">none</property>
|
<property name="relief">none</property>
|
||||||
<property name="receives_default">True</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>
|
<child>
|
||||||
<object class="GtkLabel" id="calendar_settings_label">
|
<object class="GtkLabel" id="calendar_settings_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|||||||
+19
-17
@@ -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,
|
static void on_date_action_activated (GSimpleAction *action,
|
||||||
GVariant *param,
|
GVariant *param,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -204,9 +208,6 @@ static void remove_source (GcalManager *m
|
|||||||
ESource *source,
|
ESource *source,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static void show_source_dialog (GtkButton *button,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
static void source_row_activated (GtkListBox *listbox,
|
static void source_row_activated (GtkListBox *listbox,
|
||||||
GtkListBoxRow *row,
|
GtkListBoxRow *row,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -280,8 +281,23 @@ static const GActionEntry actions[] = {
|
|||||||
{"previous", on_date_action_activated },
|
{"previous", on_date_action_activated },
|
||||||
{"today", on_date_action_activated },
|
{"today", on_date_action_activated },
|
||||||
{"change-view", on_view_action_activated, "i" },
|
{"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
|
static void
|
||||||
on_date_action_activated (GSimpleAction *action,
|
on_date_action_activated (GSimpleAction *action,
|
||||||
GVariant *param,
|
GVariant *param,
|
||||||
@@ -886,19 +902,6 @@ remove_source (GcalManager *manager,
|
|||||||
g_list_free (children);
|
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
|
static void
|
||||||
source_row_activated (GtkListBox *listbox,
|
source_row_activated (GtkListBox *listbox,
|
||||||
GtkListBoxRow *row,
|
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_action_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalWindow, notification_close_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, source_row_activated);
|
||||||
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, key_pressed);
|
gtk_widget_class_bind_template_callback (widget_class, key_pressed);
|
||||||
|
|||||||
Reference in New Issue
Block a user