Bug 317791

Summary: KML editor panel (dock widget)
Product: marble Reporter: Dennis Nienhüser <nienhueser>
Component: generalAssignee: Adrian Draghici <draghici.adrian.b>
Status: RESOLVED FIXED    
Severity: task CC: aitashish173, shentey
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: KML Editor Dock Widget replacing the previous toolbar used to display the actions provided by the annotate plugin

Description Dennis Nienhüser 2013-04-03 17:28:32 UTC
Dock widgets have recently been introduced to replace the TabWidget on the left. The KML editor plugin (src/plugins/render/annotate) should provide its own dock widget for user interaction as well, replacing the currently used toolbar.

- Extend RenderPlugin by a new method equal or similar to
virtual QWidget* createDockWidget() const
with a default implementation doing nothing (returning 0).

- Extend QtMainWindow.cpp and marble_part.cpp to create dock widgets from render plugins that return a createDockWidget() != 0.

- Move the existing toolbar in src/plugins/render/annotate to a QWidget* that is returned in the overridden createDockWidget() method. Remove the part from it where the toolbar actions are returned.

- Optionally add a QTreeView to the same window which shows the outline of the currently edited KML file (using the existing TreeModel).

When done, the existing KML editor toolbar shouldn't be shown in the main application toolbar anymore, but in its own dock widget (with the title "KML Editor" or "Map Editor").
Comment 1 Adrian Draghici 2013-04-14 23:21:18 UTC
Created attachment 78909 [details]
KML Editor Dock Widget replacing the previous toolbar used to display the actions provided by the annotate plugin
Comment 2 Bernhard Beschow 2013-04-15 17:29:38 UTC
I wonder if RenderPlugins should really depend on QWidget. I could well imagine that QWidgets are not available on every platform Qt 5.x will support, so this dependency could hit us hard when targeting these platforms. A quick'n'dirty fix would probably be to introduce an interface similar to the Marble::DialogConfigurationInterface.
Comment 3 Dennis Nienhüser 2013-04-16 19:01:24 UTC
Git commit 37977619162f91285b7862ac8dab5578d229f6e2 by Dennis Nienhüser, on behalf of Adrian Draghici.
Committed on 16/04/2013 at 20:59.
Pushed by nienhueser into branch 'master'.

KML Editor Dock Widget

REVIEW: 110019

M  +18   -0    src/QtMainWindow.cpp
M  +1    -0    src/QtMainWindow.h
M  +1    -1    src/lib/BranchFilterProxyModel.h
M  +5    -0    src/lib/RenderPlugin.cpp
M  +12   -0    src/lib/RenderPlugin.h
M  +131  -100  src/plugins/render/annotate/AnnotatePlugin.cpp
M  +6    -1    src/plugins/render/annotate/AnnotatePlugin.h

http://commits.kde.org/marble/37977619162f91285b7862ac8dab5578d229f6e2
Comment 4 Dennis Nienhüser 2013-04-16 19:17:07 UTC
(In reply to comment #2)
> I wonder if RenderPlugins should really depend on QWidget. I could well
> imagine that QWidgets are not available on every platform Qt 5.x will
> support, so this dependency could hit us hard when targeting these
> platforms. A quick'n'dirty fix would probably be to introduce an interface
> similar to the Marble::DialogConfigurationInterface.

Currently QDockWidget is only introduced as a forward declaration in RenderPlugin.h. Not using things from QtGui is too much planning ahead in my opinion and too restrictive. If we ever run into the problem of Qt classes missing on a target platform (Qt is platform independent after all) and Qt guys haven't thought of a solution ahead, we can still adjust things.