[Gnucash-changes] r12065 - gnucash/trunk - Migrate from the deprecated gtk_progress interface to the supported

David Hampton hampton at cvs.gnucash.org
Mon Nov 28 22:53:43 EST 2005


Author: hampton
Date: 2005-11-28 22:53:42 -0500 (Mon, 28 Nov 2005)
New Revision: 12065
Trac: http://svn.gnucash.org/trac/changeset/12065

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome/dialog-progress.c
   gnucash/trunk/src/gnome/dialog-progress.h
   gnucash/trunk/src/gnome/gw-gnc-spec.scm
   gnucash/trunk/src/import-export/hbci/hbci-interaction.c
   gnucash/trunk/src/import-export/qif-import/qif-file.scm
   gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm
   gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm
Log:
Migrate from the deprecated gtk_progress interface to the supported
gtk_progress_bar.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/ChangeLog	2005-11-29 03:53:42 UTC (rev 12065)
@@ -1,5 +1,13 @@
 2005-11-28  David Hampton  <hampton at 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.
 

Modified: gnucash/trunk/src/gnome/dialog-progress.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-progress.c	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/gnome/dialog-progress.c	2005-11-29 03:53:42 UTC (rev 12065)
@@ -180,9 +180,6 @@
   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");
 
@@ -261,32 +258,6 @@
 }
 
 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,
                                      gpointer user_data)
@@ -322,12 +293,12 @@
 }
 
 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 @@
     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);

Modified: gnucash/trunk/src/gnome/dialog-progress.h
===================================================================
--- gnucash/trunk/src/gnome/dialog-progress.h	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/gnome/dialog-progress.h	2005-11-29 03:53:42 UTC (rev 12065)
@@ -47,15 +47,6 @@
 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 @@
                                               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

Modified: gnucash/trunk/src/gnome/gw-gnc-spec.scm
===================================================================
--- gnucash/trunk/src/gnome/gw-gnc-spec.scm	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/gnome/gw-gnc-spec.scm	2005-11-29 03:53:42 UTC (rev 12065)
@@ -160,25 +160,6 @@
 
   (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
    '<gw:void>
    "gnc_progress_dialog_set_cancel_scm_func"
@@ -193,7 +174,7 @@
    '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

Modified: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c	2005-11-29 03:53:42 UTC (rev 12065)
@@ -640,8 +640,7 @@
 
   /* 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 @@
     /* 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);

Modified: gnucash/trunk/src/import-export/qif-import/qif-file.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-file.scm	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/import-export/qif-import/qif-file.scm	2005-11-29 03:53:42 UTC (rev 12065)
@@ -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...

Modified: gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm	2005-11-29 03:53:42 UTC (rev 12065)
@@ -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))

Modified: gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm	2005-11-29 03:28:11 UTC (rev 12064)
+++ gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm	2005-11-29 03:53:42 UTC (rev 12065)
@@ -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 



More information about the gnucash-changes mailing list