Commit Graph

447 Commits

Author SHA1 Message Date
Gergely Polonkai 3d61e18c6b Redraw chart when changing to the chart tab
Fixes #59
2014-08-22 15:45:09 +02:00
Gergely Polonkai 95d0e21ef8 ag_window_recalculate_chart() now considers country and city names 2014-08-21 01:31:10 +02:00
Gergely Polonkai 3d2d61ef0a Merge branch 'master' into city-chooser 2014-08-21 01:25:16 +02:00
Gergely Polonkai df8c954331 Change string_collate() so NULL and empty strings are equal. 2014-08-21 01:23:40 +02:00
Gergely Polonkai 9a8a0bb9d9 Merge branch 'master' into city-chooser 2014-08-21 01:06:58 +02:00
Gergely Polonkai 4bb4304683 Change Ctrl to Primary in accels
This is somewhat a revert for 3ad29b3f, which also changed Primary to
Ctrl.
2014-08-21 00:55:54 +02:00
Gergely Polonkai 1a8c778d31 Merge branch 'master' into city-chooser
Conflicts:
	src/ag-db.c
	src/ag-window.c
2014-08-21 00:00:41 +02:00
Gergely Polonkai 59ac56ba8f Add connection view changer buttons (aspects/antiscia) 2014-08-20 23:42:59 +02:00
Gergely Polonkai 6070dc9cc0 Add an empty toolbar to the chart tab 2014-08-20 23:36:29 +02:00
Gergely Polonkai 8aeec229f3 Switch to WebKit 4.0 API 2014-08-20 20:23:14 +02:00
Gergely Polonkai edcccbd08f Empty/update city and country fields 2014-08-19 00:40:26 +02:00
Gergely Polonkai 86414b37df Update UI to use country/city chooser 2014-08-19 00:40:26 +02:00
Gergely Polonkai 4e93781bb9 Read country/city list from geodata.xml into GtkListStores 2014-08-19 00:29:45 +02:00
Gergely Polonkai 8d82c48f5f Fix ag_db_get_chart_data_by_id() to recognise NULL values 2014-08-19 00:29:45 +02:00
Gergely Polonkai 1c2c2d0342 Bind signal callbacks with gtk_widget_class_bind_template_callback() 2014-08-18 22:49:19 +02:00
Gergely Polonkai cdb856d8ed Create a DEFAULT_ALTITUDE macro
It is set to 280.0, which is roughly the average altitude of dry land
2014-08-18 22:49:19 +02:00
Gergely Polonkai 2d10273af8 Bind signal callbacks with gtk_widget_class_bind_template_callback() 2014-08-18 22:17:50 +02:00
Gergely Polonkai 512897cfd3 Create a DEFAULT_ALTITUDE macro
It is set to 280.0, which is roughly the average altitude of dry land
2014-08-17 09:36:30 +02:00
Gergely Polonkai cb99af5a0d Add GtkListStore for city and country list 2014-08-17 00:53:48 +02:00
Gergely Polonkai 3169e8a587 Empty the Edit tab fields when creating a new chart 2014-08-16 21:27:49 +02:00
Gergely Polonkai 458c984034 Code beautification 2014-08-16 14:29:45 +02:00
Gergely Polonkai 6d9db1bc7d Reorder functions of ag-window.c to remove prototype need 2014-08-12 12:33:55 +02:00
Gergely Polonkai a44da21306 Refine dist value so icons (hopefully) don’t get too far from the chart 2014-08-12 00:06:44 +02:00
Gergely Polonkai bb38df71a7 Fix #46 2014-08-11 23:46:22 +02:00
Gergely Polonkai 085f2225ea Add debug messages to ag_db_save_identical() 2014-08-11 22:19:07 +02:00
Gergely Polonkai 5d028b5e17 Add notification for property setters 2014-08-11 22:19:07 +02:00
Gergely Polonkai 6e736c9b87 Add AgChart::note property 2014-08-11 22:19:07 +02:00
Gergely Polonkai 8b5f99d5b4 Rename chart_changed() to ag_window_chart_changed()
Just to follow naming conventions
2014-08-11 22:19:06 +02:00
Gergely Polonkai 1ae1972cd0 Remove chart name when going back to chart list
Fixes #47
2014-08-11 01:26:58 +02:00
Gergely Polonkai 142284dada Delete selected charts 2014-08-11 01:01:04 +02:00
Gergely Polonkai 4a42ae40b6 Implement view-selection-changed signal handler 2014-08-11 01:01:04 +02:00
Gergely Polonkai f44c5b8c86 Add selection mode button and selection toolbar 2014-08-11 01:01:04 +02:00
Gergely Polonkai e0b4d30b07 Implement chart deletion from database 2014-08-11 01:01:04 +02:00
Gergely Polonkai 88fb58a527 Import Placidus charts 2014-08-10 14:31:38 +02:00
Gergely Polonkai fee23777f6 Add Placidus import to the app menu 2014-08-10 14:31:38 +02:00
Gergely Polonkai 6e847d83ed Create .hor filter for Placidus files 2014-08-10 14:31:38 +02:00
Gergely Polonkai ea3389aadd Define gdouble endianness conversion macros
GLib doesn’t have these for some reason. These are protected in case a
later version of GLib defines them, too.
2014-08-10 14:31:38 +02:00
Gergely Polonkai a30d19d1bb Generalize chart loading functions
* ag_app_import_chart() became ag_app_import_file(), and has the potential
  to load any file type
* ag_app_import_cb() so it can open multiple file types
* ag_chart_load_from_file() is now called ag_chart_load_from_agc()
2014-08-10 14:31:38 +02:00
Gergely Polonkai a3927458b4 Make ag_app_buttoned_dialog()'s first parameter nullable 2014-08-10 09:46:14 +02:00
Gergely Polonkai 49c41ca7d7 Refactor ag_window_recalculate_chart() to recalc if edit tab has changed 2014-08-06 00:04:59 +02:00
Gergely Polonkai ffde691aef Rename recalculate_chart() to ag_window_recalculate_chart()
This is simply to follow naming conventions
2014-08-06 00:04:59 +02:00
Gergely Polonkai 5e97af76ea Fix tab_edit widget’s name in .ui file 2014-08-06 00:04:34 +02:00
Gergely Polonkai aefbb8e4fa ag_db_save_identical can now compare based only on chart-related data
This way the chart won’t get recalculated on a name change.
2014-08-05 23:45:16 +02:00
Gergely Polonkai 881b58080a Add ag_house_system_id_to_nick() and ag_house_system_nick_to_id()
This is to convert between house system ID (required for chart generating)
and GEnum nick (required for saving).
2014-08-04 00:31:25 +02:00
Gergely Polonkai 3ad29b3f2d Moved to gtk_application_set_accels_for_action() API
... and with that, to a GTK+ 3.12 requirement.
2014-08-03 23:32:17 +02:00
Gergely Polonkai e3b109819e Merge branch 'master' into chart-db 2014-08-03 11:15:29 +02:00
Gergely Polonkai 803b0211dd Using g_clear_object() instead of g_object_unref() in ag_window_set_chart 2014-08-03 11:12:29 +02:00
Gergely Polonkai 0d1358303a ag_app_import_chart() now saves the chart immediately after importing 2014-08-03 11:03:23 +02:00
Gergely Polonkai 35c7d32636 ag_window_save_chart() now creates an AgDbSave struct for a new chart
Its db_id is -1, thus considered unsaved.
2014-08-03 11:02:52 +02:00
Gergely Polonkai 069ce4574f ag_window_can_close() now checks for unsaved (db_id == -1) charts, too 2014-08-03 10:58:19 +02:00
Gergely Polonkai b0e7daeec8 ag_db_save_chart() now sets save_data->db_id after a successful INSERT 2014-08-03 10:57:05 +02:00
Gergely Polonkai c871246d58 Add refresh button to chart list 2014-08-02 21:55:17 +02:00
Gergely Polonkai 2f9637e698 Add error checking to ag_window_can_close() 2014-08-02 21:41:30 +02:00
Gergely Polonkai 1049b933e8 ag_window_back_action() goes to list only if the chart is saved
The user is prompted if they actually want to save or discard
2014-08-02 20:00:56 +02:00
Gergely Polonkai 8d76bdf1ef ag_window_new_chart_action() goes to chart tab if chart was not correctly closed 2014-08-02 20:00:24 +02:00
Gergely Polonkai f1fba37d0d ag_window_save_action() now only saves if needed 2014-08-02 19:59:21 +02:00
Gergely Polonkai d2d67534b3 Change return type of ag_window_list_item_activated_cb() to void
The signal itself defines its return type as GTK_TYPE_VOID
2014-08-02 19:58:33 +02:00
Gergely Polonkai e2701396cc Check if chart needs to be saved upon close action 2014-08-02 19:54:30 +02:00
Gergely Polonkai 1c84845fa2 Add delete-event handler to AgWindow 2014-08-02 19:53:50 +02:00
Gergely Polonkai 6e35a98cd5 Add ag_app_buttoned_dialog() to ag-app.h 2014-08-02 19:52:47 +02:00
Gergely Polonkai 367a91cb51 Show error message if DB chart could not be loaded 2014-08-02 10:28:22 +02:00
Gergely Polonkai 377a2e1e8a Rename Open functionality to Import 2014-08-02 01:41:33 +02:00
Gergely Polonkai ab12922d8a Rework chart save procedure
* Fixed some design flows: AgDb should not know about the window
* AgChart now only creates an AgDbSave structure, saving is done through
  AgWindow
2014-08-02 01:37:11 +02:00
Gergely Polonkai 860638ed98 Add function ag_app_buttoned_dialog()
This is required to create dialogs with more than one buttons, like Yes/No
dialogs.
2014-08-02 00:34:07 +02:00
Gergely Polonkai defdc75eb0 Add missing va_end() to ag_db_select() 2014-08-02 00:26:49 +02:00
Gergely Polonkai c2241e622a Add New/Back buttons to the header bar
New opens the Edit tab immediately, back goes back to the chart list
2014-08-01 23:55:26 +02:00
Gergely Polonkai d30b31ce7e Merge branch 'master' into chart-db
Conflicts:
        src/ag-chart.h
        src/ag-window.c

Conflicts fixed without problems.
2014-08-01 18:03:27 +02:00
Gergely Polonkai c79e24c709 Annotated AgDb functions 2014-08-01 10:51:15 +02:00
Gergely Polonkai c22fc02a2a Add missing (but actually unnecessary) gtk.h include 2014-08-01 01:09:34 +02:00
Gergely Polonkai c22c81cc61 Move away from popover
GtkPopover cannot display accels, which is not ideal for the gear/view
menu. Switching to normal menus instead.
2014-08-01 01:09:12 +02:00
Gergely Polonkai 12e088b452 Add function ag_chart_save_to_db() to save the chart to the db 2014-07-31 21:23:23 +02:00
Gergely Polonkai 2e34b71f69 Add function ag_db_save_identical()
It compares two AgDbSave structs and returns TRUE if they are equal or
identical.
2014-07-31 21:22:53 +02:00
Gergely Polonkai 1628a71f8b Remove URI from AgWindowPrivate 2014-07-31 21:22:44 +02:00
Gergely Polonkai 41098fd2c0 Rename Save as function to Export 2014-07-31 18:12:23 +02:00
Gergely Polonkai 8533b2f887 Load chart list when opening a new window 2014-07-31 01:06:24 +02:00
Gergely Polonkai 36e89f3fe4 Create the GdMainView for the chart list
GdMainView doesn’t implement GtkBuildable yet, thus, it cannot be added
via the UI file.
2014-07-31 01:06:10 +02:00
Gergely Polonkai 809a1b215f Add libgd as a dependency and git submodule
libgd is required for GdMainView until MainView gets into Gtk (which I hope
will happen)
2014-07-31 01:05:23 +02:00
Gergely Polonkai 47fa484875 Add function ag_window_load_chart_list()
It loads all charts from the database and fills the main view’s list
store with it
2014-07-31 01:05:19 +02:00
Gergely Polonkai e2606ea5eb Add list store model for the GdMainView 2014-07-31 01:03:49 +02:00
Gergely Polonkai 310caa9292 Add function ag_chart_new_from_db_save()
It constructs an AgChart from an AgDbSave struct
2014-07-31 01:00:22 +02:00
Gergely Polonkai bee9ae363f Fix ag_db_select()
Using parameter @err for error collection was a bad idea. Creating
local_err instead.
2014-07-31 01:00:16 +02:00
Gergely Polonkai ea9e4a73a5 Add function ag_db_get_chart_data_by_id()
It loads one single chart from the database and fills an AgDbSave
struct with its data
2014-07-31 01:00:03 +02:00
Gergely Polonkai bfa4cf8cca Add AgDbError error type 2014-07-31 00:59:53 +02:00
Gergely Polonkai 8a654e9c0f Add function ag_db_get_chart_list() 2014-07-31 00:49:55 +02:00
Gergely Polonkai e8d9386916 Add function ag_db_save_chart() to add/update charts in the database 2014-07-22 00:11:08 +02:00
Gergely Polonkai 98d08893ef Add struct AgDbSave together with the function ag_db_save_data_free() 2014-07-22 00:11:08 +02:00
Gergely Polonkai 749a253f18 Code beautification in ag-chart.h 2014-07-21 23:46:20 +02:00
Gergely Polonkai 0fc41ba545 Add missing closing bracket in ag_db_non_select() 2014-07-21 23:46:09 +02:00
Gergely Polonkai 89e5f5c4dc Code beautification in ag-chart.h 2014-07-21 23:38:22 +02:00
Gergely Polonkai 4d64e707bc Add AgDb class 2014-07-20 23:18:45 +02:00
Gergely Polonkai fe25f5ce9d Remove unneeded UI_FILE #define
All UI code is now stored in GResources
2014-07-20 23:18:28 +02:00
Gergely Polonkai d671500a1a Code beautification in xml_open_gresource() 2014-07-20 23:15:58 +02:00
Gergely Polonkai cad657c1b1 Move AgChartPrivate to ag-chart.c completely 2014-07-19 10:46:41 +02:00
Gergely Polonkai bc81187e8b Set month and day to 1, so warnings disappear
This is somewhat cosmetic, a better approach should be found.
Fixes #23
2014-07-18 23:05:40 +02:00
Gergely Polonkai d23c7c42c4 Unset house system is now a critical error
Fixes #38
2014-07-18 22:33:58 +02:00
Gergely Polonkai 46cb2b24a5 Add default house system to preferences dialog 2014-07-18 22:27:00 +02:00
Gergely Polonkai 69bc58495c Set Edit tab’s house system to the default on startup 2014-07-18 20:49:35 +02:00
Gergely Polonkai 0ead40813b Rename ag_window_find_house_system() to ag_window_set_house_system() 2014-07-18 20:49:02 +02:00
Gergely Polonkai bd277de1bc Add house system save functionality
This was missing from #37
2014-07-18 18:32:53 +02:00
Gergely Polonkai 427f915f62 Use enum nick instead of name in house system saving
This is easier to do, and the save file has that value already
2014-07-18 18:31:56 +02:00
Gergely Polonkai 74e8373dad Add missing g_free() call for house_system_enum_name in chart loading 2014-07-18 18:30:11 +02:00
Gergely Polonkai 71cc129e95 Now considering house system setting on the Edit tab 2014-07-18 00:15:20 +02:00
Gergely Polonkai 023b179457 House system GtkComboBox now indicates the loaded house system 2014-07-18 00:02:56 +02:00
Gergely Polonkai fa6a850331 Add house system loading to chart load code 2014-07-18 00:02:56 +02:00
Gergely Polonkai 09d1fe352a Add the house system configuration widgets to the Edit tab
It is already filled with data, but it is not functional yet!
2014-07-18 00:02:56 +02:00
Gergely Polonkai 4e5b649173 Code beautification in ag_chart_load_from_file() 2014-07-17 23:11:24 +02:00
Gergely Polonkai e745312ffe Remove err when checking for note in save file
Note is not required to be present in any save file. However,
get_by_xpath() sets err if it is not, which will never be checked for.
2014-07-17 23:11:24 +02:00
Gergely Polonkai 5671a751a9 Fix error messages in AgChart’s get_by_xpath() 2014-07-17 23:08:34 +02:00
Gergely Polonkai 183c0a00dc Remove unnecessary upper bound for year_adjust 2014-07-16 22:20:34 +02:00
Gergely Polonkai 39881908b7 Remove unnecessary lines from ag_window_init()
* priv->settings assignment is already done in that function
* gtk_window_set_hide_titlebar_when_maximized() is somewhat deprecated
  with HeaderBars
2014-07-15 16:43:56 +02:00
Gergely Polonkai 2656df25cb Code beautification in `ag_chart_create_svg()` 2014-07-13 23:01:23 +02:00
Gergely Polonkai 69233be35e Add a dist attribute to XML <body> tags so planet icons won't collide 2014-07-13 22:44:15 +02:00
Gergely Polonkai 1341628c24 Redesign Aquarius symbol 2014-07-12 22:45:26 +02:00
Gergely Polonkai b762d93ee2 Add license to About dialog 2014-07-12 11:07:45 +02:00
Gergely Polonkai fa7a87dd76 Add artists section to the About dialog
Also remove documentors as it was empty
2014-07-12 11:07:33 +02:00
Gergely Polonkai f63d42dee9 Minor code beautification 2014-07-12 11:06:46 +02:00
Gergely Polonkai 5ac17cd8be Move default sign symbols to the resource list 2014-07-12 10:45:38 +02:00
Gergely Polonkai c31ddb6fe7 Add gres:// type links support for libxml2 2014-07-12 10:27:11 +02:00
Gergely Polonkai a5d76beb23 Move the default xsl file to the resources 2014-07-11 15:03:54 +02:00
Gergely Polonkai 4144d6b4ff Remove CSS from the xsl file and the SVG generating code 2014-07-11 14:32:24 +02:00
Gergely Polonkai 9342ea63de Code beautification
Wrap long lines in all files
2014-07-11 10:33:04 +02:00
Gergely Polonkai 110e7f3c25 Beautify code 2014-07-11 00:37:14 +02:00
Gergely Polonkai b6af9a9d96 Refactor all `gtk_message_dialog()` calls to `ag_app_message_dialog()` 2014-07-11 00:34:12 +02:00
Gergely Polonkai 4db1ecff96 Code beautification
Truncate long lines. This is not finished yet, though!
2014-07-10 23:47:39 +02:00
Gergely Polonkai 2af46ece40 Remove WebKitWebView creation from Glade
The Glade template cannot assign an already created WebKitWebViewGroup
to the WebKitWebView it creates. Thus we need to create it manuallp
2014-07-10 23:33:22 +02:00
Gergely Polonkai b8cc90912d Load default chart CSS to AgApp’s private member, web_view_group
This will make sure at least one CSS is loaded for each web view created
later.
2014-07-10 23:24:33 +02:00
Gergely Polonkai 3efb358a4f Copy the default chart CSS to the resource database 2014-07-10 23:22:16 +02:00
Gergely Polonkai e6aa43cba7 Add class private to AgApp 2014-07-10 23:20:23 +02:00
Gergely Polonkai a312e59020 Merge branch 'master' into webkit2 2014-07-10 14:34:12 +02:00
Gergely Polonkai 86e5438807 Add chart note support
It is saved under /chartinfo/note, and may be non-existant or an empty
tag.

Fixes #28
2014-07-09 00:38:04 +02:00
Gergely Polonkai 7c745e51a7 Reorder Edit GtkGrid’s children to be a bit more logical 2014-07-08 23:55:54 +02:00
Gergely Polonkai 6724f68dcf Started transitioning to Webkit 2.0
Unfortunately, webkit_web_view_load_string() is not implemented in the
2.0 API, so trying with load_html() for now. Seems not to work with SVG
images without tweaking.
2014-07-08 21:04:45 +02:00
Gergely Polonkai ee4faf34a6 Remove unneeded TODO line 2014-07-05 11:14:11 +02:00
Gergely Polonkai 8262eaabd1 Add error checking to several places 2014-07-05 11:03:27 +02:00
Gergely Polonkai 165cf260c9 Add ag_app_message_dialog() to create multi-purpose message dialogs 2014-07-04 22:31:59 +02:00
Gergely Polonkai 740691f97f Automatically apply settings change for planet/aspect icons as characters 2014-07-04 22:07:16 +02:00
Gergely Polonkai 76975df877 Refactor aspect table redrawing to a separate function
This is to later allow me to call when the certain GSettings values
((planets|aspects)-char) change.
2014-07-04 22:07:16 +02:00
Gergely Polonkai 409c1f5267 Create planet and aspect symbols with respect to the (planets|aspects)-char settings 2014-07-04 22:07:16 +02:00
Gergely Polonkai 582c7e02b9 Add new settings planets-char and aspects-char to the preferences dialog
They are only effective upon chart redraw. A callback must be utilised
to automatically redraw the aspect table upon change.
2014-07-04 13:13:38 +02:00
Gergely Polonkai d8aadc4ffa Add planets-char and aspects-char settings to GSettings schema 2014-07-04 13:02:45 +02:00
Gergely Polonkai f65cb50f8e Incorporate first icon in the aspect table
Sun is now represented by an (oversized) icon in the aspects table.
2014-07-03 23:24:11 +02:00
Gergely Polonkai 5da0699607 Move resource files to resources/ directory
This is to make them more managable
2014-07-03 23:13:52 +02:00
Gergely Polonkai 26fb959a48 Remove AgSettings’ priv property 2014-07-03 18:15:48 +02:00
Gergely Polonkai 4542f52980 Remove AgWindow’s priv property 2014-07-03 18:08:34 +02:00
Gergely Polonkai ee86d98317 ag-window.c cleanup
Remove non-used private variables and their references
2014-07-03 15:56:46 +02:00
Gergely Polonkai d95ef75e59 Set window title and subtitle
Title is fixed, set to “Astrognome”
Subtitle is the name on the chart
2014-07-03 15:31:05 +02:00
Gergely Polonkai 20cc731289 Move view changing functionality from GtkStackSwitcher into a view menu 2014-07-03 14:08:51 +02:00
Gergely Polonkai bdecad3c2a Start transitioning main window to Glade 2014-07-03 10:57:57 +02:00
Gergely Polonkai 9e3b4400a9 Add type cast to ag_window_open_chart_tab() call 2014-07-02 23:02:39 +02:00
Gergely Polonkai 9c9da9c273 Removed TODO comment after merging chart-tab-if-open 2014-07-02 19:50:46 +02:00