summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-26 09:19:30 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-26 09:19:30 -0700
commitacca9b1804efc43b589d04b60682081b56afe7bc (patch)
tree6854fd05d8b4ded273ea5aec81089d9e32955354 /gtk-gui.c
parentc3a484419731e680e343153f9fd32ed9e2695747 (diff)
downloadsubsurface-acca9b1804efc43b589d04b60682081b56afe7bc.tar.gz
Add a "Dive Computer" frame around the dive computer choice in import
I'll add a widget to allow the user to select the device too, so let's name things to make them more obvious. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 7eb85cf80..5675e5d4a 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -613,21 +613,23 @@ static void fill_computer_list(GtkListStore *store)
}
}
-static GtkComboBox *dive_computer_selector(GtkWidget *dialog)
+static GtkComboBox *dive_computer_selector(GtkWidget *vbox)
{
- GtkWidget *hbox, *combo_box, *vbox;
+ GtkWidget *hbox, *combo_box, *frame;
GtkListStore *model;
GtkCellRenderer *renderer;
hbox = gtk_hbox_new(FALSE, 6);
- vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 3);
model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
fill_computer_list(model);
+ frame = gtk_frame_new("Dive computer");
+ gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, TRUE, 3);
+
combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
- gtk_box_pack_start(GTK_BOX(hbox), combo_box, FALSE, TRUE, 3);
+ gtk_container_add(GTK_CONTAINER(frame), combo_box);
renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), renderer, TRUE);
@@ -652,10 +654,11 @@ void import_dialog(GtkWidget *w, gpointer data)
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
NULL);
- computer = dive_computer_selector(dialog);
+ vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+ computer = dive_computer_selector(vbox);
hbox = gtk_hbox_new(FALSE, 6);
- vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 3);
devicedata.progress.bar = gtk_progress_bar_new();
gtk_container_add(GTK_CONTAINER(hbox), devicedata.progress.bar);