Summary: | Enable Locking of Desktop Icons arrangement | ||
---|---|---|---|
Product: | [Unmaintained] kdesktop | Reporter: | Joel Wiramu Pauling <aenertia> |
Component: | icons | Assignee: | Benoit Walter <b.walter> |
Status: | CLOSED FIXED | ||
Severity: | wishlist | CC: | finex, kdebugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Other | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Current Desktop .directory
Patch to cure the bug |
Description
Joel Wiramu Pauling
2004-11-06 05:40:13 UTC
Created attachment 8189 [details]
Current Desktop .directory
Current .directory file, does not specify any resolution specific location
information, nor is there an ability to lock all icon positions on desktop.
bug 35203 is also very much related to this report, and discuss other useability issues with the icon placement scheme. Consider this report to be more of an interim solution request for many of the issues reported in bug 35203 *** This bug has been confirmed by popular vote. *** I have created a patch that adds a "Lock in Place" entry under the "Icons" submenu. Added bonus: removes that ridiculous "Bookmarks" submenu as well (only from the context menu) as per bug 62791. I will create an attachment. Created attachment 11371 [details]
Patch to cure the bug
Please commit!
Thanks luke, it's much appreciated. Can you submit for inclusion in head please. Kind regards Joel W (P.S my GF will be mighty happy about this ;-) Be aware that this particular patch _only_ keeps icons from being dragged around... it won't stop new icons from messing them up. SVN commit 423947 by dfaure: FEATURE: RMB entry for locking icons where they are, so that they can't be moved. FEATURE: 92789 M +6 -0 kdesktop.kcfg M +24 -4 krootwm.cc M +1 -0 krootwm.h --- trunk/KDE/kdebase/kdesktop/kdesktop.kcfg #423946:423947 @@ -165,6 +165,12 @@ <label>Sort directories first</label> <whatsthis>Enable this to place directories in front of the sorted list, otherwise they are amongst the files.</whatsthis> </entry> + <entry key="LockIcons" type="Bool"> + <default>false</default> + <label>Lock in Place</label> + <whatsthis>Check this option if you want to keep your icons from moving.</whatsthis> + </entry> + <entry key="AlwaysFirstItems" type="StringList"> <default></default> <label></label> --- trunk/KDE/kdebase/kdesktop/krootwm.cc #423946:423947 @@ -171,6 +171,9 @@ m_actionCollection, "realign" ); connect( aAutoAlign, SIGNAL( toggled( bool ) ), this, SLOT( slotToggleAutoAlign( bool ) ) ); + KToggleAction *aLockIcons = new KToggleAction(i18n("Lock in Place"), 0, m_actionCollection, "lock_icons"); + connect( aLockIcons, SIGNAL( toggled( bool ) ), + this, SLOT( slotToggleLockIcons( bool ) ) ); } if (m_bDesktopEnabled) { @@ -236,12 +239,16 @@ // Read configuration for icons alignment if ( m_bDesktopEnabled ) { - bool b = KDesktopSettings::autoLineUpIcons(); - m_pDesktop->iconView()->setAutoAlign( b ); + m_pDesktop->iconView()->setAutoAlign( KDesktopSettings::autoLineUpIcons() ); + if ( kapp->authorize( "editable_desktop_icons" ) ) { + m_pDesktop->iconView()->setItemsMovable( !KDesktopSettings::lockIcons() ); + KToggleAction *aLockIcons = static_cast<KToggleAction*>(m_actionCollection->action("lock_icons")); + if (aLockIcons) + aLockIcons->setChecked( KDesktopSettings::lockIcons() ); + } KToggleAction *aAutoAlign = static_cast<KToggleAction*>(m_actionCollection->action("realign")); if (aAutoAlign) - aAutoAlign->setChecked( b ); - + aAutoAlign->setChecked( KDesktopSettings::autoLineUpIcons() ); KToggleAction *aSortDirsFirst = static_cast<KToggleAction*>(m_actionCollection->action("sort_directoriesfirst")); if (aSortDirsFirst) aSortDirsFirst->setChecked( KDesktopSettings::sortDirectoriesFirst() ); @@ -412,6 +419,9 @@ m_actionCollection->action( "lineupVert" )->plug( pIconOperationsMenu ); pIconOperationsMenu->insertSeparator(); m_actionCollection->action( "realign" )->plug( pIconOperationsMenu ); + KAction *aLockIcons = m_actionCollection->action( "lock_icons" ); + if ( aLockIcons ) + aLockIcons->plug( pIconOperationsMenu ); desktopMenu->insertItem(SmallIconSet("icons"), i18n("Icons"), pIconOperationsMenu); } @@ -679,6 +689,16 @@ } } +void KRootWm::slotToggleLockIcons( bool lock ) +{ + if (m_bDesktopEnabled) + { + m_pDesktop->iconView()->setItemsMovable( !lock ); + KDesktopSettings::setLockIcons( lock ); + KDesktopSettings::writeConfig(); + } +} + void KRootWm::slotRefreshDesktop() { if (m_bDesktopEnabled) { --- trunk/KDE/kdebase/kdesktop/krootwm.h #423946:423947 @@ -106,6 +106,7 @@ void slotConfigureDesktop(); void slotToggleDirFirst( bool ); void slotToggleAutoAlign( bool ); + void slotToggleLockIcons( bool ); void slotToggleDesktopMenu(); void slotUnclutterWindows(); void slotCascadeWindows(); Bug closed. Kdesktop is no more mantained. |