]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't disable the "Properties" action when no file is selected, just use the current...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 29 Jun 2008 13:54:52 +0000 (13:54 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 29 Jun 2008 13:54:52 +0000 (13:54 +0000)
CCMAIL: faure@kde.org
BUG: 165311

svn path=/trunk/KDE/kdebase/apps/; revision=825846

src/dolphinmainwindow.cpp
src/dolphinpart.cpp
src/dolphinpart.rc
src/dolphinui.rc

index 46937fe1a50f477997fd953b0efbb94e5b05e57a..6822250e1706b4becaff9795694b26821e50c04f 100644 (file)
@@ -355,9 +355,15 @@ void DolphinMainWindow::updateNewMenu()
 
 void DolphinMainWindow::properties()
 {
+    KPropertiesDialog* dialog = 0;
     const KFileItemList list = m_activeViewContainer->view()->selectedItems();
+    if (list.isEmpty()) {
+        const KUrl url = activeViewContainer()->url();
+        dialog = new KPropertiesDialog(url, this);
+    } else {
+        dialog = new KPropertiesDialog(list, this);
+    }
 
-    KPropertiesDialog *dialog = new KPropertiesDialog(list, this);
     dialog->setAttribute(Qt::WA_DeleteOnClose);
     dialog->show();
     dialog->raise();
index b56e7b3a1563de0ce87376ce2e65518c88b2e8d2..3a94a71070d23f7e6256deb2181b2393215cc5ce 100644 (file)
@@ -449,11 +449,19 @@ void DolphinPart::slotEditMimeType()
 
 void DolphinPart::slotProperties()
 {
-    const KFileItemList items = m_view->selectedItems();
-    if (!items.isEmpty()) {
-        KPropertiesDialog dialog(items.first().url(), m_view);
-        dialog.exec();
+    KPropertiesDialog* dialog = 0;
+    const KFileItemList list = m_view->selectedItems();
+    if (list.isEmpty()) {
+        const KUrl url = m_view->url();
+        dialog = new KPropertiesDialog(url, m_view);
+    } else {
+        dialog = new KPropertiesDialog(list, m_view);
     }
+
+    dialog->setAttribute(Qt::WA_DeleteOnClose);
+    dialog->show();
+    dialog->raise();
+    dialog->activateWindow();
 }
 
 void DolphinPart::setCurrentViewMode(const QString& viewModeName)
index e285437d59c154011694aaf74c43db8a38d724dc..5f60737fc3c983dcafa74d285856f5db9131589b 100644 (file)
@@ -67,7 +67,6 @@
   <enable>
    <Action name="move_to_trash" />
    <Action name="delete" />
-   <Action name="properties" />
   </enable>
  </State>
  <State name="has_no_selection" >
@@ -75,7 +74,6 @@
    <Action name="rename" />
    <Action name="move_to_trash" />
    <Action name="delete" />
-   <Action name="properties" />
   </disable>
 </State>
 </kpartgui>
index 05875dcd41460a2a5103c664b53303cf822f2a5a..c951f856b6df6c2245a9a883e0950cc2e1a6ce41 100644 (file)
@@ -86,7 +86,6 @@
    <Action name="delete" />
    <Action name="invert_selection" />
    <Separator/>
-   <Action name="properties" />
    <Action name="go_back" />
    <Action name="go_forward" />
   </disable>
@@ -98,7 +97,6 @@
    <Action name="rename" />
    <Action name="move_to_trash" />
    <Action name="delete" />
-   <Action name="properties" />
    <Action name="invert_selection" />
   </enable>
  </State>
    <Action name="move_to_trash" />
    <Action name="delete" />
    <Action name="delete_shortcut" />
-   <Action name="properties" />
    <Action name="invert_selection" />
   </disable>
  </State>