diff options
author | Martin Smith <msmith@trolltech.com> | 2010-03-23 13:34:42 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-03-23 13:34:42 (GMT) |
commit | 265b6b3383e8e3adb89db2e6015ef10e405cf418 (patch) | |
tree | fa082478bc2725cc138d3428e315b30d5b9d2bcd /tools | |
parent | f44f210ca4611fbc30afa849058d4286e1a1284c (diff) | |
parent | c4536ce25a9fdfe6a9b447f893796c1262e06df6 (diff) | |
download | Qt-265b6b3383e8e3adb89db2e6015ef10e405cf418.zip Qt-265b6b3383e8e3adb89db2e6015ef10e405cf418.tar.gz Qt-265b6b3383e8e3adb89db2e6015ef10e405cf418.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/tools/assistant/bookmarkmanager.cpp | 5 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.cpp | 16 | ||||
-rw-r--r-- | tools/designer/src/components/formeditor/formwindowmanager.cpp | 4 | ||||
-rw-r--r-- | tools/designer/src/designer/qdesigner_actions.cpp | 10 | ||||
-rw-r--r-- | tools/linguist/linguist/mainwindow.cpp | 44 |
5 files changed, 59 insertions, 20 deletions
diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index b9a1b0e..4bc7027 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -363,8 +363,9 @@ void BookmarkManager::refeshBookmarkMenu() bookmarkMenu->addAction(tr("Manage Bookmarks..."), this, SLOT(manageBookmarks())); - bookmarkMenu->addAction(tr("Add Bookmark..."), this, SLOT(addBookmark()), - QKeySequence(tr("Ctrl+D"))); + bookmarkMenu->addAction(QIcon::fromTheme("bookmark-new"), + tr("Add Bookmark..."), this, SLOT(addBookmark()), + QKeySequence(tr("Ctrl+D"))); bookmarkMenu->addSeparator(); const QModelIndex &root = bookmarkModel->index(0, 0, QModelIndex()); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index c403aa7..913e342 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -409,6 +409,11 @@ void MainWindow::setupActions() QMenu *menu = menuBar()->addMenu(tr("&File")); + m_newTabAction = menu->addAction(tr("New &Tab"), m_centralWidget, SLOT(newTab())); + m_newTabAction->setShortcut(QKeySequence::AddTab); + + menu->addSeparator(); + m_pageSetupAction = menu->addAction(tr("Page Set&up..."), m_centralWidget, SLOT(pageSetup())); m_printPreviewAction = menu->addAction(tr("Print Preview..."), m_centralWidget, @@ -421,14 +426,12 @@ void MainWindow::setupActions() menu->addSeparator(); - m_newTabAction = menu->addAction(tr("New &Tab"), m_centralWidget, SLOT(newTab())); - m_newTabAction->setShortcut(QKeySequence::AddTab); - m_closeTabAction = menu->addAction(tr("&Close Tab"), m_centralWidget, SLOT(closeTab())); m_closeTabAction->setShortcuts(QKeySequence::Close); - QAction *tmp = menu->addAction(tr("&Quit"), this, SLOT(close())); + QAction *tmp = menu->addAction(QIcon::fromTheme("application-exit"), + tr("&Quit"), this, SLOT(close())); tmp->setMenuRole(QAction::QuitRole); #ifdef Q_OS_WIN tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); @@ -532,6 +535,8 @@ void MainWindow::setupActions() m_aboutAction->setMenuRole(QAction::AboutRole); #ifdef Q_WS_X11 + m_newTabAction->setIcon(QIcon::fromTheme("tab-new", m_newTabAction->icon())); + m_closeTabAction->setIcon(QIcon::fromTheme("window-close", m_closeTabAction->icon())); m_backAction->setIcon(QIcon::fromTheme("go-previous" , m_backAction->icon())); m_nextAction->setIcon(QIcon::fromTheme("go-next" , m_nextAction->icon())); m_zoomInAction->setIcon(QIcon::fromTheme("zoom-in" , m_zoomInAction->icon())); @@ -541,7 +546,10 @@ void MainWindow::setupActions() m_copyAction->setIcon(QIcon::fromTheme("edit-copy" , m_copyAction->icon())); m_findAction->setIcon(QIcon::fromTheme("edit-find" , m_findAction->icon())); m_homeAction->setIcon(QIcon::fromTheme("go-home" , m_homeAction->icon())); + m_pageSetupAction->setIcon(QIcon::fromTheme("document-page-setup", m_pageSetupAction->icon())); + m_printPreviewAction->setIcon(QIcon::fromTheme("document-print-preview", m_printPreviewAction->icon())); m_printAction->setIcon(QIcon::fromTheme("document-print" , m_printAction->icon())); + m_aboutAction->setIcon(QIcon::fromTheme("help-about", m_aboutAction->icon())); #endif QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar")); diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index 88b4ac5..ce809ff 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -523,10 +523,11 @@ void FormWindowManager::setupActions() connect(m_actionShowFormWindowSettingsDialog, SIGNAL(triggered()), this, SLOT(slotActionShowFormWindowSettingsDialog())); m_actionShowFormWindowSettingsDialog->setEnabled(false); - +#ifdef Q_WS_X11 m_actionCopy->setIcon(QIcon::fromTheme("edit-copy", m_actionCopy->icon())); m_actionCut->setIcon(QIcon::fromTheme("edit-cut", m_actionCut->icon())); m_actionPaste->setIcon(QIcon::fromTheme("edit-paste", m_actionPaste->icon())); + m_actionDelete->setIcon(QIcon::fromTheme("edit-delete", m_actionDelete->icon())); // These do not currently exist, but will allow theme authors to fill in the gaps m_actionBreakLayout->setIcon(QIcon::fromTheme("designer-break-layout", m_actionBreakLayout->icon())); @@ -536,6 +537,7 @@ void FormWindowManager::setupActions() m_actionSplitHorizontal->setIcon(QIcon::fromTheme("designer-split-horizontal", m_actionSplitHorizontal->icon())); m_actionSplitVertical->setIcon(QIcon::fromTheme("designer-split-vertical", m_actionSplitVertical->icon())); m_actionAdjustSize->setIcon(QIcon::fromTheme("designer-adjust-size", m_actionAdjustSize->icon())); +#endif } void FormWindowManager::slotActionCutActivated() diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp index 887ba98..6776351 100644 --- a/tools/designer/src/designer/qdesigner_actions.cpp +++ b/tools/designer/src/designer/qdesigner_actions.cpp @@ -200,9 +200,15 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) #endif m_previewManager(0) { +#ifdef Q_WS_X11 m_newFormAction->setIcon(QIcon::fromTheme("document-new", m_newFormAction->icon())); m_openFormAction->setIcon(QIcon::fromTheme("document-open", m_openFormAction->icon())); m_saveFormAction->setIcon(QIcon::fromTheme("document-save", m_saveFormAction->icon())); + m_saveFormAsAction->setIcon(QIcon::fromTheme("document-save-as", m_saveFormAsAction->icon())); + m_printPreviewAction->setIcon(QIcon::fromTheme("document-print", m_printPreviewAction->icon())); + m_closeFormAction->setIcon(QIcon::fromTheme("window-close", m_closeFormAction->icon())); + m_quitAction->setIcon(QIcon::fromTheme("application-exit", m_quitAction->icon())); +#endif Q_ASSERT(m_core != 0); qdesigner_internal::QDesignerFormWindowManager *ifwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager *>(m_core->formWindowManager()); @@ -490,13 +496,13 @@ QAction *QDesignerActions::createRecentFilesMenu() } updateRecentFileActions(); menu->addSeparator(); - act = new QAction(tr("Clear &Menu"), this); + act = new QAction(QIcon::fromTheme("edit-clear"), tr("Clear &Menu"), this); act->setObjectName(QLatin1String("__qt_action_clear_menu_")); connect(act, SIGNAL(triggered()), this, SLOT(clearRecentFiles())); m_recentFilesActions->addAction(act); menu->addAction(act); - act = new QAction(tr("&Recent Forms"), this); + act = new QAction(QIcon::fromTheme("document-open-recent"), tr("&Recent Forms"), this); act->setMenu(menu); return act; } diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 321fe8c..7d73596 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -1810,28 +1810,50 @@ QString MainWindow::friendlyString(const QString& str) return f.simplified(); } +static inline void setThemeIcon(QAction *action, const char *name, const char *fallback) +{ + const QIcon fallbackIcon(MainWindow::resourcePrefix() + QLatin1String(fallback)); +#ifdef Q_WS_X11 + action->setIcon(QIcon::fromTheme(QLatin1String(name), fallbackIcon)); +#else + Q_UNUSED(name) + action->setIcon(fallbackIcon); +#endif +} + void MainWindow::setupMenuBar() { + // There are no fallback icons for these +#ifdef Q_WS_X11 + m_ui.menuRecentlyOpenedFiles->setIcon(QIcon::fromTheme(QLatin1String("document-open-recent"))); + m_ui.actionCloseAll->setIcon(QIcon::fromTheme(QLatin1String("window-close"))); + m_ui.actionExit->setIcon(QIcon::fromTheme(QLatin1String("application-exit"))); + m_ui.actionSelectAll->setIcon(QIcon::fromTheme(QLatin1String("edit-select-all"))); +#endif + + // Prefer theme icons when available for these actions + setThemeIcon(m_ui.actionOpen, "document-open", "/fileopen.png"); + setThemeIcon(m_ui.actionOpenAux, "document-open", "/fileopen.png"); + setThemeIcon(m_ui.actionSave, "document-save", "/filesave.png"); + setThemeIcon(m_ui.actionSaveAll, "document-save", "/filesave.png"); + setThemeIcon(m_ui.actionPrint, "document-print", "/print.png"); + setThemeIcon(m_ui.actionRedo, "edit-redo", "/redo.png"); + setThemeIcon(m_ui.actionUndo, "edit-undo", "/undo.png"); + setThemeIcon(m_ui.actionCut, "edit-cut", "/editcut.png"); + setThemeIcon(m_ui.actionCopy, "edit-copy", "/editcopy.png"); + setThemeIcon(m_ui.actionPaste, "edit-paste", "/editpaste.png"); + setThemeIcon(m_ui.actionFind, "edit-find", "/searchfind.png"); + + // No well defined theme icons for these actions m_ui.actionAccelerators->setIcon(QIcon(resourcePrefix() + QLatin1String("/accelerator.png"))); m_ui.actionOpenPhraseBook->setIcon(QIcon(resourcePrefix() + QLatin1String("/book.png"))); m_ui.actionDoneAndNext->setIcon(QIcon(resourcePrefix() + QLatin1String("/doneandnext.png"))); - m_ui.actionCopy->setIcon(QIcon(resourcePrefix() + QLatin1String("/editcopy.png"))); - m_ui.actionCut->setIcon(QIcon(resourcePrefix() + QLatin1String("/editcut.png"))); - m_ui.actionPaste->setIcon(QIcon(resourcePrefix() + QLatin1String("/editpaste.png"))); - m_ui.actionOpen->setIcon(QIcon(resourcePrefix() + QLatin1String("/fileopen.png"))); - m_ui.actionOpenAux->setIcon(QIcon(resourcePrefix() + QLatin1String("/fileopen.png"))); - m_ui.actionSaveAll->setIcon(QIcon(resourcePrefix() + QLatin1String("/filesave.png"))); - m_ui.actionSave->setIcon(QIcon(resourcePrefix() + QLatin1String("/filesave.png"))); m_ui.actionNext->setIcon(QIcon(resourcePrefix() + QLatin1String("/next.png"))); m_ui.actionNextUnfinished->setIcon(QIcon(resourcePrefix() + QLatin1String("/nextunfinished.png"))); m_ui.actionPhraseMatches->setIcon(QIcon(resourcePrefix() + QLatin1String("/phrase.png"))); m_ui.actionEndingPunctuation->setIcon(QIcon(resourcePrefix() + QLatin1String("/punctuation.png"))); m_ui.actionPrev->setIcon(QIcon(resourcePrefix() + QLatin1String("/prev.png"))); m_ui.actionPrevUnfinished->setIcon(QIcon(resourcePrefix() + QLatin1String("/prevunfinished.png"))); - m_ui.actionPrint->setIcon(QIcon(resourcePrefix() + QLatin1String("/print.png"))); - m_ui.actionRedo->setIcon(QIcon(resourcePrefix() + QLatin1String("/redo.png"))); - m_ui.actionFind->setIcon(QIcon(resourcePrefix() + QLatin1String("/searchfind.png"))); - m_ui.actionUndo->setIcon(QIcon(resourcePrefix() + QLatin1String("/undo.png"))); m_ui.actionPlaceMarkerMatches->setIcon(QIcon(resourcePrefix() + QLatin1String("/validateplacemarkers.png"))); m_ui.actionWhatsThis->setIcon(QIcon(resourcePrefix() + QLatin1String("/whatsthis.png"))); |