Added file filters for later use

This commit is contained in:
Gergely Polonkai 2013-09-17 14:42:45 +02:00
parent 72df6b944d
commit cc91246d38
2 changed files with 26 additions and 0 deletions

View File

@ -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));

8
src/astrognome.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef __ASTROGNOME_H__
#define __ASTROGNOME_H__
extern GtkFileFilter *filter_all,
*filter_chart;
#endif /* __ASTROGNOME_H__ */