source-dialog: add an action group
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
876d50fdab
commit
2667a0860e
@@ -65,6 +65,9 @@ typedef struct
|
|||||||
GBinding *title_bind;
|
GBinding *title_bind;
|
||||||
gboolean *prompt_password;
|
gboolean *prompt_password;
|
||||||
|
|
||||||
|
/* auxiliary */
|
||||||
|
GSimpleActionGroup *action_group;
|
||||||
|
|
||||||
/* manager */
|
/* manager */
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
} GcalSourceDialogPrivate;
|
} GcalSourceDialogPrivate;
|
||||||
@@ -165,6 +168,12 @@ static void discover_sources_cb (GObject *so
|
|||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GcalSourceDialog, gcal_source_dialog, GTK_TYPE_DIALOG)
|
G_DEFINE_TYPE_WITH_PRIVATE (GcalSourceDialog, gcal_source_dialog, GTK_TYPE_DIALOG)
|
||||||
|
|
||||||
|
GActionEntry actions[] = {
|
||||||
|
{"file", NULL, NULL, NULL, NULL},
|
||||||
|
{"local", NULL, NULL, NULL, NULL},
|
||||||
|
{"web", NULL, NULL, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_source (GcalManager *manager,
|
add_source (GcalManager *manager,
|
||||||
ESource *source,
|
ESource *source,
|
||||||
@@ -1230,6 +1239,12 @@ gcal_source_dialog_constructed (GObject *object)
|
|||||||
|
|
||||||
//gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (priv->select_file_button), filter);
|
//gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (priv->select_file_button), filter);
|
||||||
|
|
||||||
|
// Action group
|
||||||
|
priv->action_group = g_simple_action_group_new ();
|
||||||
|
gtk_widget_insert_action_group (GTK_WIDGET (object), "source", G_ACTION_GROUP (priv->action_group));
|
||||||
|
|
||||||
|
g_action_map_add_action_entries (G_ACTION_MAP (priv->action_group), actions, G_N_ELEMENTS (actions), object);
|
||||||
|
|
||||||
/* setup titlebar */
|
/* setup titlebar */
|
||||||
gtk_window_set_titlebar (GTK_WINDOW (object), priv->headerbar);
|
gtk_window_set_titlebar (GTK_WINDOW (object), priv->headerbar);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user