diff --git a/ChangeLog b/ChangeLog index cc5476226b..f4bb53bf82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2005-11-28 David Hampton + * src/import-export/qif-import/qif-to-gnc.scm: + * src/import-export/qif-import/qif-merge-groups.scm: + * src/import-export/qif-import/qif-file.scm: + * src/import-export/hbci/hbci-interaction.c: + * src/gnome/gw-gnc-spec.scm: + * src/gnome/dialog-progress.[ch]: Migrate from the deprecated + gtk_progress interface to the supported gtk_progress_bar. + * src/import-export/qif-import/druid-qif-import.c: Need to escape user input string to prevent errors from gtk. diff --git a/src/gnome/dialog-progress.c b/src/gnome/dialog-progress.c index 26d01f3ff9..cb6a74a157 100644 --- a/src/gnome/dialog-progress.c +++ b/src/gnome/dialog-progress.c @@ -180,9 +180,6 @@ gnc_progress_dialog_create(GtkWidget * parent, GNCProgressDialog *progress) gtk_widget_hide(progress->heading_label); progress->progress_bar = glade_xml_get_widget (xml, "progress_bar"); - gtk_progress_set_show_text (GTK_PROGRESS(progress->progress_bar), TRUE); - gtk_progress_configure (GTK_PROGRESS(progress->progress_bar), - 0.0, 0.0, 100.0); progress->ok_button = glade_xml_get_widget (xml, "ok_button"); @@ -260,32 +257,6 @@ gnc_progress_dialog_set_heading (GNCProgressDialog *progress, gnc_progress_dialog_update (progress); } -void -gnc_progress_dialog_set_limits (GNCProgressDialog *progress, - gfloat min, gfloat max) -{ - if (progress == NULL) - return; - - gtk_progress_configure (GTK_PROGRESS (progress->progress_bar), - min, min, max); - - gnc_progress_dialog_update (progress); -} - -void -gnc_progress_dialog_set_activity_mode (GNCProgressDialog *progress, - gboolean activity_mode) -{ - if (progress == NULL) - return; - - gtk_progress_set_activity_mode (GTK_PROGRESS (progress->progress_bar), - activity_mode); - - gnc_progress_dialog_update (progress); -} - void gnc_progress_dialog_set_cancel_func (GNCProgressDialog *progress, GNCProgressCancelFunc cancel_func, @@ -322,12 +293,12 @@ gnc_progress_dialog_set_cancel_scm_func (GNCProgressDialog *progress, } void -gnc_progress_dialog_set_value (GNCProgressDialog *progress, gfloat value) +gnc_progress_dialog_set_value (GNCProgressDialog *progress, gdouble value) { if (progress == NULL) return; - gtk_progress_set_value (GTK_PROGRESS (progress->progress_bar), value); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress->progress_bar), value); gnc_progress_dialog_update (progress); } @@ -351,7 +322,7 @@ gnc_progress_dialog_finish (GNCProgressDialog *progress) progress->closed = TRUE; } - gtk_progress_set_percentage (GTK_PROGRESS (progress->progress_bar), 1.0); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(progress->progress_bar), 1.0); gtk_widget_set_sensitive (progress->ok_button, TRUE); gtk_widget_set_sensitive (progress->cancel_button, FALSE); diff --git a/src/gnome/dialog-progress.h b/src/gnome/dialog-progress.h index 84fc02d3a8..3d0f03ac55 100644 --- a/src/gnome/dialog-progress.h +++ b/src/gnome/dialog-progress.h @@ -47,15 +47,6 @@ void gnc_progress_dialog_set_title (GNCProgressDialog *progress, void gnc_progress_dialog_set_heading (GNCProgressDialog *progress, const char *heading); -/* Set the upper and lower bound of the progress meter. */ -void gnc_progress_dialog_set_limits (GNCProgressDialog *progress, - gfloat min, gfloat max); - -/* Set the activity mode. If TRUE, the dialog just indicates - * that stuff is happening, rather than a percentage complete. */ -void gnc_progress_dialog_set_activity_mode (GNCProgressDialog *progress, - gboolean activity_mode); - /* Set the C function which will be called if the user hits the * 'cancel' button. The cancel function returns a boolean value. * If the value is TRUE, the window is hidden. */ @@ -71,7 +62,7 @@ void gnc_progress_dialog_set_cancel_scm_func (GNCProgressDialog *progress, SCM cancel_scm_func); /* Set the value of the progress dialog. */ -void gnc_progress_dialog_set_value (GNCProgressDialog *progress, gfloat value); +void gnc_progress_dialog_set_value (GNCProgressDialog *progress, gdouble value); /* Update the GUI of the progress dialog, and call any pending cancel * callbacks. This function will be called automatically by the other diff --git a/src/gnome/gw-gnc-spec.scm b/src/gnome/gw-gnc-spec.scm index ae68f512e1..c1323cb2c5 100644 --- a/src/gnome/gw-gnc-spec.scm +++ b/src/gnome/gw-gnc-spec.scm @@ -158,25 +158,6 @@ (( caller-owned const) heading)) "Set the heading of 'progress' to 'heading'.") - (gw:wrap-function - ws - 'gnc:progress-dialog-set-limits - ' - "gnc_progress_dialog_set_limits" - '(( progress) - ( min) - ( max)) - "Set the mininum and maximum range of 'progress'.") - - (gw:wrap-function - ws - 'gnc:progress-dialog-set-activity-mode - ' - "gnc_progress_dialog_set_activity_mode" - '(( progress) - ( activity-mode)) - "Set the mininum and maximum range of 'progress'.") - (gw:wrap-function ws 'gnc:progress-dialog-set-cancel-scm-func @@ -193,7 +174,7 @@ returns #t, the dialog is closed, but not destroyed.") 'gnc:progress-dialog-set-value ' "gnc_progress_dialog_set_value" - '(( progress) ( value)) + '(( progress) ( value)) "Set the value of the progress dialog to 'value'.") (gw:wrap-function diff --git a/src/import-export/hbci/hbci-interaction.c b/src/import-export/hbci/hbci-interaction.c index 9f04236f8b..fafb9f5816 100644 --- a/src/import-export/hbci/hbci-interaction.c +++ b/src/import-export/hbci/hbci-interaction.c @@ -640,8 +640,7 @@ static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title, /* Set progress bar */ gtk_widget_set_sensitive (data->action_progress, TRUE); - gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), - 0.0); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(data->action_progress), 0.0); data->action_max = total; GNCInteractor_setRunning(data); /* printf("progressStartCB: Action \"%s\" started, total %d.\n", @@ -672,8 +671,8 @@ static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, /* printf("progressLogCB: Progress set to %d out of %f.\n", progress, data->action_max); */ if (progress <= data->action_max) - gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), - progress/data->action_max); + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (data->action_progress), + progress/data->action_max); } return !keepAlive(data); diff --git a/src/import-export/qif-import/qif-file.scm b/src/import-export/qif-import/qif-file.scm index 488568c8b6..5fb612a0ca 100644 --- a/src/import-export/qif-import/qif-file.scm +++ b/src/import-export/qif-import/qif-file.scm @@ -54,8 +54,7 @@ (set! progress-dialog (gnc:progress-dialog-new #f #f)) (gnc:progress-dialog-set-title progress-dialog (_ "Progress")) (gnc:progress-dialog-set-heading progress-dialog - (_ "Loading QIF file...")) - (gnc:progress-dialog-set-limits progress-dialog 0.0 100.0))) + (_ "Loading QIF file...")))) (with-input-from-file path (lambda () @@ -377,8 +376,7 @@ (if progress-dialog (begin (gnc:progress-dialog-set-value - progress-dialog - (* 100 (/ bytes-read file-size))) + progress-dialog (/ bytes-read file-size)) (gnc:progress-dialog-update progress-dialog))) ;; this is if we read a normal (non-null, non-eof) line... diff --git a/src/import-export/qif-import/qif-merge-groups.scm b/src/import-export/qif-import/qif-merge-groups.scm index ff3c3ad2a8..888b053d77 100644 --- a/src/import-export/qif-import/qif-merge-groups.scm +++ b/src/import-export/qif-import/qif-merge-groups.scm @@ -46,8 +46,7 @@ (set! progress-dialog (gnc:progress-dialog-new #f #f)) (gnc:progress-dialog-set-title progress-dialog (_ "Progress")) (gnc:progress-dialog-set-heading progress-dialog - (_ "Finding duplicate transactions...")) - (gnc:progress-dialog-set-limits progress-dialog 0.0 100.0))) + (_ "Finding duplicate transactions...")))) ;; for each transaction in the new group, build a query that could ;; match possibly similar transactions. @@ -58,7 +57,7 @@ (if progress-dialog (begin (gnc:progress-dialog-set-value - progress-dialog (* 100 (/ work-done work-to-do))) + progress-dialog (/ work-done work-to-do)) (gnc:progress-dialog-update progress-dialog))) (gnc:query-set-book query (gnc:group-get-book old-group)) diff --git a/src/import-export/qif-import/qif-to-gnc.scm b/src/import-export/qif-import/qif-to-gnc.scm index 4a89a6f392..0fc389f668 100644 --- a/src/import-export/qif-import/qif-to-gnc.scm +++ b/src/import-export/qif-import/qif-to-gnc.scm @@ -300,8 +300,7 @@ (set! progress-dialog (gnc:progress-dialog-new #f #f)) (gnc:progress-dialog-set-title progress-dialog (_ "Progress")) (gnc:progress-dialog-set-heading progress-dialog - (_ "Importing transactions...")) - (gnc:progress-dialog-set-limits progress-dialog 0.0 100.0))) + (_ "Importing transactions...")))) ;; now run through the markable transactions marking any @@ -313,7 +312,7 @@ (if progress-dialog (begin (gnc:progress-dialog-set-value - progress-dialog (* 100 (/ work-done work-to-do))) + progress-dialog (/ work-done work-to-do)) (gnc:progress-dialog-update progress-dialog))) (if (not (qif-xtn:mark xtn)) (qif-import:mark-matching-xtns xtn rest)) @@ -330,7 +329,7 @@ (if progress-dialog (begin (gnc:progress-dialog-set-value - progress-dialog (* 100 (/ work-done work-to-do))) + progress-dialog (/ work-done work-to-do)) (gnc:progress-dialog-update progress-dialog))) (if (not (qif-xtn:mark xtn)) (begin