void SelectCameraWindow::closeEvent(QCloseEvent *event) { if(setAndContinueClicked) { event->accept(); } else { QMessageBox exitDialog(this); int reply; exitDialog.setWindowTitle("Exit"); exitDialog.setText("Are you sure you want to exit?"); exitDialog.setWindowIcon(QPixmap("Images/exit.png")); exitDialog.setStandardButtons(QMessageBox::Yes | QMessageBox::No); exitDialog.setIcon(QMessageBox::Question); reply = exitDialog.exec(); if(reply == QMessageBox::Yes) { event->accept(); } else { event->ignore(); } } }
void ZLSelectionDialog::runState(const std::string &state) { if (!myHandler.isOpenHandler()) { if (((ZLTreeSaveHandler&)myHandler).accept(state)) { exitDialog(); } } }
void ZLSelectionDialog::runNode(const ZLTreeNodePtr node) { if (!node) { return; } if (node->isFolder()) { myHandler.changeFolder(*node); update(); } else if (myHandler.isOpenHandler()) { if (((ZLTreeOpenHandler&)myHandler).accept(*node)) { exitDialog(); } else { update(); } } else { ((ZLTreeSaveHandler&)myHandler).processNode(*node); update(); } }
Scanner::Scanner (QString n, DBIndex *i) : QTabDialog (0, 0, FALSE) { chartIndex = i; scannerName = n; QString s = "Qtstalker Scanner"; s.append(": "); s.append(scannerName); setCaption (s); QWidget *w = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(w); vbox->setMargin(5); vbox->setSpacing(5); QHGroupBox *gbox = new QHGroupBox(tr("Symbol Selection"), w); vbox->addWidget(gbox); allSymbols = new QCheckBox(tr("All symbols"), gbox); connect(allSymbols, SIGNAL(toggled(bool)), this, SLOT(allSymbolsToggled(bool))); fileButton = new QPushButton(tr("0 Symbols"), gbox); connect(fileButton, SIGNAL(clicked()), this, SLOT(getSymbols())); basePath = new QComboBox(gbox); basePath->insertItem(tr("Chart"), -1); basePath->insertItem(tr("Group"), -1); QGridLayout *grid = new QGridLayout(vbox, 1, 2); grid->setColStretch(1, 1); QLabel *label = new QLabel(tr("Bar Length"), w); grid->addWidget(label, 0, 0); BarData bd(scannerName); period = new QComboBox(w); bd.getBarLengthList(barLengthList); period->insertStringList(barLengthList, -1); period->setCurrentText("Daily"); grid->addWidget(period, 0, 1); label = new QLabel(tr("Bars"), w); grid->addWidget(label, 1, 0); bars = new QSpinBox(1, 99999999, 1, w); bars->setValue(100); grid->addWidget(bars, 1, 1); list = new FormulaEdit(w, FormulaEdit::Logic); vbox->addWidget(list); setDefaultButton(tr("&Scan")); connect(this, SIGNAL(defaultButtonPressed()), this, SLOT(scan())); setApplyButton(tr("&Apply")); connect(this, SIGNAL(applyButtonPressed()), this, SLOT(saveRule())); setCancelButton(tr("&Cancel")); connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog())); setOkButton(QString::null); setHelpButton(); QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp())); addTab(w, tr("Parms")); loadRule(); }
void fileExitCb(Widget w, XtPointer client_data, XtPointer call_data) { exitDialog(((FileWindowRec *) client_data)->shell); }