Bug 207296 - New Contact, New group and Quick Search actions are preselected by default in the 'Configure Toolbar' dialogue
Summary: New Contact, New group and Quick Search actions are preselected by default in...
Status: VERIFIED FIXED
Alias: None
Product: kontact
Classification: Applications
Component: general (show other bugs)
Version: SVN trunk
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-13 23:53 UTC by Sabine Faure
Modified: 2009-10-02 00:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
proposed fix (4.05 KB, patch)
2009-09-22 20:43 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Faure 2009-09-13 23:53:54 UTC
Version:            (using Devel)
Compiler:          gcc 4.3.2 
OS:                Linux
Installed from:    Compiled sources

- Launch KAB
- Go to Settings menu/Configure Toolbars...
- The 'Configure Toolbars' dialogue appears
- Select 'Main Toolbar <kaddressbook>' from the 'Toolbar' combo box.
- In the 'Current actions' column there are already three actions selected by default: New Contact, New Group and Quick search.
- Select 'Copy Contact' from the 'Available actions' column and click on the right hand side arrow.
- Click on 'Apply'

The 'Copy Contact' button appears but so do the 'New Contact' and 'New Group' buttons along with it.

The only mean to add only the 'Copy Contact' button is to deselect manually the three default actions (select them and click on the left side arrow and then on 'Apply')

Those default actions should not be there at all.

Trunk, Svn Rev 1022237
Comment 1 Sabine Faure 2009-09-14 00:12:16 UTC
Except for Quick Search maybe.

- Click on the 'Defaults' button from the 'Configure Toolbars' dialogue.

All the buttons that you have added are removed except the default ones 'New Contact' and 'New Group'

Trunk,Svn Rev 1022237
Comment 2 Tobias Koenig 2009-09-14 18:12:51 UTC
Kontact specific bug
Comment 3 David Faure 2009-09-15 11:14:07 UTC
A solution would be to do the KToolBar::removeAction again after editing toolbars (I made that patch here), but this leaves the unwanted actions visible in the toolbar editing dialog.

I think a better solution would be to modify the XML at runtime to really remove the actions from the toolbar.
Comment 4 David Faure 2009-09-22 20:43:31 UTC
Created attachment 37114 [details]
proposed fix

For review and/or archiving purposes: here's the suggested fix (modifying the XML on startup and after toolbar editing). Requires the kdelibs patch in http://reviewboard.kde.org/r/1694.

The problem is that if the user adds "New Contact" explicitely, the code will remove it again. Maybe we should have <Action name="akonadi_contact_create" remove_in_kontact="true"/> in kaddressbookui.rc, so that we only remove the default actions and not the ones added by the user. This would replace invisibleToolbarActions().

I also wonder what happens when editing toolbars in kontact and then using kaddressbook standalone -- the actions will be missing, since the local ui.rc file will not contain the actions anymore. Argh. Seems the only clean solution is to have two ui.rc files, either in the sources (duplication) or at runtime (making a local copy with the actions removed, and using that for the kaddressbook part in kontact...)
Comment 5 David Faure 2009-09-25 11:47:56 UTC
SVN commit 1027982 by dfaure:

Better solution for hiding specific actions in kontact: tagging them in the xml
and removing them from the xml dynamically, so that they don't appear in "Configure Toolbars"
(but so that it's still possible to manually add them).
I still need to convert the other plugins to this system, but this solves 207296 at least.
CCMAIL: kde-pim@kde.org
BUG: 207296


 M  +2 -2      kaddressbook/kaddressbookui.rc  
 M  +5 -7      kontact/plugins/kaddressbook/kaddressbook_plugin.cpp  
 M  +1 -1      kontact/plugins/kaddressbook/kaddressbook_plugin.h  
 M  +47 -12    kontact/src/mainwindow.cpp  
 M  +1 -0      kontact/src/mainwindow.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1027982
Comment 6 David Faure 2009-09-26 03:12:45 UTC
SVN commit 1028153 by dfaure:

Even better fix for 207296, using the strategy described on k-c-d ("Re: Review Request: Use in-memory dom document when editing toolbars...")
This way toolbar changes in kontact don't mess up kaddressbook; and users can freely edit toolbars without some
hidden magic removing their newly-added actions; and upgrades are handled, etc.

Had to add a unique name to the Plugin ctor, to differenciate the 3 korganizer plugins though, so
this is an API change in kontactinterface (volker said it was ok until 4.4 is released).

CCBUG: 207296


 M  +3 -6      kdepim/kaddressbook/kaddressbookui.rc  
 M  +1 -1      kdepim/kontact/plugins/akregator/akregatorplugin.desktop  
 M  +6 -5      kdepim/kontact/plugins/kaddressbook/kaddressbook_plugin.cpp  
 M  +1 -1      kdepim/kontact/plugins/kaddressbook/kaddressbook_plugin.h  
 M  +1 -1      kdepim/kontact/plugins/kaddressbook/kaddressbookplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/kjots/kjots_plugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/kmail/kmailplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/knode/knodeplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/knotes/knotesplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/korganizer/journalplugin.cpp  
 M  +1 -1      kdepim/kontact/plugins/korganizer/journalplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/korganizer/korganizerplugin.cpp  
 M  +1 -1      kdepim/kontact/plugins/korganizer/korganizerplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/korganizer/todoplugin.cpp  
 M  +1 -1      kdepim/kontact/plugins/korganizer/todoplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/ktimetracker/ktimetracker_plugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/planner/plannerplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/specialdates/specialdatesplugin.desktop  
 M  +1 -1      kdepim/kontact/plugins/summary/summaryplugin.desktop  
 M  +10 -16    kdepim/kontact/src/kontactui.rc  
 M  +0 -47     kdepim/kontact/src/mainwindow.cpp  
 M  +0 -1      kdepim/kontact/src/mainwindow.h  
 M  +58 -3     kdepimlibs/kontactinterface/plugin.cpp  
 M  +5 -6      kdepimlibs/kontactinterface/plugin.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1028153
Comment 7 Sabine Faure 2009-10-02 00:51:36 UTC
It is corrected now.

When selecting a button from the 'Configure Toolbars' dialogue only the selected button gets added now.

Trunk, Svn Rev 1030016