[Bug 1042529] YaST submodule windows don't remember their size and position when opened as standalone programs
http://bugzilla.suse.com/show_bug.cgi?id=1042529 http://bugzilla.suse.com/show_bug.cgi?id=1042529#c2 Stefan Hundhammer <shundhammer@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(shundhammer@suse. | |com) | --- Comment #2 from Stefan Hundhammer <shundhammer@suse.com> --- We could use the window title as a handle to identify different main windows. Based on that, we would need to use QSettings (which is quite trivial) to store and retrieve window position and size for each of those main windows. http://doc.qt.io/qt-5/qsettings.html QSettings uses .ini file format, but in addition to the usual settings groups, you can use paths for each key. We could normalize the window title (replace all nonstandard characters that won't work for a key with "_", for example) and use that as a path component for settings keys, e.g. /main_win/my_window_title/pos /main_win/my_window_title/size There are very likely limitations that we would have to accept, such as all those values getting invalid when the system language changes because the UI only gets the translated window title (which would change in that case). Restoring both position and size when opening a window is quite trivial. Storing them would have to be done in that window's destructor which might depend on the lifetime of that window being as long as that module runs (which is always the case IMHO). When there are multiple main windows in the same module, however, it might get somewhat inconsistent. All in all I'd guess this is one day initial work and then one or two additional days for fiddling with fringe cases we'd discover while testing it for different modules and different desktop environments / window managers. One caveat is that since YaST is always running as root, the settings would be stored in root's home directory, i.e. they would be shared amont all users on that machine that use YaST. For normal PCs, this is a non-issue, but for real multi-user environments this might become somewhat annoying. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com