X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=gtk-gui.c;h=98c0111eab530ef11de4027f54217f45eed45a27;hb=e7a70b6ae821e6a178957e2814406ac387b990ea;hp=0bc79954f49124b413cd84dbb08737f659a817df;hpb=b0ba22a06879697efa7c429b9df8e13feaa02480;p=ext%2Fsubsurface.git diff --git a/gtk-gui.c b/gtk-gui.c index 0bc7995..98c0111 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -624,13 +624,13 @@ static const gchar* ui_string = " \ \ \ \ - \ - \ \ - \ + \ \ \ \ + \ + \ \ \ \ @@ -1013,20 +1013,26 @@ static void do_import_file(gpointer data, gpointer user_data) } } -static GtkWidget *import_dive_computer(device_data_t *data, GtkBox *vbox) +static GtkWidget *import_dive_computer(device_data_t *data, GtkDialog *dialog) { GError *error; - GtkWidget *info, *container, *label; + GtkWidget *vbox, *info, *container, *label, *button; error = do_import(data); if (!error) return NULL; + button = gtk_dialog_get_widget_for_response(dialog, GTK_RESPONSE_ACCEPT); + gtk_button_set_use_stock(GTK_BUTTON(button), 0); + gtk_button_set_label(GTK_BUTTON(button), "Retry"); + + vbox = gtk_dialog_get_content_area(dialog); + info = gtk_info_bar_new(); container = gtk_info_bar_get_content_area(GTK_INFO_BAR(info)); label = gtk_label_new(error->message); gtk_container_add(GTK_CONTAINER(container), label); - gtk_box_pack_start(vbox, info, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), info, FALSE, FALSE, 0); return info; } @@ -1086,7 +1092,7 @@ repeat: devicedata.name = comp; devicedata.devname = gtk_entry_get_text(device); set_default_dive_computer(devicedata.name); - info = import_dive_computer(&devicedata, GTK_BOX(vbox)); + info = import_dive_computer(&devicedata, GTK_DIALOG(dialog)); if (info) goto repeat; } else { @@ -1107,6 +1113,10 @@ void update_progressbar(progressbar_t *progress, double value) gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress->bar), value); } +void update_progressbar_text(progressbar_t *progress, const char *text) +{ + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress->bar), text); +} void set_filename(const char *filename) {