Merge branch 'maint'

This commit is contained in:
John Ralls 2016-12-06 16:26:25 -08:00
commit 1f30e2dacb
5 changed files with 55 additions and 19 deletions

View File

@ -1913,7 +1913,7 @@ AC_CONFIG_FILES([src/gnc-module/test/test-scm-multi],
AC_CONFIG_FILES([src/gnome-utils/test/test-load-module], AC_CONFIG_FILES([src/gnome-utils/test/test-load-module],
[chmod +x src/gnome-utils/test/test-load-module]) [chmod +x src/gnome-utils/test/test-load-module])
AC_CONFIG_FILES([src/report/locale-specific/us/test/test-load-module], AC_CONFIG_FILES([src/report/locale-specific/us/test/test-load-module],
[src/report/locale-specific/us/test/test-load-module]) [chmod +x src/report/locale-specific/us/test/test-load-module])
AC_CONFIG_FILES([src/report/report-gnome/test/test-load-module], AC_CONFIG_FILES([src/report/report-gnome/test/test-load-module],
[chmod +x src/report/report-gnome/test/test-load-module]) [chmod +x src/report/report-gnome/test/test-load-module])
AC_CONFIG_FILES([src/report/report-system/test/test-load-module], AC_CONFIG_FILES([src/report/report-system/test/test-load-module],

View File

@ -1177,6 +1177,8 @@ static gint
gnc_dense_cal_button_press(GtkWidget *widget, gnc_dense_cal_button_press(GtkWidget *widget,
GdkEventButton *evt) GdkEventButton *evt)
{ {
GdkScreen *screen = gdk_screen_get_default ();
GtkAllocation alloc;
gint doc; gint doc;
GncDenseCal *dcal = GNC_DENSE_CAL(widget); GncDenseCal *dcal = GNC_DENSE_CAL(widget);
@ -1191,15 +1193,21 @@ gnc_dense_cal_button_press(GtkWidget *widget,
// second move after show_all'ing the window should do the // second move after show_all'ing the window should do the
// trick with a bit of flicker. // trick with a bit of flicker.
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root + 5, evt->y_root + 5); gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root + 5, evt->y_root + 5);
gtk_widget_get_allocation(GTK_WIDGET(dcal->transPopup), &alloc);
populate_hover_window(dcal, doc); populate_hover_window(dcal, doc);
gtk_widget_queue_resize(GTK_WIDGET(dcal->transPopup)); gtk_widget_queue_resize(GTK_WIDGET(dcal->transPopup));
gtk_widget_show_all(GTK_WIDGET(dcal->transPopup)); gtk_widget_show_all(GTK_WIDGET(dcal->transPopup));
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root + 5, evt->y_root + 5);
if ((evt->x_root + 5 + alloc.width > gdk_screen_get_width(screen))||
(evt->y_root + 5 + alloc.height > gdk_screen_get_height(screen)))
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root - 2 - alloc.width, evt->y_root - 2 - alloc.height);
else
gtk_window_move(GTK_WINDOW(dcal->transPopup), evt->x_root + 5, evt->y_root + 5);
} }
else else
{
gtk_widget_hide(GTK_WIDGET(dcal->transPopup)); gtk_widget_hide(GTK_WIDGET(dcal->transPopup));
}
return FALSE; return FALSE;
} }
@ -1207,35 +1215,39 @@ static gint
gnc_dense_cal_motion_notify(GtkWidget *widget, gnc_dense_cal_motion_notify(GtkWidget *widget,
GdkEventMotion *event) GdkEventMotion *event)
{ {
GdkScreen *screen = gdk_screen_get_default ();
GncDenseCal *dcal; GncDenseCal *dcal;
GtkAllocation alloc;
gint doc; gint doc;
int unused; int unused;
int x_root_offset, y_root_offset;
GdkModifierType unused2; GdkModifierType unused2;
dcal = GNC_DENSE_CAL(widget); dcal = GNC_DENSE_CAL(widget);
if (!dcal->showPopup) if (!dcal->showPopup)
return FALSE; return FALSE;
x_root_offset = event->x_root;
y_root_offset = event->y_root;
/* As per http://www.gtk.org/tutorial/sec-eventhandling.html */ /* As per http://www.gtk.org/tutorial/sec-eventhandling.html */
if (event->is_hint) if (event->is_hint)
gdk_window_get_pointer(event->window, &unused, &unused, &unused2); gdk_window_get_pointer(event->window, &unused, &unused, &unused2);
gdk_window_move(gtk_widget_get_window (GTK_WIDGET(dcal->transPopup)),
x_root_offset + 5, y_root_offset + 5);
doc = wheres_this(dcal, event->x, event->y); doc = wheres_this(dcal, event->x, event->y);
if (doc >= 0) if (doc >= 0)
{ {
populate_hover_window(dcal, doc); populate_hover_window(dcal, doc);
gtk_widget_queue_resize(GTK_WIDGET(dcal->transPopup)); gtk_widget_queue_resize(GTK_WIDGET(dcal->transPopup));
gtk_widget_get_allocation(GTK_WIDGET(dcal->transPopup), &alloc);
gtk_widget_show_all(GTK_WIDGET(dcal->transPopup)); gtk_widget_show_all(GTK_WIDGET(dcal->transPopup));
if ((event->x_root + 5 + alloc.width > gdk_screen_get_width(screen))||
(event->y_root + 5 + alloc.height > gdk_screen_get_height(screen)))
gtk_window_move(GTK_WINDOW(dcal->transPopup), event->x_root - 2 - alloc.width, event->y_root - 2 - alloc.height);
else
gtk_window_move(GTK_WINDOW(dcal->transPopup), event->x_root + 5, event->y_root + 5);
} }
else else
{
gtk_widget_hide(GTK_WIDGET(dcal->transPopup)); gtk_widget_hide(GTK_WIDGET(dcal->transPopup));
}
return TRUE; return TRUE;
} }

View File

@ -1703,7 +1703,7 @@ gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
SCM parse_results = scm_c_eval_string("qif-file:parse-fields-results"); SCM parse_results = scm_c_eval_string("qif-file:parse-fields-results");
SCM scm_qiffile; SCM scm_qiffile;
SCM imported_files = SCM_EOL; SCM imported_files = SCM_EOL;
SCM load_return, parse_return; SCM load_return = SCM_BOOL_F, parse_return = SCM_BOOL_F;
SCM progress; SCM progress;
/* Raise the busy flag so the assistant can't be canceled unexpectedly. */ /* Raise the busy flag so the assistant can't be canceled unexpectedly. */
@ -1809,11 +1809,15 @@ gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
*/ */
/* This step will fill the remainder of the bar. */ /* This step will fill the remainder of the bar. */
gnc_progress_dialog_push(wind->load_progress, 1); if (!wind->load_stop)
parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress); {
gnc_progress_dialog_pop(wind->load_progress); gnc_progress_dialog_push(wind->load_progress, 1);
wind->ask_date_format = FALSE; parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files),
wind->date_format = NULL; progress);
gnc_progress_dialog_pop(wind->load_progress);
wind->ask_date_format = FALSE;
wind->date_format = NULL;
}
if (parse_return == SCM_BOOL_T) if (parse_return == SCM_BOOL_T)
{ {
/* Canceled by the user. */ /* Canceled by the user. */

View File

@ -96,6 +96,25 @@
(string-append str "\n" (_ "Read aborted."))) (string-append str "\n" (_ "Read aborted.")))
(set! abort-read #t))) (set! abort-read #t)))
(define (strip-bom)
(let ((c1 (read-char)))
(if (char=? c1 (integer->char #xEF))
(let ((c2 (read-char)))
(if (char=? c2 (integer->char #xBB))
(let ((c3 (read-char)))
(if (char=? c3 (integer->char #xBF)) #t
(begin
(unread-char c3)
(unread-char c2)
(unread-char c1)
#f)))
(begin
(unread-char c2)
(unread-char c1)
#f)))
(begin
(unread-char c1)
#f))))
(qif-file:set-path! self path) (qif-file:set-path! self path)
(if (not (access? path R_OK)) (if (not (access? path R_OK))
@ -112,6 +131,7 @@
(with-input-from-file path (with-input-from-file path
(lambda () (lambda ()
(strip-bom)
;; loop over lines ;; loop over lines
(let line-loop () (let line-loop ()
(set! line (read-delimited delimiters)) (set! line (read-delimited delimiters))

View File

@ -159,7 +159,7 @@
;;./share/gnucash/scm/gnucash/report/balsheet-eg.eguile.scm:<html> ;;./share/gnucash/scm/gnucash/report/balsheet-eg.eguile.scm:<html>
;; Validate against HTML4 Transitional: ;; Validate against HTML4 Transitional:
(push "<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN\" \n\"http://www.w3.org/TR/html4/loose.dtd\">") (push "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \n\"http://www.w3.org/TR/html4/loose.dtd\">")
(push "<head>\n") (push "<head>\n")
(push "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n") (push "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n")
(if css? (if css?