Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
393a0374
Commit
393a0374
authored
Mar 26, 2009
by
con
Browse files
Shortcut for just opening search dialog with last filter.
Task-number: 237733
parent
bd3bf8a3
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/find/findplugin.cpp
View file @
393a0374
...
...
@@ -105,6 +105,14 @@ void FindPlugin::filterChanged()
QTC_ASSERT
(
changedFilter
,
return
);
QTC_ASSERT
(
action
,
return
);
action
->
setEnabled
(
changedFilter
->
isEnabled
());
bool
haveEnabledFilters
=
false
;
foreach
(
IFindFilter
*
filter
,
m_filterActions
.
keys
())
{
if
(
filter
->
isEnabled
())
{
haveEnabledFilters
=
true
;
break
;
}
}
m_openFindDialog
->
setEnabled
(
haveEnabledFilters
);
}
void
FindPlugin
::
openFindFilter
()
...
...
@@ -112,8 +120,6 @@ void FindPlugin::openFindFilter()
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
());
QTC_ASSERT
(
action
,
return
);
IFindFilter
*
filter
=
action
->
data
().
value
<
IFindFilter
*>
();
QTC_ASSERT
(
filter
,
return
);
QTC_ASSERT
(
filter
->
isEnabled
(),
return
);
QString
currentFindString
=
(
m_currentDocumentFind
->
isEnabled
()
?
m_currentDocumentFind
->
currentFindString
()
:
""
);
if
(
!
currentFindString
.
isEmpty
())
m_findDialog
->
setFindText
(
currentFindString
);
...
...
@@ -127,6 +133,7 @@ void FindPlugin::setupMenu()
Core
::
ActionContainer
*
mfind
=
am
->
createMenu
(
Constants
::
M_FIND
);
medit
->
addMenu
(
mfind
,
Core
::
Constants
::
G_EDIT_FIND
);
mfind
->
menu
()
->
setTitle
(
tr
(
"&Find/Replace"
));
mfind
->
appendGroup
(
Constants
::
G_FIND_CURRENTDOCUMENT
);
mfind
->
appendGroup
(
Constants
::
G_FIND_FILTERS
);
mfind
->
appendGroup
(
Constants
::
G_FIND_FLAGS
);
mfind
->
appendGroup
(
Constants
::
G_FIND_ACTIONS
);
...
...
@@ -141,6 +148,12 @@ void FindPlugin::setupMenu()
separator
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
separator
,
QLatin1String
(
"Find.Sep.Actions"
),
globalcontext
);
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_ACTIONS
);
m_openFindDialog
=
new
QAction
(
tr
(
"Find Dialog"
),
this
);
cmd
=
am
->
registerAction
(
m_openFindDialog
,
QLatin1String
(
"Find.Dialog"
),
globalcontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+Shift+F"
)));
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_FILTERS
);
connect
(
m_openFindDialog
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFindFilter
()));
}
void
FindPlugin
::
setupFilterMenuItems
()
...
...
@@ -153,9 +166,13 @@ void FindPlugin::setupFilterMenuItems()
Core
::
ActionContainer
*
mfind
=
am
->
actionContainer
(
Constants
::
M_FIND
);
m_filterActions
.
clear
();
bool
haveEnabledFilters
=
false
;
foreach
(
IFindFilter
*
filter
,
findInterfaces
)
{
QAction
*
action
=
new
QAction
(
filter
->
name
(),
this
);
action
->
setEnabled
(
filter
->
isEnabled
());
QAction
*
action
=
new
QAction
(
QString
(
" %1"
).
arg
(
filter
->
name
()),
this
);
bool
isEnabled
=
filter
->
isEnabled
();
if
(
isEnabled
)
haveEnabledFilters
=
true
;
action
->
setEnabled
(
isEnabled
);
action
->
setData
(
qVariantFromValue
(
filter
));
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"FindFilter."
)
+
filter
->
name
(),
globalcontext
);
cmd
->
setDefaultKeySequence
(
filter
->
defaultShortcut
());
...
...
@@ -165,6 +182,8 @@ void FindPlugin::setupFilterMenuItems()
connect
(
filter
,
SIGNAL
(
changed
()),
this
,
SLOT
(
filterChanged
()));
}
m_findDialog
->
setFindFilters
(
findInterfaces
);
m_openFindDialog
->
setEnabled
(
haveEnabledFilters
);
}
QTextDocument
::
FindFlags
FindPlugin
::
findFlags
()
const
...
...
src/plugins/find/findplugin.h
View file @
393a0374
...
...
@@ -97,6 +97,7 @@ private:
QStringListModel
*
m_replaceCompletionModel
;
QStringList
m_findCompletions
;
QStringList
m_replaceCompletions
;
QAction
*
m_openFindDialog
;
};
}
// namespace Internal
...
...
src/plugins/find/findtoolbar.cpp
View file @
393a0374
...
...
@@ -149,7 +149,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
m_findInDocumentAction
=
new
QAction
(
tr
(
"Current Document"
),
this
);
cmd
=
am
->
registerAction
(
m_findInDocumentAction
,
Constants
::
FIND_IN_DOCUMENT
,
globalcontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Find
);
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_
FILTERS
);
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_
CURRENTDOCUMENT
);
connect
(
m_findInDocumentAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFind
()));
if
(
QApplication
::
clipboard
()
->
supportsFindBuffer
())
{
...
...
src/plugins/find/textfindconstants.h
View file @
393a0374
...
...
@@ -34,6 +34,7 @@ namespace Find {
namespace
Constants
{
const
char
*
const
M_FIND
=
"Find.FindMenu"
;
const
char
*
const
G_FIND_CURRENTDOCUMENT
=
"Find.FindMenu.CurrentDocument"
;
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"
;
...
...
src/plugins/projectexplorer/allprojectsfind.cpp
View file @
393a0374
...
...
@@ -65,7 +65,7 @@ bool AllProjectsFind::isEnabled() const
QKeySequence
AllProjectsFind
::
defaultShortcut
()
const
{
return
QKeySequence
(
"Ctrl+Shift+F"
);
return
QKeySequence
();
}
QStringList
AllProjectsFind
::
files
()
...
...
src/plugins/projectexplorer/currentprojectfind.cpp
View file @
393a0374
...
...
@@ -64,7 +64,7 @@ bool CurrentProjectFind::isEnabled() const
QKeySequence
CurrentProjectFind
::
defaultShortcut
()
const
{
return
QKeySequence
(
"Ctrl+Alt+F"
);
return
QKeySequence
();
}
QStringList
CurrentProjectFind
::
files
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment