Example #1
0
void ConfirmBox::init(const QString &text) {
    _text.setText(st::boxTextFont, text, _informative ? _confirmBoxTextOptions : _textPlainOptions);

    connect(&_confirm, SIGNAL(clicked()), this, SLOT(onConfirmPressed()));
    connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));
    if (_informative) {
        _cancel.hide();
        connect(this, SIGNAL(confirmed()), this, SLOT(onCancel()));
    }
    onTextUpdated();

    prepare();
}
void OpenFileWidget::setupGUI()
{
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    mainLayout->setSizeConstraint(QLayout::SetMaximumSize);
    m_pathLabel = new QLabel(m_path);
    mainLayout->addWidget(m_pathLabel);
    m_fileList = new QListWidget();
    m_fileList->setSelectionMode(QAbstractItemView::SingleSelection);
    m_fileList->setSortingEnabled(false);
    m_fileList->setTextElideMode(Qt::ElideRight);
    m_fileList->setSpacing(4);
    connect(m_fileList, SIGNAL(itemClicked(QListWidgetItem*))
            , this, SLOT(onItemClicked(QListWidgetItem*)));
    connect(m_fileList, SIGNAL(itemDoubleClicked(QListWidgetItem*))
            , this, SLOT(onItemDoubleClicked(QListWidgetItem*)));
    mainLayout->addWidget(m_fileList, 1);
    QHBoxLayout *operateLayout = new QHBoxLayout();
    m_parentButton = new QPushButton("上级目录");
    connect(m_parentButton, SIGNAL(clicked()), this, SLOT(onParent()));
    m_openButton = new QPushButton("打开");
    connect(m_openButton, SIGNAL(clicked()), this, SLOT(onOpen()));
    m_cancelButton = new QPushButton("取消");
    connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));
    operateLayout->addStretch(1);
    operateLayout->addWidget(m_parentButton);
    operateLayout->addWidget(m_openButton);
    operateLayout->addWidget(m_cancelButton);
    mainLayout->addLayout(operateLayout);
}
Example #3
0
void AddContactBox::initBox() {
	_width = st::addContactWidth;
	if (_peer) {
		if (_peer->chat) {
			_boxTitle = lang(lng_edit_group_title);
			_height = st::addContactTitleHeight + st::addContactPadding.top() + 1 * _firstInput.height() + st::addContactPadding.bottom() + _addButton.height();
		} else {
			_boxTitle = lang(_peer == App::self() ? lng_edit_self_title : lng_edit_contact_title);
			_height = st::addContactTitleHeight + st::addContactPadding.top() + 2 * _firstInput.height() + 1 * st::addContactDelta + st::addContactPadding.bottom() + _addButton.height();
		}
	} else {
		bool readyToAdd = !_phoneInput.text().isEmpty() && (!_firstInput.text().isEmpty() || !_lastInput.text().isEmpty());
		_boxTitle = lang(readyToAdd ? lng_confirm_contact_data : lng_enter_contact_data);
		_height = st::addContactTitleHeight + st::addContactPadding.top() + 3 * _firstInput.height() + 2 * st::addContactDelta + st::addContactPadding.bottom() + _addButton.height();
	}
	_firstInput.setGeometry(st::addContactPadding.left(), st::addContactTitleHeight + st::addContactPadding.top(), _width - st::addContactPadding.left() - st::addContactPadding.right(), _firstInput.height());
	_lastInput.setGeometry(st::addContactPadding.left(), _firstInput.y() + _firstInput.height() + st::addContactDelta, _firstInput.width(), _firstInput.height());
	_phoneInput.setGeometry(st::addContactPadding.left(), _lastInput.y() + _lastInput.height() + st::addContactDelta, _lastInput.width(), _lastInput.height());

	int32 buttonTop = (_peer ? (_peer->chat ? _firstInput : _lastInput) : _phoneInput).y() + _phoneInput.height() + st::addContactPadding.bottom();
	_cancelButton.move(0, buttonTop);
	_addButton.move(_width - _addButton.width(), buttonTop);
	_retryButton.move(_width - _retryButton.width(), buttonTop);
	_retryButton.hide();

	connect(&_addButton, SIGNAL(clicked()), this, SLOT(onSend()));
	connect(&_retryButton, SIGNAL(clicked()), this, SLOT(onRetry()));
	connect(&_cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));

	resize(_width, _height);

	showAll();
	_cache = myGrab(this, rect());
	hideAll();
}
ParameterEstimationDialog::ParameterEstimationDialog(QWidget *parent) : QDialog(parent) {
	ui.setupUi(this);

	QButtonGroup group(this);
	group.addButton(ui.radioButtonStreetView);
	group.addButton(ui.radioButtonAerialView);

	ui.lineEditCGADirectory->setText("../cga/mass");
	ui.lineEditTestDataDirectory->setText("C:/Anaconda/caffe/contour_regression/data");
	ui.lineEditRegressionDirectory->setText("C:/Anaconda/caffe/contour_regression");
	ui.lineEditOutputDirectory->setText("results");
	ui.checkBoxCentering->setChecked(true);
	ui.radioButtonStreetView->setChecked(true);
	ui.lineEditCameraDistance->setText("25");
	ui.checkBoxSubtractMean->setChecked(false);
	ui.lineEditXrotMin->setText("50");
	ui.lineEditXrotMax->setText("70");
	ui.lineEditYrotMin->setText("20");
	ui.lineEditYrotMax->setText("70");
	ui.lineEditZrotMin->setText("-20");
	ui.lineEditZrotMax->setText("20");
	ui.lineEditFovMin->setText("10");
	ui.lineEditFovMax->setText("10");

	connect(ui.pushButtonCGADirectory, SIGNAL(clicked()), this, SLOT(onCGADirectory()));
	connect(ui.pushButtonTestDataDirectory, SIGNAL(clicked()), this, SLOT(onTestDataDirectory()));
	connect(ui.pushButtonRegressionDirectory, SIGNAL(clicked()), this, SLOT(onRegressionDirectory()));
	connect(ui.pushButtonOutputDirectory, SIGNAL(clicked()), this, SLOT(onOutputDirectory()));
	connect(ui.pushButtonOK, SIGNAL(clicked()), this, SLOT(onOK()));
	connect(ui.pushButtonCancel, SIGNAL(clicked()), this, SLOT(onCancel()));
}
Example #5
0
ConnectDlg::ConnectDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ConnectDlg)
{
    ui->setupUi(this);

    marketDataAddrList = DataManager::GetInstance()->getMarketDataAddrList();
    tradingAddrList = DataManager::GetInstance()->getTradingAddrList();

#ifdef TEST
    ui->brokerName->setText(tr("sim"));
    ui->brokerID->setText("2030");
    // ui->userName->setText("000000002855");
    //ui->password->setText("123456");
    //ui->userName->setText("354315");
    ui->userName->setText("352032");
    ui->password->setText("888888");
#endif

    initComboBox();

    connect(ui->okBtn, SIGNAL(clicked()), this, SLOT(accept()));
    connect(ui->cancelBtn, SIGNAL(clicked()), this, SLOT(onCancel()));
    connect(ui->tradingAddressCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(currentIndexChangedSlot(int)));
}
Example #6
0
void CAbstractUpdateController::cancel()
{
    if (mCurrentProgress.misCanCancel)
    {
        onCancel();
    }
}
InitVirtualDriveDialog::InitVirtualDriveDialog(const Account& account, QWidget *parent)
    : QDialog(parent),
      account_(account)
{
    setupUi(this);
    mLogo->setPixmap(QPixmap(":/images/seafile-32.png"));
    setWindowTitle(tr("Download Default Library"));
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

    mStatusText->setText(
        tr("%1 organizes files by libraries.\nDo you like to download your "
           "default library?").arg(getBrand()));
    setStatusIcon(":/images/download-48.png");

    create_default_repo_req_ = NULL;
    download_default_repo_req_ = NULL;

    check_download_timer_ = NULL;
    connect(mYesBtn, SIGNAL(clicked()), this, SLOT(start()));
    connect(mNoBtn, SIGNAL(clicked()), this, SLOT(onCancel()));

    mRunInBackgroundBtn->setVisible(false);
    mFinishBtn->setVisible(false);
    mOpenBtn->setVisible(false);
}
Example #8
0
CreateGroupBox::CreateGroupBox(const MTPVector<MTPInputUser> &users) : _users(users),
	_createRequestId(0),
	_name(this, st::newGroupName, lang(lng_dlg_new_group_name)),
	_create(this, lang(lng_dlg_create_group), st::btnSelectDone),
	_cancel(this, lang(lng_cancel), st::btnSelectCancel),
    _hiding(false),	a_opacity(0, 1) {
	_width = st::addContactWidth;

	_height = st::addContactTitleHeight + st::addContactPadding.top() + _name.height() + st::addContactPadding.bottom() + _create.height();

	_name.setGeometry(st::addContactPadding.left(), st::addContactTitleHeight + st::addContactPadding.top(), _width - st::addContactPadding.left() - st::addContactPadding.right(), _name.height());

	int32 buttonTop = _name.y() + _name.height() + st::addContactPadding.bottom();
	_cancel.move(0, buttonTop);
	_create.move(_width - _create.width(), buttonTop);

	connect(&_create, SIGNAL(clicked()), this, SLOT(onCreate()));
	connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));

	resize(_width, _height);

	showAll();
	_cache = myGrab(this, rect());
	hideAll();
}
Example #9
0
void NewPassCodePage::onKeyPress(Qt::Key k) {
	if (k == Qt::Key_Enter) {
		onSave();
	} else if (k == Qt::Key_Escape) {
		onCancel();
	}
}
Example #10
0
ConnectionBox::ConnectionBox() :
    _saveButton(this, lang(lng_connection_save), st::btnSelectDone),
    _cancelButton(this, lang(lng_cancel), st::btnSelectCancel),
    _hostInput(this, st::inpConnectionHost, lang(lng_connection_host_ph), cConnectionProxy().host),
    _portInput(this, st::inpConnectionPort, lang(lng_connection_port_ph), QString::number(cConnectionProxy().port)),
    _userInput(this, st::inpConnectionUser, lang(lng_connection_user_ph), cConnectionProxy().user),
	_passwordInput(this, st::inpConnectionPassword, lang(lng_connection_password_ph), cConnectionProxy().password),
	_autoRadio(this, qsl("conn_type"), dbictAuto, lang(lng_connection_auto_rb), (cConnectionType() == dbictAuto)),
	_httpProxyRadio(this, qsl("conn_type"), dbictHttpProxy, lang(lng_connection_http_proxy_rb), (cConnectionType() == dbictHttpProxy)),
	_tcpProxyRadio(this, qsl("conn_type"), dbictTcpProxy, lang(lng_connection_tcp_proxy_rb), (cConnectionType() == dbictTcpProxy)),
	a_opacity(0, 1), _hiding(false) {

	_width = st::addContactWidth;

	connect(&_saveButton, SIGNAL(clicked()), this, SLOT(onSave()));
	connect(&_cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));

	connect(&_autoRadio, SIGNAL(changed()), this, SLOT(onChange()));
	connect(&_httpProxyRadio, SIGNAL(changed()), this, SLOT(onChange()));
	connect(&_tcpProxyRadio, SIGNAL(changed()), this, SLOT(onChange()));

	_passwordInput.setEchoMode(QLineEdit::Password);

	showAll();
	_cache = myGrab(this, rect());
	hideAll();
}
Example #11
0
void PhotoSendBox::keyPressEvent(QKeyEvent *e) {
	if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
		onSend();
	} else if (e->key() == Qt::Key_Escape) {
		onCancel();
	}
}
Example #12
0
/* \x41\x41\x41\x41\x41\x41\x41 */
TDialog::TDialog(QWidget *parent, Qt::WindowFlags flags, TempleLang *lang, int ctype)
    : QDialog(parent, flags) {
    setModal(true);

    dlang = lang;
    type = ctype;

    QGridLayout *grid = new QGridLayout(this);

    QLabel *nameLabel = new QLabel("Name:");
    nameIn = new QLineEdit();
    grid->addWidget(nameLabel, 0, 0);
    grid->addWidget(nameIn, 0, 1, 1, 2);

    QPushButton *ok = new QPushButton("Ok");
    ok->setDefault(true);
    connect(ok, SIGNAL(clicked()), this, SLOT(onOk()));

    QPushButton *cancel = new QPushButton("Cancel");
    connect(cancel, SIGNAL(clicked()), this, SLOT(onCancel()));

    grid->addWidget(ok, 1, 1);
    grid->addWidget(cancel, 1, 2);

}
Example #13
0
CpuRetryDialog::CpuRetryDialog(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl), m_seconds(SECONDSTOWAIT)
{
    m_timerId = startTimer(1000); //timer goes every 1 second

    QVBoxLayout* pLayout = new QVBoxLayout;


    m_pText = new QLabel;


    if (nullptr != m_pText)
    {
        QString text;
        text.sprintf(FORMATSTRING, m_seconds);
        m_pText->setText(text);
        pLayout->addWidget(m_pText);
    }

    m_pCancel = new QPushButton("Cancel", this);


    if (nullptr != m_pCancel)
    {
        m_pCancel->setDefault(true);
        connect(m_pCancel, SIGNAL(clicked()), this, SLOT(onCancel()));
        pLayout->addWidget(m_pCancel);
    }

    setLayout(pLayout);
}
Example #14
0
SerialPortDlg::SerialPortDlg(QWidget *parent, QSettings *settings)
	: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), m_settings(settings)
{
	layoutWindow();
	connect(m_okBtn, SIGNAL(clicked()), this, SLOT(onOK()));
	connect(m_cancelBtn, SIGNAL(clicked()), this, SLOT(onCancel()));

	setWindowTitle("Configure Gateway");
}
Example #15
0
SelectFusionDlg::SelectFusionDlg(RTIMUSettings *settings, QWidget *parent)
	: QDialog(parent, Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
{
    m_settings = settings;
	layoutWindow();
    setWindowTitle("Select Fusion algorithm");
	connect(m_buttons, SIGNAL(accepted()), this, SLOT(onOk()));
    connect(m_buttons, SIGNAL(rejected()), this, SLOT(onCancel()));
 }
Example #16
0
bool ContactView::CheckSaving()
{
  if (isEditing() && isModyfied())
  {
    QMessageBox::StandardButton ret;
    ret = QMessageBox::question(this, tr("Application"),
                                tr("The contact has been modified.\nDo you want to save your changes ?"),
                                QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
    if (ret == QMessageBox::Cancel)
    {
      ui->firstname->setFocus();
      return false;
    }
    else
    {
      if (ret == QMessageBox::Yes)
      {
        if (isValid())
        {
          onSave();
        }
        else
        {
          ui->id_edit->setFocus();
          ui->id_edit->selectAll();
          QMessageBox::warning(this, tr("Application"),
                               tr("Please correct the Keyhotee ID."),
                               QMessageBox::Ok);
          return false;
        }
      }
      else
      {
        onCancel();
      }
      setModyfied(false);
    }
  }
  else if (isEditing() && !isModyfied())
  {
    onCancel();
  }
  return true;
}
Example #17
0
void AmSession::onSipRequest(const AmSipRequest& req)
{
  CALL_EVENT_H(onSipRequest,req);

  DBG("onSipRequest: method = %s\n",req.method.c_str());

  updateRefreshMethod(req.hdrs);

  if(req.method == SIP_METH_INVITE){

    try {
      onInvite(req);
    }
    catch(const string& s) {
      ERROR("%s\n",s.c_str());
      setStopped();
      dlg->reply(req, 500, SIP_REPLY_SERVER_INTERNAL_ERROR);
    }
    catch(const AmSession::Exception& e) {
      ERROR("%i %s\n",e.code,e.reason.c_str());
      setStopped();
      dlg->reply(req, e.code, e.reason, NULL, e.hdrs);
    }
  }
  else if(req.method == SIP_METH_ACK){
    return;
  }
  else if( req.method == SIP_METH_BYE ){
    dlg->reply(req,200,"OK");
    onBye(req);
  }
  else if( req.method == SIP_METH_CANCEL ){
    onCancel(req);
  } 
  else if( req.method == SIP_METH_INFO ){

    const AmMimeBody* dtmf_body = 
      req.body.hasContentType("application/dtmf-relay");

    if (dtmf_body) {
      string dtmf_body_str((const char*)dtmf_body->getPayload(),
			   dtmf_body->getLen());
      postDtmfEvent(new AmSipDtmfEvent(dtmf_body_str));
      dlg->reply(req, 200, "OK");
    } else {
      dlg->reply(req, 415, "Unsupported Media Type");
    }
  } else if (req.method == SIP_METH_PRACK) {
    // TODO: SDP
    dlg->reply(req, 200, "OK");
    // TODO: WARN: only include latest SDP if req.rseq == dlg->rseq (latest 1xx)
  }
  else {
    dlg->reply(req, 501, "Not implemented");
  }
}
Example #18
0
	virtual bool onCommand(int id, HWND hwndCtl, UINT codeNotify) {
		switch (id) {
		case IDOK:
			return onOK();

		case IDCANCEL:
			return onCancel();
		}
		return mxWindow::onCommand(id, hwndCtl, codeNotify);
	}
Example #19
0
void ConfirmBox::init(const QString &text) {
	_text.setText(st::boxTextFont, text, _informative ? _confirmBoxTextOptions : _textPlainOptions);

	textstyleSet(&st::boxTextStyle);
	_textWidth = st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right();
	_textHeight = qMin(_text.countHeight(_textWidth), 16 * int(st::boxTextStyle.lineHeight));
	setMaxHeight(st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + st::boxButtonPadding.top() + _confirm.height() + st::boxButtonPadding.bottom());
	textstyleRestore();

	connect(&_confirm, SIGNAL(clicked()), this, SIGNAL(confirmed()));
	connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));
	if (_informative) {
		_cancel.hide();
		connect(this, SIGNAL(confirmed()), this, SLOT(onCancel()));
	}
	setMouseTracking(_text.hasLinks());

	prepare();
}
Example #20
0
UpdateProgressDialog::UpdateProgressDialog(QWidget *parent)
  : QDialog(parent)
{
  ui.setupUi(this);

  connect(ui.btnHide, SIGNAL(clicked()), this, SLOT(onHide()));
  connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(onCancel()));

  setModal(true);
}
Example #21
0
CDlgForgotPwd::CDlgForgotPwd(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CDlgForgotPwd)
{
    ui->setupUi(this);

    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onOk()));
    connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onCancel()));
    connect(ui->lineEditUserName, SIGNAL(returnPressed()), this, SLOT(onOk()));
}
Example #22
0
SelectPSDlg::SelectPSDlg(RTIMUSettings *settings, QWidget *parent)
    : QDialog(parent, Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
{
    m_settings = settings;
    layoutWindow();
    setWindowTitle("Select Pressure sensor");
    connect(m_buttons, SIGNAL(accepted()), this, SLOT(onOk()));
    connect(m_buttons, SIGNAL(rejected()), this, SLOT(onCancel()));
    connect(m_selectPS, SIGNAL(currentIndexChanged(int)), this, SLOT(setSelectAddress(int)));
    connect(m_selectBus, SIGNAL(currentIndexChanged(int)), this, SLOT(setSelectAddress(int)));
}
Example #23
0
void CDlgLogin::createLayout()
{
    QHBoxLayout* pMainLayout = new QHBoxLayout;
    setLayout(pMainLayout);
    QGroupBox* pGroupBox = new QGroupBox(this);
    pMainLayout->addWidget(pGroupBox);
    pGroupBox->setTitle(tr("Login"));

    // label edit
    QLabel* pLabelUserName = new QLabel(tr("User Name:"), this);
    QLabel* pLabelPassword = new QLabel(tr("Password:"******"Always login by the name"));

    // ok cancel
    m_pBtnOk = new QPushButton(this);
    m_pBtnOk->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    QIcon icon1;
    icon1.addFile(QString::fromUtf8(":/res/login.png"));
    m_pBtnOk->setIcon(icon1);
    m_pBtnOk->setIconSize(QSize(48,48));
    m_pBtnOk->setToolTip(tr("Login"));
    m_pBtnCancel = new QPushButton(this);
    QIcon icon2;
    icon2.addFile(QString::fromUtf8(":/res/cancel.png"));
    m_pBtnCancel->setIcon(icon2);
    m_pBtnCancel->setText(tr("Cancel"));
    m_pBtnCancel->setIconSize(QSize(16,16));
    m_pBtnCancel->setToolTip(tr("Cancel"));

    // connect
    connect(m_pBtnOk, SIGNAL(clicked()), this, SLOT(onOk()));
    connect(m_pBtnCancel, SIGNAL(clicked()), this, SLOT(onCancel()));

    // layout
    QGridLayout* pGridLayout = new QGridLayout(this);
    pGridLayout->addWidget(pLabelUserName, 0, 0);
    pGridLayout->addWidget(pLabelPassword, 1, 0);
    pGridLayout->addWidget(m_pEditUserName, 0, 1);
    pGridLayout->addWidget(m_pEditPassword, 1, 1);
    pGridLayout->addWidget(m_pBtnOk, 0, 2, 2, 1);
    pGridLayout->addWidget(m_pCheckBoxAlwaysLogin, 2, 0, 1, 2);
    pGridLayout->addWidget(m_pBtnCancel, 2, 2);
    pGroupBox->setLayout(pGridLayout);
    pGridLayout->setContentsMargins(20, 0, 20, 0);
}
Example #24
0
DBRefreshDialog::DBRefreshDialog(QWidget *parent) : QProgressDialog(parent) {
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Please wait..."));
    setLabelText(tr("Synchronizing package databases..."));
    setMinimumDuration(500);
    setRange(0,0);
    connect(this,SIGNAL(canceled()),this,SLOT(onCancel()));

    dbRefresher = new PacmanDBRefresher();
    connect(dbRefresher,SIGNAL(finished(PacmanProcessReader *)),this,SLOT(read_info_finished(PacmanProcessReader *)));
}
Example #25
0
void prefDialog::connectSlots()
{
	connect(ui.okPushButton, SIGNAL(clicked()), this, SLOT(onOK()) );
	connect(ui.cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancel()) );
	connect(ui.selectsoundPushButton, SIGNAL(clicked()), this, SLOT(onSound()) );
	connect(ui.selectPlayerPushButton, SIGNAL(clicked()), this, SLOT(onPlayer()) );
	connect(ui.choosehttpPushButton, SIGNAL(clicked()), this, SLOT(onHttp()) );
	connect(ui.browsePushButton, SIGNAL(clicked()), this, SLOT(onBrowse()) );
	connect(ui.imagePushButton, SIGNAL(clicked()), this, SLOT(onImage()) );
	connect(ui.poolPushButton, SIGNAL(clicked()), this, SLOT(onPool()) );
	connect(ui.resetPushButton, SIGNAL(clicked()), this, SLOT(onReset()) );
}
CircleDetectionScaleInputDialog::CircleDetectionScaleInputDialog(MainWindow* mainWin) : QDialog((QWidget*)mainWin) {
	this->mainWin = mainWin;

	// set up the UI
	ui.setupUi(this);
	ui.lineEditScale->setText("500.0");

	// register the event handlers
	connect(ui.okButton, SIGNAL(clicked()), this, SLOT(onOK()));
	connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));

	hide();
}
Example #27
0
CompassCalDlg::CompassCalDlg(QWidget *parent)
	: QDialog(parent, Qt::WindowCloseButtonHint | Qt::WindowTitleHint)
{
	layoutWindow();
    setWindowTitle("Compass calibration");
	connect(m_buttons, SIGNAL(accepted()), this, SLOT(onOk()));
    connect(m_buttons, SIGNAL(rejected()), this, SLOT(onCancel()));

    m_timer = startTimer(100);

    m_compassMin = RTVector3(10000, 10000, 10000);
    m_compassMax = RTVector3(-10000, -10000, -10000);
}
void RemoveProgressLoop::readyToProcess(double total_removed) {
    if (PackageChangesDialog(QStringList(),remover->packages(),0,total_removed,(QWidget *)parent()).exec() == QDialog::Rejected) {
        wasCanceled = true;
        remover->cancelRemove();
        return;
    }

    RemoveProgressDialog dlg(remover,(QWidget *)parent());
    dlg.setRange(0,(remover->packages().count() == 1)?0:remover->packages().count());
    connect(&dlg,SIGNAL(canceled()),this,SLOT(onCancel()));
    remover->beginRemove();
    dlg.exec();
    removed_packages = dlg.removedPackages();
}
// virtual
LRESULT PropertyPage::wndProc(UINT msg, WPARAM wp, LPARAM lp) {
	switch(msg) {
	case WM_NOTIFY:
		switch(LPNMHDR(lp)->code) {
		case PSN_APPLY:
			onOK();
			return TRUE;
		case PSN_QUERYCANCEL:
			onCancel();
			return TRUE;
		}
	}
	return Dialog::wndProc(msg, wp, lp);
}
Example #30
0
void ConfirmBox::init(const QString &text) {
	_text.setText(st::boxFont, text, (_infoMsg ? _confirmBoxTextOptions : _textPlainOptions));

	_textWidth = st::boxWidth - st::boxPadding.left() - st::boxPadding.right();
	_textHeight = _text.countHeight(_textWidth);
	setMaxHeight(st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + (_infoMsg ? _close.height() : _confirm.height()));

	if (_infoMsg) {
		_confirm.hide();
		_cancel.hide();

		connect(&_close, SIGNAL(clicked()), this, SLOT(onCancel()));

		setMouseTracking(_text.hasLinks());
	} else {
		_close.hide();

		connect(&_confirm, SIGNAL(clicked()), this, SIGNAL(confirmed()));
		connect(&_cancel, SIGNAL(clicked()), this, SLOT(onCancel()));
	}

	prepare();
}