summaryrefslogtreecommitdiffstats
path: root/download-dialog.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-17 22:01:41 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-17 22:01:41 -0700
commitf3f7bf51fa1dbe9cdb859e1a45b20c108613275b (patch)
treea28814b4d3d59ff26b41ecfe71670c03fe2ce71d /download-dialog.c
parent082ec43eeabe92c7d65d3ab0f189e8fb43016f35 (diff)
parent56dbb7c2ff697a393f5051e2b5363bd4c0f2bb6e (diff)
downloadsubsurface-f3f7bf51fa1dbe9cdb859e1a45b20c108613275b.tar.gz
Merge branch 'Qt'
After the 3.1 release it is time to shift the focus on the Qt effort - and the best way to do this is to merge the changes in the Qt branch into master. Linus was extremely nice and did a merge for me. I decided to do my own merge instead (which by accident actually based on a different version of the Qt branch) and then used his merge to double check what I was doing. I resolved a few things differently but overall what we did was very much the same (and I say this with pride since Linus is a professional git merger) Here's his merge commit message: This is a rough and tumble merge of the Qt branch into 'master', trying to sort out the conflicts as best as I could. There were two major kinds of conflicts: - the Makefile changes, in particular the split of the single Makefile into Rules.mk and Configure.mk, along with the obvious Qt build changes themselves. Those changes conflicted with some of the updates done in mainline wrt "release" targets and some helper macros ($(NAME) etc). Resolved by largely taking the Qt branch versions, and then editing in the most obvious parts of the Makefile updates from mainline. NOTE! The script/get_version shell script was made to just fail silently on not finding a git repository, which avoided having to take some particularly ugly Makefile changes. - Various random updates in mainline to support things like dive tags. The conflicts were mainly to the gtk GUI parts, which obviously looked different afterwards. I fixed things up to look like the newer code, but since the gtk files themselves are actually dead in the Qt branch, this is largely irrelevant. NOTE! This does *NOT* introduce the equivalent Qt functionality. The fields are there in the code now, but there's no Qt UI for the whole dive tag stuff etc. This seems to compile for me (although I have to force "QMAKE=qmake-qt4" on f19), and results in a Linux binary that seems to work, but it is otherwise largely untested. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'download-dialog.c')
-rw-r--r--download-dialog.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/download-dialog.c b/download-dialog.c
index 6a55a327c..8f6220e31 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)
{
@@ -75,7 +81,7 @@ int is_default_dive_computer_device(const char *name)
return default_dive_computer_device && !strcmp(name, default_dive_computer_device);
}
-static void set_default_dive_computer(const char *vendor, const char *product)
+void set_default_dive_computer(const char *vendor, const char *product)
{
if (!vendor || !*vendor)
return;
@@ -93,7 +99,7 @@ static void set_default_dive_computer(const char *vendor, const char *product)
subsurface_set_conf("dive_computer_product", product);
}
-static void set_default_dive_computer_device(const char *name)
+void set_default_dive_computer_device(const char *name)
{
if (!name || !*name)
return;
@@ -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;
@@ -161,10 +168,10 @@ 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)
+void add_dc(const char *vendor, const char *product, dc_descriptor_t *descriptor)
{
struct vendor *dcl = dc_list;
struct vendor **dclp = &dc_list;
@@ -207,6 +214,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)
@@ -485,3 +493,4 @@ void update_progressbar_text(progressbar_t *progress, const char *text)
{
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress->bar), text);
}
+#endif