summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-03 11:04:51 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-03 11:37:09 -0700
commit8677721e85a344e29782cfc2ab838edb8da9215b (patch)
tree0b3094c3ce528773a9b4051bd2fcd622acf4fc56 /main.c
parenta6b89b3254adf7c559fe6fb89367cc50c9f41900 (diff)
downloadsubsurface-8677721e85a344e29782cfc2ab838edb8da9215b.tar.gz
Remove the majority of the Gtk related code
- rip all Gtk code from qt-gui.cpp - don't compile Gtk specific files - don't link against Gtk libraries - don't compile modules we don't use at all (yet) - use #if USE_GTK_UI on the remaining files to disable Gtk related parts - disable the non-functional Cochran support while I'm at it Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.c b/main.c
index 40492a7e1..424750d28 100644
--- a/main.c
+++ b/main.c
@@ -99,7 +99,11 @@ static void parse_argument(const char *arg)
if (strcmp(arg,"--import") == 0) {
/* mark the dives so far as the base,
* everything after is imported */
+#if USE_GTK_UI
report_dives(FALSE, FALSE);
+#else
+ process_dives(FALSE, FALSE);
+#endif
imported = TRUE;
return;
}
@@ -119,6 +123,7 @@ static void parse_argument(const char *arg)
void update_dive(struct dive *new_dive)
{
+#if USE_GTK_UI
static struct dive *buffered_dive;
struct dive *old_dive = buffered_dive;
@@ -129,6 +134,7 @@ void update_dive(struct dive *new_dive)
show_dive_equipment(new_dive, W_IDX_PRIMARY);
show_dive_stats(new_dive);
buffered_dive = new_dive;
+#endif
}
void renumber_dives(int nr)
@@ -138,7 +144,9 @@ void renumber_dives(int nr)
for (i = 0; i < dive_table.nr; i++) {
struct dive *dive = dive_table.dives[i];
dive->number = nr + i;
+#if USE_GTK_UI
flush_divelist(dive);
+#endif
}
mark_divelist_changed(TRUE);
}
@@ -229,7 +237,9 @@ int main(int argc, char **argv)
}
if (error != NULL)
{
+#if USE_GTK_UI
report_error(error);
+#endif
g_error_free(error);
error = NULL;
}
@@ -242,9 +252,13 @@ int main(int argc, char **argv)
sure we remember this as the filename in use */
set_filename(filename, FALSE);
}
+#if USE_GTK_UI
report_dives(imported, FALSE);
if (dive_table.nr == 0)
show_dive_info(NULL);
+#else
+ process_dives(imported, FALSE);
+#endif
parse_xml_exit();
subsurface_command_line_exit(&argc, &argv);