FindToolWindow::FindToolWindow(FindPlugin *plugin, QWidget *parent) : QWidget(parent), m_plugin(plugin), m_findCompleter(new QCompleter(this)), m_currentFilter(0), m_configWidget(0) { m_instance = this; m_ui.setupUi(this); m_ui.searchTerm->setFiltering(true); m_ui.searchTerm->setPlaceholderText(QString()); setFocusProxy(m_ui.searchTerm); connect(m_ui.searchButton, SIGNAL(clicked()), this, SLOT(search())); connect(m_ui.replaceButton, SIGNAL(clicked()), this, SLOT(replace())); connect(m_ui.matchCase, SIGNAL(toggled(bool)), m_plugin, SLOT(setCaseSensitive(bool))); connect(m_ui.wholeWords, SIGNAL(toggled(bool)), m_plugin, SLOT(setWholeWord(bool))); connect(m_ui.regExp, SIGNAL(toggled(bool)), m_plugin, SLOT(setRegularExpression(bool))); connect(m_ui.filterList, SIGNAL(activated(int)), this, SLOT(setCurrentFilter(int))); connect(m_ui.searchTerm, SIGNAL(textChanged(QString)), this, SLOT(updateButtonStates())); m_findCompleter->setModel(m_plugin->findCompletionModel()); m_ui.searchTerm->setSpecialCompleter(m_findCompleter); m_ui.searchTerm->installEventFilter(this); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); m_ui.configWidget->setLayout(layout); updateButtonStates(); connect(m_plugin, SIGNAL(findFlagsChanged()), this, SLOT(updateFindFlags())); }
FindToolWindow::FindToolWindow(FindPlugin *plugin) : QDialog(Core::ICore::instance()->mainWindow()), m_plugin(plugin), m_findCompleter(new QCompleter(this)), m_currentFilter(0), m_configWidget(0) { m_ui.setupUi(this); connect(m_ui.closeButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_ui.searchButton, SIGNAL(clicked()), this, SLOT(search())); connect(m_ui.replaceButton, SIGNAL(clicked()), this, SLOT(replace())); connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelSearch())); connect(m_ui.matchCase, SIGNAL(toggled(bool)), m_plugin, SLOT(setCaseSensitive(bool))); connect(m_ui.wholeWords, SIGNAL(toggled(bool)), m_plugin, SLOT(setWholeWord(bool))); connect(m_ui.regExp, SIGNAL(toggled(bool)), m_plugin, SLOT(setRegularExpression(bool))); connect(m_ui.filterList, SIGNAL(activated(int)), this, SLOT(setCurrentFilter(int))); connect(m_ui.searchTerm, SIGNAL(textChanged(QString)), this, SLOT(updateButtonStates())); m_findCompleter->setModel(m_plugin->findCompletionModel()); m_ui.searchTerm->setCompleter(m_findCompleter); m_ui.searchTerm->installEventFilter(this); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); m_ui.configWidget->setLayout(layout); updateButtonStates(); }
FindToolWindow::FindToolWindow(FindPlugin *plugin) : QDialog(Core::ICore::instance()->mainWindow()), m_plugin(plugin), m_findCompleter(new QCompleter(this)), m_currentFilter(0) { m_ui.setupUi(this); connect(m_ui.closeButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_ui.searchButton, SIGNAL(clicked()), this, SLOT(accept())); connect(m_ui.matchCase, SIGNAL(toggled(bool)), m_plugin, SLOT(setCaseSensitive(bool))); connect(m_ui.wholeWords, SIGNAL(toggled(bool)), m_plugin, SLOT(setWholeWord(bool))); connect(m_ui.filterList, SIGNAL(activated(int)), this, SLOT(setCurrentFilter(int))); connect(this, SIGNAL(accepted()), this, SLOT(search())); m_findCompleter->setModel(m_plugin->findCompletionModel()); m_ui.searchTerm->setCompleter(m_findCompleter); QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); m_ui.configWidget->setLayout(layout); }