forked from qt-creator/qt-creator
Use some more standard icons from the theme
Added icons for Save As, Exit, Select All, Go To Line, About and Search & Replace actions.
This commit is contained in:
@@ -278,7 +278,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
ActionManager *am = m_d->m_core->actionManager();
|
||||
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
|
||||
|
||||
//Revert to saved
|
||||
// Revert to saved
|
||||
Command *cmd = am->registerAction(m_d->m_revertToSavedAction,
|
||||
Constants::REVERTTOSAVED, editManagerContext);
|
||||
cmd->setAttribute(Command::CA_UpdateText);
|
||||
@@ -286,18 +286,18 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||
connect(m_d->m_revertToSavedAction, SIGNAL(triggered()), this, SLOT(revertToSaved()));
|
||||
|
||||
//Save Action
|
||||
// Save Action
|
||||
am->registerAction(m_d->m_saveAction, Constants::SAVE, editManagerContext);
|
||||
connect(m_d->m_saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
|
||||
|
||||
//Save As Action
|
||||
// Save As Action
|
||||
am->registerAction(m_d->m_saveAsAction, Constants::SAVEAS, editManagerContext);
|
||||
connect(m_d->m_saveAsAction, SIGNAL(triggered()), this, SLOT(saveFileAs()));
|
||||
|
||||
//Window Menu
|
||||
// Window Menu
|
||||
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
|
||||
|
||||
//Window menu separators
|
||||
// Window menu separators
|
||||
QAction *tmpaction = new QAction(this);
|
||||
tmpaction->setSeparator(true);
|
||||
cmd = am->registerAction(tmpaction, QLatin1String("QtCreator.Window.Sep.Split"), editManagerContext);
|
||||
@@ -308,7 +308,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
cmd = am->registerAction(tmpaction, QLatin1String("QtCreator.Window.Sep.Navigate"), editManagerContext);
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_NAVIGATE);
|
||||
|
||||
//Close Action
|
||||
// Close Action
|
||||
cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext);
|
||||
#ifdef Q_WS_WIN
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F4")));
|
||||
@@ -320,13 +320,13 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
|
||||
connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor()));
|
||||
|
||||
//Close All Action
|
||||
// Close All Action
|
||||
cmd = am->registerAction(m_d->m_closeAllEditorsAction, Constants::CLOSEALL, editManagerContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+W")));
|
||||
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
|
||||
connect(m_d->m_closeAllEditorsAction, SIGNAL(triggered()), this, SLOT(closeAllEditors()));
|
||||
|
||||
//Close All Others Action
|
||||
// Close All Others Action
|
||||
cmd = am->registerAction(m_d->m_closeOtherEditorsAction, Constants::CLOSEOTHERS, editManagerContext);
|
||||
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
|
||||
cmd->setAttribute(Core::Command::CA_UpdateText);
|
||||
|
||||
@@ -579,7 +579,8 @@ void MainWindow::registerDefaultActions()
|
||||
mfile->addAction(cmd, Constants::G_FILE_SAVE);
|
||||
|
||||
// Save As Action
|
||||
tmpaction = new QAction(tr("Save &As..."), this);
|
||||
icon = QIcon::fromTheme(QLatin1String("document-save-as"));
|
||||
tmpaction = new QAction(icon, tr("Save &As..."), this);
|
||||
cmd = am->registerAction(tmpaction, Constants::SAVEAS, m_globalContext);
|
||||
#ifdef Q_WS_MAC
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
|
||||
@@ -604,7 +605,8 @@ void MainWindow::registerDefaultActions()
|
||||
mfile->addAction(cmd, Constants::G_FILE_PRINT);
|
||||
|
||||
// Exit Action
|
||||
m_exitAction = new QAction(tr("E&xit"), this);
|
||||
icon = QIcon::fromTheme(QLatin1String("application-exit"));
|
||||
m_exitAction = new QAction(icon, tr("E&xit"), this);
|
||||
cmd = am->registerAction(m_exitAction, Constants::EXIT, m_globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Q")));
|
||||
mfile->addAction(cmd, Constants::G_FILE_OTHER);
|
||||
@@ -655,14 +657,16 @@ void MainWindow::registerDefaultActions()
|
||||
tmpaction->setEnabled(false);
|
||||
|
||||
// Select All
|
||||
tmpaction = new QAction(tr("&Select All"), this);
|
||||
icon = QIcon::fromTheme(QLatin1String("edit-select-all"));
|
||||
tmpaction = new QAction(icon, tr("&Select All"), this);
|
||||
cmd = am->registerAction(tmpaction, Constants::SELECTALL, m_globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence::SelectAll);
|
||||
medit->addAction(cmd, Constants::G_EDIT_SELECTALL);
|
||||
tmpaction->setEnabled(false);
|
||||
|
||||
// Goto Action
|
||||
tmpaction = new QAction(tr("&Go To Line..."), this);
|
||||
icon = QIcon::fromTheme(QLatin1String("go-jump"));
|
||||
tmpaction = new QAction(icon, tr("&Go To Line..."), this);
|
||||
cmd = am->registerAction(tmpaction, Constants::GOTO, m_globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+L")));
|
||||
medit->addAction(cmd, Constants::G_EDIT_OTHER);
|
||||
@@ -724,10 +728,11 @@ void MainWindow::registerDefaultActions()
|
||||
#endif
|
||||
|
||||
// About IDE Action
|
||||
icon = QIcon::fromTheme(QLatin1String("help-about"));
|
||||
#ifdef Q_WS_MAC
|
||||
tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||
tmpaction = new QAction(icon, tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||
#else
|
||||
tmpaction = new QAction(tr("About &Qt Creator..."), this);
|
||||
tmpaction = new QAction(icon, tr("About &Qt Creator..."), this);
|
||||
#endif
|
||||
cmd = am->registerAction(tmpaction, Constants::ABOUT_QTCREATOR, m_globalContext);
|
||||
mhelp->addAction(cmd, Constants::G_HELP_ABOUT);
|
||||
|
||||
@@ -133,7 +133,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
||||
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
|
||||
Core::Command *cmd;
|
||||
|
||||
m_findInDocumentAction = new QAction(tr("Find/Replace"), this);
|
||||
QIcon icon = QIcon::fromTheme(QLatin1String("edit-find-replace"));
|
||||
m_findInDocumentAction = new QAction(icon, tr("Find/Replace"), this);
|
||||
cmd = am->registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext);
|
||||
cmd->setDefaultKeySequence(QKeySequence::Find);
|
||||
mfind->addAction(cmd, Constants::G_FIND_CURRENTDOCUMENT);
|
||||
|
||||
Reference in New Issue
Block a user