Skip to content

Commit

Permalink
Merge Bob Fewell's 'gtk3-update12' into unstable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Dec 30, 2017
2 parents 5823f1b + 477e71b commit 0c6e2eb
Show file tree
Hide file tree
Showing 33 changed files with 146 additions and 91 deletions.
13 changes: 8 additions & 5 deletions gnucash/gnome-utils/dialog-preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ gnc_prefs_connect_one (const gchar *name,
* @return A pointer to the newly created dialog.
*/
static GtkWidget *
gnc_preferences_dialog_create(void)
gnc_preferences_dialog_create(GtkWindow *parent)
{
GtkBuilder *builder;
GtkWidget *dialog, *notebook, *label, *image;
Expand Down Expand Up @@ -1236,6 +1236,9 @@ gnc_preferences_dialog_create(void)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncPreferenceDialog");

/* parent */
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));

#ifndef REGISTER2_ENABLED
/* Hide preferences that are related to register2 */
box = GTK_WIDGET (gtk_builder_get_object (builder, "label14"));
Expand Down Expand Up @@ -1273,8 +1276,8 @@ gnc_preferences_dialog_create(void)
book = gnc_get_current_book();
g_date_clear (&fy_end, 1);
qof_instance_get (QOF_INSTANCE (book),
"fy-end", &fy_end,
NULL);
"fy-end", &fy_end,
NULL);
box = GTK_WIDGET(gtk_builder_get_object (builder,
"pref/" GNC_PREFS_GROUP_ACCT_SUMMARY "/" GNC_PREF_START_PERIOD));
period = gnc_period_select_new(TRUE);
Expand Down Expand Up @@ -1425,7 +1428,7 @@ close_handler (gpointer user_data)
* preferences dialog already exists it will be raised to the top of
* the window stack instead of creating a new dialog. */
void
gnc_preferences_dialog (void)
gnc_preferences_dialog (GtkWindow *parent)
{
GtkWidget *dialog;

Expand All @@ -1437,7 +1440,7 @@ gnc_preferences_dialog (void)
return;
}

dialog = gnc_preferences_dialog_create();
dialog = gnc_preferences_dialog_create(parent);

gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
gtk_widget_show(dialog);
Expand Down
4 changes: 3 additions & 1 deletion gnucash/gnome-utils/dialog-preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#ifndef GNC_DIALOG_PREFERENCES_H
#define GNC_DIALOG_PREFERENCES_H

#include <gtk/gtk.h>

/** This function adds a full page of preferences to the preferences
* dialog. When the dialog is created, the specified widget will be
* pulled from the specified glade file and added to the preferences
Expand Down Expand Up @@ -100,7 +102,7 @@ void gnc_preferences_add_to_page (const gchar *filename,
* the user. The preferences dialog is a singleton, so if a
* preferences dialog already exists it will be raised to the top of
* the window stack instead of creating a new dialog. */
void gnc_preferences_dialog (void);
void gnc_preferences_dialog (GtkWindow *parent);

#endif
/** @} */
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-icons.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ G_BEGIN_DECLS
#define GNC_ICON_PDF_EXPORT "gnc-gnome-pdf"

//FIXME: use own budget icons?
#define GNC_ICON_BUDGET "gnc-budget"
#define GNC_ICON_BUDGET "gnc-account"
#define GNC_ICON_NEW_BUDGET "gnc-account"
#define GNC_ICON_OPEN_BUDGET "gnc-account-open"
//#define GNC_ICON_CLOSE_BUDGET "gnc-close-account"
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/gnc-main-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -4199,7 +4199,7 @@ gnc_main_window_cmd_edit_paste (GtkAction *action, GncMainWindow *window)
static void
gnc_main_window_cmd_edit_preferences (GtkAction *action, GncMainWindow *window)
{
gnc_preferences_dialog ();
gnc_preferences_dialog (GTK_WINDOW(window));
}

static void
Expand Down
1 change: 1 addition & 0 deletions gnucash/gnome-utils/gtkbuilder/dialog-preferences.glade
Original file line number Diff line number Diff line change
Expand Up @@ -2837,6 +2837,7 @@ many months before the current month:</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">On high resolution screens reports tend to be hard to read. This option allows you to scale reports up by the set factor. For example setting this to 2.0 will display reports at twice their typical size.</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="adjustment">default_zoom_adj</property>
</object>
<packing>
Expand Down
6 changes: 5 additions & 1 deletion gnucash/gnome/dialog-fincalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ fincalc_init_commodity_gae (GNCAmountEdit *edit)
}

void
gnc_ui_fincalc_dialog_create(void)
gnc_ui_fincalc_dialog_create(GtkWindow *parent)
{
FinCalcDialog *fcd;
GtkWidget *button;
Expand All @@ -575,6 +575,10 @@ gnc_ui_fincalc_dialog_create(void)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(fcd->dialog), "GncFinCalcDialog");

/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW(fcd->dialog), GTK_WINDOW(parent));

gnc_register_gui_component (DIALOG_FINCALC_CM_CLASS,
NULL, close_handler, fcd);

Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/dialog-fincalc.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

typedef struct _FinCalcDialog FinCalcDialog;

void gnc_ui_fincalc_dialog_create(void);
void gnc_ui_fincalc_dialog_create(GtkWindow *parent);
void gnc_ui_fincalc_dialog_destroy(FinCalcDialog *fcd);

#endif
19 changes: 13 additions & 6 deletions gnucash/gnome/dialog-sx-editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ sxed_delete_event( GtkWidget *widget, GdkEvent *event, gpointer ud )
* Create the Schedule Editor Dialog *
************************************/
GncSxEditorDialog *
gnc_ui_scheduled_xaction_editor_dialog_create (SchedXaction *sx,
gboolean newSX)
gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
SchedXaction *sx, gboolean newSX)
{
GncSxEditorDialog *sxed;
GtkBuilder *builder;
Expand Down Expand Up @@ -1192,12 +1192,13 @@ gnc_ui_scheduled_xaction_editor_dialog_create (SchedXaction *sx,

// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(sxed->dialog), "GncSxEditorDialog");

gtk_window_set_transient_for (GTK_WINDOW (sxed->dialog), parent);

/* Setup the end-date GNC widget */
{
GtkWidget *endDateBox = GTK_WIDGET(gtk_builder_get_object (builder, "editor_end_date_box"));
sxed->endDateEntry = GNC_DATE_EDIT(gnc_date_edit_new (gnc_time (NULL),
FALSE, FALSE));
sxed->endDateEntry = GNC_DATE_EDIT(gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE));
gtk_widget_show(GTK_WIDGET(sxed->endDateEntry));
g_signal_connect( sxed->endDateEntry, "date-changed",
G_CALLBACK( sxed_excal_update_adapt_cb ), sxed );
Expand Down Expand Up @@ -1714,6 +1715,7 @@ typedef struct _acct_deletion_handler_data
{
GList *affected_sxes;
GtkWidget *dialog;
GtkWindow *parent;
} acct_deletion_handler_data;


Expand All @@ -1726,8 +1728,8 @@ _open_editors(GtkDialog *dialog, gint response_code, gpointer data)
GList *sx_iter;
for (sx_iter = adhd->affected_sxes; sx_iter; sx_iter = sx_iter->next)
{
gnc_ui_scheduled_xaction_editor_dialog_create((SchedXaction*)sx_iter->data,
FALSE);
gnc_ui_scheduled_xaction_editor_dialog_create(GTK_WINDOW(adhd->parent),
(SchedXaction*)sx_iter->data, FALSE);
}
}
g_list_free(adhd->affected_sxes);
Expand Down Expand Up @@ -1759,6 +1761,7 @@ _sx_engine_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_
acct_deletion_handler_data *data;
GtkBuilder *builder;
GtkWidget *dialog;
GtkWindow *parent;
GtkListStore *name_list;
GtkTreeView *list;
GtkTreeViewColumn *name_column;
Expand All @@ -1768,6 +1771,9 @@ _sx_engine_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_
gnc_builder_add_from_file (builder, "dialog-sx.glade", "account_deletion_dialog");

dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_deletion_dialog"));
parent = gnc_ui_get_main_window (NULL);

gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);

list = GTK_TREE_VIEW(gtk_builder_get_object (builder, "sx_list"));

Expand All @@ -1776,6 +1782,7 @@ _sx_engine_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_

data = (acct_deletion_handler_data*)g_new0(acct_deletion_handler_data, 1);
data->dialog = dialog;
data->parent = parent;
data->affected_sxes = affected_sxes;
name_list = gtk_list_store_new(1, G_TYPE_STRING);
for (sx_iter = affected_sxes; sx_iter != NULL; sx_iter = sx_iter->next)
Expand Down
5 changes: 3 additions & 2 deletions gnucash/gnome/dialog-sx-editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define DIALOG_SX_EDITOR_H

#include "SchedXaction.h"
#include <gtk/gtk.h>

#define DIALOG_SCHEDXACTION_CM_CLASS "dialog-scheduledtransactions"
#define DIALOG_SCHEDXACTION_EDITOR_CM_CLASS "dialog-scheduledtransaction-editor"
Expand All @@ -36,8 +37,8 @@

typedef struct _GncSxEditorDialog GncSxEditorDialog;

GncSxEditorDialog* gnc_ui_scheduled_xaction_editor_dialog_create(SchedXaction *sx,
gboolean newSX);
GncSxEditorDialog* gnc_ui_scheduled_xaction_editor_dialog_create(GtkWindow *parent,
SchedXaction *sx, gboolean newSX);

void gnc_ui_scheduled_xaction_editor_dialog_destroy(GncSxEditorDialog *sxd);

Expand Down
19 changes: 13 additions & 6 deletions gnucash/gnome/dialog-sx-editor2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,8 @@ sxed_delete_event (GtkWidget *widget, GdkEvent *event, gpointer ud)
* Create the Schedule Editor Dialog *
************************************/
GncSxEditorDialog2 *
gnc_ui_scheduled_xaction_editor_dialog_create2 (SchedXaction *sx,
gboolean newSX)
gnc_ui_scheduled_xaction_editor_dialog_create2 (GtkWindow *parent,
SchedXaction *sx, gboolean newSX)
{
GncSxEditorDialog2 *sxed;
GtkBuilder *builder;
Expand Down Expand Up @@ -1166,11 +1166,12 @@ gnc_ui_scheduled_xaction_editor_dialog_create2 (SchedXaction *sx,
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(sxed->dialog), "GncSxEditorDialog");

gtk_window_set_transient_for (GTK_WINDOW (sxed->dialog), parent);

/* Setup the end-date GNC widget */
{
GtkWidget *endDateBox = GTK_WIDGET(gtk_builder_get_object (builder, "editor_end_date_box"));
sxed->endDateEntry = GNC_DATE_EDIT (gnc_date_edit_new (gnc_time (NULL),
FALSE, FALSE));
sxed->endDateEntry = GNC_DATE_EDIT (gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE));
gtk_widget_show (GTK_WIDGET (sxed->endDateEntry));
g_signal_connect (sxed->endDateEntry, "date-changed",
G_CALLBACK (sxed_excal_update_adapt_cb), sxed);
Expand Down Expand Up @@ -1665,6 +1666,7 @@ typedef struct _acct_deletion_handler_data
{
GList *affected_sxes;
GtkWidget *dialog;
GtkWindow *parent;
} acct_deletion_handler_data;


Expand All @@ -1677,8 +1679,8 @@ _open_editors (GtkDialog *dialog, gint response_code, gpointer data)
GList *sx_iter;
for (sx_iter = adhd->affected_sxes; sx_iter; sx_iter = sx_iter->next)
{
gnc_ui_scheduled_xaction_editor_dialog_create2 ((SchedXaction*)sx_iter->data,
FALSE);
gnc_ui_scheduled_xaction_editor_dialog_create2 (GTK_WINDOW(adhd->parent),
(SchedXaction*)sx_iter->data, FALSE);
}
}
g_list_free (adhd->affected_sxes);
Expand Down Expand Up @@ -1710,6 +1712,7 @@ _sx_engine_event_handler (QofInstance *ent, QofEventId event_type, gpointer user
acct_deletion_handler_data *data;
GtkBuilder *builder;
GtkWidget *dialog;
GtkWindow *parent;
GtkListStore *name_list;
GtkTreeView *list;
GtkTreeViewColumn *name_column;
Expand All @@ -1719,6 +1722,9 @@ _sx_engine_event_handler (QofInstance *ent, QofEventId event_type, gpointer user
gnc_builder_add_from_file (builder, "dialog-sx.glade", "account_deletion_dialog");

dialog = GTK_WIDGET (gtk_builder_get_object (builder, "account_deletion_dialog"));
parent = gnc_ui_get_main_window (NULL);

gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);

list = GTK_TREE_VIEW (gtk_builder_get_object (builder, "sx_list"));

Expand All @@ -1727,6 +1733,7 @@ _sx_engine_event_handler (QofInstance *ent, QofEventId event_type, gpointer user

data = (acct_deletion_handler_data*)g_new0 (acct_deletion_handler_data, 1);
data->dialog = dialog;
data->parent = parent;
data->affected_sxes = affected_sxes;
name_list = gtk_list_store_new (1, G_TYPE_STRING);
for (sx_iter = affected_sxes; sx_iter != NULL; sx_iter = sx_iter->next)
Expand Down
4 changes: 2 additions & 2 deletions gnucash/gnome/dialog-sx-editor2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

typedef struct _GncSxEditorDialog2 GncSxEditorDialog2;

GncSxEditorDialog2* gnc_ui_scheduled_xaction_editor_dialog_create2 (SchedXaction *sx,
gboolean newSX);
GncSxEditorDialog2* gnc_ui_scheduled_xaction_editor_dialog_create2 (GtkWindow *parent,
SchedXaction *sx, gboolean newSX);

void gnc_ui_scheduled_xaction_editor_dialog_destroy2 (GncSxEditorDialog2 *sxd);

Expand Down
7 changes: 5 additions & 2 deletions gnucash/gnome/dialog-sx-from-trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ sxftd_advanced_clicked(SXFromTransInfo *sxfti)
context = g_main_context_default();
while (g_main_context_iteration(context, FALSE));

gnc_ui_scheduled_xaction_editor_dialog_create(sxfti->sx, TRUE /* newSX */);
gnc_ui_scheduled_xaction_editor_dialog_create(gnc_ui_get_main_window (sxfti->dialog),
sxfti->sx, TRUE /* newSX */);
/* close ourself, since advanced editing entails us, and there are sync
* issues otherwise. */
sxftd_close(sxfti, FALSE);
Expand Down Expand Up @@ -752,7 +753,7 @@ sxftd_update_excal_adapt( GObject *o, gpointer ud )
* Create the dialog *
********************/
void
gnc_sx_create_from_trans( Transaction *trans )
gnc_sx_create_from_trans( GtkWindow *parent, Transaction *trans )
{
#ifndef __MINGW32__
int errno;
Expand All @@ -771,6 +772,8 @@ gnc_sx_create_from_trans( Transaction *trans )
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncSxFromTransDialog");

gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);

sxfti->builder = builder;
sxfti->dialog = dialog;
sxfti->trans = trans;
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/dialog-sx-from-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@

#include "Transaction.h"

void gnc_sx_create_from_trans(Transaction *trans);
void gnc_sx_create_from_trans(GtkWindow *parent, Transaction *trans);

#endif
10 changes: 7 additions & 3 deletions gnucash/gnome/dialog-trans-assoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ get_trans_info (AssocDialog *assoc_dialog)
}

static void
gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
{
GtkWidget *dialog;
GtkBuilder *builder;
Expand All @@ -396,6 +396,10 @@ gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncTransAssocDialog");

/* parent */
if (parent != NULL)
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));

assoc_dialog->view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
path_head = GTK_WIDGET(gtk_builder_get_object (builder, "path-head"));

Expand Down Expand Up @@ -500,7 +504,7 @@ show_handler (const char *klass, gint component_id,
* Return: nothing *
\********************************************************************/
void
gnc_trans_assoc_dialog ()
gnc_trans_assoc_dialog (GtkWindow *parent)
{
AssocDialog *assoc_dialog;

Expand All @@ -512,7 +516,7 @@ gnc_trans_assoc_dialog ()
}
assoc_dialog = g_new0 (AssocDialog, 1);

gnc_assoc_dialog_create (assoc_dialog);
gnc_assoc_dialog_create (parent, assoc_dialog);

gnc_register_gui_component (DIALOG_ASSOC_CM_CLASS,
refresh_handler, close_handler,
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome/dialog-trans-assoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
#ifndef DIALOG_TRANS_ASSOC_H
#define DIALOG_TRANS_ASSOC_H

void gnc_trans_assoc_dialog (void);
void gnc_trans_assoc_dialog (GtkWindow *parent);

#endif
Loading

0 comments on commit 0c6e2eb

Please sign in to comment.