summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/knewprojectdlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefilereplace/knewprojectdlg.cpp')
-rw-r--r--tdefilereplace/knewprojectdlg.cpp75
1 files changed, 50 insertions, 25 deletions
diff --git a/tdefilereplace/knewprojectdlg.cpp b/tdefilereplace/knewprojectdlg.cpp
index 372ba18..9ba6bbc 100644
--- a/tdefilereplace/knewprojectdlg.cpp
+++ b/tdefilereplace/knewprojectdlg.cpp
@@ -64,7 +64,7 @@ KNewProjectDlg::KNewProjectDlg(RCOptions* info, TQWidget *parent, const char *na
connect(m_pbCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotReject()));
connect(m_pbSearchNow, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSearchNow()));
connect(m_pbSearchLater, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSearchLater()));
- connect(m_leSearch, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotSearchLineEdit(const TQString&)));
+ connect(m_cbSearch, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotSearchLineEdit(const TQString&)));
connect(m_chbSizeMin, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEnableSpinboxSizeMin(bool)));
connect(m_chbSizeMax, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotEnableSpinboxSizeMax(bool)));
connect(m_chbDateMin, TQT_SIGNAL(toggled(bool)), m_dedDateMin, TQT_SLOT(setEnabled(bool)));
@@ -89,7 +89,7 @@ void KNewProjectDlg::saveRCOptions()
saveFileSizeOptions();
saveDateAccessOptions();
saveOwnerOptions();
- saveLocationsList();
+ saveCBLists();
saveFiltersList();
saveBackupExtensionOptions();
}
@@ -104,19 +104,17 @@ void KNewProjectDlg::slotDir()
void KNewProjectDlg::slotOK()
{
// Check that Search text and Filter are not empty
- m_option->m_directories = m_cbLocation->currentText();
- m_option->m_filters = m_cbFilter->currentText();
- if(!m_leSearch->text().isEmpty())
+ if(!m_cbSearch->currentText().isEmpty())
{
- if(m_leReplace->text().isEmpty())
+ if(m_cbReplace->currentText().isEmpty())
m_option->m_searchingOnlyMode = true;
else
m_option->m_searchingOnlyMode = false;
}
- m_option->m_quickSearchString = m_searchNowFlag + m_leSearch->text();
- m_option->m_quickReplaceString = m_searchNowFlag + m_leReplace->text();
+ m_option->m_quickSearchString = m_searchNowFlag + m_cbSearch->currentText();
+ m_option->m_quickReplaceString = m_searchNowFlag + m_cbReplace->currentText();
- if (m_option->m_directories.isEmpty() || m_option->m_filters.isEmpty())
+ if (m_cbLocation->currentText().isEmpty() || m_cbFilter->currentText().isEmpty())
{
KMessageBox::error(this, i18n("You must fill the combo boxes (location and filter) before continuing."));
return;
@@ -166,6 +164,7 @@ void KNewProjectDlg::slotSearchLater()
void KNewProjectDlg::slotSearchLineEdit(const TQString& t)
{
m_pbSearchNow->setEnabled(!t.isEmpty());
+ m_pbSearchLater->setEnabled(!t.isEmpty());
}
void KNewProjectDlg::slotEnableSpinboxSizeMin(bool b)
@@ -225,16 +224,17 @@ void KNewProjectDlg::initGUI()
m_pbLocation->setFixedSize(pixMap.width() + 8, pixMap.height() + 8);
m_pbSearchNow->setEnabled(false);
+ m_pbSearchLater->setEnabled(false);
loadOptions();
loadFileSizeOptions();
loadDateAccessOptions();
loadOwnerOptions();
loadBackupExtensionOptions();
- loadLocationsList();
+ loadCBLists();
loadFiltersList();
- m_leSearch->setFocus();
+ m_cbSearch->setFocus();
}
void KNewProjectDlg::loadOptions()
@@ -363,8 +363,10 @@ void KNewProjectDlg::loadOwnerOptions()
m_edOwnerGroup->setText(m_option->m_ownerGroupValue);
}
-void KNewProjectDlg::loadLocationsList()
+void KNewProjectDlg::loadCBLists()
{
+ m_cbSearch->insertStringList(m_option->m_searchStrings);
+ m_cbReplace->insertStringList(m_option->m_replaceStrings);
m_cbLocation->insertStringList(m_option->m_directories);
}
@@ -467,20 +469,43 @@ void KNewProjectDlg::saveOwnerOptions()
}
}
-void KNewProjectDlg::saveLocationsList()
+void KNewProjectDlg::saveCBLists()
{
- TQString current = m_cbLocation->currentText();
- TQStringList list = current;
-
- int count = m_cbLocation->listBox()->count(),
- i;
- for(i = 0; i < count; i++)
+ // Search list
+ TQString current = m_cbSearch->currentText();
+ m_option->m_searchStrings.clear();
+ m_option->m_searchStrings.append(current);
+ int count = m_cbSearch->listBox()->count();
+ for (int i = 0; i < count; ++i)
{
- TQString text = m_cbLocation->listBox()->item(i)->text();
- if(text != current)
- list.append(text);
+ TQString text = m_cbSearch->listBox()->item(i)->text();
+ if (text != "" && text != current)
+ m_option->m_searchStrings.append(text);
+ }
+
+ // Replace list
+ current = m_cbReplace->currentText();
+ m_option->m_replaceStrings.clear();
+ m_option->m_replaceStrings.append(current);
+ count = m_cbReplace->listBox()->count();
+ for (int i = 0; i < count; ++i)
+ {
+ TQString text = m_cbReplace->listBox()->item(i)->text();
+ if (text != "" && text != current)
+ m_option->m_replaceStrings.append(text);
+ }
+
+ // Location list
+ current = m_cbLocation->currentText();
+ m_option->m_directories.clear();
+ m_option->m_directories.append(current);
+ count = m_cbLocation->listBox()->count();
+ for (int i = 0; i < count; ++i)
+ {
+ TQString text = m_cbLocation->listBox()->item(i)->text();
+ if (text != "" && text != current)
+ m_option->m_directories.append(text);
}
- m_option->m_directories = list;
}
void KNewProjectDlg::saveFiltersList()
@@ -549,8 +574,8 @@ void KNewProjectDlg::whatsThis()
TQWhatsThis::add(m_chbCaseSensitive, chbCaseSensitiveWhatthis);
TQWhatsThis::add(m_chbBackup, chbBackupWhatthis);
TQWhatsThis::add(m_leBackup, chbBackupWhatthis);
- TQWhatsThis::add(m_leSearch, leSearchWhatthis);
- TQWhatsThis::add(m_leReplace, leReplaceWhatthis);
+ TQWhatsThis::add(m_cbSearch, leSearchWhatthis);
+ TQWhatsThis::add(m_cbReplace, leReplaceWhatthis);
}
#include "knewprojectdlg.moc"