After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742321 - "don't ask me again this session" remembers answer forever
"don't ask me again this session" remembers answer forever
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.6.4
Other Linux
: Normal normal
: ---
Assigned To: gnucash-general-maint
gnucash-general-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-04 14:07 UTC by Tim Waugh
Modified: 2018-06-29 23:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reset temporary prefs on application startup (848 bytes, patch)
2015-11-05 16:58 UTC, Bill Nottingam
committed Details | Review

Description Tim Waugh 2015-01-04 14:07:39 UTC
The "warnings.permanent" and "warnings.temporary" preferences are both backed by gsettings, and "warnings.temporary" is never cleared.

Steps to Reproduce:
1.Select a transaction in an account
2.Transaction->Delete Transaction
3.Select 'Remember the answer and don't ask me again this session.'
4.Click Delete Transaction
5.Close application and open it again
6.Select another transaction
7.Transaction->Delete Transaction

Actual results:
2: dialog appears:

Delete the current transaction?
[] Remember the answer and don't ask me again.
[] Remember the answer and don't ask me again this session.
[Cancel] [Delete Transaction]

7: no dialog is shown, transaction deleted

Expected results:
7: the dialog should appear again

Original report:
  https://bugzilla.redhat.com/show_bug.cgi?id=1178516
Comment 1 Bill Nottingam 2015-01-09 03:40:53 UTC
Absolutely, positively, completely untested patch. (Not even compile-tested!)

diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c
index 0328d99..c1c74d5 100644
--- a/src/bin/gnucash-bin.c
+++ b/src/bin/gnucash-bin.c
@@ -613,6 +613,8 @@ inner_main (void *closure, int argc, char **argv)
         gnc_destroy_splash_screen();
         gnc_ui_new_user_dialog();
     }
+    /* Ensure temporary preferences are temporary */
+    gnc_prefs_reset_group (GNC_PREFS_GROUP_WARNINGS_TEMP);
 
     gnc_destroy_splash_screen();
     gnc_main_window_show_all_windows();

(I suspect you could do some work around ensuring that saving the temporary prefs only saves to memory. But this is a much shorter patch.)
Comment 2 Bill Nottingam 2015-11-04 20:29:46 UTC
<poke>  Does the attached patch seem reasonable? I can include it in Fedora for smoke testing if people want.
Comment 3 John Ralls 2015-11-05 02:27:23 UTC
Bill, if you put a patch in a comment like that it's invisible in the tracker. Make a patch (instructions at http://wiki.gnucash.org/wiki/Git#Patches if you're not familiar with Git) and attach it to the bug. Make sure to check the "patch" checkbox so that it shows up on the open patches status page.

Whether this is the correct patch depends on what you think of as a session. In GnuCash code a session is a connection to a particular file or database, so one could argue that the reset belongs in qof_session_end(). Users might think otherwise, though, and prefer your choice, to reset it at the next startup of GnuCash.
Comment 4 Bill Nottingam 2015-11-05 16:58:28 UTC
Created attachment 314935 [details] [review]
Reset temporary prefs on application startup

Patch from above comment.
Comment 5 John Ralls 2015-11-05 17:40:29 UTC
Thanks.

No response to whether it's better in inner_main or qof_session_end?
Comment 6 Bill Nottingam 2015-11-05 18:15:58 UTC
From a user perspective, might defer to Tim who filed the original bug. It could go in either place... if it's in qof_session_end, then it won't get reset on any abnormal exit/kill of GnuCash, but that may not be a big need.

From a code standpoint, putting it in inner_main where the prefs themselves were initialized made sense to me in knowing that it's in the right context of the app where the prefs engine was initialized and working. I didn't look deeper at the control flow to find qof_session_end, and would defer to those more familiar with the code as to if the change would need to be any different if called from qof_session_end.
Comment 7 Tim Waugh 2015-11-05 22:40:56 UTC
I understood it to mean that my answer would stand until I closed the application. It didn't occur to me it could mean anything else.
Comment 8 Geert Janssens 2015-11-10 21:12:01 UTC
I'm fine with the interpretation of session as "until the next start of gnucash".

For most users that will be the same as "as long as the current book is open" as most users only have one book anyway.

Tested the patch and found it to work as advertised. I have applied it to the maint branch, so the fix will appear in upcoming 2.6.10.

Thanks a lot!
Comment 9 John Ralls 2018-06-29 23:37:20 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=742321. Please update any external references or bookmarks.