From cb99af5a0de90b98ab849555bbbbe2cbc44cd90e Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 17 Aug 2014 00:53:48 +0200 Subject: [PATCH] Add GtkListStore for city and country list --- src/astrognome.c | 19 +++++++++++++++++++ src/astrognome.h | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/astrognome.c b/src/astrognome.c index 03f487e..04f1bf9 100644 --- a/src/astrognome.c +++ b/src/astrognome.c @@ -19,6 +19,8 @@ GtkBuilder *builder; GtkFileFilter *filter_all = NULL; GtkFileFilter *filter_chart = NULL; GtkFileFilter *filter_hor = NULL; +GtkTreeModel *country_list = NULL; +GtkTreeModel *city_list = NULL; GHashTable *xinclude_positions; const char *moonStateName[] = { @@ -279,6 +281,23 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } + country_list = GTK_TREE_MODEL(gtk_list_store_new( + AG_COUNTRY_COLCOUNT, + G_TYPE_STRING, + G_TYPE_STRING + )); + + city_list = GTK_TREE_MODEL(gtk_list_store_new( + AG_CITY_COLCOUNT, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE, + G_TYPE_DOUBLE + )); + status = g_application_run(G_APPLICATION(app), argc, argv); g_hash_table_destroy(xinclude_positions); diff --git a/src/astrognome.h b/src/astrognome.h index 6ad04e8..80a1eeb 100644 --- a/src/astrognome.h +++ b/src/astrognome.h @@ -12,6 +12,25 @@ typedef struct { extern GtkFileFilter *filter_all; extern GtkFileFilter *filter_chart; extern GtkFileFilter *filter_hor; +extern GtkTreeModel *country_list; +extern GtkTreeModel *city_list; + +enum { + AG_COUNTRY_CODE, + AG_COUNTRY_NAME, + AG_COUNTRY_COLCOUNT +}; + +enum { + AG_CITY_COUNTRY, + AG_CITY_NAME, + AG_CITY_LAT, + AG_CITY_LONG, + AG_CITY_ALT, + AG_CITY_TZO, + AG_CITY_TZD, + AG_CITY_COLCOUNT +}; const gchar *ag_house_system_id_to_nick(GsweHouseSystem house_system); GsweHouseSystem ag_house_system_nick_to_id(const gchar *nick);