示例#1
0
DccAcceptDialog::DccAcceptDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, const QString & capt)
    : QWidget(nullptr), DccDialog(br, dcc)
{
	setObjectName("dcc_accept_box");
	//QVBoxLayout * vb = new QVBoxLayout(this,4,4);
	QVBoxLayout * vb = new QVBoxLayout(this);
	vb->setMargin(4);
	vb->setSpacing(4);
	QLabel * l = new QLabel(text, this);
	l->setWordWrap(true);
	vb->addWidget(l);

	//QHBoxLayout *hb = new QHBoxLayout(4);
	QHBoxLayout * hb = new QHBoxLayout();
	hb->setSpacing(4);
	vb->addLayout(hb, Qt::AlignCenter);
	QPushButton * btn = new QPushButton(__tr2qs_ctx("&Accept", "dcc"), this);
	btn->setDefault(true);
	//btn->setFocus();
	hb->addWidget(btn);
	connect(btn, SIGNAL(clicked()), this, SLOT(acceptClicked()));
	btn = new QPushButton(__tr2qs_ctx("&Reject", "dcc"), this);
	connect(btn, SIGNAL(clicked()), this, SLOT(rejectClicked()));
	hb->addWidget(btn);

	setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DccMsg))));
	setWindowTitle(capt);

	l->activateWindow();
	l->setFocus();
}
QDialogButtons::QDialogButtons(QDialog *parent, bool autoConnect, Q_UINT32 buttons,
			       Orientation orient, const char *name ) : QWidget(parent, name)
{
    init(buttons, orient);
    if(parent && autoConnect) {
	QObject::connect(this, SIGNAL(acceptClicked()), parent, SLOT(accept()));
	QObject::connect(this, SIGNAL(rejectClicked()), parent, SLOT(reject()));
    }
}
示例#3
0
UrlInputDialog::UrlInputDialog(QWidget* parent)
: QDialog(parent)
{
    setupUi(this);

    QPushButton* openFile = buttons->addButton("Open File...", QDialogButtonBox::ActionRole);

    connect(openFile, SIGNAL(clicked()), SLOT(openFileClicked()));
    connect(buttons, SIGNAL(accepted()), SLOT(acceptClicked()));
    connect(buttons, SIGNAL(rejected()), SLOT(rejectClicked()));
}
bool QDialogButtons::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: clicked((Button)(*((Button*)static_QUType_ptr.get(_o+1)))); break;
    case 1: acceptClicked(); break;
    case 2: rejectClicked(); break;
    case 3: helpClicked(); break;
    case 4: applyClicked(); break;
    case 5: allClicked(); break;
    case 6: retryClicked(); break;
    case 7: ignoreClicked(); break;
    case 8: abortClicked(); break;
    default:
	return QWidget::qt_emit(_id,_o);
    }
    return TRUE;
}
void
QDialogButtons::handleClicked()
{
    const QObject *s = sender();
    if(!s)
	return;

    for(QMapIterator<QDialogButtons::Button, QWidget *> it = d->buttons.begin(); it != d->buttons.end(); ++it) {
	if(it.data() == s) {
	    emit clicked((QDialogButtons::Button)it.key());
	    switch(it.key()) {
	    case Retry:
		emit retryClicked();
		break;
	    case Ignore:
		emit ignoreClicked();
		break;
	    case Abort:
		emit abortClicked();
		break;
	    case All:
		emit allClicked();
		break;
	    case Accept:
		emit acceptClicked();
		break;
	    case Reject:
		emit rejectClicked();
		break;
	    case Apply:
		emit applyClicked();
		break;
	    case Help:
		emit helpClicked();
		break;
	    default:
		break;
	    }
	    return;
	}
    }
}
示例#6
0
//------------------------------------------------------------------------
AdvDlg::AdvDlg(QWidget* parent,
	       bool &synthShortNames,
	       bool &enableCharSetXform,
	       bool &previewGmap,
	       int  &debugLevel):
  QDialog(parent),
  synthShortNames(synthShortNames),
  enableCharSetXform(enableCharSetXform),
  previewGmap(previewGmap),
  debugLevel(debugLevel)
{
  ui.setupUi(this);
  ui.synthShortNames->setChecked(synthShortNames);
  ui.enableCharSetXform->setChecked(enableCharSetXform);
  ui.previewGmap->setChecked(previewGmap);
  ui.debugCombo->setCurrentIndex(debugLevel+1);
  ui.buttonBox->button(QDialogButtonBox::Ok)->setIcon(QIcon(":images/ok"));
  ui.buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":images/cancel"));
  connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
  connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejectClicked()));
}
Preferences::Preferences(QWidget* parent, QList<Format>& formatList,
                         BabelData& bd) : QDialog(parent),
  formatList_(formatList),
  bd_(bd)
{
  ui_.setupUi(this);

  ui_.startupCheck->setChecked(bd_.startupVersionCheck);
  ui_.reportStatisticsCheck->setChecked(bd_.reportStatistics);

  connect (ui_.buttonBox, SIGNAL(accepted()), this, SLOT(acceptClicked()));
  connect (ui_.buttonBox, SIGNAL(rejected()), this, SLOT(rejectClicked()));

  connect (ui_.enableAllButton, SIGNAL(clicked()), this, SLOT(enableAllClicked()));
  connect (ui_.disableAllButton, SIGNAL(clicked()), this, SLOT(disableAllClicked()));

  for (int i = 0; i < formatList_.size(); i++) {
    FormatListEntry *item = new FormatListEntry(formatList[i]);

    ui_.enabledFormatsList->addItem(item);
  }
}