diff --git a/src/astrognome.c b/src/astrognome.c index a468f8f..e3ad27a 100644 --- a/src/astrognome.c +++ b/src/astrognome.c @@ -16,6 +16,8 @@ GtkBuilder *builder; static gboolean option_version, option_quit, option_new_window; +GtkFileFilter *filter_all = NULL, + *filter_chart = NULL; const char *moonStateName[] = { "New Moon", @@ -50,6 +52,20 @@ application_activate_cb(AgApp *app, gpointer user_data) run_action(app, FALSE); } +void +init_filters(void) +{ + filter_all = gtk_file_filter_new(); + gtk_file_filter_set_name(filter_all, _("All files")); + gtk_file_filter_add_pattern(filter_all, "*"); + g_object_ref_sink(filter_all); + + filter_chart = gtk_file_filter_new(); + gtk_file_filter_set_name(filter_chart, _("Astrognome charts")); + gtk_file_filter_add_pattern(filter_chart, "*.agc"); + g_object_ref_sink(filter_chart); +} + int main(int argc, char *argv[]) { @@ -88,6 +104,8 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } + init_filters(); + app = ag_app_new(); g_signal_connect(app, "activate", G_CALLBACK(application_activate_cb), NULL); g_application_set_default(G_APPLICATION(app)); diff --git a/src/astrognome.h b/src/astrognome.h new file mode 100644 index 0000000..f935f30 --- /dev/null +++ b/src/astrognome.h @@ -0,0 +1,8 @@ +#ifndef __ASTROGNOME_H__ +#define __ASTROGNOME_H__ + +extern GtkFileFilter *filter_all, + *filter_chart; + +#endif /* __ASTROGNOME_H__ */ +