void QtUserSearchWindow::handleSearch() {
	boost::shared_ptr<SearchPayload> search(new SearchPayload());
	if (fieldsPage_->nickInput_->isEnabled()) {
		search->setNick(Q2PSTRING(fieldsPage_->nickInput_->text()));
	}
	if (fieldsPage_->firstInput_->isEnabled()) {
		search->setFirst(Q2PSTRING(fieldsPage_->firstInput_->text()));
	}
	if (fieldsPage_->lastInput_->isEnabled()) {
		search->setLast(Q2PSTRING(fieldsPage_->lastInput_->text()));
	}
	if (fieldsPage_->emailInput_->isEnabled()) {
		search->setEMail(Q2PSTRING(fieldsPage_->emailInput_->text()));
	}
	onSearchRequested(search, getServerToSearch());
}
示例#2
0
void QtUserSearchWindow::handleSearch() {
    std::shared_ptr<SearchPayload> search(new SearchPayload());
    if (fieldsPage_->getFormWidget()) {
        search->setForm(fieldsPage_->getFormWidget()->getCompletedForm());
        search->getForm()->clearEmptyTextFields();
    } else {
        if (fieldsPage_->nickInput_->isEnabled() && !fieldsPage_->nickInput_->text().isEmpty()) {
            search->setNick(Q2PSTRING(fieldsPage_->nickInput_->text()));
        }
        if (fieldsPage_->firstInput_->isEnabled() && !fieldsPage_->firstInput_->text().isEmpty()) {
            search->setFirst(Q2PSTRING(fieldsPage_->firstInput_->text()));
        }
        if (fieldsPage_->lastInput_->isEnabled() && !fieldsPage_->lastInput_->text().isEmpty()) {
            search->setLast(Q2PSTRING(fieldsPage_->lastInput_->text()));
        }
        if (fieldsPage_->emailInput_->isEnabled() && !fieldsPage_->emailInput_->text().isEmpty()) {
            search->setEMail(Q2PSTRING(fieldsPage_->emailInput_->text()));
        }
    }
    onSearchRequested(search, getServerToSearch());
}
示例#3
0
BrowserWindow::BrowserWindow(QWidget *parent, MafwRegistryAdapter *mafwRegistry) :
    BaseWindow(parent),
    ui(new Ui::BrowserWindow)
{
    ui->setupUi(this);

    ui->searchHideButton->setIcon(QIcon::fromTheme("general_close"));

    ui->indicator->setRegistry(mafwRegistry);

    this->setAttribute(Qt::WA_DeleteOnClose);

    objectModel = new QStandardItemModel(this);
    objectProxyModel = new HeaderAwareProxyModel(this);
    objectProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
    objectProxyModel->setSourceModel(objectModel);
    ui->objectList->setModel(objectProxyModel);

    ui->objectList->viewport()->installEventFilter(this);

    connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F), this), SIGNAL(activated()), this, SLOT(onSearchRequested()));

    connect(ui->objectList->verticalScrollBar(), SIGNAL(valueChanged(int)), ui->indicator, SLOT(poke()));

    connect(ui->searchEdit, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString)));
    connect(ui->searchHideButton, SIGNAL(clicked()), this, SLOT(onSearchHideButtonClicked()));

    // Set the initial orientation later, after child class constructor
    QTimer::singleShot(0, this, SLOT(orientationInit()));
}