summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-04-30 20:40:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-04-30 22:01:35 +0900
commitf3ddd5b7cd91574ac67d6c5dcf1c40093285d200 (patch)
tree0030dfb1fd9e2c42cdf603f9f4bb06f2fe32aef2
parente539275ad3d719ae9b95c9e94760f078acc608af (diff)
downloadtdebase-f3ddd5b7.tar.gz
tdebase-f3ddd5b7.zip
konqueror: add option to enable/disable using double click to navitage to the parent folder. This resolves issue #329
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--kcontrol/konq/behaviour.cpp8
-rw-r--r--kcontrol/konq/behaviour.h1
-rw-r--r--konqueror/konqueror.kcfg6
-rw-r--r--konqueror/listview/konq_listviewwidget.cpp50
-rw-r--r--libkonq/konq_settings.cpp2
-rw-r--r--libkonq/konq_settings.h5
6 files changed, 47 insertions, 25 deletions
diff --git a/kcontrol/konq/behaviour.cpp b/kcontrol/konq/behaviour.cpp
index d662d6af7..1b477d0e3 100644
--- a/kcontrol/konq/behaviour.cpp
+++ b/kcontrol/konq/behaviour.cpp
@@ -126,6 +126,11 @@ KBehaviourOptions::KBehaviourOptions(TDEConfig *config, TQString group, TQWidget
"renamed by clicking directly on the icon name. "));
connect(cbRenameDirectlyIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ cbDoubleClickMoveToParent = new TQCheckBox(i18n("Double click on empty area to move to parent folder"), vbox);
+ TQWhatsThis::add(cbDoubleClickMoveToParent, i18n("When this option is enabled, double clicking an "
+ "empty area will navigate to the parent folder."));
+ connect(cbDoubleClickMoveToParent, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+
TQHBoxLayout *hlay = new TQHBoxLayout( lay );
label = new TQLabel(i18n("Home &URL:"), this);
@@ -213,6 +218,8 @@ void KBehaviourOptions::load( bool useDefaults )
cbRenameDirectlyIcon->setChecked( g_pConfig->readBoolEntry("RenameIconDirectly", DEFAULT_RENAMEICONDIRECTLY ) );
+ cbDoubleClickMoveToParent->setChecked(g_pConfig->readBoolEntry("DoubleClickMoveToParent", true));
+
TDEConfig globalconfig("kdeglobals", true, false);
globalconfig.setGroup( "KDE" );
cbShowDeleteCommand->setChecked( globalconfig.readBoolEntry("ShowDeleteCommand", false) );
@@ -254,6 +261,7 @@ void KBehaviourOptions::save()
// g_pConfig->writeEntry( "FileTipsItems", sbToolTip->value() );
g_pConfig->writeEntry( "RenameIconDirectly", cbRenameDirectlyIcon->isChecked());
+ g_pConfig->writeEntry( "DoubleClickMoveToParent", cbDoubleClickMoveToParent->isChecked());
TDEConfig sidebarconfig("konqsidebartng.rc");
sidebarconfig.setGroup( "" );
diff --git a/kcontrol/konq/behaviour.h b/kcontrol/konq/behaviour.h
index bb6421be3..dce243fb3 100644
--- a/kcontrol/konq/behaviour.h
+++ b/kcontrol/konq/behaviour.h
@@ -68,6 +68,7 @@ private:
TQCheckBox *cbShowTips;
TQCheckBox *cbShowPreviewsInTips;
TQCheckBox *cbRenameDirectlyIcon;
+ TQCheckBox *cbDoubleClickMoveToParent;
TQCheckBox *cbMoveToTrash;
TQCheckBox *cbDelete;
diff --git a/konqueror/konqueror.kcfg b/konqueror/konqueror.kcfg
index 4049e8791..041fe4a46 100644
--- a/konqueror/konqueror.kcfg
+++ b/konqueror/konqueror.kcfg
@@ -45,6 +45,12 @@
<whatsthis>Checking this option will allow files to be renamed by clicking directly on the icon name.</whatsthis>
<!-- checked -->
</entry>
+ <entry key="DoubleClickMoveToParent" type="Bool">
+ <default>true</default>
+ <label>Double click on empty area to move to parent folder</label>
+ <whatsthis>When this option is enabled, double clicking an empty area will navigate to the parent folder.</whatsthis>
+ <!-- checked -->
+ </entry>
<entry key="ShowDeleteCommand" type="Bool">
<default>true</default>
<label>Show 'Delete' menu entries which bypass the trashcan</label>
diff --git a/konqueror/listview/konq_listviewwidget.cpp b/konqueror/listview/konq_listviewwidget.cpp
index ef70fe949..e1cfa9bb2 100644
--- a/konqueror/listview/konq_listviewwidget.cpp
+++ b/konqueror/listview/konq_listviewwidget.cpp
@@ -525,33 +525,37 @@ void KonqBaseListViewWidget::contentsWheelEvent( TQWheelEvent *e )
void KonqBaseListViewWidget::contentsMouseDoubleClickEvent(TQMouseEvent *e)
{
- if (m_rubber) {
- TQRect r(m_rubber->normalize());
- delete m_rubber;
- m_rubber = NULL;
- repaintContents(r, false);
- }
-
- TQPoint vp = contentsToViewport(e->pos());
- KonqBaseListViewItem* item = isExecuteArea(vp) ?
- static_cast<KonqBaseListViewItem*>(itemAt(vp)) : NULL;
+ if (m_rubber)
+ {
+ TQRect r(m_rubber->normalize());
+ delete m_rubber;
+ m_rubber = NULL;
+ repaintContents(r, false);
+ }
- if (item) {
+ TQPoint vp = contentsToViewport(e->pos());
+ KonqBaseListViewItem* item = isExecuteArea(vp) ?
+ static_cast<KonqBaseListViewItem*>(itemAt(vp)) : NULL;
+
+ if (item)
+ {
TDEListView::contentsMouseDoubleClickEvent(e);
- }
- else {
+ }
+ else if (m_pSettings->doubleClickMoveToParent())
+ {
KParts::URLArgs args;
args.trustedSource = true;
- KURL baseURL(m_dirLister->url().internalReferenceURL());
- if (baseURL.isEmpty())
- {
- baseURL = m_dirLister->url();
- }
- KURL upURL = baseURL.upURL();
- if (!upURL.isEmpty()) {
- m_pBrowserView->extension()->openURLRequest(upURL, args);
- }
- }
+ KURL baseURL(m_dirLister->url().internalReferenceURL());
+ if (baseURL.isEmpty())
+ {
+ baseURL = m_dirLister->url();
+ }
+ KURL upURL = baseURL.upURL();
+ if (!upURL.isEmpty())
+ {
+ m_pBrowserView->extension()->openURLRequest(upURL, args);
+ }
+ }
}
void KonqBaseListViewWidget::leaveEvent( TQEvent *e )
diff --git a/libkonq/konq_settings.cpp b/libkonq/konq_settings.cpp
index 41460e8ae..fe61d150a 100644
--- a/libkonq/konq_settings.cpp
+++ b/libkonq/konq_settings.cpp
@@ -121,6 +121,8 @@ void KonqFMSettings::init( TDEConfig * config )
/// true if TQString::localeAwareCompare is case sensitive (it usually isn't, when LC_COLLATE is set)
d->localeAwareCompareIsCaseSensitive = TQString( "a" ).localeAwareCompare( "B" ) > 0; // see #40131
+
+ m_doubleClickMoveToParent = config->readBoolEntry("DoubleClickMoveToParent", true);
}
bool KonqFMSettings::shouldEmbed( const TQString & serviceType ) const
diff --git a/libkonq/konq_settings.h b/libkonq/konq_settings.h
index daca8babe..52e9ac3b6 100644
--- a/libkonq/konq_settings.h
+++ b/libkonq/konq_settings.h
@@ -81,12 +81,13 @@ public:
bool underlineLink() const { return m_underlineLink; }
bool fileSizeInBytes() const { return m_fileSizeInBytes; }
bool alwaysNewWin() const { return m_alwaysNewWin; }
+ bool doubleClickMoveToParent() const { return m_doubleClickMoveToParent; }
const TQString & homeURL() const { return m_homeURL; }
bool showFileTips() const {return m_showFileTips; }
bool showPreviewsInFileTips() const;
int numFileTips() const {return m_numFileTips; }
- bool renameIconDirectly() const;
+ bool renameIconDirectly() const;
// Font settings
const TQFont& standardFont() const { return m_standardFont; }
@@ -107,7 +108,7 @@ private:
bool m_underlineLink;
bool m_fileSizeInBytes;
bool m_alwaysNewWin;
- bool m_bTreeFollow;
+ bool m_doubleClickMoveToParent;
TQMap<TQString, TQString> m_embedMap;