Windows 7 x32
windows binaries as supplied by http://corvus.eu.org/trojita-win-builds/.
I'm on a mobile LTE connection with my notebook and use Trojita.
Setting "Network Access" to "Expensive connection" is only remembered for the current sessions, as soon as I close and reopen trojita the default of "Free Access" is selected again.
I would expect that the setting is remembered after closing.
That makes sense. Do you think you could come up with a patch fixing this?
I can have a try.
Could you give a pointer where to start?
I'm fluent in C++ so a few class names should be sufficient.
Sorry for a late reply. These are great news. Look for usages of Common::SettingsNames::imapStartOffline. This bool should probably be extended to be a tri-state enum (reusing the int values of the actual Imap::Mailbox::NetworkPolicy should be OK). This requires a migration of the settings, to be done within Imap::migrateSettings.
The value of that pref is reused within ImapAccess.cpp, ImapAccess::doConnect where it controls an invokeMethod() for triggering an appropriate slot for actually propagating the policy.
Then you also need to remember the user's prefs. The NetworkWatcher.h should be extended with a signal informing about changes in the desired network policy (if you find the difference between effective and desired network policy confusing, doc patches are welcome as well). Then you just should listen to that signal (probably within ImapAccess) and update the on-disk prefs when user changes their mind. When this is done, the checkbox in the SettingsDialog.cpp/xxxPage.ui can be removed as it will be obsolete by that time.
Hope this is all. Oh, and patches are most welcome to be submitted through https://techbase.kde.org/Development/Gerrit .
Looking forward to your patch!
Git commit a760ac6fff3bba477c6716677afed7345eda34f6 by Jan Kundrát, on behalf of Toby Chen.
Committed on 16/12/2014 at 20:29.
Pushed by gerrit into branch 'master'.
Add support for remembering network state
M +2 -1 src/Common/SettingsNames.cpp
M +2 -2 src/Common/SettingsNames.h
M +1 -2 src/Gui/SettingsDialog.cpp
M +5 -28 src/Gui/SettingsImapPage.ui
M +2 -1 src/Gui/Window.cpp
M +18 -4 src/Imap/Model/ImapAccess.cpp
M +1 -0 src/Imap/Model/ImapAccess.h
M +3 -0 src/Imap/Model/NetworkWatcher.cpp
M +1 -0 src/Imap/Model/NetworkWatcher.h
M +7 -0 src/Imap/Model/Utils.cpp