void EnrollDialog::enrollFinished(QString response) { bool rc; QString identificacion, serial, resultado; CHECK(!response.contains("<title>Error en tiempo"), "Response error"); rc = parseXmlEnroll(response, identificacion, serial, resultado); CHECK(rc == true, "Error parsing XML"); DEBUG("*******Identificacion: %s", identificacion.toStdString().c_str()); if (resultado == "-1") { DEBUG("WS Error. identificacion = %s", identificacion.toStdString().c_str()); closeDialog(tr("Error procesando...")); return; } if (resultado == "0") { DEBUG("Fingerprint already exists. identificacion = %s", identificacion.toStdString().c_str()); closeDialog(tr("Huella ya existe...")); return; } DEBUG("User fingerprint enrolled. identificacion = %s", identificacion.toStdString().c_str()); closeDialog(tr("Huella enrolada...")); return; error: closeDialog(tr("Error procesando...")); DEBUG("enroll error..."); }
void Npcdialog::insol2DialogSelect(int index, int choice) { if(index==1) { if(choice==1) { insol2DIalog(3); } else if(choice==0) { insol2DIalog(2); } } else if(index==2) { map->nextstory(); closeDialog(); } else if(index==3) { map->nextstory(); closeDialog(); } else if(index==4) { closeDialog(); } }
LBMStreamDialog::LBMStreamDialog(QWidget * parent, capture_file * cfile) : QDialog(parent), m_ui(new Ui::LBMStreamDialog), m_dialog_info(NULL), m_capture_file(cfile) { m_ui->setupUi(this); m_dialog_info = new LBMStreamDialogInfo(); connect(this, SIGNAL(accepted()), this, SLOT(closeDialog())); connect(this, SIGNAL(rejected()), this, SLOT(closeDialog())); fillTree(); }
void Npcdialog::friendDialogSelect(int index, int choice) { if(index == 1) { if(choice==0) closeDialog(); else if(choice == 1) friendDialog(5); } else if(index == 2) { if(choice==0) { int friendtype = room->getfriend()->friendtype; if(friendtype==1) friendDialog(3); else if(friendtype==2) friendDialog(4); } else if(choice==1) { closeDialog(); } } else if(index==3) { map->getMenu()->setMoney( map->getMenu()->getMoney() + room->getfriend()->money); room->deletefriend(); closeDialog(); } else if(index==4) { closeDialog(); } else if(index==5) { if(choice==0) closeDialog(); else if(choice==1) { int schrodinger = rand()%2; if(schrodinger==0) friendDialog(3); else friendDialog(4); } } }
void PrefsDialog::actionPerformed( AButtonEvent *buttonEvent ) { if( buttonEvent->getSource() == OKButton ) { editorDialog->saveSettings(); asciiDialog->saveSettings(); ascii2Dialog->saveSettings(); hexDialog->saveSettings(); displayDialog->saveSettings(); miscDialog->saveSettings(); closeDialog( TRUE ); return; } closeDialog( FALSE ); }
void Npcdialog::trapDialogSelect() { babam->stop(); delete babam; emit reset(); closeDialog(); }
progressDialog::progressDialog(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags){ ui.setupUi(this); Consumer *c = new Consumer(); Producer *p = new Producer(); Thread *t1 = new Thread(0); Thread *t2 = new Thread(0); connect(this,SIGNAL(begin(bool)),c,SLOT(startReceiving(bool))); connect(c,SIGNAL(initiate(bool)),p,SLOT(produce(bool))); connect(p,SIGNAL(sendPacket(const QByteArray,bool)),c,SLOT(receiveFrame(const QByteArray,bool))); connect(ui.pushButton,SIGNAL(clicked(bool)),this,SLOT(_begin(bool))); connect(p,SIGNAL(halt(bool)),c,SLOT(startReceiving(bool))); connect(c,SIGNAL(blockDone()),p,SLOT(frameData())); connect(c,SIGNAL(measure(bool)),p,SLOT(measurement(bool)),Qt::DirectConnection); connect(c,SIGNAL(openDialog()),this,SLOT(startDlg())); connect(c,SIGNAL(closeDialog()),this,SLOT(closeDlg())); connect(p,SIGNAL(setDlgMax(int)),this,SLOT(setMaxVal(int))); connect(p,SIGNAL(setDlgVal(int)),this,SLOT(setVal(int))); connect(p,SIGNAL(setSeconds(int)),this,SLOT(setSecondsRemaining(int))); c->moveToThread(t1); p->moveToThread(t2); t1->start(); t2->start(); }
/** * @brief Called when dialog is closing by OK button. */ void EditKeymapDlg::handleOK() { MBCString name; UICTextEdit* nameEdit = getNameTextEdit(); if (NULL != nameEdit) { nameEdit->GetText(name); } if (name.IsEmpty()) { getMessageBoxProvider()->DoMessageBox( NSID_EMSG_EMPTY_KEYMAP_NAME, MessageBoxProvider::ButtonType_OK, MessageBoxProvider::AlertType_Warning); if (NULL != nameEdit) { nameEdit->MakeFocus(); } return; } // update keyMappings by keyMappingManager. if (NULL != keyMappings) { UTF8String utf8Title; UTF8Conv::FromMultiByte(utf8Title, name.CString()); keyMappings->SetTitle(utf8Title.CString()); MainWindowKeyFunc keyFunc; keyMappingManager.WriteOut(keyMappings, KeyMappings::STR_CATEGORY_MAIN_WINDOW, &keyFunc); } closeDialog(true); }
void WelcomeDialog::showMenu(void) { MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu"); if (m_menuPopup->Create()) popupStack->AddScreen(m_menuPopup); m_menuPopup->SetReturnEvent(this, "action"); QString mythshutdown_status = m_installDir + "/bin/mythshutdown --status 0"; QByteArray tmpcmd = mythshutdown_status.toAscii(); int statusCode = system(tmpcmd.constData()); if (WIFEXITED(statusCode)) statusCode = WEXITSTATUS(statusCode); if (statusCode & 16) m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown())); else m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown())); m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber())); m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow())); m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog())); m_menuPopup->AddButton(tr("Cancel")); }
TutorialDialog::TutorialDialog(QWidget *parent) : QDialog(parent), ui(new Ui::TutorialDialog){ ui->setupUi(this); lblText = findChild<QLabel*>("lblText"); tutorials = new QString[5]; tutorials[0] = tr("Hello! Is it your first time here? \nWelcome to Series! Track your favourite TV series, you'll never forget which\nwas the last episode you watched!\n" \ "Thank you for downloading the app, I hope you like it!"); tutorials[1] = tr("In order to add a new series, just click Add new TV series button, it allows\nyou to choose name, espisode and season for a new series!\nA dialog will be showed to do this operation, " \ "just insert name, season and\nepisode (optional) and press Ok. The new series will be displayed immediately."); tutorials[2] = tr("You can update season and episode of every series: just wrtite it into the\ncorrect field and press the Save button."); tutorials[3] = tr("In order to make some changes, press the Modify button.\nYou will be able to change name and positions (the display order)\nof every series. You can also delete them."); tutorials[4] = tr("I hope you like this app! Thank you for downloading it."); index = 0; lblText->setText(tutorials[0]); btnNext = findChild<QPushButton*>("btnNext"); btnBack = findChild<QPushButton*>("btnBack"); btnClose = findChild<QPushButton*>("btnClose"); connect(btnNext, SIGNAL(released()), this, SLOT(moveNext())); connect(btnBack, SIGNAL(released()), this, SLOT(moveBack())); connect(btnClose, SIGNAL(released()), this, SLOT(closeDialog())); btnBack->setEnabled(false); }
void saveFile(Widget *widget, Window *window) { closeDialog(widget, window); int fd = open(filenameBox.text, O_WRONLY); char isNewFile = 0; if (fd < 0) { fd = open(filenameBox.text, O_CREATE); if (fd < 0) { return; } close(fd); fd = open(filenameBox.text, O_WRONLY); if (fd < 0) { return; } isNewFile = 1; } write(fd, text_box.text, strlen(text_box.text) + 1); close(fd); if (isNewFile) { strcpy(mainwindow.caption, filenameBox.text); updateWindow(hWind); fileSystemChanged(); } }
void EditMetadataDialog::showSaveMenu() { popup = new MythPopupBox(GetMythMainWindow(), "Menu"); QLabel *label = popup->addLabel(tr("Save Changes?"), MythPopupBox::Large, false); label->setAlignment(Qt::AlignCenter | Qt::WordBreak); QAbstractButton *topButton; if (metadataOnly) { topButton = popup->addButton(tr("Save Changes"), this, SLOT(saveToMetadata())); } else { topButton = popup->addButton(tr("Save Changes"), this, SLOT(saveAll())); } popup->addButton(tr("Exit/Do Not Save"), this, SLOT(closeDialog())); popup->addButton(tr("Cancel"), this, SLOT(cancelPopup())); popup->ShowPopup(this, SLOT(cancelPopup())); topButton->setFocus(); }
/* * Constructs a Superconductor_Messages as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ Superconductor_Messages::Superconductor_Messages( SCMessageList* sl, QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( sl ) strings = sl; if ( !name ) setName( "Superconductor_Messages" ); layout = new QGridLayout( this, 2, 2 ); // layout->setAutoAdd( TRUE ); layout->setResizeMode( QLayout::FreeResize ); listBox = new QListBox( this, "listBox" ); listBox->setGeometry( QRect( 10, 10, 291, 461 ) ); listBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, listBox->sizePolicy().hasHeightForWidth() ) ); listBox->setSelectionMode( QListBox::NoSelection ); listBox->setVariableWidth( TRUE ); languageChange(); resize( QSize(314, 480).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); save = new QPushButton( "Save", this ); closeButton = new QPushButton( "Close", this ); layout->addMultiCellWidget( listBox, 0, 0, 0, 1 ); layout->addWidget( save, 1, 0 ); layout->addWidget( closeButton, 1, 1 ); connect( save, SIGNAL( clicked() ), this, SLOT( saveOutput() ) ); connect( closeButton, SIGNAL( clicked() ), this, SLOT( closeDialog() ) ); }
Trabajadores::Trabajadores ( BlMainCompany *emp, QWidget *parent, bool deleteOnClose ) : QDialog ( parent ), BlMainCompanyPointer ( emp ) { setupUi ( this ); connect (this, SIGNAL(rejected()), this, SLOT(closeDialog()) ); mui_password->setFocus(Qt::OtherFocusReason); installEventFilter(this); m_validUser = false; m_deleteOnClose = deleteOnClose; BlDbRecordSet *cur = mainCompany() ->loadQuery ( "SELECT * FROM trabajador" ); while ( !cur->eof() ) { QPushButton * toolbutton = new QPushButton ( mui_frame ); toolbutton->setText ( cur->value( "nomtrabajador" ) + " " + cur->value( "apellidostrabajador" ) ); toolbutton->setMaximumHeight(200); QVBoxLayout *m_hboxLayout1 = mui_frame->findChild<QVBoxLayout *> ( "hboxLayout1" ); if ( !m_hboxLayout1 ) { m_hboxLayout1 = new QVBoxLayout ( mui_frame ); m_hboxLayout1->setSpacing ( 0 ); m_hboxLayout1->setMargin ( 0 ); m_hboxLayout1->setObjectName ( QString::fromUtf8 ( "hboxLayout1" ) ); } // end if m_hboxLayout1->addWidget ( toolbutton ); connect ( toolbutton, SIGNAL ( clicked() ), this, SLOT ( trabajadorClicked() ) ); cur->nextRecord(); } // end while delete cur; }
void WidgetRegister::registerKey() { QString strSeriesNumber = m_pEdtKey->text(); if(!Global::decodeSeriesNumber(strSeriesNumber)) { QMessageBox::about( this, Global::s_strExeName,"invalid key!"); return; } QSettings settings("option.ini", QSettings::IniFormat); // 当前目录的INI文件 settings.beginGroup("Option"); settings.setValue("SeriesNumber", strSeriesNumber ); settings.endGroup(); //备份的路径 { QString strPath = QString("%1\\dllescort\\option.ini").arg(Global::s_strProgramDataPath); if(!Tool::isFileOrDirExist(strPath)) { Tool::createDirectory(strPath,true); } QSettings settings(strPath, QSettings::IniFormat); // 当前目录的INI文件 settings.beginGroup("Option"); settings.setValue("SeriesNumber", strSeriesNumber ); settings.endGroup(); } QMessageBox::about( this, Global::s_strExeName,"Thank you! Your product registration was successful! Click OK to continue."); closeDialog(); }
void SensorsManagerWidget::deleteSetOfSensors() { QSqlQuery query; if(query.exec(QString("SELECT id FROM Sets_of_sensors WHERE name=\"%1\"").arg(m_names->currentText()))) { while(query.next()) { QSqlQuery queryDelete; QString tableId = query.value(0).toString(); if(queryDelete.exec(QString("DROP TABLE %1").arg(QString("Set_") + tableId))) // PLACEHOLDER: arg { if(queryDelete.exec(QString("DELETE FROM %1 WHERE name=\"%2\"").arg("Sets_of_sensors").arg(m_names->currentText()))) { QMessageBox::information(this, tr("Result"), tr("Set of sensors succesfully deleted")); emit closeDialog(); } else QMessageBox::critical(dialogBox, tr("Error"), tr("Deletion of the set of sensors in the set list failed.")); } else QMessageBox::critical(dialogBox,tr("Error"), tr("Deletion of the set of sensors in the database failed.")); } } else QMessageBox::critical(dialogBox, tr("Error"), tr("Selection of the set id in the database failed.")); }
void SensorsManagerWidget::editSetOfSensors() { QSqlQuery query; if(query.exec(QString("UPDATE %1 SET nb_sensors=%2, comments=\"%3\" WHERE name=\"%4\"").arg("Sets_of_sensors").arg(m_numberOfSensors->text().toInt()).arg(m_comments->toPlainText()).arg(m_names->currentText()))) { if(query.exec(QString("SELECT id FROM Sets_of_sensors WHERE name=\"%1\"").arg(m_names->currentText()))) { while(query.next()) { QSqlQuery queryUpdate; QString tableId = query.value(0).toString(); for(QVector<SensorWidget*>::iterator sensor = m_sensors->begin(); sensor != m_sensors->end(); ++sensor) { if(!(queryUpdate.exec(QString("UPDATE %1 SET name=\"%2\", x=%3, y=%4, z=%5 WHERE id=%6").arg(QString("Set_") + tableId).arg((*sensor)->getName()).arg((*sensor)->getX()).arg((*sensor)->getY()).arg((*sensor)->getZ()).arg(sensor-m_sensors->begin() + 1)))) QMessageBox::critical(dialogBox, tr("Error"), tr("Insertion of a sensor failed.")); } QMessageBox::information(this, tr("Result"), tr("Set of sensors succesfully updated")); emit closeDialog(); } } else QMessageBox::critical(dialogBox, tr("Error"), tr("Selection of the set id in the database failed.")); } else QMessageBox::critical(dialogBox, tr("Error"), tr("Update of the set in the database failed.")); }
/** * Adds a QDialog to set force to nodes */ Dialog_Add_Force::Dialog_Add_Force(interfaces::ControlCenter* c, main_gui::GuiInterface *gui) : main_gui::BaseWidget(0, c->cfg, "Dialog_Add_Force"), pDialog( new main_gui::PropertyDialog(0)), mainGui(gui) { control = c; pDialog->setAttribute(Qt::WA_DeleteOnClose); pDialog->setWindowTitle(tr("Apply Force")); pDialog->setPropCallback(dynamic_cast<main_gui::PropertyCallback*>(this)); QObject::connect(pDialog, SIGNAL(closeSignal()), this, SLOT(closeDialog())); control->nodes->getListNodes(this->getNodeListPtr()); std::map<QString, QVariant> attr; attr.insert(pair<QString, QVariant>(QString("decimals"), 9)); attr.insert(pair<QString, QVariant>(QString("singleStep"), 0.1)); QStringList enumNames; for (unsigned int i = 0; i <myNodes.size(); i++) enumNames << QString::fromStdString(myNodes[i].name); node = pDialog->addGenericProperty("../Node", QtVariantPropertyManager::enumTypeId(), QVariant(1), NULL, &enumNames); vector_x = pDialog->addGenericProperty("../Vector/x", QVariant::Double, 1.0, &attr); vector_y = pDialog->addGenericProperty("../Vector/y", QVariant::Double, 0.0, &attr); vector_z = pDialog->addGenericProperty("../Vector/z", QVariant::Double, 0.0, &attr); magnitude = pDialog->addGenericProperty("../Magnitude [N]", QVariant::Double, 10, &attr); }
void ShredDialog::initConnect() { connect(select_btn, SIGNAL(clicked()), this, SLOT(onSelectButtonClicked())); connect(shred_btn, SIGNAL(clicked()), this, SLOT(onShredButtonClicked())); connect(cacel_btn, SIGNAL(clicked()), this, SLOT(onCacelButtonClicked())); // connect(title_bar, SIGNAL(showMinDialog()), this, SLOT(onMinButtonClicked())); connect(title_bar,SIGNAL(closeDialog()), this, SLOT(onCloseButtonClicked())); }
void DialogController::closeDialogWhenDestroyed() { QWidget *w = static_cast<QWidget*>(sender()); if(w != m_widget) return; closeDialog(); }
void Scraper::showErrorDialog(const QString& error){ closeDialog(); QMessageBox msgBox; msgBox.setText("Unable to retrieve information."); msgBox.setDetailedText(error); msgBox.exec(); }
void ChatDialog::setupEventHandler() { QObject::connect(mBtnSend, SIGNAL(clicked()), this, SLOT(sendMsg())); QObject::connect(mBtnClose, SIGNAL(clicked()), this, SLOT(closeDialog())); QObject::connect(mChannel, SIGNAL(readyRead()), this, SLOT(recvMsg())); QObject::connect(mTxtSend, SIGNAL(textChanged()), this, SLOT(enableSendButton())); // QObject:: }
void EmuSettings::closeAboutDialog() { __DEBUG_IN disconnect( about, SIGNAL(closeDialog()), this, SLOT( closeAboutDialog() )); delete about; about = NULL; __DEBUG_OUT }
void HTMLDialogElement::close(const String& returnValue, ExceptionState& exceptionState) { if (!fastHasAttribute(openAttr)) { exceptionState.throwDOMException(InvalidStateError, "The element does not have an 'open' attribute, and therefore cannot be closed."); return; } closeDialog(returnValue); }
void HTMLDialogElement::defaultEventHandler(Event* event) { if (event->type() == EventTypeNames::cancel) { closeDialog(); event->setDefaultHandled(); return; } HTMLElement::defaultEventHandler(event); }
//index에 대한 choice 작업 처리 void Npcdialog::insol1DialogSelect(int index, int choice) { if(index==1) { if(choice==0 || choice==1) { //Start Game insol1Dialog(2); } } if(index==2) { if(choice==1) { //Succeeded in mission, story : 1->2 map->nextstory(); insol1Dialog(3); } else if(choice==0) { //Fail the mission insol1Dialog(4); } } if(index==3) { //room->storyfinished closeDialog(); } if(index==4) { //room->storyfinished closeDialog(); } if(index==5) { //room->storyfinished closeDialog(); } if(index==6) { closeDialog(); } }
void DialogController::closeDialogOnMousePress(const QPoint &mousePos) { if(!m_dialog) return; if(m_dialog->geometry().contains(mousePos)) return; closeDialog(); }
void EmuSettings::aboutClicked() { __DEBUG_IN //show about dialog about = new aboutdialog( this ); connect( about, SIGNAL(closeDialog()), this, SLOT( closeAboutDialog() )); about->show(); about->setFocus(); __DEBUG_OUT }
void KylinFontDialog::initConnect() { // connect(title_bar, SIGNAL(showMinDialog()), this, SLOT(onMinButtonClicked())); connect(title_bar,SIGNAL(closeDialog()), this, SLOT(onCacelButtonClicked())); connect(font_view, SIGNAL(clicked(QModelIndex)), this, SLOT(updateAll(QModelIndex))); connect(style_view, SIGNAL(clicked(QModelIndex)), this, SLOT(updateStyleandSize(QModelIndex))); connect(size_view, SIGNAL(clicked(QModelIndex)), this, SLOT(updateSize(QModelIndex))); connect(cacel_btn, SIGNAL(clicked()), this, SLOT(onCacelButtonClicked())); connect(ok_btn, SIGNAL(clicked()), this, SLOT(onOKButtonClicked())); }
/** * @brief Called when dialog is closing by Cancel button. */ void EditKeymapDlg::handleCancel() { if (isModified) { MessageBoxProvider::Button button = getMessageBoxProvider()->DoMessageBox( NSID_QMSG_EDITED_KEYMAP_DISCARDING, MessageBoxProvider::ButtonType_YesNo, MessageBoxProvider::AlertType_Warning, MessageBoxProvider::Button_No); if (MessageBoxProvider::Button_Yes == button) { closeDialog(false); } } else { closeDialog(false); } }