* provide descriptive tooltip texts for actions

* fixed some coding style issue (tabs...)

BUG: 213358

svn path=/trunk/KDE/kdebase/apps/; revision=1045751
This commit is contained in:
Peter Penz 2009-11-06 18:02:55 +00:00
parent 49a1a72d50
commit 7746fdb9a3
3 changed files with 23 additions and 14 deletions

View file

@ -298,11 +298,13 @@ void DolphinMainWindow::updateHistory()
const int index = urlNavigator->historyIndex();
QAction* backAction = actionCollection()->action("go_back");
backAction->setToolTip(i18nc("@info", "Go back"));
if (backAction != 0) {
backAction->setEnabled(index < urlNavigator->historySize() - 1);
}
QAction* forwardAction = actionCollection()->action("go_forward");
forwardAction->setToolTip(i18nc("@info", "Go forward"));
if (forwardAction != 0) {
forwardAction->setEnabled(index > 0);
}
@ -1208,6 +1210,7 @@ void DolphinMainWindow::setupActions()
KAction* stop = actionCollection()->addAction("stop");
stop->setText(i18nc("@action:inmenu View", "Stop"));
stop->setToolTip(i18nc("@info", "Stop loading"));
stop->setIcon(KIcon("process-stop"));
connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading()));
@ -1523,13 +1526,16 @@ void DolphinMainWindow::updateSplitAction()
if (m_viewTab[m_tabIndex].secondaryView != 0) {
if (m_activeViewContainer == m_viewTab[m_tabIndex].secondaryView) {
splitAction->setText(i18nc("@action:intoolbar Close right view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close right view"));
splitAction->setIcon(KIcon("view-right-close"));
} else {
splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close left view"));
splitAction->setIcon(KIcon("view-left-close"));
}
} else {
splitAction->setText(i18nc("@action:intoolbar Split view", "Split"));
splitAction->setToolTip(i18nc("@info", "Split view"));
splitAction->setIcon(KIcon("view-right-new"));
}
}

View file

@ -144,6 +144,7 @@ void DolphinViewActionHandler::createActions()
KToggleAction* showPreview = m_actionCollection->add<KToggleAction>("show_preview");
showPreview->setText(i18nc("@action:intoolbar", "Preview"));
showPreview->setToolTip(i18nc("@info", "Show preview of files and folders"));
showPreview->setIcon(KIcon("view-preview"));
connect(showPreview, SIGNAL(triggered(bool)), this, SLOT(togglePreview(bool)));
@ -182,12 +183,12 @@ void DolphinViewActionHandler::createActions()
findFile->setIcon(KIcon("edit-find"));
connect(findFile, SIGNAL(triggered()), this, SLOT(slotFindFile()));
// Settings menu
KAction* getServiceMenu = m_actionCollection->addAction("get_servicemenu");
getServiceMenu->setText(i18nc("@action:inmenu Settings", "Get Servicemenu..."));
getServiceMenu->setIcon(KIcon ("get-hot-new-stuff"));
connect(getServiceMenu, SIGNAL(triggered()), this, SLOT(slotGetServiceMenu()));
// Settings menu
KAction* getServiceMenu = m_actionCollection->addAction("get_servicemenu");
getServiceMenu->setText(i18nc("@action:inmenu Settings", "Get Servicemenu..."));
getServiceMenu->setIcon(KIcon("get-hot-new-stuff"));
connect(getServiceMenu, SIGNAL(triggered()), this, SLOT(slotGetServiceMenu()));
}
QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
@ -432,6 +433,7 @@ KToggleAction* DolphinViewActionHandler::iconsModeAction()
{
KToggleAction* iconsView = m_actionCollection->add<KToggleAction>("icons");
iconsView->setText(i18nc("@action:inmenu View Mode", "Icons"));
iconsView->setToolTip(i18nc("@info", "Icons view mode"));
iconsView->setShortcut(Qt::CTRL | Qt::Key_1);
iconsView->setIcon(KIcon("view-list-icons"));
iconsView->setData(QVariant::fromValue(DolphinView::IconsView));
@ -442,6 +444,7 @@ KToggleAction* DolphinViewActionHandler::detailsModeAction()
{
KToggleAction* detailsView = m_actionCollection->add<KToggleAction>("details");
detailsView->setText(i18nc("@action:inmenu View Mode", "Details"));
detailsView->setToolTip(i18nc("@info", "Details view mode"));
detailsView->setShortcut(Qt::CTRL | Qt::Key_2);
detailsView->setIcon(KIcon("view-list-details"));
detailsView->setData(QVariant::fromValue(DolphinView::DetailsView));
@ -452,6 +455,7 @@ KToggleAction* DolphinViewActionHandler::columnsModeAction()
{
KToggleAction* columnView = m_actionCollection->add<KToggleAction>("columns");
columnView->setText(i18nc("@action:inmenu View Mode", "Columns"));
columnView->setToolTip(i18nc("@info", "Columns view mode"));
columnView->setShortcut(Qt::CTRL | Qt::Key_3);
columnView->setIcon(KIcon("view-file-columns"));
columnView->setData(QVariant::fromValue(DolphinView::ColumnView));
@ -543,7 +547,7 @@ void DolphinViewActionHandler::slotProperties()
void DolphinViewActionHandler::slotGetServiceMenu()
{
KNS::Engine khns(m_currentView);
khns.init("servicemenu.knsrc");
khns.downloadDialogModal(m_currentView);
KNS::Engine khns(m_currentView);
khns.init("servicemenu.knsrc");
khns.downloadDialogModal(m_currentView);
}

View file

@ -210,10 +210,10 @@ private Q_SLOTS:
*/
void slotProperties();
/**
* Starts KHotNewStuff to download servicemenus.
*/
void slotGetServiceMenu();
/**
* Starts KHotNewStuff to download servicemenus.
*/
void slotGetServiceMenu();
private:
/**
@ -251,7 +251,6 @@ private:
*/
KToggleAction* columnsModeAction();
KActionCollection* m_actionCollection;
DolphinView* m_currentView;
};