summaryrefslogtreecommitdiffstats
path: root/download-dialog.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 /download-dialog.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 'download-dialog.c')
-rw-r--r--download-dialog.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/download-dialog.c b/download-dialog.c
index 5d5c1de04..729f3a6b6 100644
--- a/download-dialog.c
+++ b/download-dialog.c
@@ -3,19 +3,23 @@
#include "dive.h"
#include "divelist.h"
#include "display.h"
+#if USE_GTK_UI
#include "display-gtk.h"
#include "callbacks-gtk.h"
+#endif
#include "libdivecomputer.h"
const char *default_dive_computer_vendor;
const char *default_dive_computer_product;
const char *default_dive_computer_device;
+#if USE_GTK_UI
static gboolean force_download;
static gboolean prefer_downloaded;
OPTIONCALLBACK(force_toggle, force_download)
OPTIONCALLBACK(prefer_dl_toggle, prefer_downloaded)
+#endif
struct product {
const char *product;
@@ -38,6 +42,7 @@ struct mydescriptor {
struct vendor *dc_list;
+#if USE_GTK_UI
static void render_dc_vendor(GtkCellLayout *cell,
GtkCellRenderer *renderer,
GtkTreeModel *model,
@@ -63,6 +68,7 @@ static void render_dc_product(GtkCellLayout *cell,
product = dc_descriptor_get_product(descriptor);
g_object_set(renderer, "text", product, NULL);
}
+#endif
int is_default_dive_computer(const char *vendor, const char *product)
{
@@ -105,6 +111,7 @@ static void set_default_dive_computer_device(const char *name)
subsurface_set_conf("dive_computer_device", name);
}
+#if USE_GTK_UI
static void dive_computer_selector_changed(GtkWidget *combo, gpointer data)
{
GtkWidget *import, *button;
@@ -149,7 +156,7 @@ static GtkWidget *import_dive_computer(device_data_t *data, GtkDialog *dialog)
gtk_box_pack_start(GTK_BOX(vbox), info, FALSE, FALSE, 0);
return info;
}
-
+#endif
/* create a list of lists and keep the elements sorted */
static void add_dc(const char *vendor, const char *product, dc_descriptor_t *descriptor)
@@ -195,6 +202,7 @@ static void add_dc(const char *vendor, const char *product, dc_descriptor_t *des
pl->descriptor = descriptor;
}
+#if USE_GTK_UI
/* fill the vendors and create and fill the respective product stores; return the longest product name
* and also the indices of the default vendor / product */
static int fill_computer_list(GtkListStore *vendorstore, GtkListStore ***productstore, int *vendor_index, int *product_index)
@@ -469,3 +477,4 @@ void update_progressbar_text(progressbar_t *progress, const char *text)
{
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress->bar), text);
}
+#endif