[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesdk/cervisia
From:       Christian Loose <christian.loose () hamburg ! de>
Date:       2005-03-15 21:33:21
Message-ID: 20050315213321.A62AE12E73 () office ! kde ! org
[Download RAW message or body]

CVS commit by cloose: 

GUI:

Cleanup context menu for folders: only show valid actions 
instead of disabling the invalid ones.

This gives us some space to implement feature #40760.

CCBUGS: 40760


  M +34 -25    cervisiapart.cpp   1.162
  M +7 -0      cervisiaui.rc   1.24


--- kdesdk/cervisia/cervisiapart.cpp  #1.161:1.162
@@ -50,4 +50,5 @@
 #include "historydlg.h"
 #include "updateview.h"
+#include "updateview_items.h"
 #include "protocolview.h"
 #include "repositorydlg.h"
@@ -615,7 +616,14 @@ void CervisiaPart::setupActions()
 
 
-void CervisiaPart::popupRequested(KListView*, QListViewItem*, const QPoint& p)
+void CervisiaPart::popupRequested(KListView*, QListViewItem* item, const QPoint& p)
 {
-    if (QPopupMenu* popup = \
static_cast<QPopupMenu*>(hostContainer("context_popup"))) +    QString xmlName = \
"context_popup"; +
+    if( isDirItem(item) )
+        xmlName = "folder_context_popup";
+
+    if( QPopupMenu* popup = static_cast<QPopupMenu*>(hostContainer(xmlName)) )
+    {
+        if( isFileItem(item) )
     {
         // remove old 'Edit with...' menu
@@ -644,9 +652,10 @@ void CervisiaPart::popupRequested(KListV
                                           m_currentEditMenu->menu(), -1, 1);
         }
+        }
 
         popup->exec(p);
     }
     else
-        kdDebug(8050) << "CervisiaPart: can't get XML definition for context_popup, \
factory()=" << factory() << endl; +        kdDebug(8050) << "CervisiaPart: can't get \
XML definition for " << xmlName << ", factory()=" << factory() << endl;  }
 

--- kdesdk/cervisia/cervisiaui.rc  #1.23:1.24
@@ -108,4 +108,11 @@
   <Action name="file_properties"/>
 </Menu>
+<Menu name="folder_context_popup">
+  <Action name="file_update"/>
+  <Action name="file_commit"/>
+  <Separator/>
+  <Action name="file_add"/>
+  <Action name="file_remove"/>
+</Menu>
 <State name="has_sandbox">
   <Enable>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic