D28580: [Kleopatra] Fix size saving/restore

Andrey Legayev noreply at phabricator.kde.org
Sun Apr 5 00:02:25 BST 2020


andreylegayev created this revision.
andreylegayev added a project: KDE PIM: Kleopatra.
Herald added a project: KDE PIM.
Herald added a subscriber: kde-pim.
andreylegayev requested review of this revision.

REVISION SUMMARY
  Fixes applied:
  
  1. Make sure MainWindow destructor executed on app exit
  2. MainWindow: Remove standard KDE Session Manager methods - they work only in KDE login/logout and don't work in Windows
  3. MainWindow, SignEncrypt dialog, DecryptVerify dialog: Use custom save/read config methods based on helper functions from KWindowConfig
  4. Add check of QT_NO_SYSTEMTRAYICON in KleopatraApplication::~Private()
  
  New implementation works fine with KDE SM:
  
  - saved session load happens after custom readConfig() and overrides window settings with values from session
  - session save happens before custom writeConfig() and saves data to ~/.config/session/ - it doesn't impact writeConfig()
  
  This implementation works fine under Win10 on multi-monitor multi-dpi setup.
  Appropriate setting is loaded in case of display switch or main monitor switch.
  
  Example of config file which stores size for several resolutions:
  
    [SignEncryptFilesWizard]
    Height 1200=604
    Height 720=451
    Width 1280=458
    Width 1920=597
  
  Related bug reports:
  
  - https://dev.gnupg.org/T4819
  - https://bugreports.qt.io/browse/QTBUG-77385

TEST PLAN
  **MainWindow Size**
  
  1. Run kleopatra and resize main window
  2. Exit kleopatra via SysTrayIcon menu
  
  Check that configuration file - size should be saved to section "MainWindow"
  
  3. Change screen resolution, run Kleo and exit from it
  
  Check that configuration file - new size should be saved to section "MainWindow" in parallel to old one
  
  4. Change screen resolution to previous value, run Kleo - main window should be of size from configuration file
  
  **SignEncrypt and DecryptVerify dialogs**
  Try to use dialogs on different screen resolutions. Sizes saved on dialog window close.
  You should see several sizes in corresponding sections of configuration file.
  Size should be restored when you start dialog again.
  
  **KDE Sessions**
  
  1. Run Kleopatra
  2. Change main window size
  3. Logout
  4. Login
  
  Window size should be the same as before logout

REPOSITORY
  R168 Kleopatra

REVISION DETAIL
  https://phabricator.kde.org/D28580

AFFECTED FILES
  src/crypto/gui/decryptverifyfilesdialog.cpp
  src/crypto/gui/signencryptfileswizard.cpp
  src/crypto/gui/signencryptfileswizard.h
  src/kleopatraapplication.cpp
  src/mainwindow.cpp
  src/mainwindow.h

To: andreylegayev
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, ach, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200404/42984764/attachment.html>


More information about the kde-pim mailing list