ConnectionWindow::ConnectionWindow(QWidget *parent, RedisServerItem * srv) : QDialog(parent), inEditMode(false) { ui.setupUi(this); this->setWindowFlags(Qt::Tool); this->setModal(true); ui.validationWarning->hide(); if (parent) { mainForm = qobject_cast<MainWin *>(parent); } // connect slots to signals connect(ui.okButton, SIGNAL(clicked()), this, SLOT(OnOkButtonClick())); connect(ui.okButton, SIGNAL(pressed()), this, SLOT(clicked())); connect(ui.showPasswordCheckbox, SIGNAL(stateChanged(int)), this, SLOT(OnShowPasswordCheckboxChanged(int))); //edit mode if (srv != nullptr) { server = srv; loadValuesFromConnection(srv->getConnection()); } else { ui.namespaceSeparator->setText(QString(RedisConnectionConfig::DEFAULT_NAMESPACE_SEPARATOR)); ui.connectionTimeout->setValue(DEFAULT_TIMEOUT_IN_MS / 1000); ui.executionTimeout->setValue(DEFAULT_TIMEOUT_IN_MS / 1000); } }
void ButtonChoiceMenu::OnDPADClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) { if(trigger == &buttonATrigger) { //! do not auto launch when wiimote is pointing to screen and presses A if((controller->chan & (GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5)) && controller->data.validPointer) { return; } if(selectedButtonDPAD >= 0 && selectedButtonDPAD <= buttonCount-1) { selectedButton = selectedButtonDPAD; } else if(selectedButtonDPAD == buttonCount || selectedButtonDPAD == -2) { OnOkButtonClick(button,controller,trigger); } } else if(trigger == &buttonBTrigger) { OnBackButtonClick(button,controller,trigger); } else if(trigger == &buttonUpTrigger) { if(buttonCount > 2){ selectedButtonDPAD -= 2; if(selectedButtonDPAD < 0){ selectedButtonDPAD = 0; } } } else if(trigger == &buttonDownTrigger){ if(buttonCount > 2 || selectedButtonDPAD != buttonCount){ selectedButtonDPAD += 2; if(selectedButtonDPAD >= buttonCount){ selectedButtonDPAD = buttonCount-1; } } } else if(trigger == &buttonRightTrigger){ selectedButtonDPAD++; if(selectedButtonDPAD >= buttonCount){ selectedButtonDPAD = buttonCount; } } else if(trigger == &buttonLeftTrigger){ selectedButtonDPAD--; if(selectedButtonDPAD < 0){ selectedButtonDPAD = 0; } } UpdateChoiceButtons(button,controller,trigger); }
void KeyPadMenu::OnDPADClick(GuiButton *button, const GuiController *controller, GuiTrigger *trigger) { if(trigger == &buttonATrigger) { //! do not auto launch when wiimote is pointing to screen and presses A if((controller->chan & (GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5)) && controller->data.validPointer) { return; } OnOkButtonClick(button,controller,trigger); } else if(trigger == &buttonBTrigger) { OnBackButtonClick(button,controller,trigger); } }
connection::connection(QWidget *parent, RedisServerItem * srv) : QDialog(parent), inEditMode(false) { ui.setupUi(this); this->setWindowFlags(Qt::Tool); this->setModal(true); if (parent) { mainForm = qobject_cast<MainWin *>(parent); } // connect slots to signals connect(ui.okButton, SIGNAL(clicked()), this, SLOT(OnOkButtonClick())); connect(ui.okButton, SIGNAL(pressed()), this, SLOT(clicked())); //edit mode if (srv != nullptr) { server = srv; loadValuesFromConnection(srv->getConnection()); } }
PreferencesWindow::PreferencesWindow(VisualizationManager* mng): myVizMng(mng) { myUI = new Ui::PreferencesWindow(); myUI->setupUi(this); setModal(true); // Add color buttons to Geo Data View preferences. myOldBathyColorButton = new pqColorChooserButton(myUI->geoDataBox); myUI->geoDataBox->layout()->addWidget(myOldBathyColorButton); myOldBathyColorButton->setText("Bathy Color"); mySondeBathyColorButton = new pqColorChooserButton(myUI->geoDataBox); mySondeBathyColorButton->setText("Sonde Bathy Color"); myUI->geoDataBox->layout()->addWidget(mySondeBathyColorButton); myOldBathyContourButton = new pqColorChooserButton(myUI->geoDataBox); myUI->geoDataBox->layout()->addWidget(myOldBathyContourButton); myOldBathyContourButton->setText("Bathy Contour"); mySondeBathyContourButton = new pqColorChooserButton(myUI->geoDataBox); mySondeBathyContourButton->setText("Sonde Bathy Contour"); myUI->geoDataBox->layout()->addWidget(mySondeBathyContourButton); myMissionPathButton = new pqColorChooserButton(myUI->geoDataBox); myMissionPathButton->setText("Mission Path"); myUI->NavigationViewBox->layout()->addWidget(myMissionPathButton); myPlotBackgroundButton = new pqColorChooserButton(myUI->plotBox); myPlotBackgroundButton->setText("Plot Background"); myUI->plotColorsBox->layout()->addWidget(myPlotBackgroundButton); myPlotForegroundButton = new pqColorChooserButton(myUI->plotBox); myPlotForegroundButton->setText("Plot Foreground"); myUI->plotColorsBox->layout()->addWidget(myPlotForegroundButton); myPlotDataDefaultButton = new pqColorChooserButton(myUI->plotBox); myPlotDataDefaultButton->setText("Plot Data Default Color"); myUI->plotColorsBox->layout()->addWidget(myPlotDataDefaultButton); myPlotColorWidget = new pqColorMapWidget(myUI->plotBox); myPlotColorWidget->setMinimumHeight(32); myPlotColorWidget->setMaximumHeight(32); myUI->plotColorLayout->addWidget(myPlotColorWidget); // Set tag grouping labels. DataSetInfo* dataInfo = myVizMng->GetDataSet()->GetInfo(); myUI->plotGroupingBox->addItem(QString(dataInfo->GetTag1Label().c_str())); myUI->plotGroupingBox->addItem(QString(dataInfo->GetTag2Label().c_str())); myUI->plotGroupingBox->addItem(QString(dataInfo->GetTag3Label().c_str())); myUI->plotGroupingBox->addItem(QString(dataInfo->GetTag4Label().c_str())); // Wire signals connect(myUI->okButton, SIGNAL(clicked()), SLOT(OnOkButtonClick())); connect(myUI->cancelButton, SIGNAL(clicked()), SLOT(OnCancelButtonClick())); connect(myUI->reductionSlider, SIGNAL(valueChanged(int)), SLOT(OnReductionSliderValueChanged(int))); connect(myUI->scaleSlider, SIGNAL(valueChanged(int)), SLOT(OnDepthScaleSliderValueChanged(int))); connect(myPlotColorWidget, SIGNAL(pointMoved(int)), SLOT(OnPlotColorPointMove(int))); connect(myPlotColorWidget, SIGNAL(colorChangeRequested(int)), SLOT(OnPlotColorPointChange(int))); // Set initial value for scale slider (sort of hack, 6 is set as default elsewhere...) myUI->scaleSlider->setValue(6); }