Bug 80584

Summary: Keyboard shortcuts and menu entries (cut, paste, trash, delete, rename, etc.) are not working when focus is on the navigation panel
Product: [Applications] konqueror Reporter: Olivier Fisette <olivier.fisette>
Component: sidebarAssignee: Joseph Wenninger <jowenn>
Status: RESOLVED FIXED    
Severity: normal CC: archon, faure, frederic.coiffier, havaji, kdebugs.phobie, kimkingo, lex.lists, sridhar+bugs, thoane, vdboor
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description Olivier Fisette 2004-04-29 04:47:08 UTC
Version:            (using KDE KDE 3.2.2)
Installed from:    Gentoo Packages

When keyboard focus is on a directory in Konqueror's navigation pannel, keyboard shortcuts for actions such as : cut, copy, paste, trash and delete do not work. The contextual menu does not appear when pressing the Menu key. The corresponding entries (Cut, Copy, etc.) are disabled in the Edit menu. It is also impossible to rename directories in the navigation pannel.

This makes manipulating directories using the navigation pannel impractical.
Comment 1 Michael Jahn 2004-09-07 21:35:30 UTC
*** Bug 36749 has been marked as a duplicate of this bug. ***
Comment 2 Michael Jahn 2004-09-07 21:36:15 UTC
*** Bug 71301 has been marked as a duplicate of this bug. ***
Comment 3 Michael Jahn 2004-09-07 21:36:24 UTC
*** Bug 77186 has been marked as a duplicate of this bug. ***
Comment 4 Tommi Tervo 2004-09-15 14:35:35 UTC
*** Bug 89560 has been marked as a duplicate of this bug. ***
Comment 5 Rodrigo Fernandes 2004-11-09 23:14:11 UTC
Problem still exists in 3.3.1
Comment 6 Per (phobie) 2005-02-09 01:10:03 UTC
Problem still exists in 3.3.2-1 (debian/sid)
Comment 7 Frédéric COIFFIER 2005-02-22 20:28:50 UTC
With KDE-3.4.0_beta2, the "Rename" option is now enabled (in the popup menu in the side bar) but when I click on "Rename", nothing happens, no dialog box appears, no editable field...
But the Properties in the Side bar can renamed the directory
Comment 8 Thiago Macieira 2005-02-23 01:42:21 UTC
Confirm on HEAD 20050213.
Comment 9 Vlad C. 2005-06-13 23:33:27 UTC
Confirm on KDE 3.4.1 20050613.
Comment 10 mauceri 2005-08-13 23:51:02 UTC
Confirm on KDE 3.4.2.
Comment 11 Ashar Voultoiz 2005-11-26 00:02:13 UTC
The bug also happens in debian testing kde 3.4.2
Comment 12 Frédéric COIFFIER 2005-12-15 13:35:48 UTC
Status in KDE-3.5 :

- Keyboard shortcuts :
   "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK
- The contextual menu : 
   "Copy", "paste", "cut", "move to trash" or "delete" work
   "Rename" is present but DOESN'T WORK
- Edit menu :
   "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK (I think Edit menu works only with the right panel, not the left panel (even if the focus is in the left panel)
Comment 13 Andreas Watermeyer 2006-02-12 14:11:57 UTC
Problem also exists in KDE 3.4.0 Level b, SuSE Linux
Comment 14 Frédéric COIFFIER 2006-02-17 16:21:01 UTC
Status in KDE-3.5.1 : 
 
 - Keyboard shortcuts : 
    "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK 
 - The contextual menu : 
    "Copy", "paste", "cut", "move to trash" or "delete" work 
    "Rename" is present but DOESN'T WORK 
 - Edit menu : 
    "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK (I think Edit menu works only with the right panel, not the left panel (even if the focus is in the left panel) 
Comment 15 Macy Gasp 2006-03-17 14:54:53 UTC
I've noticed the same thing on KDE 3.5.1 (at least the delete key), with konqueror, in file management mode:

Steps to reproduce: 

- Select folder from the filesystem in the folder tree on the left.
- Press the Delete key; the menu doesn't appear.
- Right click, select delete -> works.
Comment 16 Ashar Voultoiz 2006-05-13 17:16:27 UTC
'delete' 'rename' (at least) are still bugged in debian KDE 3.5.2
Comment 17 David Faure 2006-05-17 12:39:39 UTC
The point is that the sidebar is a passive view. It can not take focus.
This is why the menu items never refer to the sidebar, but always to the active view (e.g. icon view).
Well, this is how it was supposed to work. But I see that one can click in the sidebar tree and use the up/down keys so it indeed has focus....

In any case RMB/rename wasn't implemented on non-toplevel items and that was a bug indeed - fixed now. RMB/delete worked fine already.
Comment 18 David Faure 2006-05-17 12:43:21 UTC
SVN commit 541800 by dfaure:

Fix RMB+rename in sidebar tree not working (part of the 19th most hated KDE bug)
CCBUG: 80584


 M  +4 -1      konq_mainwindow.cc  
 M  +1 -1      sidebar/sidebar_widget.cpp  
 M  +10 -3     sidebar/trees/dirtree_module/dirtree_item.cpp  
 M  +2 -0      sidebar/trees/dirtree_module/dirtree_item.h  
 M  +2 -8      sidebar/trees/konq_sidebartree.cpp  
 M  +2 -1      sidebar/trees/konq_sidebartreeitem.h  
 M  +1 -1      sidebar/trees/konq_sidebartreetoplevelitem.h  
 M  +4 -3      sidebar/trees/konqsidebar_tree.cpp  


--- branches/KDE/3.5/kdebase/konqueror/konq_mainwindow.cc #541799:541800
@@ -4767,7 +4767,10 @@
             connectExtension( m_oldView->browserExtension() );
             m_currentView = m_oldView;
         }
-        m_oldView->part()->widget()->setFocus();
+        // Special case: RMB + renaming in sidebar; setFocus would abort editing.
+        QWidget* fw = focusWidget();
+        if ( !fw || !::qt_cast<QLineEdit*>( fw ) )
+            m_oldView->part()->widget()->setFocus();
     }
   }
 }
--- branches/KDE/3.5/kdebase/konqueror/sidebar/sidebar_widget.cpp #541799:541800
@@ -652,7 +652,7 @@
 	if (!(mod->module))
 		return;
 
-	kdDebug() << "Try calling >active< module's action" << handlestd << endl;
+	kdDebug() << "Try calling >active< module's (" << mod->module->className() << ") slot " << handlestd << endl;
 
 	int id = mod->module->metaObject()->findSlot( handlestd );
   	if ( id == -1 )
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp #541799:541800
@@ -231,8 +231,15 @@
 
 QString KonqSidebarDirTreeItem::toolTipText() const
 {
-    if ( m_fileItem->url().isLocalFile() )
-	return m_fileItem->url().path();
+    return m_fileItem->url().pathOrURL();
+}
 
-    return m_fileItem->url().prettyURL();
+void KonqSidebarDirTreeItem::rename()
+{
+    tree()->rename( this, 0 );
 }
+
+void KonqSidebarDirTreeItem::rename( const QString & name )
+{
+    KonqOperations::rename( tree(), m_fileItem->url(), name );
+}
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/dirtree_module/dirtree_item.h #541799:541800
@@ -49,6 +49,8 @@
     virtual void trash();
     virtual void del();
     virtual void shred();
+    virtual void rename(); // start a rename operation
+    void rename( const QString & name ); // do the actual renaming
 
     // The URL to open when this link is clicked
     virtual KURL externalURL() const;
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/konq_sidebartree.cpp #541799:541800
@@ -857,13 +857,7 @@
     if (col != 0) return;
     assert(item);
     KonqSidebarTreeItem * treeItem = static_cast<KonqSidebarTreeItem *>(item);
-    if ( treeItem->isTopLevelItem() )
-    {
-        KonqSidebarTreeTopLevelItem * topLevelItem = static_cast<KonqSidebarTreeTopLevelItem *>(treeItem);
-        topLevelItem->rename( name );
-    }
-    else
-        kdWarning() << "slotItemRenamed: rename not implemented for non-toplevel items" << endl;
+    treeItem->rename( name );
 }
 
 
@@ -1022,7 +1016,7 @@
 void KonqSidebarTree::slotOpenTab()
 {
     if (!m_currentTopLevelItem) return;
-    DCOPRef ref(kapp->dcopClient()->appId(), topLevelWidget()->name());   
+    DCOPRef ref(kapp->dcopClient()->appId(), topLevelWidget()->name());
     ref.call( "newTab(QString)", m_currentTopLevelItem->externalURL().url() );
 }
 
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/konq_sidebartreeitem.h #541799:541800
@@ -65,6 +65,7 @@
     virtual void del() {}
     virtual void shred() {}
     virtual void rename() {}
+    virtual void rename( const QString& ) {}
 
     // The URL to open when this link is clicked
     virtual KURL externalURL() const = 0;
@@ -100,7 +101,7 @@
     KonqSidebarTree *tree() const;
 
     virtual QString key( int column, bool ) const { return text( column ).lower(); }
-    
+
     // List of alternative names (URLs) this entry is known under
     QStringList alias;
 protected:
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/konq_sidebartreetoplevelitem.h #541799:541800
@@ -62,7 +62,7 @@
     virtual void del();
     virtual void shred();
     virtual void rename(); // start a rename operation
-    void rename( const QString & name ); // do the actual renaming
+    virtual void rename( const QString & name ); // do the actual renaming
 
     virtual void setOpen( bool open );
 
--- branches/KDE/3.5/kdebase/konqueror/sidebar/trees/konqsidebar_tree.cpp #541799:541800
@@ -20,9 +20,9 @@
 		ksc.setGroup("Desktop Entry");
 		int virt= ( (ksc.readEntry("X-KDE-TreeModule","")=="Virtual") ?VIRT_Folder:VIRT_Link);
 		if (virt==1) desktopName_=ksc.readEntry("X-KDE-RelURL","");
-		
+
 		widget = new QVBox(widgetParent);
-                
+
 		if (ksc.readBoolEntry("X-KDE-SearchableTreeModule",false)) {
 			QHBox* searchline = new QHBox(widget);
 			searchline->setSpacing(KDialog::spacingHint());
@@ -43,7 +43,7 @@
 
 		connect(tree,SIGNAL(createNewWindow( const KURL &, const KParts::URLArgs &)),
 			this,SIGNAL(createNewWindow( const KURL &, const KParts::URLArgs &)));
-		
+
 		connect(tree,SIGNAL(popupMenu( const QPoint &, const KURL &, const QString &, mode_t )),
 			this,SIGNAL(popupMenu( const QPoint &, const KURL &, const QString &, mode_t )));
 
@@ -111,6 +111,7 @@
 
 void KonqSidebar_Tree::rename()
 {
+    Q_ASSERT( tree->currentItem() );
     if (tree->currentItem())
         tree->currentItem()->rename();
 }
Comment 19 Youngjoon Kim 2006-08-23 11:06:59 UTC
Not applied yet in KDE 3.5.4?
Not working in kdebase-3.5.4-0.2.fc5.
Comment 20 Frédéric COIFFIER 2006-08-23 14:11:28 UTC
The 'rename' in context menu (of the panel view) works with KDE-3.5.4
(But, the F2 shortcut doesn't work : seems to be normal as the panel view is a passive view)

Status in KDE-3.5.4 : 
   
  - The contextual menu : 
     "Copy", "paste", "cut", "move to trash", "delete" and "rename" work
  - Keyboard shortcuts : 
     "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK 
  - Edit menu : 
     "Copy", "paste", "cut", "move to trash", "delete" or "rename" DON'T WORK

I think the keyboard shortcut and edit menu problems can't be solved with the current Konqueror architecture, can they ?
Comment 21 David Faure 2006-08-23 21:57:32 UTC
On Wednesday 23 August 2006 14:11, Frédéric COIFFIER wrote:
> I think the keyboard shortcut and edit menu problems can't be solved with the current Konqueror architecture, can they ?


Right, it is by design that the sidebar is passive, i.e. doesn't take focus.

I can see how this is a problem for keyboard usage; but I still think menu usage
would get confusing if the result of the menu entries depended on whether you
last clicked on the main view or on the sidebar....  Well... it works like that with splitted
views, but that's a less common case.

Can someone do a little research and check whether sidebars take focus (and are
affected by menu items) in many other apps? (Windows file manager, amarok, MacOsX, etc.)
Comment 22 Youngjoon Kim 2006-08-24 11:10:40 UTC
In MS Windows' file manager(explorer), shortcuts such as delete, Ctrl+x, Ctrl+v work well in the sidebar. 

Many people like to use shortcuts than a mouse in such jobs, and may want to be able to use shortcuts in a sidebar, too. (Especially the sidebar is useful when operate on directories).

I hope that shortcuts are activated in the sidebar, if possible.
Comment 23 Frédéric COIFFIER 2006-08-24 11:32:44 UTC
And currently, shortcuts are displayed in the sidebar context menu, which is really ambiguous.
Comment 24 jg 2006-10-06 18:18:30 UTC
I'm using KDE 3.5.4 and this bug is still present for me, I press F2 with a directory selected in the Navigation Panel and nothing happens.

I can get it to work by selecting using the mouse from the context menu at least. 

Would be great if this bug could be prioritised.

Kind regards
Jon
Comment 25 David Faure 2006-10-06 21:04:01 UTC
This is not a bug, but the way the GUI has been designed: the sidebar is a passive view, it cannot get focus.
Comment 26 jg 2006-10-06 22:48:58 UTC
It can get focus. Here is a case you can try to see for your self:

1) Open the Navigation Plane side bar
2) Right click on a file and rename it.
3) Press the down arrow, see that the Navigation Plane side bar is still with the focus for keyboard input.
4) Press F2 and see that despite the Navigation Plane side bar having focus, pressing F2 does not trigger a Rename.

Kind regards
Jon
Comment 27 David Faure 2006-10-07 01:01:08 UTC
On Friday 06 October 2006 22:48, jg@jguk.org wrote:
> 3) Press the down arrow, see that the Navigation Plane side bar is still with the focus for keyboard input.

That's a bug, in the current design :)
Comment 28 jg 2006-10-12 21:09:38 UTC
Would be great if that feature could be kept and the design changed to allow the F2 rename feature added...
Jon
Comment 29 lexual 2006-10-19 11:21:39 UTC
*** Bug 122889 has been marked as a duplicate of this bug. ***
Comment 30 cewan 2007-03-21 11:20:15 UTC
The current behavior of Konqueror forces the user to use the mouse, which is not very nice. Also, as mentioned, if you right click it says that F2 would rename the folder, which does not work.

I really hope that it will be possible to rename and delete folders directly in navigation panel. Most other file managers out there supports this!

BR
Comment 31 Jaime Torres 2008-07-17 17:44:10 UTC
It is still present in kde4 svn trunk r831729
Comment 32 David Faure 2009-11-10 01:47:38 UTC
*** Bug 95006 has been marked as a duplicate of this bug. ***
Comment 33 David Faure 2009-11-10 15:55:43 UTC
SVN commit 1047132 by dfaure:

Support for renaming with F2 in the sidebar tree.
(Note that Edit/Rename will still be about the active part, not about the sidebar.)
CCBUG: 80584


 M  +18 -2     konq_sidebartree.cpp  
 M  +1 -0      konq_sidebartree.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1047132
Comment 34 David Faure 2009-11-10 18:00:03 UTC
SVN commit 1047182 by dfaure:

Make the shortcuts for copy, paste, cut, trash and delete work in the sidebar directory tree.
This fixes bug 80584 (356 votes)
BUG: 80584

That tree module (qt3support based) is quite buggy though (missing updates after renaming and deleting (sometimes); no DnD).
I should replace it with a dolphinpart-based tree...


 M  +33 -6     konq_sidebartree.cpp  
 M  +6 -0      konq_sidebartree.h  
 M  +7 -0      konqsidebar_oldtreemodule.cpp  
 M  +7 -5      konqsidebar_oldtreemodule.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1047182