Migrate from the deprecated gtk_progress interface to the supported

gtk_progress_bar.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12065 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2005-11-29 03:53:42 +00:00
parent 32a6629abb
commit 349e74ca6d
8 changed files with 23 additions and 77 deletions

View File

@@ -1,5 +1,13 @@
2005-11-28 David Hampton <hampton@employees.org>
* 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.

View File

@@ -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);

View File

@@ -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

View File

@@ -158,25 +158,6 @@
((<gw:mchars> caller-owned const) heading))
"Set the heading of 'progress' to 'heading'.")
(gw:wrap-function
ws
'gnc:progress-dialog-set-limits
'<gw:void>
"gnc_progress_dialog_set_limits"
'((<gnc:ProgressDialog*> progress)
(<gw:float> min)
(<gw:float> max))
"Set the mininum and maximum range of 'progress'.")
(gw:wrap-function
ws
'gnc:progress-dialog-set-activity-mode
'<gw:void>
"gnc_progress_dialog_set_activity_mode"
'((<gnc:ProgressDialog*> progress)
(<gw:bool> 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
'<gw:void>
"gnc_progress_dialog_set_value"
'((<gnc:ProgressDialog*> progress) (<gw:float> value))
'((<gnc:ProgressDialog*> progress) (<gw:double> value))
"Set the value of the progress dialog to 'value'.")
(gw:wrap-function

View File

@@ -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);

View File

@@ -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...

View File

@@ -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))

View File

@@ -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