Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
f9504cd3
Commit
f9504cd3
authored
14 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Find Dialog: Update en/disabled state on finishing searching
Makes QTCREATORBUG-2243 easier to do.
parent
7c2d3659
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/find/findtoolwindow.cpp
+20
-14
20 additions, 14 deletions
src/plugins/find/findtoolwindow.cpp
src/plugins/find/findtoolwindow.h
+1
-0
1 addition, 0 deletions
src/plugins/find/findtoolwindow.h
with
21 additions
and
14 deletions
src/plugins/find/findtoolwindow.cpp
+
20
−
14
View file @
f9504cd3
...
@@ -45,7 +45,8 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin)
...
@@ -45,7 +45,8 @@ FindToolWindow::FindToolWindow(FindPlugin *plugin)
:
QDialog
(
Core
::
ICore
::
instance
()
->
mainWindow
()),
:
QDialog
(
Core
::
ICore
::
instance
()
->
mainWindow
()),
m_plugin
(
plugin
),
m_plugin
(
plugin
),
m_findCompleter
(
new
QCompleter
(
this
)),
m_findCompleter
(
new
QCompleter
(
this
)),
m_currentFilter
(
0
)
m_currentFilter
(
0
),
m_configWidget
(
0
)
{
{
m_ui
.
setupUi
(
this
);
m_ui
.
setupUi
(
this
);
connect
(
m_ui
.
closeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
reject
()));
connect
(
m_ui
.
closeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
reject
()));
...
@@ -84,11 +85,21 @@ bool FindToolWindow::eventFilter(QObject *obj, QEvent *event)
...
@@ -84,11 +85,21 @@ bool FindToolWindow::eventFilter(QObject *obj, QEvent *event)
void
FindToolWindow
::
updateButtonStates
()
void
FindToolWindow
::
updateButtonStates
()
{
{
bool
e
nabled
=
!
m_
ui
.
searchT
er
m
->
text
().
isEmpty
()
bool
filterE
nabled
=
m_
currentFilter
&&
m_currentFilt
er
->
isEnabled
()
;
&&
m_currentFilter
&&
m_currentF
ilter
->
is
Enabled
()
;
bool
enabled
=
!
m_ui
.
searchTerm
->
text
().
isEmpty
()
&&
f
ilterEnabled
;
m_ui
.
searchButton
->
setEnabled
(
enabled
);
m_ui
.
searchButton
->
setEnabled
(
enabled
);
m_ui
.
replaceButton
->
setEnabled
(
m_currentFilter
m_ui
.
replaceButton
->
setEnabled
(
m_currentFilter
&&
m_currentFilter
->
isReplaceSupported
()
&&
enabled
);
&&
m_currentFilter
->
isReplaceSupported
()
&&
enabled
);
if
(
m_configWidget
)
m_configWidget
->
setEnabled
(
filterEnabled
);
m_ui
.
matchCase
->
setEnabled
(
filterEnabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindCaseSensitively
));
m_ui
.
wholeWords
->
setEnabled
(
filterEnabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindWholeWords
));
m_ui
.
regExp
->
setEnabled
(
filterEnabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindRegularExpression
));
m_ui
.
searchTerm
->
setEnabled
(
filterEnabled
);
}
}
void
FindToolWindow
::
setFindFilters
(
const
QList
<
IFindFilter
*>
&
filters
)
void
FindToolWindow
::
setFindFilters
(
const
QList
<
IFindFilter
*>
&
filters
)
...
@@ -135,19 +146,14 @@ void FindToolWindow::setCurrentFilter(int index)
...
@@ -135,19 +146,14 @@ void FindToolWindow::setCurrentFilter(int index)
for
(
int
i
=
0
;
i
<
m_configWidgets
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
m_configWidgets
.
size
();
++
i
)
{
QWidget
*
configWidget
=
m_configWidgets
.
at
(
i
);
QWidget
*
configWidget
=
m_configWidgets
.
at
(
i
);
if
(
i
==
index
)
{
if
(
i
==
index
)
{
m_configWidget
=
configWidget
;
if
(
m_currentFilter
)
disconnect
(
m_currentFilter
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateButtonStates
()));
m_currentFilter
=
m_filters
.
at
(
i
);
m_currentFilter
=
m_filters
.
at
(
i
);
bool
enabled
=
m_currentFilter
->
isEnabled
();
connect
(
m_currentFilter
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateButtonStates
()));
m_ui
.
matchCase
->
setEnabled
(
enabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindCaseSensitively
));
m_ui
.
wholeWords
->
setEnabled
(
enabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindWholeWords
));
m_ui
.
regExp
->
setEnabled
(
enabled
&&
(
m_currentFilter
->
supportedFindFlags
()
&
Find
::
FindRegularExpression
));
m_ui
.
searchTerm
->
setEnabled
(
enabled
);
updateButtonStates
();
updateButtonStates
();
if
(
configWidget
)
{
if
(
m_configWidget
)
{
configWidget
->
setEnabled
(
enabled
);
m_ui
.
configWidget
->
layout
()
->
addWidget
(
m_configWidget
);
m_ui
.
configWidget
->
layout
()
->
addWidget
(
configWidget
);
}
}
}
else
{
}
else
{
if
(
configWidget
)
if
(
configWidget
)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/find/findtoolwindow.h
+
1
−
0
View file @
f9504cd3
...
@@ -75,6 +75,7 @@ private:
...
@@ -75,6 +75,7 @@ private:
QCompleter
*
m_findCompleter
;
QCompleter
*
m_findCompleter
;
QWidgetList
m_configWidgets
;
QWidgetList
m_configWidgets
;
IFindFilter
*
m_currentFilter
;
IFindFilter
*
m_currentFilter
;
QWidget
*
m_configWidget
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment