Commit 9eba87bd authored by con's avatar con
Browse files

Add "Advanced..." button to find tool bar that opens the search dialog.

We had multiple cases where people were assuming that you can't do
project wide search/replace, because they tried Ctrl+f and that is only
single file.

Reviewed-by: Thorbjørn Lindeijer
parent 56523377
......@@ -209,7 +209,8 @@ void FindPlugin::setupMenu()
mfindadvanced->menu()->setTitle(tr("Advanced Find"));
mfind->addMenu(mfindadvanced, Constants::G_FIND_FILTERS);
d->m_openFindDialog = new QAction(tr("Open Advanced Find..."), this);
cmd = am->registerAction(d->m_openFindDialog, QLatin1String("Find.Dialog"), globalcontext);
d->m_openFindDialog->setIconText(tr("Advanced..."));
cmd = am->registerAction(d->m_openFindDialog, Constants::ADVANCED_FIND, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F")));
mfindadvanced->addAction(cmd);
connect(d->m_openFindDialog, SIGNAL(triggered()), this, SLOT(openFindFilter()));
......
......@@ -140,6 +140,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::Command *cmd;
m_ui.advancedButton->setDefaultAction(am->command(Constants::ADVANCED_FIND)->action());
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);
......@@ -345,6 +347,7 @@ void FindToolBar::updateToolBar()
m_ui.replaceButton->setVisible(replaceEnabled);
m_ui.replaceNextButton->setVisible(replaceEnabled);
m_ui.replaceAllButton->setVisible(replaceEnabled);
m_ui.advancedButton->setVisible(replaceEnabled);
layout()->invalidate();
if (!replaceEnabled && enabled && replaceFocus)
......
......@@ -168,6 +168,16 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="advancedButton">
<property name="text">
<string>Advanced...</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
......
......@@ -40,6 +40,7 @@ const char * const G_FIND_FILTERS = "Find.FindMenu.Filters";
const char * const G_FIND_FLAGS = "Find.FindMenu.Flags";
const char * const G_FIND_ACTIONS = "Find.FindMenu.Actions";
const char * const ADVANCED_FIND = "Find.Dialog";
const char * const FIND = "Find.FindReplace";
const char * const FIND_IN_DOCUMENT = "Find.FindInCurrentDocument";
const char * const FIND_NEXT = "Find.FindNext";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment