本文整理汇总了C++中rejected函数的典型用法代码示例。如果您正苦于以下问题:C++ rejected函数的具体用法?C++ rejected怎么用?C++ rejected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rejected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
/** Default constructor */
IdDetailsDialog::IdDetailsDialog(const RsGxsGroupId& id, QWidget *parent) :
QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint),
mId(id),
ui(new Ui::IdDetailsDialog)
{
/* Invoke Qt Designer generated QObject setup routine */
ui->setupUi(this);
setAttribute (Qt::WA_DeleteOnClose,true);
/* Setup UI helper */
mStateHelper = new UIStateHelper(this);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->toolButton_Reputation);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repModButton);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Accept);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Ban);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Negative);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Positive);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_Custom);
mStateHelper->addWidget(IDDETAILSDIALOG_IDDETAILS, ui->repMod_spinBox);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
mStateHelper->addLoadPlaceholder(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Nickname);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_KeyId);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgId);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_Type);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->lineEdit_GpgName);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOverall);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingImplicit);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingOwn);
mStateHelper->addClear(IDDETAILSDIALOG_IDDETAILS, ui->line_RatingPeers);
/* Create token queue */
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
Settings->loadWidgetInformation(this);
ui->headerFrame->setHeaderImage(QPixmap(":/images/identity/identity_64.png"));
ui->headerFrame->setHeaderText(tr("Person Details"));
//connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(changeGroup()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
// Hiding Rep Btn until that part is finished.
ui->toolButton_Reputation->setVisible(false);
requestIdDetails();
}
示例2: QDialog
QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *parent, Qt::WFlags fl )
: QDialog( parent, fl )
, mMapCanvas( mapCanvas )
{
setupUi( this );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) );
connect( projectionSelector, SIGNAL( sridSelected( QString ) ), this, SLOT( setMapUnitsToCurrentProjection() ) );
///////////////////////////////////////////////////////////
// Properties stored in map canvas's QgsMapRenderer
// these ones are propagated to QgsProject by a signal
QgsMapRenderer* myRenderer = mMapCanvas->mapRenderer();
QGis::UnitType myUnit = myRenderer->mapUnits();
setMapUnits( myUnit );
// we need to initialize it, since the on_cbxProjectionEnabled_stateChanged()
// callback triggered by setChecked() might use it.
mProjectSrsId = myRenderer->destinationCrs().srsid();
//see if the user wants on the fly projection enabled
bool myProjectionEnabled = myRenderer->hasCrsTransformEnabled();
cbxProjectionEnabled->setChecked( myProjectionEnabled );
QgsDebugMsg( "Read project CRSID: " + QString::number( mProjectSrsId ) );
projectionSelector->setSelectedCrsId( mProjectSrsId );
projectionSelector->setEnabled( myProjectionEnabled );
///////////////////////////////////////////////////////////
// Properties stored in QgsProject
title( QgsProject::instance()->title() );
// get the manner in which the number of decimal places in the mouse
// position display is set (manual or automatic)
bool automaticPrecision = QgsProject::instance()->readBoolEntry( "PositionPrecision", "/Automatic" );
if ( automaticPrecision )
{
radAutomatic->setChecked( true );
spinBoxDP->setDisabled( true );
labelDP->setDisabled( true );
}
else
{
radManual->setChecked( true );
}
cbxAbsolutePath->setCurrentIndex( QgsProject::instance()->readBoolEntry( "Paths", "/Absolute", true ) ? 0 : 1 );
int dp = QgsProject::instance()->readNumEntry( "PositionPrecision", "/DecimalPlaces" );
spinBoxDP->setValue( dp );
QString format = QgsProject::instance()->readEntry( "PositionPrecision", "/DegreeFormat", "D" );
if ( format == "DM" )
radDM->setChecked( true );
else if ( format == "DMS" )
radDMS->setChecked( true );
else
radD->setChecked( true );
//get the color selections and set the button color accordingly
int myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorRedPart", 255 );
int myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorGreenPart", 255 );
int myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorBluePart", 0 );
int myAlphaInt = QgsProject::instance()->readNumEntry( "Gui", "/SelectionColorAlphaPart", 255 );
QColor myColor = QColor( myRedInt, myGreenInt, myBlueInt, myAlphaInt );
pbnSelectionColor->setColor( myColor );
//get the color for map canvas background and set button color accordingly (default white)
myRedInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorRedPart", 255 );
myGreenInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorGreenPart", 255 );
myBlueInt = QgsProject::instance()->readNumEntry( "Gui", "/CanvasColorBluePart", 255 );
myColor = QColor( myRedInt, myGreenInt, myBlueInt );
pbnCanvasColor->setColor( myColor );
//get project scales
QStringList myScales = QgsProject::instance()->readListEntry( "Scales", "/ScalesList" );
if ( !myScales.isEmpty() )
{
QStringList::const_iterator scaleIt = myScales.constBegin();
for ( ; scaleIt != myScales.constEnd(); ++scaleIt )
{
QListWidgetItem* newItem = new QListWidgetItem( lstScales );
newItem->setText( *scaleIt );
newItem->setFlags( Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable );
lstScales->addItem( newItem );
}
}
grpProjectScales->setChecked( QgsProject::instance()->readBoolEntry( "Scales", "/useProjectScales" ) );
QgsMapLayer* currentLayer = 0;
QStringList noIdentifyLayerIdList = QgsProject::instance()->readListEntry( "Identify", "/disabledLayers" );
const QMap<QString, QgsMapLayer*> &mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
//.........这里部分代码省略.........
示例3: setWindowTitle
//.........这里部分代码省略.........
QList<user> roles_list = users_repository::get_list();
QList<QString> assigned_roles = user::granted_roles(m_role_oid);
for (int ri=0; ri<roles_list.size(); ri++) {
const user& u = roles_list.at(ri);
if (!u.m_can_login && u.m_role_oid>0) {
// keep only entries from pg_roles without the LOGIN privilege
// they're supposed to be roles to assign rather than users
QListWidgetItem* item = new QListWidgetItem(u.m_db_login, m_qlist_roles);
item->setFlags(Qt::ItemIsUserCheckable|/*Qt::ItemIsSelectable|*/Qt::ItemIsEnabled);
item->setCheckState(assigned_roles.indexOf(u.m_db_login) >= 0 ?
Qt::Checked : Qt::Unchecked);
}
}
// m_case_sensitive = new QCheckBox;
m_custom1 = new custom_user_field;
m_custom2 = new custom_user_field;
m_custom3 = new custom_user_field;
if (u.m_is_superuser) {
QLabel* label = new QLabel(tr("<b>Superuser account: unrestricted permissions.</b>"));
layout->addRow(QString(), label);
}
layout->addRow(tr("Login <sup>(*)</sup>:"), m_login);
layout->addRow(tr("Password <sup>(*)</sup>:"), /*m_password*/ vlpassw);
layout->addRow(tr("Retype password <sup>(*)</sup>:"), m_password2);
/*
m_password2->resize(QSize(m_password->width(), m_password2->height()));
m_password2->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
*/
#ifdef PERM_LOGIN
add_field_with_help(layout,
tr("Active <sup>(*)</sup>:"),
m_perm_login,
tr("The database role has the LOGIN capability."));
#endif
add_field_with_help(layout,
tr("Can connect <sup>(**)</sup>:"),
m_perm_connect,
tr("The login has CONNECT permission on this database."));
add_field_with_help(layout,
tr("Registered <sup>(**)</sup>:"),
m_registered,
tr("The user account corresponds to an operator in this database."));
layout->addRow(tr("Operator name <sup>(*)</sup>:"), m_fullname);
layout->addRow(tr("Groups <sup>(*)</sup>:"), m_qlist_roles);
layout->addRow(tr("Custom field #1 <sup>(**)</sup>:"), m_custom1);
layout->addRow(tr("Custom field #2 <sup>(**)</sup>:"), m_custom2);
layout->addRow(tr("Custom field #3 <sup>(**)</sup>:"), m_custom3);
top_layout->addLayout(layout);
QLabel* lremark = new QLabel(tr("(*) Fields marked with <sup>(*)</sup> apply across all databases of this server.<br>(**) Fields marked with <sup>(**)</sup> apply only to the current database: <b>%1</b>.").arg(db.dbname().toHtmlEscaped()));
QFont smf = lremark->font();
smf.setPointSize((smf.pointSize()*8)/10);
lremark->setFont(smf);
top_layout->addWidget(lremark);
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
top_layout->addWidget(m_buttons);
connect(m_buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));
setLayout(top_layout);
m_user_id = 0;
if (role_oid!=0) {
/* set readOnly but not disabled because disabled is hard to read
and the login is the major information */
m_login->setReadOnly(true); //m_login->setEnabled(false);
// u is loaded (for an existing role) at the top of the function
m_user_id = u.m_user_id;
m_fullname->setText(u.m_fullname);
m_login->setText(u.m_login);
m_initial_login = u.m_login;
m_custom1->setPlainText(u.m_custom_field1);
m_custom2->setPlainText(u.m_custom_field2);
m_custom3->setPlainText(u.m_custom_field3);
#ifdef PERM_LOGIN
m_perm_login->setChecked(u.m_can_login);
#endif
m_perm_connect->setChecked(u.m_can_connect);
m_registered->setChecked(u.m_user_id!=0);
}
connect(m_registered, SIGNAL(clicked()), this, SLOT(enable_fields()));
enable_fields();
}
示例4: QDialog
DlgEditTokens::DlgEditTokens(CardDatabaseModel *_cardDatabaseModel, QWidget *parent)
: QDialog(parent), currentCard(0), cardDatabaseModel(_cardDatabaseModel)
{
nameLabel = new QLabel(tr("&Name:"));
nameEdit = new QLineEdit;
nameEdit->setEnabled(false);
nameLabel->setBuddy(nameEdit);
colorLabel = new QLabel(tr("C&olor:"));
colorEdit = new QComboBox;
colorEdit->addItem(tr("white"), "w");
colorEdit->addItem(tr("blue"), "u");
colorEdit->addItem(tr("black"), "b");
colorEdit->addItem(tr("red"), "r");
colorEdit->addItem(tr("green"), "g");
colorEdit->addItem(tr("multicolor"), "m");
colorEdit->addItem(tr("colorless"), QString());
colorLabel->setBuddy(colorEdit);
connect(colorEdit, SIGNAL(currentIndexChanged(int)), this, SLOT(colorChanged(int)));
ptLabel = new QLabel(tr("&P/T:"));
ptEdit = new QLineEdit;
ptLabel->setBuddy(ptEdit);
connect(ptEdit, SIGNAL(textChanged(QString)), this, SLOT(ptChanged(QString)));
annotationLabel = new QLabel(tr("&Annotation:"));
annotationEdit = new QLineEdit;
annotationLabel->setBuddy(annotationEdit);
connect(annotationEdit, SIGNAL(textChanged(QString)), this, SLOT(annotationChanged(QString)));
QGridLayout *grid = new QGridLayout;
grid->addWidget(nameLabel, 0, 0);
grid->addWidget(nameEdit, 0, 1);
grid->addWidget(colorLabel, 1, 0);
grid->addWidget(colorEdit, 1, 1);
grid->addWidget(ptLabel, 2, 0);
grid->addWidget(ptEdit, 2, 1);
grid->addWidget(annotationLabel, 3, 0);
grid->addWidget(annotationEdit, 3, 1);
QGroupBox *tokenDataGroupBox = new QGroupBox(tr("Token data"));
tokenDataGroupBox->setLayout(grid);
cardDatabaseDisplayModel = new CardDatabaseDisplayModel(this);
cardDatabaseDisplayModel->setSourceModel(cardDatabaseModel);
cardDatabaseDisplayModel->setIsToken(CardDatabaseDisplayModel::ShowTrue);
chooseTokenView = new QTreeView;
chooseTokenView->setModel(cardDatabaseDisplayModel);
chooseTokenView->setUniformRowHeights(true);
chooseTokenView->setRootIsDecorated(false);
chooseTokenView->setAlternatingRowColors(true);
chooseTokenView->setSortingEnabled(true);
chooseTokenView->sortByColumn(0, Qt::AscendingOrder);
chooseTokenView->resizeColumnToContents(0);
chooseTokenView->header()->setStretchLastSection(false);
chooseTokenView->header()->hideSection(1);
chooseTokenView->header()->hideSection(2);
#if QT_VERSION < 0x050000
chooseTokenView->header()->setResizeMode(3, QHeaderView::ResizeToContents);
chooseTokenView->header()->setResizeMode(4, QHeaderView::ResizeToContents);
#else
chooseTokenView->header()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
chooseTokenView->header()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
#endif
connect(chooseTokenView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(tokenSelectionChanged(QModelIndex, QModelIndex)));
QAction *aAddToken = new QAction(tr("Add token"), this);
aAddToken->setIcon(QPixmap("theme:icons/increment"));
connect(aAddToken, SIGNAL(triggered()), this, SLOT(actAddToken()));
QAction *aRemoveToken = new QAction(tr("Remove token"), this);
aRemoveToken->setIcon(QPixmap("theme:icons/decrement"));
connect(aRemoveToken, SIGNAL(triggered()), this, SLOT(actRemoveToken()));
QToolBar *databaseToolBar = new QToolBar;
databaseToolBar->addAction(aAddToken);
databaseToolBar->addAction(aRemoveToken);
QVBoxLayout *leftVBox = new QVBoxLayout;
leftVBox->addWidget(chooseTokenView);
leftVBox->addWidget(databaseToolBar);
QHBoxLayout *hbox = new QHBoxLayout;
hbox->addLayout(leftVBox);
hbox->addWidget(tokenDataGroupBox);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(hbox);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
setWindowTitle(tr("Edit tokens"));
}
示例5: QDialog
PinEntryDialog::PinEntryDialog( QWidget* parent, const char* name,
bool modal, bool enable_quality_bar )
: QDialog( parent, name, modal, Qt::WStyle_StaysOnTop ), _grabbed( false )
{
QBoxLayout* top = new QVBoxLayout( this, 6 );
QBoxLayout* upperLayout = new QHBoxLayout( top );
_icon = new QLabel( this );
_icon->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) );
upperLayout->addWidget( _icon );
QBoxLayout* labelLayout = new QVBoxLayout( upperLayout );
_error = new QLabel( this );
labelLayout->addWidget( _error );
_desc = new QLabel( this );
labelLayout->addWidget( _desc );
QGridLayout* grid = new QGridLayout( labelLayout );
_prompt = new QLabel( this );
_prompt->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
grid->addWidget( _prompt, 0, 0 );
_edit = new SecQLineEdit( this );
_edit->setMaxLength( 256 );
_edit->setEchoMode( SecQLineEdit::Password );
grid->addWidget( _edit, 0, 1 );
if (enable_quality_bar)
{
_quality_bar_label = new QLabel( this );
_quality_bar_label->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
grid->addWidget ( _quality_bar_label, 1, 0 );
_quality_bar = new QProgressBar( this );
_quality_bar->setCenterIndicator( true );
grid->addWidget( _quality_bar, 1, 1 );
_have_quality_bar = true;
}
else
_have_quality_bar = false;
QBoxLayout* l = new QHBoxLayout( top );
_ok = new QPushButton( tr("OK"), this );
_cancel = new QPushButton( tr("Cancel"), this );
l->addWidget( _ok );
l->addStretch();
l->addWidget( _cancel );
_ok->setDefault(true);
connect( _ok, SIGNAL( clicked() ),
this, SIGNAL( accepted() ) );
connect( _cancel, SIGNAL( clicked() ),
this, SIGNAL( rejected() ) );
connect( _edit, SIGNAL( textModified(const SecQString&) ),
this, SLOT( updateQuality(const SecQString&) ) );
connect (this, SIGNAL (accepted ()),
this, SLOT (accept ()));
connect (this, SIGNAL (rejected ()),
this, SLOT (reject ()));
_edit->setFocus();
}
示例6: QDialog
CreateTxDialog::CreateTxDialog(const QString& accountName, const PaymentRequest& paymentRequest, QWidget* parent)
: QDialog(parent), status(SAVE_ONLY)
{
// Buttons
signAndSendButton = new QPushButton(tr("Sign and Send"));
signAndSaveButton = new QPushButton(tr("Sign and Save"));
saveButton = new QPushButton(tr("Save Unsigned"));
cancelButton = new QPushButton(tr("Cancel"));
cancelButton->setDefault(true);
/*
QDialogButtonBox* buttonBox = new QDialogButtonBox(
QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
*/
QDialogButtonBox* buttonBox = new QDialogButtonBox;
buttonBox->addButton(signAndSendButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(signAndSaveButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(saveButton, QDialogButtonBox::AcceptRole);
buttonBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
connect(signAndSendButton, &QPushButton::clicked, [this]() { status = SIGN_AND_SEND; accept(); });
connect(signAndSaveButton, &QPushButton::clicked, [this]() { status = SIGN_AND_SAVE; accept(); });
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
// Prompt
QLabel* promptLabel = new QLabel(tr("Add Outputs:"));
// Account
QLabel* accountLabel = new QLabel(tr("Account:"));
accountComboBox = new QComboBox();
accountComboBox->insertItem(0, accountName);
QHBoxLayout* accountLayout = new QHBoxLayout();
accountLayout->addWidget(accountLabel);
accountLayout->addWidget(accountComboBox);
// Fee
QLabel* feeLabel = new QLabel(tr("Fee:"));
feeEdit = new QLineEdit();
feeEdit->setValidator(new QRegExpValidator(AMOUNT_REGEXP));
feeEdit->setText("0.0005"); // TODO: suggest more intelligently
QHBoxLayout* feeLayout = new QHBoxLayout();
feeLayout->addWidget(feeLabel);
feeLayout->addWidget(feeEdit);
// TxOuts
txOutVBoxLayout = new QVBoxLayout();
txOutVBoxLayout->setSizeConstraint(QLayout::SetMinimumSize);
addTxOut(paymentRequest);
// Add Output Button
QPushButton* addTxOutButton = new QPushButton(tr("Add Output"));
connect(addTxOutButton, SIGNAL(clicked()), this, SLOT(addTxOut()));
mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(promptLabel);
mainLayout->addLayout(accountLayout);
mainLayout->addLayout(feeLayout);
mainLayout->addLayout(txOutVBoxLayout);
mainLayout->addWidget(addTxOutButton);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
}
示例7: QgsOptionsDialogBase
QgsVectorLayerProperties::QgsVectorLayerProperties(
QgsVectorLayer *lyr,
QWidget * parent,
Qt::WindowFlags fl
)
: QgsOptionsDialogBase( "VectorLayerProperties", parent, fl )
, mLayer( lyr )
, mMetadataFilled( false )
, mOriginalSubsetSQL( lyr->subsetString() )
, mSaveAsMenu( nullptr )
, mLoadStyleMenu( nullptr )
, mRendererDialog( nullptr )
, labelingDialog( nullptr )
, labelDialog( nullptr )
, mActionDialog( nullptr )
, diagramPropertiesDialog( nullptr )
, mFieldsPropertiesDialog( nullptr )
{
setupUi( this );
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
// and connecting QDialogButtonBox's accepted/rejected signals to dialog's accept/reject slots
initOptionsBase( false );
QPushButton* b = new QPushButton( tr( "Style" ) );
QMenu* m = new QMenu( this );
mActionLoadStyle = m->addAction( tr( "Load Style" ), this, SLOT( loadStyle_clicked() ) );
mActionSaveStyleAs = m->addAction( tr( "Save Style" ), this, SLOT( saveStyleAs_clicked() ) );
m->addSeparator();
m->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
m->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
b->setMenu( m );
connect( m, SIGNAL( aboutToShow() ), this, SLOT( aboutToShowStyleMenu() ) );
buttonBox->addButton( b, QDialogButtonBox::ResetRole );
connect( lyr->styleManager(), SIGNAL( currentStyleChanged( QString ) ), this, SLOT( syncToLayer() ) );
connect( buttonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( this, SIGNAL( accepted() ), this, SLOT( apply() ) );
connect( this, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
connect( mOptionsStackedWidget, SIGNAL( currentChanged( int ) ), this, SLOT( mOptionsStackedWidget_CurrentChanged( int ) ) );
fieldComboBox->setLayer( lyr );
displayFieldComboBox->setLayer( lyr );
connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );
// connections for Map Tip display
connect( htmlRadio, SIGNAL( toggled( bool ) ), htmlMapTip, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), insertFieldButton, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), fieldComboBox, SLOT( setEnabled( bool ) ) );
connect( htmlRadio, SIGNAL( toggled( bool ) ), insertExpressionButton, SLOT( setEnabled( bool ) ) );
connect( fieldComboRadio, SIGNAL( toggled( bool ) ), displayFieldComboBox, SLOT( setEnabled( bool ) ) );
if ( !mLayer )
return;
QVBoxLayout *layout;
if ( mLayer->hasGeometryType() )
{
// Create the Labeling dialog tab
layout = new QVBoxLayout( labelingFrame );
layout->setMargin( 0 );
labelingDialog = new QgsLabelingWidget( mLayer, QgisApp::instance()->mapCanvas(), labelingFrame );
labelingDialog->layout()->setContentsMargins( -1, 0, -1, 0 );
layout->addWidget( labelingDialog );
labelingFrame->setLayout( layout );
// Create the Labeling (deprecated) dialog tab
layout = new QVBoxLayout( labelOptionsFrame );
layout->setMargin( 0 );
labelDialog = new QgsLabelDialog( mLayer->label(), labelOptionsFrame );
labelDialog->layout()->setMargin( 0 );
layout->addWidget( labelDialog );
labelOptionsFrame->setLayout( layout );
connect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
}
else
{
labelingDialog = nullptr;
labelDialog = nullptr;
mOptsPage_Labels->setEnabled( false ); // disable labeling item
mOptsPage_LabelsOld->setEnabled( false ); // disable labeling (deprecated) item
}
// Create the Actions dialog tab
QVBoxLayout *actionLayout = new QVBoxLayout( actionOptionsFrame );
actionLayout->setMargin( 0 );
mActionDialog = new QgsAttributeActionDialog( *mLayer->actions(), actionOptionsFrame );
mActionDialog->layout()->setMargin( 0 );
actionLayout->addWidget( mActionDialog );
// Create the menu for the save style button to choose the output format
mSaveAsMenu = new QMenu( this );
mSaveAsMenu->addAction( tr( "QGIS Layer Style File..." ) );
mSaveAsMenu->addAction( tr( "SLD File..." ) );
//Only if the provider support loading & saving styles to db add new choices
//.........这里部分代码省略.........
示例8: QDialog
QgsGrassSelect::QgsGrassSelect( QWidget *parent, int type )
: QDialog( parent )
, QgsGrassSelectBase()
, selectedType( 0 )
{
QgsDebugMsg( QString( "QgsGrassSelect() type = %1" ).arg( type ) );
setupUi( this );
connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
if ( first )
{
if ( QgsGrass::activeMode() )
{
lastGisdbase = QgsGrass::getDefaultGisdbase();
lastLocation = QgsGrass::getDefaultLocation();
lastMapset = QgsGrass::getDefaultMapset();
}
else
{
QSettings settings;
lastGisdbase = settings.value( QStringLiteral( "/GRASS/lastGisdbase" ) ).toString();
//check we got something from qsettings otherwise default to users home dir
if ( lastGisdbase.isEmpty() )
{
QDir home = QDir::home();
lastGisdbase = QString( home.path() );
}
lastMapset = settings.value( QStringLiteral( "/GRASS/lastMapset" ) ).toString();
}
first = false;
}
QgsGrassSelect::type = type;
switch ( type )
{
case QgsGrassSelect::VECTOR:
setWindowTitle( tr( "Select GRASS Vector Layer" ) );
break;
case QgsGrassSelect::RASTER:
/* Remove layer combo box */
Layer->hide();
elayer->hide();
setWindowTitle( tr( "Select GRASS Raster Layer" ) );
break;
case QgsGrassSelect::MAPCALC:
/* Remove layer combo box */
Layer->hide();
elayer->hide();
setWindowTitle( tr( "Select GRASS mapcalc schema" ) );
break;
case QgsGrassSelect::MAPSET:
Layer->hide();
elayer->hide();
MapName->hide();
emap->hide();
setWindowTitle( tr( "Select GRASS Mapset" ) );
break;
}
egisdbase->setText( lastGisdbase );
setLocations();
adjustSize();
}
示例9: QDialog
DiskUsageGUI::DiskUsageGUI(QUrl openDir, QWidget* parent)
: QDialog(parent), exitAtFailure(true)
{
setWindowTitle(i18n("Krusader::Disk Usage"));
baseDirectory = openDir;
if (!newSearch())
return;
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QGridLayout *duGrid = new QGridLayout();
duGrid->setSpacing(6);
duGrid->setContentsMargins(11, 11, 11, 11);
QWidget *duTools = new QWidget(this);
QHBoxLayout *duHBox = new QHBoxLayout(duTools);
duHBox->setContentsMargins(0, 0, 0, 0);
duTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
btnNewSearch = new QToolButton(duTools);
btnNewSearch->setIcon(QIcon(krLoader->loadIcon("document-open", KIconLoader::Desktop)));
duHBox->addWidget(btnNewSearch);
btnNewSearch->setToolTip(i18n("Start new disk usage search"));
btnRefresh = new QToolButton(duTools);
btnRefresh->setIcon(QIcon(krLoader->loadIcon("view-refresh", KIconLoader::Desktop)));
duHBox->addWidget(btnRefresh);
btnRefresh->setToolTip(i18n("Refresh"));
btnDirUp = new QToolButton(duTools);
btnDirUp->setIcon(QIcon(krLoader->loadIcon("go-up", KIconLoader::Desktop)));
duHBox->addWidget(btnDirUp);
btnDirUp->setToolTip(i18n("Parent folder"));
QWidget * separatorWidget = new QWidget(duTools);
separatorWidget->setMinimumWidth(10);
duHBox->addWidget(separatorWidget);
btnLines = new QToolButton(duTools);
btnLines->setIcon(QIcon(krLoader->loadIcon("view-list-details", KIconLoader::Desktop)));
btnLines->setCheckable(true);
duHBox->addWidget(btnLines);
btnLines->setToolTip(i18n("Line view"));
btnDetailed = new QToolButton(duTools);
btnDetailed->setIcon(QIcon(krLoader->loadIcon("view-list-tree", KIconLoader::Desktop)));
btnDetailed->setCheckable(true);
duHBox->addWidget(btnDetailed);
btnDetailed->setToolTip(i18n("Detailed view"));
btnFilelight = new QToolButton(duTools);
btnFilelight->setIcon(QIcon(krLoader->loadIcon("kr_diskusage", KIconLoader::Desktop)));
btnFilelight->setCheckable(true);
duHBox->addWidget(btnFilelight);
btnFilelight->setToolTip(i18n("Filelight view"));
QWidget *spacerWidget = new QWidget(duTools);
duHBox->addWidget(spacerWidget);
QHBoxLayout *hboxlayout = new QHBoxLayout(spacerWidget);
QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed);
hboxlayout->addItem(spacer);
duGrid->addWidget(duTools, 0, 0);
diskUsage = new DiskUsage("DiskUsage", this);
duGrid->addWidget(diskUsage, 1, 0);
status = new KSqueezedTextLabel(this);
duGrid->addWidget(status, 2, 0);
mainLayout->addLayout(duGrid);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
mainLayout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(diskUsage, SIGNAL(status(QString)), this, SLOT(setStatus(QString)));
connect(diskUsage, SIGNAL(viewChanged(int)), this, SLOT(slotViewChanged(int)));
connect(diskUsage, SIGNAL(newSearch()), this, SLOT(newSearch()));
connect(diskUsage, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool)));
connect(btnNewSearch, SIGNAL(clicked()), this, SLOT(newSearch()));
connect(btnRefresh, SIGNAL(clicked()), this, SLOT(loadUsageInfo()));
connect(btnDirUp, SIGNAL(clicked()), diskUsage, SLOT(dirUp()));
connect(btnLines, SIGNAL(clicked()), this, SLOT(selectLinesView()));
connect(btnDetailed, SIGNAL(clicked()), this, SLOT(selectListView()));
connect(btnFilelight, SIGNAL(clicked()), this, SLOT(selectFilelightView()));
KConfigGroup group(krConfig, "DiskUsage");
int view = group.readEntry("View", VIEW_LINES);
if (view < VIEW_LINES || view > VIEW_FILELIGHT)
view = VIEW_LINES;
diskUsage->setView(view);
sizeX = group.readEntry("Window Width", QFontMetrics(font()).width("W") * 70);
sizeY = group.readEntry("Window Height", QFontMetrics(font()).height() * 25);
resize(sizeX, sizeY);
//.........这里部分代码省略.........
示例10: QDialog
BackgroundWidget::BackgroundWidget( MasterConfiguration& configuration,
QWidget* parent_ )
: QDialog( parent_ )
, configuration_( configuration )
, backgroundFolder_( configuration.getDockStartDir( ))
{
setWindowTitle( tr( "Background settings" ));
const int frameStyle = QFrame::Sunken | QFrame::Panel;
// Get current variables
previousColor_ = configuration_.getBackgroundColor();
previousBackgroundURI_ = configuration_.getBackgroundUri();
// Color chooser
colorLabel_ = new QLabel( previousColor_.name( ));
colorLabel_->setFrameStyle( frameStyle );
colorLabel_->setPalette( QPalette( previousColor_ ));
colorLabel_->setAutoFillBackground( true );
QPushButton* colorButton = new QPushButton(
tr( "Choose background color..." ));
connect( colorButton, SIGNAL( clicked( )), this, SLOT( chooseColor( )));
// Background chooser
backgroundLabel_ = new QLabel( previousBackgroundURI_ );
backgroundLabel_->setFrameStyle( frameStyle );
QPushButton* backgroundButton = new QPushButton(
tr( "Choose background content..." ));
connect( backgroundButton, SIGNAL( clicked( )),
this, SLOT( openBackgroundContent( )));
QPushButton* backgroundClearButton = new QPushButton(
tr( "Remove background" ));
connect( backgroundClearButton, SIGNAL( clicked( )),
this, SLOT( removeBackground( )));
// Standard buttons
typedef QDialogButtonBox::StandardButton button;
QDialogButtonBox* buttonBox = new QDialogButtonBox( button::Ok |
button::Cancel,
Qt::Horizontal, this );
connect( buttonBox, SIGNAL( accepted( )), this, SLOT( accept( )));
connect( buttonBox, SIGNAL( rejected( )), this, SLOT( reject( )));
// Layout
QGridLayout* gridLayout = new QGridLayout;
gridLayout->setColumnStretch( 1, 1 );
gridLayout->setColumnMinimumWidth( 1, 250 );
setLayout( gridLayout );
gridLayout->addWidget( colorButton, 0, 0 );
gridLayout->addWidget( colorLabel_, 0, 1 );
gridLayout->addWidget( backgroundButton, 1, 0 );
gridLayout->addWidget( backgroundLabel_, 1, 1 );
gridLayout->addWidget( backgroundClearButton, 2, 0 );
gridLayout->addWidget( buttonBox, 2, 1 );
}
示例11: foreach
ui_select_ending = new QComboBox;
foreach(int id, ids){
ui_select_ending->addItem(QString::number(id));
}
ui_select_ending_label = new QLabel("End vertex:");
ui_select_ending_label->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
ui_select_ending_layout = new QHBoxLayout;
ui_select_ending_layout->addWidget(ui_select_ending_label);
ui_select_ending_layout->addWidget(ui_select_ending);
ui_buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
connect(ui_buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(ui_buttons, SIGNAL(rejected()), this, SLOT(reject()));
ui_layout = new QVBoxLayout;
ui_layout->addWidget(ui_description);
ui_layout->addStretch();
ui_layout->addLayout(ui_select_starting_layout);
ui_layout->addLayout(ui_select_ending_layout);
ui_layout->addWidget(ui_buttons);
setLayout(ui_layout);
starting_vertex = -1;
ending_vertex = -1;
}
VisDijkstra::~VisDijkstra()
示例12: QDialog
//.........这里部分代码省略.........
// around to solve problems like this. Our stylesheet and style code are a
// complete mess, and I will probably have to rewrite all of this one day,
// but not before Thorn/Abraham Darby releases.
QString listStyle = localStyle;
setModal(true);
setWindowTitle(tr("Guitar Chord Selector"));
setWindowIcon(IconLoader().loadPixmap("window-guitar"));
QGridLayout *metagrid = new QGridLayout;
setLayout(metagrid);
QGroupBox *page = new QGroupBox(this);
QGridLayout *topLayout = new QGridLayout(page);
metagrid->addWidget(page, 0, 0);
topLayout->addWidget(new QLabel(tr("Root"), page), 0, 0);
m_rootNotesList = new QListWidget(page);
m_rootNotesList->setStyleSheet(listStyle);
topLayout->addWidget(m_rootNotesList, 1, 0);
topLayout->addWidget(new QLabel(tr("Extension"), page), 0, 1);
m_chordExtList = new QListWidget(page);
m_chordExtList->setStyleSheet(listStyle);
topLayout->addWidget(m_chordExtList, 1, 1);
m_newFingeringButton = new QPushButton(tr("New"), page);
m_deleteFingeringButton = new QPushButton(tr("Delete"), page);
m_editFingeringButton = new QPushButton(tr("Edit"), page);
m_chordComplexityCombo = new QComboBox(page);
m_chordComplexityCombo->addItem(tr("beginner"));
m_chordComplexityCombo->addItem(tr("common"));
m_chordComplexityCombo->addItem(tr("all"));
//m_chordComplexityCombo->setMinimumContentsLength(20);
connect(m_chordComplexityCombo, SIGNAL(activated(int)),
this, SLOT(slotComplexityChanged(int)));
page->setContentsMargins(5, 5, 5, 5);
QVBoxLayout* vboxLayout = new QVBoxLayout();
//topLayout->addLayout(vboxLayout, 1, 2, 3, 1);
topLayout->addLayout(vboxLayout, 2, 1);
vboxLayout->addWidget(m_chordComplexityCombo);
vboxLayout->addStretch(10);
vboxLayout->addWidget(m_newFingeringButton);
vboxLayout->addWidget(m_deleteFingeringButton);
vboxLayout->addWidget(m_editFingeringButton);
connect(m_newFingeringButton, SIGNAL(clicked()),
this, SLOT(slotNewFingering()));
connect(m_deleteFingeringButton, SIGNAL(clicked()),
this, SLOT(slotDeleteFingering()));
connect(m_editFingeringButton, SIGNAL(clicked()),
this, SLOT(slotEditFingering()));
topLayout->addWidget(new QLabel(tr("Fingerings"), page), 0, 3);
m_fingeringsList = new QListWidget(page);
m_fingeringsList->setStyleSheet(listStyle);
// try setting size to something 200 can be divided into evenly, in the hope
// of avoiding fuzzy half pixel scaling problems (50 was no good, but 100
// works well for grid lines here; dots still look awful, but who cares)
m_fingeringsList->setIconSize(QSize(100, 100));
topLayout->addWidget(m_fingeringsList, 1, 3, 2, 1);
m_fingeringBox = new FingeringBox(false, page, true);
topLayout->addWidget(m_fingeringBox, 2, 0, 1, 2);
connect(m_rootNotesList, SIGNAL(currentRowChanged(int)),
this, SLOT(slotRootHighlighted(int)));
connect(m_chordExtList, SIGNAL(currentRowChanged(int)),
this, SLOT(slotChordExtHighlighted(int)));
// connect itemClicked() so it will fire if a user clicks directly on the
// fingering list doodad thingummy (and comments like "fingering list doodad
// thingummy" are what you get when you abandon half-finished code the core
// developers don't really understand, and expect them to keep it alive for
// you in perpetuity)
//
connect(m_fingeringsList, SIGNAL(itemClicked(QListWidgetItem*)),
this, SLOT(slotFingeringHighlighted(QListWidgetItem*)));
// connect currentRowChanged() so this can be fired when other widgets are
// manipulated, which will cause this one to pop back up to the top. This
// slot triggers other updates in a leg bone connected to the thigh bone
// fashion, so we have to wire it to some input to get those updates to
// happen, and overloading this to fire two different ways was quick and
// cheap
//
connect(m_fingeringsList, SIGNAL(currentRowChanged(int)),
this, SLOT(slotFingeringHighlighted(int)));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
QDialogButtonBox::Cancel);
metagrid->addWidget(buttonBox, 1, 0);
metagrid->setRowStretch(0, 10);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
示例13: QDialog
MergeContactsDialog::MergeContactsDialog(IMetaContacts *AMetaContacts, IMetaRoster *AMetaRoster, const QList<QString> AMetaIds, QWidget *AParent) : QDialog(AParent)
{
ui.setupUi(this);
StyleStorage::staticStorage(RSR_STORAGE_STYLESHEETS)->insertAutoStyle(this,STS_METACONTACTS_MERGECONTACTSDIALOG);
GraphicsEffectsStorage::staticStorage(RSR_STORAGE_GRAPHICSEFFECTS)->installGraphicsEffect(this, GFX_LABELS);
FBorder = CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_DIALOG);
if (FBorder)
{
FBorder->setResizable(false);
FBorder->setMinimizeButtonVisible(false);
FBorder->setMaximizeButtonVisible(false);
FBorder->setAttribute(Qt::WA_DeleteOnClose,true);
FBorder->setWindowTitle(ui.lblCaption->text());
connect(this, SIGNAL(accepted()), FBorder, SLOT(closeWidget()));
connect(this, SIGNAL(rejected()), FBorder, SLOT(closeWidget()));
connect(FBorder, SIGNAL(closeClicked()), SLOT(reject()));
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
}
else
{
ui.lblCaption->setVisible(false);
setAttribute(Qt::WA_DeleteOnClose,true);
}
#ifdef Q_WS_MAC
ui.buttonsLayout->setSpacing(16);
ui.buttonsLayout->addWidget(ui.pbtMerge);
setWindowGrowButtonEnabled(this->window(), false);
#endif
ui.lneName->setAttribute(Qt::WA_MacShowFocusRect, false);
FMetaRoster = AMetaRoster;
FMetaContacts = AMetaContacts;
FMetaIds = AMetaIds;
ui.lblNotice->setText(tr("These %n contacts will be merged into one:","",AMetaIds.count()));
QString name;
int nameCapCount = 0;
QRegExp nameRegExp(tr("([a-z])","From first letter to last of alphabet"),Qt::CaseInsensitive);
QSet<Jid> items;
ui.ltContacts->addStretch();
foreach(QString metaId, FMetaIds)
{
IMetaContact contact = FMetaRoster->metaContact(metaId);
items += contact.items;
QImage avatar = FMetaRoster->metaAvatarImage(metaId,false,false).scaled(24, 24, Qt::KeepAspectRatio,Qt::SmoothTransformation);
QString itemName = FMetaContacts->metaContactName(contact);
int pos = 0;
int itemNameCapCount = 0;
while ((pos = nameRegExp.indexIn(itemName, pos)) != -1)
{
itemNameCapCount++;
pos += nameRegExp.matchedLength();
}
if (nameCapCount < itemNameCapCount)
{
name = itemName;
nameCapCount = itemNameCapCount;
}
else if (name.isEmpty())
{
name = itemName.trimmed();
}
QHBoxLayout *itemLayout = new QHBoxLayout();
itemLayout->setContentsMargins(0, 0, 0, 0);
itemLayout->setSpacing(8);
QLabel *avatarLabel = new QLabel(this);
avatarLabel->setFixedSize(24, 24);
avatarLabel->setPixmap(QPixmap::fromImage(avatar));
avatarLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
itemLayout->addWidget(avatarLabel);
QLabel *nameLabel = new QLabel(this);
nameLabel->setText(itemName);
itemLayout->addWidget(nameLabel);
ui.ltContacts->addItem(itemLayout);
}
示例14: QDialog
SettingsDialog::SettingsDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(tr("Settings"));
m_saveChangesOnExitCheckBox = new QCheckBox(this);
m_saveChangesOnExitCheckBox->setText(
tr("Automatically save the changes before exiting"));
m_saveChangesPeriodicallyCheckBox = new QCheckBox(this);
m_saveChangesPeriodicallyCheckBox->setText(
tr("Automatically save the changes every"));
m_saveChangesIntervalSpinBox = new QSpinBox(this);
m_saveChangesIntervalSpinBox->setMinimum(1);
m_saveChangesIntervalSpinBox->setMaximum(99999);
m_saveChangesIntervalSpinBox->setValue(5);
m_saveChangesIntervalSpinBox->setSuffix(tr(" minutes"));
m_saveChangesIntervalSpinBox->setEnabled(false);
connect(m_saveChangesPeriodicallyCheckBox, SIGNAL(toggled(bool)),
m_saveChangesIntervalSpinBox, SLOT(setEnabled(bool)));
m_workingFinishedTrayNotifyCheckBox = new QCheckBox(this);
m_workingFinishedTrayNotifyCheckBox->setText(
tr("Show a notification when the working time is over"));
m_restingFinishedTrayNotifyCheckBox = new QCheckBox(this);
m_restingFinishedTrayNotifyCheckBox->setText(
tr("Show a notification when the resting time is over"));
m_playWorkingFinishedSoundCheckBox = new QCheckBox(this);
m_playWorkingFinishedSoundCheckBox->setText(
tr("Play a sound when the working time is over"));
m_playRestingFinishedSoundCheckBox = new QCheckBox(this);
m_playRestingFinishedSoundCheckBox->setText(
tr("Play a sound when the resting time is over"));
m_workingFinishedSoundWidget = new GetOpenFileNameWidget(this);
m_workingFinishedSoundWidget->setFileMask(tr("Audio files (*.wav)"));
m_workingFinishedSoundWidget->setSettingsKey(SettingsWorkingFinishedSoundFile);
m_workingFinishedSoundWidget->setEnabled(false);
connect(m_playWorkingFinishedSoundCheckBox, SIGNAL(toggled(bool)),
m_workingFinishedSoundWidget, SLOT(setEnabled(bool)));
m_restingFinishedSoundWidget = new GetOpenFileNameWidget(this);
m_restingFinishedSoundWidget->setFileMask(tr("Audio files (*.wav)"));
m_restingFinishedSoundWidget->setSettingsKey(SettingsRestingFinishedSoundFile);
m_restingFinishedSoundWidget->setEnabled(false);
connect(m_playRestingFinishedSoundCheckBox, SIGNAL(toggled(bool)),
m_restingFinishedSoundWidget, SLOT(setEnabled(bool)));
QGroupBox *trayIconNotifyGroupBox = new QGroupBox(this);
trayIconNotifyGroupBox->setTitle(tr("Tray notification options"));
trayIconNotifyGroupBox->setLayout(new QVBoxLayout);
trayIconNotifyGroupBox->layout()->addWidget(m_workingFinishedTrayNotifyCheckBox);
trayIconNotifyGroupBox->layout()->addWidget(m_restingFinishedTrayNotifyCheckBox);
QGroupBox *soundNotifyGroupBox = new QGroupBox(this);
soundNotifyGroupBox->setTitle(tr("Sound notification options"));
soundNotifyGroupBox->setLayout(new QVBoxLayout);
soundNotifyGroupBox->layout()->addWidget(m_playWorkingFinishedSoundCheckBox);
soundNotifyGroupBox->layout()->addWidget(m_workingFinishedSoundWidget);
soundNotifyGroupBox->layout()->addWidget(m_playRestingFinishedSoundCheckBox);
soundNotifyGroupBox->layout()->addWidget(m_restingFinishedSoundWidget);
QHBoxLayout *saveChangesEveryMinutesHBox = new QHBoxLayout;
saveChangesEveryMinutesHBox->addWidget(m_saveChangesPeriodicallyCheckBox);
saveChangesEveryMinutesHBox->addWidget(m_saveChangesIntervalSpinBox);
QGroupBox *savingGroupBox = new QGroupBox(this);
savingGroupBox->setTitle(tr("Save options"));
savingGroupBox->setLayout(new QVBoxLayout);
savingGroupBox->layout()->addWidget(m_saveChangesOnExitCheckBox);
static_cast<QVBoxLayout *>(savingGroupBox->layout())->addLayout(saveChangesEveryMinutesHBox);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QVBoxLayout *vbox = new QVBoxLayout;
vbox->addWidget(savingGroupBox);
vbox->addWidget(trayIconNotifyGroupBox);
vbox->addWidget(soundNotifyGroupBox);
vbox->addItem(new QSpacerItem(10, 10, QSizePolicy::Expanding, QSizePolicy::Expanding));
vbox->addWidget(buttonBox);
setLayout(vbox);
}
示例15: setWindowFlags
Execute::Execute() {
QWidget *w = new QWidget;
ui.setupUi( w );
#ifdef Q_OS_OSX
setWindowFlags(Qt::Tool| Qt::WindowStaysOnTopHint);
#endif
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(w);
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
mainLayout->addWidget(buttonBox);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QPushButton *execB = new QPushButton(i18n("End Session"));
QPushButton *addObs = new QPushButton(i18n("Manage Observers"));
execB->setToolTip(i18n("Save and End the current session"));
buttonBox->addButton(execB, QDialogButtonBox::ActionRole);
buttonBox->addButton(addObs, QDialogButtonBox::ActionRole);
connect(execB, SIGNAL(clicked()), this, SLOT(slotEndSession()));
connect(addObs,SIGNAL(clicked()),this,SLOT(slotObserverAdd()));
setWindowTitle( i18n( "Execute Session" ) );
currentTarget = NULL;
currentObserver = NULL;
currentScope = NULL;
currentEyepiece = NULL;
currentLens = NULL;
currentFilter = NULL;
currentSession = NULL;
nextSession = 0;
nextObservation = 0;
nextSite = 0;
//initialize the global logObject
logObject = KStarsData::Instance()->logObject();
//initialize the lists and parameters
init();
ui.Target->hide();
ui.AddObject->hide();
ui.RemoveObject->hide();
ui.NextButton->hide();
ui.NextButton->setEnabled( false );
ui.Slew->setEnabled( false );
//make connections
connect( ui.NextButton, SIGNAL( clicked() ),
this, SLOT( slotNext() ) );
connect( ui.Slew, SIGNAL( clicked() ),
this, SLOT( slotSlew() ) );
connect( ui.Location, SIGNAL( clicked() ),
this, SLOT( slotLocation() ) );
connect( ui.Target, SIGNAL( currentTextChanged(const QString) ),
this, SLOT( slotSetTarget(QString) ) );
connect( ui.SessionURL, SIGNAL( leftClickedUrl() ),
this, SLOT( slotShowSession() ) );
connect( ui.ObservationsURL, SIGNAL( leftClickedUrl() ),
this, SLOT( slotShowTargets() ) );
connect( ui.AddObject, SIGNAL( leftClickedUrl() ),
this, SLOT( slotAddObject() ) );
connect( ui.RemoveObject, SIGNAL( leftClickedUrl() ),
this, SLOT( slotRemoveObject() ) );
}