[haiku-commits] r41135 - haiku/trunk/src/kits/tracker

  • From: jonas@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 28 Mar 2011 13:05:18 +0200 (CEST)

Author: kirilla
Date: 2011-03-28 13:05:17 +0200 (Mon, 28 Mar 2011)
New Revision: 41135
Changeset: https://dev.haiku-os.org/changeset/41135

Modified:
   haiku/trunk/src/kits/tracker/ContainerWindow.cpp
Log:
Disable menu item 'Edit name' for Desktop, Root, Trash and entries with 
localized names.

Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp
===================================================================
--- haiku/trunk/src/kits/tracker/ContainerWindow.cpp    2011-03-28 08:18:31 UTC 
(rev 41134)
+++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp    2011-03-28 11:05:17 UTC 
(rev 41135)
@@ -3031,11 +3031,20 @@
                EnableNamedMenuItem(menu, kDelete, selectCount > 0);
                EnableNamedMenuItem(menu, kDuplicateSelection, selectCount > 0);
        }
+       
+       Model *selectedModel = NULL;
+       if (selectCount == 1)
+               selectedModel = 
PoseView()->SelectionList()->FirstItem()->TargetModel();
 
        if (context == kMenuBarContext || context == kPosePopUpContext) {
                SetUpEditQueryItem(menu);
                EnableNamedMenuItem(menu, kEditItem, selectCount == 1
-                       && (context == kPosePopUpContext || 
!PoseView()->ActivePose()));
+                       && (context == kPosePopUpContext || 
!PoseView()->ActivePose())
+                       && selectedModel != NULL
+                       && !selectedModel->IsDesktop()
+                       && !selectedModel->IsRoot()
+                       && !selectedModel->IsTrash()
+                       && !selectedModel->HasLocalizedName());
                SetCutItem(menu);
                SetCopyItem(menu);
                SetPasteItem(menu);


Other related posts:

  • » [haiku-commits] r41135 - haiku/trunk/src/kits/tracker - jonas