X-Git-Url: https://git.stderr.nl/gitweb?p=rodin%2Fchimara.git;a=blobdiff_plain;f=player%2Fmain.c;h=c032849cb63446e3bda8bc9878acfc40d0996ea0;hp=9827d3193e9a57f20c0c27ed33439203ec3e1c8b;hb=4b1516b78e364cd664271d0ada1d2de4777499ef;hpb=1cf1a0b599423e4c8960f2021bceb90e85d4695c diff --git a/player/main.c b/player/main.c index 9827d31..c032849 100644 --- a/player/main.c +++ b/player/main.c @@ -44,11 +44,15 @@ #include #include -/* Global pointers to widgets */ -GtkBuilder *builder = NULL; -GtkUIManager *uimanager = NULL; -GtkWidget *window = NULL; -GtkWidget *glk = NULL; +/* Static global pointers to widgets */ +static GtkBuilder *builder = NULL; +static GtkUIManager *uimanager = NULL; +static GtkWidget *window = NULL; +static GtkWidget *glk = NULL; + +/* Global global pointers */ +GtkWidget *aboutwindow = NULL; +GtkWidget *prefswindow = NULL; static GObject * load_object(const gchar *name) @@ -73,6 +77,8 @@ create_window(void) } window = GTK_WIDGET(load_object("chimara")); + aboutwindow = GTK_WIDGET(load_object("aboutwindow")); + prefswindow = GTK_WIDGET(load_object("prefswindow")); GtkActionGroup *actiongroup = GTK_ACTION_GROUP(load_object("actiongroup")); /* Add all the actions to the action group. This for-loop is a temporary fix @@ -91,7 +97,6 @@ create_window(void) "restart", "", "quit", "", "edit", "", - "cut", NULL, "copy", NULL, "paste", NULL, "preferences", "", @@ -102,6 +107,16 @@ create_window(void) const gchar **ptr; for(ptr = actions; *ptr; ptr += 2) gtk_action_group_add_action_with_accel(actiongroup, GTK_ACTION(load_object(ptr[0])), ptr[1]); + GtkRecentFilter *filter = gtk_recent_filter_new(); + /* TODO: Use mimetypes and construct the filter dynamically depending on + what plugins are installed */ + const gchar *patterns[] = { + "*.z[1-8]", "*.[zg]lb", "*.[zg]blorb", "*.ulx", "*.blb", "*.blorb", NULL + }; + for(ptr = patterns; *ptr; ptr++) + gtk_recent_filter_add_pattern(filter, *ptr); + GtkRecentChooser *recent = GTK_RECENT_CHOOSER(load_object("recent")); + gtk_recent_chooser_add_filter(recent, filter); uimanager = gtk_ui_manager_new(); if( !gtk_ui_manager_add_ui_from_file(uimanager, PACKAGE_SRC_DIR "/chimara.menus", &error) ) {