mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge Bob Fewell's assorted GUI fixups PR 310 into unstable.
Although the PR was titled "Some [fixes] for missing transient parent warnings", it actually has a bugfix and an assorted collection of GUI cleanups that happen to include a couple of transient-parent fixes.
This commit is contained in:
commit
1f7edb23f6
@ -132,12 +132,14 @@ gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unus
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( g_file_test( g_filename_from_uri( url, NULL, NULL ),
|
||||
G_FILE_TEST_IS_DIR ))
|
||||
if (g_str_has_prefix (url, "file://"))
|
||||
{
|
||||
gtk_file_chooser_set_current_folder_uri( faw->fileChooser, url );
|
||||
return;
|
||||
if ( g_file_test( g_filename_from_uri( url, NULL, NULL ),
|
||||
G_FILE_TEST_IS_DIR ))
|
||||
{
|
||||
gtk_file_chooser_set_current_folder_uri( faw->fileChooser, url );
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( faw->type == FILE_ACCESS_OPEN )
|
||||
{
|
||||
|
@ -1271,10 +1271,6 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
|
||||
// Set the style context for this assistant so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncAssistAccountHierarchy");
|
||||
|
||||
/* If we have a callback, make this window stay on top */
|
||||
if (when_completed != NULL)
|
||||
gtk_window_set_keep_above (GTK_WINDOW(data->dialog), TRUE);
|
||||
|
||||
/* Enable buttons on first and last page. */
|
||||
gtk_assistant_set_page_complete (GTK_ASSISTANT (dialog),
|
||||
GTK_WIDGET(gtk_builder_get_object(builder, "intro_page_label")),
|
||||
@ -1331,6 +1327,7 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
|
||||
|
||||
data->when_completed = when_completed;
|
||||
data->use_defaults = use_defaults;
|
||||
gtk_widget_show_all (dialog);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,18 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
||||
/* function to open a qif import assistant */
|
||||
static void (*qifImportAssistantFcn)(void) = NULL;
|
||||
|
||||
static void gnc_ui_new_user_cancel_dialog (void);
|
||||
struct _GNCNewUserDialog
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
GtkWidget *new_accounts_button;
|
||||
GtkWidget *import_qif_button;
|
||||
GtkWidget *tutorial_button;
|
||||
gboolean ok_pressed;
|
||||
};
|
||||
|
||||
static void
|
||||
gnc_ui_new_user_cancel_dialog (GtkWindow *parent);
|
||||
|
||||
void
|
||||
gnc_new_user_dialog_register_qif_assistant (void (*cb_fcn)(void))
|
||||
@ -70,71 +81,106 @@ after_hierarchy_assistant(void)
|
||||
gnc_ui_file_access_for_save_as (gnc_ui_get_main_window (NULL));
|
||||
}
|
||||
|
||||
void
|
||||
gnc_ui_new_user_dialog (void)
|
||||
static void
|
||||
gnc_ui_new_user_cancel_cb (GtkWidget * widget, gpointer data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *new_accounts_button;
|
||||
GtkWidget *import_qif_button;
|
||||
GtkWidget *tutorial_button;
|
||||
GtkBuilder *builder;
|
||||
GNCNewUserDialog *new_user = data;
|
||||
|
||||
g_return_if_fail(new_user);
|
||||
gtk_widget_destroy (new_user->window);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_new_user_destroy_cb (GtkWidget * widget, gpointer data)
|
||||
{
|
||||
GNCNewUserDialog *new_user = data;
|
||||
|
||||
g_return_if_fail(new_user);
|
||||
if (new_user->ok_pressed == FALSE)
|
||||
gnc_ui_new_user_cancel_dialog (GTK_WINDOW(new_user->window));
|
||||
|
||||
g_free (new_user);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_new_user_ok_cb (GtkWidget * widget, gpointer data)
|
||||
{
|
||||
GNCNewUserDialog *new_user = data;
|
||||
|
||||
g_return_if_fail(new_user);
|
||||
new_user->ok_pressed = TRUE;
|
||||
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_user->new_accounts_button)))
|
||||
{
|
||||
gnc_ui_hierarchy_assistant_with_callback(TRUE, after_hierarchy_assistant);
|
||||
}
|
||||
else if ((qifImportAssistantFcn != NULL)
|
||||
&& gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_user->import_qif_button)))
|
||||
{
|
||||
qifImportAssistantFcn();
|
||||
gncp_new_user_finish ();
|
||||
}
|
||||
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_user->tutorial_button)))
|
||||
{
|
||||
gnc_gnome_help (HF_GUIDE, NULL);
|
||||
gncp_new_user_finish ();
|
||||
}
|
||||
gtk_widget_destroy (new_user->window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gnc_ui_new_user_window_present (GtkWindow *window)
|
||||
{
|
||||
gtk_window_present (GTK_WINDOW(window));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_new_user_dialog_create (GNCNewUserDialog *new_user)
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *button;
|
||||
gint result;
|
||||
|
||||
ENTER(" ");
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-new-user.glade", "new_user_dialog");
|
||||
gnc_builder_add_from_file (builder, "dialog-new-user.glade", "new_user_window");
|
||||
new_user->window = GTK_WIDGET(gtk_builder_get_object (builder, "new_user_window"));
|
||||
|
||||
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "new_user_dialog"));
|
||||
gtk_window_set_keep_above (GTK_WINDOW(new_user->window), TRUE);
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncNewUserDialog");
|
||||
gnc_widget_set_style_context (GTK_WIDGET(new_user->window), "GncNewUserDialog");
|
||||
|
||||
new_accounts_button = GTK_WIDGET(gtk_builder_get_object (builder, "new_accounts_button"));
|
||||
import_qif_button = GTK_WIDGET(gtk_builder_get_object (builder, "import_qif_button"));
|
||||
tutorial_button = GTK_WIDGET(gtk_builder_get_object (builder, "tutorial_button"));
|
||||
new_user->new_accounts_button = GTK_WIDGET(gtk_builder_get_object (builder, "new_accounts_button"));
|
||||
new_user->import_qif_button = GTK_WIDGET(gtk_builder_get_object (builder, "import_qif_button"));
|
||||
new_user->tutorial_button = GTK_WIDGET(gtk_builder_get_object (builder, "tutorial_button"));
|
||||
|
||||
/* Set the sensitivity of the qif-import button based on the availability
|
||||
* of the qif-import assistant.
|
||||
*/
|
||||
gtk_widget_set_sensitive (import_qif_button, (qifImportAssistantFcn != NULL));
|
||||
gtk_widget_set_sensitive (new_user->import_qif_button, (qifImportAssistantFcn != NULL));
|
||||
|
||||
result = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
switch (result)
|
||||
{
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
gnc_ui_new_user_cancel_dialog ();
|
||||
break;
|
||||
case GTK_RESPONSE_OK:
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_accounts_button)))
|
||||
{
|
||||
gnc_ui_hierarchy_assistant_with_callback(TRUE, after_hierarchy_assistant);
|
||||
}
|
||||
else if ((qifImportAssistantFcn != NULL)
|
||||
&& gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (import_qif_button)))
|
||||
{
|
||||
qifImportAssistantFcn();
|
||||
gncp_new_user_finish ();
|
||||
}
|
||||
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tutorial_button)))
|
||||
{
|
||||
gnc_gnome_help (HF_GUIDE, NULL);
|
||||
gncp_new_user_finish ();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_print ("DEBUG: Response: %d", result);
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
g_signal_connect(G_OBJECT(new_user->window), "destroy",
|
||||
G_CALLBACK(gnc_ui_new_user_destroy_cb), new_user);
|
||||
|
||||
button = GTK_WIDGET(gtk_builder_get_object (builder, "ok_but"));
|
||||
g_signal_connect(button, "clicked", G_CALLBACK(gnc_ui_new_user_ok_cb), new_user);
|
||||
|
||||
button = GTK_WIDGET(gtk_builder_get_object (builder, "cancel_but"));
|
||||
g_signal_connect(button, "clicked", G_CALLBACK(gnc_ui_new_user_cancel_cb), new_user);
|
||||
|
||||
new_user->ok_pressed = FALSE;
|
||||
|
||||
g_idle_add ((GSourceFunc)gnc_ui_new_user_window_present, GTK_WINDOW(new_user->window));
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
gtk_widget_destroy (dialog);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_new_user_cancel_dialog (void)
|
||||
gnc_ui_new_user_cancel_dialog (GtkWindow *parent)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkBuilder *builder;
|
||||
@ -146,6 +192,8 @@ gnc_ui_new_user_cancel_dialog (void)
|
||||
|
||||
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "new_user_cancel_dialog"));
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
|
||||
|
||||
result = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
keepshowing = (result == GTK_RESPONSE_YES);
|
||||
|
||||
@ -161,3 +209,14 @@ gncp_new_user_finish (void)
|
||||
{
|
||||
gnc_hook_run(HOOK_BOOK_OPENED, gnc_get_current_session());
|
||||
}
|
||||
|
||||
void
|
||||
gnc_ui_new_user_dialog (void)
|
||||
{
|
||||
GNCNewUserDialog *new_user;
|
||||
|
||||
new_user = g_new0(GNCNewUserDialog, 1);
|
||||
gnc_ui_new_user_dialog_create (new_user);
|
||||
gtk_widget_show (new_user->window);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#define GNC_PREFS_GROUP_NEW_USER "dialogs.new-user"
|
||||
#define GNC_PREF_FIRST_STARTUP "first-startup"
|
||||
|
||||
typedef struct _GNCNewUserDialog GNCNewUserDialog;
|
||||
|
||||
void gnc_ui_new_user_dialog (void);
|
||||
void gnc_set_first_startup (gboolean first_startup);
|
||||
|
||||
|
@ -354,9 +354,6 @@ Cancel to abort.</property>
|
||||
<object class="GtkBox" id="assistant-action_area2">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -1114,9 +1114,6 @@ Cancel to abort.</b></property>
|
||||
<object class="GtkBox">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -1196,9 +1196,6 @@ More information can be displayed by using the help button.</property>
|
||||
<object class="GtkBox" id="assistant-action_area2">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -3,9 +3,10 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkAssistant" id="hierarchy_assistant">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">400</property>
|
||||
<property name="default_height">550</property>
|
||||
<signal name="cancel" handler="on_cancel" swapped="no"/>
|
||||
<signal name="close" handler="on_finish" swapped="no"/>
|
||||
@ -133,7 +134,7 @@ Select categories that correspond to the ways that you foresee you will use GnuC
|
||||
<object class="GtkPaned" id="hpaned100">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="position">650</property>
|
||||
<property name="position">300</property>
|
||||
<property name="position_set">True</property>
|
||||
<child>
|
||||
<object class="GtkPaned" id="vpaned100">
|
||||
|
@ -3,7 +3,6 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkAssistant" id="stock_split_assistant">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="border_width">12</property>
|
||||
|
@ -170,9 +170,6 @@
|
||||
<object class="GtkBox" id="assistant-action_area2">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="has_padding">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkDialog" id="encodings_dialog">
|
||||
|
@ -136,7 +136,6 @@
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkDialog" id="qif_import_account_picker_dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Select Account</property>
|
||||
<property name="default_width">300</property>
|
||||
@ -258,5 +257,10 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="1">newbutton</action-widget>
|
||||
<action-widget response="-6">cancelbutton</action-widget>
|
||||
<action-widget response="-5">okbutton</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<!-- Generated with glade 3.20.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.10"/>
|
||||
<object class="GtkDialog" id="new_user_cancel_dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="resizable">False</property>
|
||||
@ -125,26 +124,22 @@
|
||||
<action-widget response="-9">no_but</action-widget>
|
||||
<action-widget response="-8">yes_but</action-widget>
|
||||
</action-widgets>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkDialog" id="new_user_dialog">
|
||||
<object class="GtkWindow" id="new_user_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="vbox1">
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">14</property>
|
||||
<child internal-child="action_area">
|
||||
<child>
|
||||
<object class="GtkButtonBox" id="hbbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
@ -210,7 +205,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><span size="larger" weight="bold">Welcome to GnuCash!</span></property>
|
||||
@ -222,7 +217,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox2">
|
||||
<object class="GtkBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
@ -230,7 +225,7 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">There are some predefined actions available that most new users prefer to get started with GnuCash. Select one of these actions from below and click the <i>OK</i> button or press the <i>Cancel</i> button if you don't want to perform any of them.</property>
|
||||
@ -250,10 +245,10 @@
|
||||
<property name="label" translatable="yes">C_reate a new set of accounts</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
@ -314,9 +309,8 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">cancel_but</action-widget>
|
||||
<action-widget response="-5">ok_but</action-widget>
|
||||
</action-widgets>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -641,7 +641,8 @@ CsvImpTransAssist::CsvImpTransAssist ()
|
||||
Note, this will call g_new0 internally. The returned object is g_freed again
|
||||
either directly by the main matcher or in our assistant_finish code of the matcher
|
||||
is never reached. */
|
||||
gnc_csv_importer_gui = gnc_gen_trans_assist_new (match_page, nullptr, false, 42);
|
||||
gnc_csv_importer_gui = gnc_gen_trans_assist_new (GTK_WIDGET(csv_imp_asst),
|
||||
match_page, nullptr, false, 42);
|
||||
|
||||
/* Summary Page */
|
||||
summary_page = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
|
||||
@ -1786,7 +1787,7 @@ CsvImpTransAssist::acct_match_select(GtkTreeModel *model, GtkTreeIter* iter)
|
||||
MAPPING_ACCOUNT, &account, -1);
|
||||
|
||||
auto acct_name = csv_tximp_acct_match_text_parse (text);
|
||||
auto gnc_acc = gnc_import_select_account (nullptr, nullptr, true,
|
||||
auto gnc_acc = gnc_import_select_account (GTK_WIDGET(csv_imp_asst), nullptr, true,
|
||||
acct_name.c_str(), nullptr, ACCT_TYPE_NONE, account, nullptr);
|
||||
|
||||
if (gnc_acc) // We may have canceled
|
||||
|
@ -56,8 +56,7 @@
|
||||
|
||||
struct _main_matcher_info
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *assistant;
|
||||
GtkWidget *main_widget;
|
||||
GtkTreeView *view;
|
||||
GNCImportSettings *user_settings;
|
||||
int selected_row;
|
||||
@ -130,12 +129,11 @@ void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
|
||||
while (gtk_tree_model_iter_next (model, &iter));
|
||||
}
|
||||
|
||||
|
||||
if (!(info->dialog == NULL))
|
||||
if (GTK_IS_DIALOG(info->main_widget))
|
||||
{
|
||||
gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->dialog));
|
||||
gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->main_widget));
|
||||
gnc_import_Settings_delete (info->user_settings);
|
||||
gtk_widget_destroy (GTK_WIDGET (info->dialog));
|
||||
gtk_widget_destroy (GTK_WIDGET (info->main_widget));
|
||||
}
|
||||
else
|
||||
gnc_import_Settings_delete (info->user_settings);
|
||||
@ -236,7 +234,7 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
|
||||
|
||||
help_dialog = GTK_WIDGET(gtk_builder_get_object (builder, "matcher_help_dialog"));
|
||||
gtk_window_set_transient_for(GTK_WINDOW(help_dialog),
|
||||
GTK_WINDOW(info->dialog));
|
||||
GTK_WINDOW(info->main_widget));
|
||||
|
||||
/* Connect the signals */
|
||||
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, help_dialog);
|
||||
@ -260,7 +258,8 @@ run_account_picker_dialog (GNCImportMainMatcher *info,
|
||||
gboolean ok_pressed;
|
||||
g_assert (trans_info);
|
||||
old_acc = gnc_import_TransInfo_get_destacc (trans_info);
|
||||
new_acc = gnc_import_select_account(info->dialog,
|
||||
|
||||
new_acc = gnc_import_select_account(info->main_widget,
|
||||
NULL,
|
||||
TRUE,
|
||||
_("Destination account for the auto-balance split."),
|
||||
@ -276,7 +275,8 @@ static void
|
||||
run_match_dialog (GNCImportMainMatcher *info,
|
||||
GNCImportTransInfo *trans_info)
|
||||
{
|
||||
gnc_import_match_picker_run_and_close (trans_info, info->pending_matches);
|
||||
gnc_import_match_picker_run_and_close (info->main_widget,
|
||||
trans_info, info->pending_matches);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -472,7 +472,7 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info,
|
||||
/* Add the columns *
|
||||
* (keep the line break below to avoid a translator comment) */
|
||||
add_text_column(view,
|
||||
_("Date"), DOWNLOADED_COL_DATE);
|
||||
_("Date"), DOWNLOADED_COL_DATE);
|
||||
column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT);
|
||||
gtk_tree_view_column_set_visible(column, show_account);
|
||||
add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT);
|
||||
@ -550,8 +550,8 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "transaction_matcher_dialog");
|
||||
gnc_builder_add_from_file (builder, "dialog-import.glade", "transaction_matcher_content");
|
||||
info->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_dialog"));
|
||||
g_assert (info->dialog != NULL);
|
||||
info->main_widget = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_dialog"));
|
||||
g_assert (info->main_widget != NULL);
|
||||
|
||||
/* Pack the content into the dialog vbox */
|
||||
pbox = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_vbox"));
|
||||
@ -568,13 +568,13 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
|
||||
g_assert (heading_label != NULL);
|
||||
|
||||
if (parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (info->dialog), GTK_WINDOW (parent));
|
||||
gtk_window_set_transient_for (GTK_WINDOW (info->main_widget), GTK_WINDOW (parent));
|
||||
|
||||
if (heading)
|
||||
gtk_label_set_text (GTK_LABEL (heading_label), heading);
|
||||
|
||||
gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->dialog));
|
||||
gtk_widget_show_all (GTK_WIDGET (info->dialog));
|
||||
gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->main_widget));
|
||||
gtk_widget_show_all (GTK_WIDGET (info->main_widget));
|
||||
|
||||
info->transaction_processed_cb = NULL;
|
||||
|
||||
@ -591,9 +591,8 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
|
||||
*****************************************************************/
|
||||
|
||||
GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent,
|
||||
const gchar* heading,
|
||||
gboolean all_from_same_account,
|
||||
gint match_date_hardlimit)
|
||||
GtkWidget *assistant_page, const gchar* heading,
|
||||
gboolean all_from_same_account, gint match_date_hardlimit)
|
||||
{
|
||||
GNCImportMainMatcher *info;
|
||||
GtkBuilder *builder;
|
||||
@ -605,6 +604,7 @@ GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent,
|
||||
|
||||
info = g_new0 (GNCImportMainMatcher, 1);
|
||||
info->pending_matches = gnc_import_PendingMatches_new();
|
||||
info->main_widget = GTK_WIDGET(parent);
|
||||
|
||||
/* Initialize user Settings. */
|
||||
info->user_settings = gnc_import_Settings_new ();
|
||||
@ -623,7 +623,7 @@ GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent,
|
||||
}
|
||||
/* Pack content into Assistant page widget */
|
||||
box = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_content"));
|
||||
gtk_box_pack_start( GTK_BOX(parent), box, TRUE, TRUE, 6);
|
||||
gtk_box_pack_start (GTK_BOX(assistant_page), box, TRUE, TRUE, 6);
|
||||
|
||||
/* Get the view */
|
||||
info->view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "downloaded_view"));
|
||||
@ -669,7 +669,7 @@ gboolean gnc_gen_trans_list_run (GNCImportMainMatcher *info)
|
||||
gboolean result;
|
||||
|
||||
/* DEBUG("Begin"); */
|
||||
result = gtk_dialog_run (GTK_DIALOG (info->dialog));
|
||||
result = gtk_dialog_run (GTK_DIALOG (info->main_widget));
|
||||
/* DEBUG("Result was %d", result); */
|
||||
|
||||
/* No destroying here since the dialog was already destroyed through
|
||||
@ -962,7 +962,7 @@ void gnc_gen_trans_list_add_trans_with_ref_id(GNCImportMainMatcher *gui, Transac
|
||||
GtkWidget *gnc_gen_trans_list_widget (GNCImportMainMatcher *info)
|
||||
{
|
||||
g_assert(info);
|
||||
return info->dialog;
|
||||
return info->main_widget;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
@ -76,8 +76,10 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
|
||||
* transaction matcher will be packed into. The data structure
|
||||
* GNCImportMainMatcher is returned.
|
||||
*
|
||||
* @param parent The parent widget. This is the place the transaction
|
||||
* matcher will be packed into.
|
||||
* @param parent The parent widget
|
||||
*
|
||||
* @param assistant_page The parent widget. This is the place the
|
||||
* transaction matcher will be packed into.
|
||||
*
|
||||
* @param heading The heading label in the Importer window. May be NULL.
|
||||
*
|
||||
@ -98,9 +100,8 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
|
||||
* @return A pointer to the GNCImportMainMatcher which has been setup.
|
||||
*/
|
||||
GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent,
|
||||
const gchar* heading,
|
||||
gboolean all_from_same_account,
|
||||
gint match_date_hardlimit);
|
||||
GtkWidget *assistant_page, const gchar* heading,
|
||||
gboolean all_from_same_account, gint match_date_hardlimit);
|
||||
|
||||
|
||||
/** This starts the import process for transaction from an assistant.
|
||||
|
@ -449,7 +449,7 @@ gnc_import_match_picker_init_match_view (GNCImportMatchPicker * matcher)
|
||||
* -- GUI initialization for the Match_Picker Dialog
|
||||
\********************************************************************/
|
||||
static void
|
||||
init_match_picker_gui(GNCImportMatchPicker * matcher)
|
||||
init_match_picker_gui(GtkWidget *parent, GNCImportMatchPicker * matcher)
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
|
||||
@ -467,7 +467,9 @@ init_match_picker_gui(GNCImportMatchPicker * matcher)
|
||||
matcher->downloaded_view = (GtkTreeView *)GTK_WIDGET(gtk_builder_get_object (builder, "download_view"));
|
||||
matcher->match_view = (GtkTreeView *)GTK_WIDGET(gtk_builder_get_object (builder, "matched_view"));
|
||||
matcher->reconciled_chk = (GtkCheckButton *)GTK_WIDGET(gtk_builder_get_object(builder, "hide_reconciled_check1"));
|
||||
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (matcher->transaction_matcher), GTK_WINDOW(parent));
|
||||
|
||||
gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_DISPLAY_RECONCILED,
|
||||
matcher->reconciled_chk, "active");
|
||||
|
||||
@ -503,7 +505,7 @@ init_match_picker_gui(GNCImportMatchPicker * matcher)
|
||||
* return after the user clicked Ok, Cancel, or Window-Close.
|
||||
*/
|
||||
void
|
||||
gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info,
|
||||
gnc_import_match_picker_run_and_close (GtkWidget *parent, GNCImportTransInfo *transaction_info,
|
||||
GNCImportPendingMatches *pending_matches)
|
||||
{
|
||||
GNCImportMatchPicker *matcher;
|
||||
@ -519,7 +521,7 @@ gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info,
|
||||
matcher->pending_matches = pending_matches;
|
||||
|
||||
/* DEBUG("Init match_picker"); */
|
||||
init_match_picker_gui(matcher);
|
||||
init_match_picker_gui(parent, matcher);
|
||||
|
||||
/* Append this single transaction to the view and select it */
|
||||
downloaded_transaction_append(matcher, transaction_info);
|
||||
|
@ -48,10 +48,13 @@ typedef struct _transpickerdialog GNCImportMatchPicker;
|
||||
*
|
||||
* This function is used from the gnc-gen-transaction code.
|
||||
*
|
||||
* @param parent The parent widget
|
||||
* @param transaction_info The TransInfo for which the user is supposed to
|
||||
* pick a matching transaction. */
|
||||
* pick a matching transaction.
|
||||
* @param pending_matches List of transactions */
|
||||
void
|
||||
gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info,
|
||||
gnc_import_match_picker_run_and_close (GtkWidget *parent,
|
||||
GNCImportTransInfo *transaction_info,
|
||||
GNCImportPendingMatches *pending_matches);
|
||||
/**@}*/
|
||||
|
||||
|
@ -616,7 +616,7 @@ rematch_line(QIFImportWindow *wind, GtkTreeSelection *selection,
|
||||
map_entry = scm_list_ref(display_info, scm_from_int (row));
|
||||
|
||||
/* Call the account picker to update it. */
|
||||
if (!qif_account_picker_dialog(wind, map_entry))
|
||||
if (!qif_account_picker_dialog(GTK_WINDOW(wind->window), wind, map_entry))
|
||||
return;
|
||||
gnc_name = scm_call_1(get_gnc_name, map_entry);
|
||||
|
||||
|
@ -324,7 +324,7 @@ gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
|
||||
* If the clicks Cancel instead, FALSE is returned. Modal.
|
||||
****************************************************************/
|
||||
gboolean
|
||||
qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
|
||||
qif_account_picker_dialog(GtkWindow *parent, QIFImportWindow * qif_wind, SCM map_entry)
|
||||
{
|
||||
QIFAccountPickerDialog * wind;
|
||||
SCM gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
|
||||
@ -353,6 +353,8 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
|
||||
wind->treeview = GTK_TREE_VIEW(gtk_builder_get_object (builder, "account_tree"));
|
||||
wind->qif_wind = qif_wind;
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (wind->dialog), parent);
|
||||
|
||||
{
|
||||
GtkTreeStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "assistant-qif-import.h"
|
||||
|
||||
gboolean qif_account_picker_dialog(QIFImportWindow * wind, SCM initial_sel);
|
||||
gboolean qif_account_picker_dialog (GtkWindow *parent, QIFImportWindow * wind, SCM initial_sel);
|
||||
|
||||
typedef struct _accountpickerdialog QIFAccountPickerDialog;
|
||||
|
||||
|
@ -193,7 +193,8 @@ gnc_state_set_base (const QofSession *session)
|
||||
DEBUG("Clean up");
|
||||
g_free(sf_extension);
|
||||
g_free(original);
|
||||
g_key_file_free (key_file);
|
||||
if (key_file != NULL)
|
||||
g_key_file_free (key_file);
|
||||
|
||||
LEAVE ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user