* src/FileDialog.c: update for api change

* src/gnome/window-report.c: update for api change

	* src/gnome/gnc-html.c: update for api change

	* src/gnome/window-main.c: update for api change

	* src/gnome/cursors.c (gnc_set_busy_cursor): add extra arg
	to determine whether to update cursor immediately

	* src/gnome/druid-qif-import.c: update for api change


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3874 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-04-01 11:59:46 +00:00
parent e660e1c1f5
commit 599b0acf54
8 changed files with 61 additions and 47 deletions

View File

@@ -1,5 +1,18 @@
2001-04-01 Dave Peticolas <dave@krondo.com>
* src/FileDialog.c: update for api change
* src/gnome/window-report.c: update for api change
* src/gnome/gnc-html.c: update for api change
* src/gnome/window-main.c: update for api change
* src/gnome/cursors.c (gnc_set_busy_cursor): add extra arg
to determine whether to update cursor immediately
* src/gnome/druid-qif-import.c: update for api change
* src/gnome/window-help.c: expand the top nodes initially
(gnc_help_show_topic): show the topic in the tree when it
can be found

View File

@@ -299,7 +299,7 @@ gncPostFileOpen (const char * filename)
gnc_engine_suspend_events ();
/* Change the mouse to a busy cursor */
gnc_set_busy_cursor (NULL);
gnc_set_busy_cursor (NULL, TRUE);
/* -------------- BEGIN CORE SESSION CODE ------------- */
/* -- this code is almost identical in FileOpen and FileSaveAs -- */
@@ -464,7 +464,7 @@ gncFileSave (void)
}
/* use the current session to save to file */
gnc_set_busy_cursor(NULL);
gnc_set_busy_cursor(NULL, TRUE);
gnc_book_save (book);
gnc_unset_busy_cursor(NULL);

View File

@@ -111,7 +111,7 @@ void gnc_ui_destroy_all_subwindows (void);
/* Changing the GUI Cursor ******************************************/
void gnc_set_busy_cursor(gncUIWidget w);
void gnc_set_busy_cursor(gncUIWidget w, gboolean update_now);
void gnc_unset_busy_cursor(gncUIWidget w);

View File

@@ -45,7 +45,7 @@ typedef enum
* Return: none *
\********************************************************************/
static void
gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type)
gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type, gboolean update_now)
{
GdkCursor *cursor = NULL;
@@ -57,7 +57,7 @@ gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type)
gdk_window_set_cursor (win, cursor);
if (type != GNC_CURSOR_NORMAL)
if (update_now && type != GNC_CURSOR_NORMAL)
{
while (gtk_events_pending ())
gtk_main_iteration ();
@@ -68,44 +68,35 @@ gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type)
}
static void
set_cursor_helper (gpointer window, gpointer data)
{
GtkWidget *widget;
int type;
if (!window)
{
return;
}
widget = GTK_WIDGET(window);
if (!widget->window)
return;
type = GPOINTER_TO_INT(data);
gnc_ui_set_cursor (widget->window, type);
}
/********************************************************************\
* gnc_set_busy_cursor *
* sets the cursor to the busy watch for the given window. *
* gnc_set_busy_cursor *
* sets the cursor to the busy watch for the given window. *
* if the window is null, sets the cursor for all toplevel windows*
* *
* Args: w - the widget over which to make cursor busy *
* Return: none *
* *
* Args: w - the widget over which to make cursor busy *
* update_now - if true the cursor will be changed when the *
* call returns. *
* Return: none *
\********************************************************************/
void
gnc_set_busy_cursor (GtkWidget *w)
gnc_set_busy_cursor (GtkWidget *w, gboolean update_now)
{
if (w != NULL)
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY);
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
else
g_list_foreach (gtk_container_get_toplevels (),
set_cursor_helper,
GINT_TO_POINTER (GNC_CURSOR_BUSY));
{
GList *node;
for (node = gtk_container_get_toplevels (); node; node = node->next)
{
w = GTK_WIDGET (node->data);
if (!w || !w->window)
continue;
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
}
}
}
@@ -121,11 +112,21 @@ void
gnc_unset_busy_cursor (GtkWidget *w)
{
if (w != NULL)
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL);
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
else
g_list_foreach (gtk_container_get_toplevels (),
set_cursor_helper,
GINT_TO_POINTER (GNC_CURSOR_NORMAL));
{
GList *node;
for (node = gtk_container_get_toplevels (); node; node = node->next)
{
w = GTK_WIDGET (node->data);
if (!w || !w->window)
continue;
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
}
}
}
/************************* END OF FILE ******************************\

View File

@@ -550,7 +550,7 @@ gnc_ui_qif_import_load_file_next_cb(GnomeDruidPage * page,
}
/* turn on the busy cursor */
gnc_set_busy_cursor(NULL);
gnc_set_busy_cursor(NULL, TRUE);
/* create the <qif-file> object */
scm_qiffile = gh_call0(make_qif_file);
@@ -1193,7 +1193,7 @@ gnc_ui_qif_import_convert(QIFImportWindow * wind) {
/* busy cursor */
gnc_suspend_gui_refresh ();
gnc_set_busy_cursor(NULL);
gnc_set_busy_cursor(NULL, TRUE);
/* get any changes to the imported stocks */
for(pageptr = wind->commodity_pages; pageptr; pageptr=pageptr->next) {
@@ -1239,7 +1239,7 @@ gnc_ui_qif_import_convert(QIFImportWindow * wind) {
scm_protect_object(wind->imported_account_group);
/* now detect duplicate transactions */
gnc_set_busy_cursor(NULL);
gnc_set_busy_cursor(NULL, TRUE);
retval = gh_call2(find_duplicates,
gh_eval_str("(gnc:get-current-group)"),
wind->imported_account_group);

View File

@@ -486,7 +486,7 @@ gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle) {
g_hash_table_insert(html->request_info, uri, handles);
if(need_request) {
gnc_set_busy_cursor (html->html);
gnc_set_busy_cursor (html->html, FALSE);
gnc_http_start_request(html->http, uri, gnc_html_http_request_cb,
(gpointer)html);
}

View File

@@ -1715,7 +1715,7 @@ gnc_report_in_main_window (int report_id) {
page_num = gtk_notebook_page_num(GTK_NOTEBOOK(mainwin->notebook), fr);
gtk_notebook_set_page(GTK_NOTEBOOK(mainwin->notebook), page_num);
gnc_set_busy_cursor (NULL);
gnc_set_busy_cursor (NULL, TRUE);
gnc_report_window_show_report(reptwin, report_id);
gnc_unset_busy_cursor (NULL);
}

View File

@@ -586,7 +586,7 @@ void
reportWindow(int report_id) {
gnc_report_window * win;
gnc_set_busy_cursor (NULL);
gnc_set_busy_cursor (NULL, TRUE);
win = gnc_report_window_new(NULL);
gnc_report_window_show_report(win, report_id);
gnc_unset_busy_cursor (NULL);
@@ -600,7 +600,7 @@ gnc_print_report (int report_id)
html = gnc_html_new ();
gnc_set_busy_cursor (NULL);
gnc_set_busy_cursor (NULL, TRUE);
location = g_strdup_printf("id=%d", report_id);
gnc_html_show_url(html, URL_TYPE_REPORT, location, NULL, FALSE);
g_free(location);