Feature request #9746

Add a command to reset the GUI

Added by Paolo Cavallini about 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GUI
Pull Request or Patch supplied:No Resolution:fixed/implemented
Easy fix?:No Copied to github as #:18296

Description

Users occasionally remove toolbars, and do not know how to restore them. Thi is easy with a Python script:

#!/usr/bin/python
from PyQt4.QtCore import QSettings
QSettings( "QGIS", "QGIS2" ).remove( "/UI/state" )
QSettings( "QGIS", "QGIS2" ).remove( "/ComposerUI/state" )

It would be good to add it, as a new commend under Settings > Reset GUI to defaults

See also http://lists.osgeo.org/pipermail/qgis-developer/2014-March/031487.html

Associated revisions

Revision 637359ae
Added by Jürgen Fischer about 10 years ago

add menu option to reset to ui defaults (implements #9746)

History

#1 Updated by Nathan Woodrow about 10 years ago

Really? If the users can't work out how to restore a toolbar or panel then our UI is too complicated. Doing a hard reset like this on the UI state is a bit of a hack way to solve the issue IMO.

#2 Updated by Richard Duivenvoorde about 10 years ago

While I agree that there is enough room for making the UI better for QGIS, I think this is more Qt to blame for: dockable widgets, toolbars that you can move etc. I think everybody has (re)moved (or docked) widgets bij accident.

Doing a hard reset is half the work, it would even be better then to be able to save it in a file.
This seems trivial too: just create a text file of the key/value pairs).

I've been thinking about a more general 'view' for all settings too: something like the 'about:config' view in Firefox. Then we have a unified view of all QGIS related settings (instead of pointing. We could make that one exportable too? This would make it easier for classrooms to start in a unified way (more or less what Tim proposed on the mailinglist (via regedit), but then more general.

Another option is to restrict the movability a little from all the dockable stuff? In a way that you cannot move stuff around anymore, only undock it and hide/show it? Not sure if that is possible with Qt.

Somebody taking this up? Otherwise I'm happy to put some time into this.
For implementation: should this be a button somewhere in the properties? Or a dialog (or a dockable widget ;-) ).

#3 Updated by Nathan Woodrow about 10 years ago

This seems trivial too: just create a text file of the key/value pairs).

QSettings should be able to do this without a problem. I was considering this the other day.

We could add an Advanced tab on the options dialog that just lists out all the key value pairs as strings and people can edit by hand, we could also have a import export button there.

#4 Updated by Jürgen Fischer about 10 years ago

QGIS will rewrite the setting on exit.

#5 Updated by Richard Duivenvoorde about 10 years ago

jef: ah good point. So after removing those settings (from within the plugin == within QGIS), QGIS will upon exit write it's current state back to settings. Which is actually not what you want, because that state is missing the panels/toolbars that you want to bring back.

So cleaning up those settings only work when ran from outside a running QGIS...

I still like the viewing and exporting the QSettings though (for the use-cases like giving all students the same situation to begin with)...

So resetting the gui seems not suited for a plugin.

What about a command-option?
qgis --default
which actually only skips restoring the windows state:
https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L704
and
https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L2352

#6 Updated by Jürgen Fischer about 10 years ago

  • Status changed from Open to Closed

#7 Updated by Richard Duivenvoorde about 10 years ago

  • Status changed from Closed to Open

With me this solution has some unwanted side effects.

A separate pull request is created:
https://github.com/qgis/QGIS/pull/1232
with an alternative implmentation. For further info plz read comments of PR

#8 Updated by Alexander Bruy over 9 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Second pull-request applied too. Please reopen if necessary.

Also available in: Atom PDF