1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
diff -Nur ori/tdelibs/tdeutils/kfinddialog.cpp new/tdelibs/tdeutils/kfinddialog.cpp
--- ori/tdelibs/tdeutils/kfinddialog.cpp 2014-02-05 16:54:13.852605699 +0900
+++ new/tdelibs/tdeutils/kfinddialog.cpp 2014-02-11 18:16:55.292214876 +0900
@@ -149,8 +149,9 @@
m_replace->setMaxCount(10);
m_replace->setDuplicatesEnabled(false);
m_backRef = new TQCheckBox(i18n("Use p&laceholders"), m_replaceGrp);
+ m_backRef->setEnabled(m_regExp->isChecked());
m_backRefItem = new TQPushButton(i18n("Insert Place&holder"), m_replaceGrp);
- m_backRefItem->setEnabled(false);
+ m_backRefItem->setEnabled(m_regExp->isChecked() && m_backRef->isChecked());
m_replaceLayout->addWidget(m_replaceLabel, 0, 0);
m_replaceLayout->addMultiCellWidget(m_replace, 1, 1, 0, 1);
@@ -193,8 +194,8 @@
// signals and slots connections
connect(m_selectedText, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSelectedTextToggled(bool)));
- connect(m_regExp, TQT_SIGNAL(toggled(bool)), m_regExpItem, TQT_SLOT(setEnabled(bool)));
- connect(m_backRef, TQT_SIGNAL(toggled(bool)), m_backRefItem, TQT_SLOT(setEnabled(bool)));
+ connect(m_regExp, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotRegexCheckBoxToggled(bool)));
+ connect(m_backRef, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotPlaceholdersCheckBoxToggled(bool)));
connect(m_regExpItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPatterns()));
connect(m_backRefItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(showPlaceholders()));
@@ -276,11 +277,23 @@
"Ask before replacing each match found.") );
}
-void KFindDialog::textSearchChanged( const TQString & text)
+void KFindDialog::textSearchChanged(const TQString & text)
{
enableButtonOK( !text.isEmpty() );
}
+void KFindDialog::slotRegexCheckBoxToggled(bool checked)
+{
+ m_regExpItem->setEnabled(checked);
+ m_backRef->setEnabled(checked);
+ m_backRefItem->setEnabled(checked && m_backRef->isChecked());
+}
+
+void KFindDialog::slotPlaceholdersCheckBoxToggled(bool checked)
+{
+ m_backRefItem->setEnabled(checked && m_regExp->isChecked());
+}
+
void KFindDialog::showEvent( TQShowEvent *e )
{
if ( !d->m_initialShowDone )
diff -Nur ori/tdelibs/tdeutils/kfinddialog.h new/tdelibs/tdeutils/kfinddialog.h
--- ori/tdelibs/tdeutils/kfinddialog.h 2014-02-05 16:54:13.852605699 +0900
+++ new/tdelibs/tdeutils/kfinddialog.h 2014-02-11 18:16:57.876214916 +0900
@@ -250,7 +250,9 @@
void slotSelectedTextToggled(bool);
void showPatterns();
void showPlaceholders();
- void textSearchChanged( const TQString &);
+ void textSearchChanged(const TQString &);
+ void slotRegexCheckBoxToggled(bool checked);
+ void slotPlaceholdersCheckBoxToggled(bool checked);
protected:
virtual void showEvent ( TQShowEvent * );
|