Bug report #6125

Restoring print composer panels

Added by Damien O'Grady over 2 years ago. Updated about 2 years ago.

Status:Closed Start Date:07/30/2012
Priority:High Due date:
Assigned to:- % Done:

0%

Category:-
Target version:Version 2.0.0
Platform: Patch supplied:No
Platform version: Affected version:master
Status info: Causes crash or corruption:No
Resolution:fixed Tag:

Description

Issue #6042 was dismissed quickly as a non-issue, but the problem is not solved in the case of 1.8.0 for the mac, where, when panels in Print Composer have been turned off, there does not appear to be a way to retrieve them - right-clicking the menu bar, as works in Windows, does not appear to work on the Mac.

print_composer_bringbackpanels.png (19.7 kB) Larry Shaffer, 08/01/2012 01:00 pm

print_composer_panelsback.png (24.8 kB) Larry Shaffer, 08/01/2012 01:00 pm

History

Updated by Larry Shaffer about 2 years ago

Damien,

Control-clicking the toolbar (not menu bar) in Mac and selecting the panel that is missing does the trick in both 1.8.0 and latest master branch build for me, and is the same solution provided by Nathan. (see attachments)

Please update missing info for your issue (platform, version, category 'gui', and set the priority to 'normal'), and provide feedback on whether the method described above does not work for you.

I agree that there is not a Mac-like, or straightforward, means of retrieving the missing panels (using a contextual menu to bring back a major part of the ui is a bit obscure). This should be addressed for next version.

Thank you for reporting it.

Updated by Damien O'Grady about 2 years ago

Thank you Larry. Forgive me for not putting the missing details in right away, but I need to contact the student who told me of the problem once again, to get those details.

The problem comes when the Toolbar itself has been turned off. There is then nothing left to right-click to acquire the drop-down menu. Is there a config file somewhere I can access to manually switch the Toolbar back on?

Thanks

Damien

Updated by Larry Shaffer about 2 years ago

Damien,

Using 1.8.0, I hid all panels and the toolbar in Print Composer and could not find a way to retrieve them within QGIS, short of using the Python Console. Doing the following will return the Composer's UI to a default state, i.e. showing all components again:

  1. Make sure QGIS is not running.
  2. Open /Users/<user>/Library/Preferences/org.qgis.QGIS.plist in a good .plist or code editor like TextWrangler (free) or BBEdit. If you're using Lion or higher, the Library folder is hidden. To show it, use the Finder's Go->Go to Folder... menu action or hold Option while clicking the Go menu (Library will show up).
  3. Edit the file by deleting the key/data pair for ComposerUI.state, which may look similar to:
    <key>ComposerUI.state</key>
    <data>
    AAAA/wAAAAD9AAAAAQAAAAEAAAFOAAAEhPwCAAAAAfwAAAAAAAAEhAAAAAAA////+v//
    //8CAAAAA/sAAAAeAEMAbwBtAHAAbwBzAGkAdABpAG8AbgBEAG8AYwBrAAAAAAD/////
    AAAAZgD////7AAAAFgBDAG8AbQBtAGEAbgBkAEQAbwBjAGsAAAAAAP////8AAABoAP//
    //sAAAAQAEkAdABlAG0ARABvAGMAawAAAAAA/////wAAABoA////AAAHaQAABIQAAAAE
    AAAABAAAAAgAAAAI/AAAAAEAAAACAAAAAQAAAA4AdABvAG8AbABCAGEAcgAAAAAA////
    /wAAAAAAAAAA
    </data>
    

    Make sure not to leave a blank line in the file where you deleted. Close file.
  4. Relaunch QGIS to test.

Please update missing info for your issue if you can (platform, version, category 'gui', and set the priority to 'normal') and leave it as open, since this is a GUI problem that needs addressed. Thank you.

Updated by Damien O'Grady about 2 years ago

Thank you for your Help, Larry. I am waiting for feedback to confirm that your solution worked. Meanwhile I don't seem to be able to edit details and change status. Am I missing something? Thanks.

Updated by Larry Shaffer about 2 years ago

This is how to edit your issue: http://www.redmine.org/projects/redmine/wiki/RedmineIssues#Updating-an-existing-issue

However, it doesn't seem to be a feature of this version of Redmine, or it's turned off. :^(

Updated by Damien O'Grady about 2 years ago

It is probably a permissions setting...

Updated by mlennert - about 2 years ago

Larry Shaffer wrote:

Damien,

Using 1.8.0, I hid all panels and the toolbar in Print Composer and could not find a way to retrieve them within QGIS, short of using the Python Console. Doing the following will return the Composer's UI to a default state, i.e. showing all components again:

  1. Make sure QGIS is not running.
  2. Open /Users/<user>/Library/Preferences/org.qgis.QGIS.plist in a good .plist or code editor like TextWrangler (free) or BBEdit. If you're using Lion or higher, the Library folder is hidden. To show it, use the Finder's Go->Go to Folder... menu action or hold Option while clicking the Go menu (Library will show up).
  3. Edit the file by deleting the key/data pair for ComposerUI.state, which may look similar to: [...] Make sure not to leave a blank line in the file where you deleted. Close file.
  4. Relaunch QGIS to test.

A student of mine has the same problem, but under Ubuntu 12.04 using QGIS 1.8 from ubuntugis-unstable. Is there a similar file that can be edited under Ubuntu ? I have tried completely removing (and purging) all packages containing "qgis" in their name, but when I reinstall QGIS I see the same problem again, i.e. no panels and no toolbar.

Any hints ?

Moritz

Updated by Larry Shaffer about 2 years ago

This is how you can re-show those Composer GUI elements using PyQGIS (should work on all platforms).

  1. Launch QGIS and open the affected project file.
  2. Open up the affected print composer. Open only one composer after a clean restart of QGIS.
  3. Execute the following Python code in QGIS's Python Console:
    from PyQt4.QtGui import *
    cw = qgis.utils.iface.activeComposers()[0].composerWindow()
    
    cw.findChild(QToolBar, 'toolBar').show()
    cw.findChild(QDockWidget, 'CompositionDock').show()
    cw.findChild(QDockWidget, 'ItemDock').show()
    cw.findChild(QDockWidget, 'CommandDock').show()
    
  4. Quit QGIS. After restart of QGIS, all Composers, including new ones, should have all panels and the toolbar shown.

If you have more than one composer window to fix, and don't want to restart QGIS, open all of them and use this code instead:

from PyQt4.QtGui import *
actcs = qgis.utils.iface.activeComposers()

for actc in actcs:
    cw = actc.composerWindow()
    cw.findChild(QToolBar, 'toolBar').show()
    cw.findChild(QDockWidget, 'CompositionDock').show()
    cw.findChild(QDockWidget, 'ItemDock').show()
    cw.findChild(QDockWidget, 'CommandDock').show()

Updated by Larry Shaffer about 2 years ago

Here's an even better solution.

  1. Open project
  2. Execute the following in Python Console
    from PyQt4.QtGui import *
    
    actcs = qgis.utils.iface.activeComposers()
    for actc in actcs:
        cw = actc.composerWindow()
        mb = cw.menuBar()
        wm = mb.findChild(QMenu, 'wmenu')
        if not wm:
            wm = mb.addMenu('Window')
            wm.setObjectName('wmenu')
            wm.addActions(cw.createPopupMenu().actions())
    

All Composer windows now have a menu named 'Window' which lists the toolbar and dock widgets (same as contextual menu on tool bar). You can hide/show the widgets as if it was coded that way to begin with. No need to open Composer windows first.

You can execute the code as many times as needed. It will not keep adding new 'Window' menus.

Updated by Larry Shaffer about 2 years ago

Added to master with commit c928868, as per the same way they are displayed in main app (under View menu and separated by widget type).

Issue should be closed.

Updated by Giovanni Manghi about 2 years ago

  • Status changed from Open to Feedback

Issue should be closed.

can the original reporter please test and eventually close the ticket? thanks in advance.

Updated by Paolo Cavallini about 2 years ago

  • Target version set to Version 2.0.0

Updated by Giovanni Manghi about 2 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

Giovanni Manghi wrote:

Issue should be closed.

can the original reporter please test and eventually close the ticket? thanks in advance.

closing for lack of feedback and as it should be fixed.

Also available in: Atom PDF