Add multiselection info to help dialogue

This commit is contained in:
David Cousens 2019-06-29 13:42:36 +10:00
parent 0543a29012
commit 377b73d1aa
2 changed files with 79 additions and 36 deletions

View File

@ -740,6 +740,9 @@
<action-widget response="-5">ok_button1</action-widget>
</action-widgets>
</object>
<object class="GtkTextBuffer" id="textbuffer1">
<property name="text" translatable="yes">Multiple transaction rows may be selected and a transfer account assigned to all selected rows. Use Ctrl Left Click or Shift-Click to select multiple rows and then Right Click to select a transfer account. Only rows with "A" checked can be added to a selection.</property>
</object>
<object class="GtkTextBuffer" id="textbuffer2">
<property name="text" translatable="yes">This transaction probably requires your intervention or it will be imported unbalanced.</property>
</object>
@ -1095,6 +1098,35 @@
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow 36">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="textview6">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="pixels_above_lines">5</property>
<property name="pixels_below_lines">5</property>
<property name="editable">False</property>
<property name="wrap_mode">word</property>
<property name="left_margin">5</property>
<property name="right_margin">5</property>
<property name="cursor_visible">False</property>
<property name="buffer">textbuffer1</property>
<property name="accepts_tab">False</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
<property name="width">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
@ -1257,9 +1289,9 @@
</object>
</child>
<action-widgets>
<action-widget response="-11">matcher__help</action-widget>
<action-widget response="-6">matcher_cancel</action-widget>
<action-widget response="-5">matcher_ok</action-widget>
<action-widget response="-11">matcher__help</action-widget>
</action-widgets>
</object>
</interface>

View File

@ -99,26 +99,32 @@ void on_matcher_help_close_clicked (GtkButton *button, gpointer user_data);
/* Local prototypes */
static void gnc_gen_trans_assign_transfer_account (
GtkTreeView *treeview,
gboolean *first,
gboolean is_selection,
GtkTreePath *path,
Account **new_acc,
GNCImportMainMatcher *info);
GtkTreeView *treeview,
gboolean *first,
gboolean is_selection,
GtkTreePath *path,
Account **new_acc,
GNCImportMainMatcher *info);
static void gnc_gen_trans_assign_transfer_account_to_selection_cb (
GtkMenuItem *menuitem,
GNCImportMainMatcher *info);
static void gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onPopupMenu_cb (GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static void refresh_model_row (GNCImportMainMatcher *gui, GtkTreeModel *model,
GtkTreeIter *iter, GNCImportTransInfo *info);
GtkMenuItem *menuitem,
GNCImportMainMatcher *info);
static void gnc_gen_trans_view_popup_menu (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onButtonPressed_cb (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static gboolean gnc_gen_trans_onPopupMenu_cb (
GtkTreeView *treeview,
GdkEvent *event,
GNCImportMainMatcher *info);
static void refresh_model_row (
GNCImportMainMatcher *gui,
GtkTreeModel *model,
GtkTreeIter *iter,
GNCImportTransInfo *info);
/* end local prototypes */
void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
@ -233,6 +239,7 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer3");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer4");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer5");
gnc_builder_add_from_file (builder, "dialog-import.glade", "textbuffer1");
gnc_builder_add_from_file (builder, "dialog-import.glade", "matcher_help_dialog");
if (info->dark_theme == TRUE)
@ -277,14 +284,15 @@ run_account_picker_dialog (GNCImportMainMatcher *info,
g_assert (trans_info);
old_acc = gnc_import_TransInfo_get_destacc (trans_info);
new_acc = gnc_import_select_account (info->main_widget,
NULL,
TRUE,
_("Destination account for the auto-balance split."),
xaccTransGetCurrency (gnc_import_TransInfo_get_trans (trans_info)),
ACCT_TYPE_NONE,
old_acc,
&ok_pressed);
new_acc = gnc_import_select_account (
info->main_widget,
NULL,
TRUE,
_("Destination account for the auto-balance split."),
xaccTransGetCurrency (gnc_import_TransInfo_get_trans (trans_info)),
ACCT_TYPE_NONE,
old_acc,
&ok_pressed);
if (ok_pressed)
gnc_import_TransInfo_set_destacc (trans_info, new_acc, TRUE);
}
@ -445,8 +453,9 @@ gnc_gen_trans_assign_transfer_account (GtkTreeView *treeview,
}
static void
gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
GNCImportMainMatcher *info)
gnc_gen_trans_assign_transfer_account_to_selection_cb (
GtkMenuItem *menuitem,
GNCImportMainMatcher *info)
{
GtkTreeView *treeview;
GtkTreeSelection *selection;
@ -475,13 +484,15 @@ gnc_gen_trans_assign_transfer_account_to_selection_cb (GtkMenuItem *menuitem,
{
gchar *path_str = gtk_tree_path_to_string (l->data);
DEBUG("passing first = %s", first ? "true" : "false");
DEBUG("passing is_selection = %s", is_selection ? "true" : "false");
DEBUG("passing is_selection = %s",
is_selection ? "true" : "false");
DEBUG("passing path = %s", path_str);
g_free (path_str);
DEBUG("passing account value = %s",
gnc_account_get_full_name (assigned_account));
gnc_gen_trans_assign_transfer_account (treeview,
&first, is_selection, l->data, &assigned_account, info);
&first, is_selection, l->data,
&assigned_account, info);
DEBUG("returned value of account = %s",
gnc_account_get_full_name (assigned_account));
DEBUG("returned value of first = %s", first ? "true" : "false");
@ -556,7 +567,8 @@ gnc_gen_trans_view_popup_menu (GtkTreeView *treeview,
ENTER ("");
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label (_("Assign a transfer account."));
menuitem = gtk_menu_item_new_with_label (
_("Assign a transfer account to the selection."));
g_signal_connect (menuitem, "activate",
G_CALLBACK(
gnc_gen_trans_assign_transfer_account_to_selection_cb),
@ -598,7 +610,7 @@ gnc_gen_trans_onButtonPressed_cb (GtkTreeView *treeview,
selection = gtk_tree_view_get_selection (treeview);
if (gtk_tree_selection_count_selected_rows (selection) > 0)
{
gnc_gen_trans_view_popup_menu (treeview, event, info);
gnc_gen_trans_view_popup_menu (treeview, event, info);
}
LEAVE("return TRUE");
return TRUE;
@ -619,13 +631,12 @@ gnc_gen_trans_onPopupMenu_cb (GtkTreeView *treeview,
selection = gtk_tree_view_get_selection (treeview);
if (gtk_tree_selection_count_selected_rows (selection) > 0)
{
gnc_gen_trans_view_popup_menu (treeview, NULL, info);
gnc_gen_trans_view_popup_menu (treeview, NULL, info);
}
LEAVE ("");
return TRUE;
}
static GtkTreeViewColumn *
add_text_column(GtkTreeView *view, const gchar *title, int col_num)
{