diff options
| author | Peter Penz <[email protected]> | 2008-06-29 13:54:52 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-06-29 13:54:52 +0000 |
| commit | b5de4d8ffb3823c6c4bc0ce3d47e74bfa3970d5e (patch) | |
| tree | d57bdafebbb8fcd295495b9a358b77fbb4d3c80e | |
| parent | cb32d720d1b6ab82709697b2e4b9cf1067c14151 (diff) | |
Don't disable the "Properties" action when no file is selected, just use the current folder as source. TODO: the code in DolphinPart::slotProperties() and DolphinMainWindow::properties() is quite similar -> move to DolphinViewActionHandler?
CCMAIL: [email protected]
BUG: 165311
svn path=/trunk/KDE/kdebase/apps/; revision=825846
| -rw-r--r-- | src/dolphinmainwindow.cpp | 8 | ||||
| -rw-r--r-- | src/dolphinpart.cpp | 16 | ||||
| -rw-r--r-- | src/dolphinpart.rc | 2 | ||||
| -rw-r--r-- | src/dolphinui.rc | 3 |
4 files changed, 19 insertions, 10 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 46937fe1a..6822250e1 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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(); diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index b56e7b3a1..3a94a7107 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -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) diff --git a/src/dolphinpart.rc b/src/dolphinpart.rc index e285437d5..5f60737fc 100644 --- a/src/dolphinpart.rc +++ b/src/dolphinpart.rc @@ -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> diff --git a/src/dolphinui.rc b/src/dolphinui.rc index 05875dcd4..c951f856b 100644 --- a/src/dolphinui.rc +++ b/src/dolphinui.rc @@ -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> @@ -110,7 +108,6 @@ <Action name="move_to_trash" /> <Action name="delete" /> <Action name="delete_shortcut" /> - <Action name="properties" /> <Action name="invert_selection" /> </disable> </State> |
