CatalogueDialog::CatalogueDialog(QWidget *parent)
	: QDialog(parent)
{
	setupUi(this);

	closeIcon = QIcon( style()->standardPixmap(QStyle::SP_DirClosedIcon) );
	openIcon = QIcon( style()->standardPixmap(QStyle::SP_DirOpenIcon) );

	QTreeWidgetItem *item;
	for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
	{
		item = treeWidget->topLevelItem(i);
		if( !item )
			continue;
		item->setIcon(0, closeIcon);
	}

	item = treeWidget->topLevelItem(0);
	if( item )
		treeWidget->setCurrentItem( item );

	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
	connect( showCloseButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
	connect( treeWidget, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), this, SLOT( changeIcon(QTreeWidgetItem *) ) );
	connect( treeWidget, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ), this, SLOT( changeIcon(QTreeWidgetItem *) ) );
	connect( treeWidget, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), this, SLOT( itemDoubleClicked(QTreeWidgetItem *) ) );
}
AddClientDialog::AddClientDialog(QWidget *parent, Qt::WFlags flags)
	: QDialog(parent, flags)
{
	setupUi(this);
	info = new ConnectionInfoWidget(this);
	gridLayout_3->addWidget(info, 1, 0, 1, 1);
	accountGroupBox->hide();
	layout()->setSizeConstraint( QLayout::SetFixedSize );	

	currencyShortLabel->setText(tr("Code:    "));

	QRegExp regexp("[1-9][0-9][0-9]{1,1}");
	numberLineEdit->setValidator(new QRegExpValidator(regexp, this));

	connect( nameLineEdit, SIGNAL( textChanged(const QString &)), this, SLOT( enableOkButton() ) );
	connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
	connect( moreButton, SIGNAL( toggled(bool) ), this, SLOT( changeMoreButtonText() ) );
	connect( moreButton, SIGNAL( toggled(bool) ), this, SLOT( moreButtonClicked() ) );
	connect( currencyComboBox, SIGNAL( currentIndexChanged(int)), this, SLOT( changeShortLabelText() ));
	connect( numberLineEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( enableOkButton() ));

        qList << "get_currency_list" << "create_client" << "create_client_with_account";
	
        tcs = new ThreadControl( this );
        connect( tcs, SIGNAL(canGetData()), this, SLOT(loadQuery()));
        connect( tcs, SIGNAL(errorRaised(QString)), this, SLOT(loadError(QString)));

        loadCurrencyRequest();
}
NewProfileCommentDialog::NewProfileCommentDialog(QWidget *aParent,
        MController* aController,
        const QString& aCommentedProfile,
        const QString& aSubject,
        Profile& aSelectedProfile,
        ProfileCommentListingModel& aCommentListingModel,
        const Hash& aReferencesMsg,
        const Hash& aReferencesCa,
        const Hash& aRecipientsNode)
    : TextEdit(aParent,
               aController,
               aSelectedProfile),
    iRecipientsNode(aRecipientsNode),
    iCommentListingModel(aCommentListingModel) {
    ui.setupUi(this) ;
    initializeTextEditor(ui.messageEdit,
                         ui.gridLayout,
                         ui.toolBoxLayoutUpper,
                         ui.toolBoxLayoutLower) ;
    iReferencesMsg = aReferencesMsg ;
    iReferencesCa = aReferencesCa ;

    ui.subjectEdit->setText(aSubject) ;
    ui.commentedProfileEdit->setText(aCommentedProfile) ;
    iAttachmentListLabel = ui.attahcmentsListLabel ;
    connect(ui.attachButton, SIGNAL(clicked()),
            this, SLOT(attachButtonClicked()));
    connect(ui.bottomButtonsBox, SIGNAL(accepted()), this, SLOT(okButtonClicked()));
    connect(ui.bottomButtonsBox, SIGNAL(rejected()), this, SLOT(cancelButtonClicked()));
    ui.messageEdit->setFocus(Qt::PopupFocusReason) ;
}
示例#4
0
EdgeWindow::EdgeWindow(QWidget* parent, EdgeWindowType type):
        QWidget(parent, Qt::Window) {
    setFixedSize(350, 130);
    setWindowModality(Qt::ApplicationModal);
    if (type == EW_ADD)
        setWindowTitle("Добавление ребра");
    else
        setWindowTitle("Редактирование ребра");
    QGridLayout* layout = new QGridLayout;
    setLayout(layout);
    QWidget* edit_widget = new QWidget(this);
    QGridLayout* edit_layout = new QGridLayout();
    layout->addWidget(edit_widget, 0, 0);
    edit_widget->setLayout(edit_layout);
    QLabel* v1_lbl = new QLabel(edit_widget);
    v1_lbl->setText("Вершина");
    v1_lbl->setAlignment(Qt::AlignCenter);
    edit_layout->addWidget(v1_lbl, 0, 0);
    QLabel* v2_lbl = new QLabel(edit_widget);
    v2_lbl->setText("Вершина");
    v2_lbl->setAlignment(Qt::AlignCenter);
    edit_layout->addWidget(v2_lbl, 0, 1);
    QLabel* rel_lbl = new QLabel(edit_widget);
    rel_lbl->setText("Надежность");
    rel_lbl->setAlignment(Qt::AlignCenter);
    edit_layout->addWidget(rel_lbl, 0, 2);
    v1_combo = new QComboBox(edit_widget);
    if (type == EW_EDIT)
        v1_combo->setEditable(false);
    edit_layout->addWidget(v1_combo, 1, 0);
    v2_combo = new QComboBox(edit_widget);
    if (type == EW_EDIT)
        v2_combo->setEditable(false);
    edit_layout->addWidget(v2_combo, 1, 1);
    rel_spin = new QDoubleSpinBox(edit_widget);
    rel_spin->setRange(0, 1);
    rel_spin->setSingleStep(0.001);
    rel_spin->setDecimals(6);
    rel_spin->setAlignment(Qt::AlignCenter);
    edit_layout->addWidget(rel_spin, 1, 2);

    QWidget* control_widget = new QWidget(this);
    QGridLayout* control_layout = new QGridLayout();
    control_widget->setLayout(control_layout);
    layout->addWidget(control_widget, 1, 0);
    QPushButton* ok_button = new QPushButton(control_widget);
    if (type == EW_ADD)
        ok_button->setText("Добавить");
    else
        ok_button->setText("Готово");
    control_layout->addWidget(ok_button, 0, 0);
    QPushButton* cancel_button = new QPushButton(control_widget);
    cancel_button->setText("Отмена");
    control_layout->addWidget(cancel_button, 0, 1);

    connect(ok_button, SIGNAL(clicked()), SLOT(okButtonClicked()));
    connect(cancel_button, SIGNAL(clicked()), SLOT(close()));
}
FlashSegmentWindowHandler::FlashSegmentWindowHandler(QObject *parent) :
    QObject(parent)
{
    connect(mWindow.ui->classList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*, QListWidgetItem*)));
    connect(mWindow.ui->okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(mWindow.ui->addButton, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
    connect(mWindow.ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteButtonClicked()));
    connect(mWindow.ui->viewButton, SIGNAL(clicked()), this, SLOT(viewButtonClicked()));
}
void CatalogueDialog::itemDoubleClicked(QTreeWidgetItem *item)
{
	if( !item )
		return;

	int count = item->childCount();
	if( count == 0 )
		okButtonClicked();
}
AddOperdayDialog::AddOperdayDialog( const QList<QDate> &list, QWidget *parent )
	: QDialog(parent)
{
	setupUi(this);

	QDate date = QDate::currentDate();
	dateEdit->setDate( date );

	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
}
示例#8
0
/** Connects signals to slots. */
void OptionsDialog::createConnections()
{
    connect(listWidget, SIGNAL(currentRowChanged(int)),
            groupBoxManager, SLOT(onCategoryChange(int)));

    connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
            this, SLOT(okButtonClicked()));

    connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
            this, SLOT(reject()));
}
示例#9
0
void AddMusicList::okButtonClicked()
{
	if (m_nameLineEdit->text() == "" || m_pathLineEdit->text() == "")
	{
		QMessageBox::warning(this, "错误", "歌单名和歌曲路径不能为空...", QMessageBox::Ok | QMessageBox::Cancel);
		return;
	}
	m_okButton->setEnabled(false);
	emit okButtonClicked(m_nameLineEdit->text(), m_files);
	this->accept();
}
// ------------------------------------------------------------
// ------------------------------------------------------------
void CoefficientDialog::loadUi()
{
	QStringList list;
	list << tr("id") << tr("Date") << tr("A") << tr("B") << tr("C") << tr("D") << tr("E");
	table->createColumns( list );
	table->setEditTriggers( QTableWidget::NoEditTriggers );
	table->setItemDelegateForColumn( 1, new DateDelegate( 1, this ) );

	connect( buttons, SIGNAL( buttonClicked(int) ), this, SLOT( controlButtonClicked(int) ) );
	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
	connect( table, SIGNAL( cellDoubleClicked(int, int) ), this, SLOT( okButtonClicked() ) );
	connect( sortButton, SIGNAL( clicked() ), this, SLOT( loadPageInfoRequest() ) );
	connect( startDateEdit, SIGNAL( dateChanged( const QDate & ) ), this, SLOT( dateChanged( const QDate & ) ) );
	connect( endDateEdit, SIGNAL( dateChanged( const QDate & ) ), this, SLOT( dateChanged( const QDate & ) ) );
}
void EditAccountDialog::loadEnv()
{
	QRegExp regexp("[1-9][0-9][0-9][0-9]{1,4}");
	numberLineEdit->setValidator(new QRegExpValidator(regexp, this));

        qList << "get_account_properties" << "update_account" << "change_account_owner";

        tcs = new ThreadControl( this );
        connect( tcs, SIGNAL( canGetData() ), this, SLOT( chooseQuery() ) );
        connect( tcs, SIGNAL( errorRaised( const QString & ) ), this, SLOT( loadError( const QString & ) ) );
        connect( tcs, SIGNAL( stateChanged( bool ) ), this, SLOT( stateChanged( bool ) ) );

	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
        connect( ownerButton, SIGNAL( clicked() ), this, SLOT( showOwner() ) );
}
示例#12
0
AddRuleDialog::AddRuleDialog(QWidget *parent, quint32 accountid, QString number, QString cur, QString ruleDate)
	: QDialog(parent)
{
	setupUi(this);
	loadEnv();

	accId = accountid;
	date = ruleDate;

	QDate d = QDate::fromString( ruleDate, dateFormat );
	if( d.isValid() )
		dateEdit->setDate( d );

	numberLabel->setText( "<b>" + number + " " + cur + "</b>" );

	connect( okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
}
示例#13
0
MatchResDialog::MatchResDialog( Match match, QWidget* parent )
    : QDialog( parent ),
      _match( match ),
      _okButton( new QPushButton( tr( "Save" ) ) )
{
    setWindowTitle( tr( "Match score" ) );

    _okButton->setEnabled( false );

    QGridLayout* l = new QGridLayout( this );

    QLabel* playerA = new QLabel( match.playerA().name(), this );
    QLabel* playerB = new QLabel( match.playerB().name(), this );

    l->addWidget( playerA, 0, 0, Qt::AlignJustify );
    l->addWidget( playerB, 0, 1, Qt::AlignJustify );

    unsigned int games = match.games_const().count();
    for ( unsigned int i = 0; i < match.maxGames(); i ++ ) {
        QLineEdit* ballsA = new QLineEdit( this );
        QLineEdit* ballsB = new QLineEdit( this );

        if ( i < games ) {
            // this should be done before connecting of lineedits to textChanged
            // slot
            ballsA->setText( QString::number( match.games_const().at( i ).aBalls ) );
            ballsB->setText( QString::number( match.games_const().at( i ).bBalls ) );
        }

        connect( ballsA, SIGNAL( textChanged( const QString& ) ),
                 this, SLOT( textChanged( ) ) );
        connect( ballsB, SIGNAL( textChanged( const QString& ) ),
                 this, SLOT( textChanged( ) ) );

        l->addWidget( ballsA, i + 1, 0 );
        l->addWidget( ballsB, i + 1, 1 );
    }

    if ( games ) {
        textChanged();
    }

    l->addWidget( _okButton, l->rowCount(), 0, 1, 2 );

    connect( _okButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
}
CompassMotorCalibrationDialog::CompassMotorCalibrationDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CompassMotorCalibrationDialog),
    m_uasInterface(NULL)
{
    ui->setupUi(this);

    QCustomPlot* customPlot = ui->customPlot;
    customPlot->addGraph();
    customPlot->graph(GRAPH_ID_INTERFERENCE)->setPen(QPen(GRAPH_COLOR_INTERFERENCE)); // line color blue for first graph
    customPlot->graph(GRAPH_ID_INTERFERENCE)->setBrush(QBrush(GRAPH_COLOR_INTERFERENCE_FILL)); // first graph will be filled with translucent blue

    customPlot->xAxis->setLabel("Throttle (%)");

    customPlot->yAxis->setLabel("Interference (%)");
    customPlot->yAxis->setLabelColor(GRAPH_COLOR_INTERFERENCE);
    customPlot->xAxis->setRange(0,100);
    customPlot->yAxis->setRange(0,100);

    customPlot->addGraph();
    customPlot->graph(GRAPH_ID_CURRENT)->setPen(QPen(GRAPH_COLOR_CURRENT)); // line color red for second graph
    customPlot->graph(GRAPH_ID_CURRENT)->setBrush(QBrush(GRAPH_COLOR_CURRENT_FILL));

    customPlot->yAxis2->setVisible(true);
    customPlot->yAxis2->setLabel("Amps (A)");
    customPlot->yAxis2->setLabelColor(GRAPH_COLOR_CURRENT);
    customPlot->xAxis2->setRange(0,100);
    customPlot->yAxis2->setRange(0,50);

    customPlot->replot();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(this, SIGNAL(about), this, SLOT(rejected()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());

    int ok = QMessageBox::warning(this, "Compass Motor Calibration", tr("CAUTION: Starting the compass motor calibration arms the motors.\n"
                                                               "Please make sure you have read and followed all instructions"
                                                               "before untertaking the calibration as serious injury could occur!"),
                         QMessageBox::Ok, QMessageBox::Cancel);
    if (ok == QMessageBox::Cancel){
        QTimer::singleShot(100, this, SLOT(cancelCalibration()));
    }

}
示例#15
0
resizeWindow::resizeWindow(QWidget *parent, resParam *param) : QDialog(parent)
 {
     ui.setupUi(this);
	 lastPercentage = 100;
     _param=param;
     ui.spinBoxWidth->setValue(_param->width);
     ui.spinBoxHeight->setValue(_param->height);
     ui.horizontalSlider->setValue(100);
	 ui.comboBoxAlgo->setCurrentIndex(_param->algo);
     updateWidthHeightSpinners();

	 connect(ui.comboBoxSource, SIGNAL(currentIndexChanged(int)), this, SLOT(aspectRatioChanged(int)));
	 connect(ui.comboBoxDestination, SIGNAL(currentIndexChanged(int)), this, SLOT(aspectRatioChanged(int)));
	 connect(ui.checkBoxRoundup, SIGNAL(toggled(bool)), this, SLOT(roundupToggled(bool)));
	 connect(ui.lockArCheckBox, SIGNAL(toggled(bool)), this, SLOT(lockArToggled(bool)));
	 connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(okButtonClicked()));

	 connectDimensionControls();
 }
示例#16
0
AddMusicList::AddMusicList(QWidget *parent) : QDialog(parent)
{
	m_okButton = new QPushButton("确定");
	m_cancelButton = new QPushButton("取消");
	m_nameLineEdit = new QLineEdit;
	m_nameLineEdit->setFixedWidth(180);
	m_pathLineEdit = new QLineEdit;
	m_pathLineEdit->setFixedWidth(130);
	m_checkPathButton = new QPushButton("浏览");
	m_checkPathButton->setFixedWidth(40);

	connect(m_okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
	connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(accept()));
	connect(m_checkPathButton, SIGNAL(clicked()), this, SLOT(checkButtonClicked()));

	QLabel *nameLabel = new QLabel("歌单名称");
	QLabel *pathLabel = new QLabel("歌曲路径");

	QHBoxLayout *name = new QHBoxLayout;
	name->addWidget(nameLabel, 0, Qt::AlignLeft | Qt::AlignVCenter);
	name->addSpacing(5);
	name->addWidget(m_nameLineEdit, 0, Qt::AlignVCenter);
	name->setContentsMargins(5, 5, 5, 5);

	QHBoxLayout *path = new QHBoxLayout;
	path->addWidget(pathLabel, 0, Qt::AlignLeft | Qt::AlignVCenter);
	path->addSpacing(5);
	path->addWidget(m_pathLineEdit, Qt::AlignVCenter);
	path->addWidget(m_checkPathButton, 0, Qt::AlignRight | Qt::AlignVCenter);
	path->setContentsMargins(5, 5, 5, 5);

	QHBoxLayout *button = new QHBoxLayout;
	button->addWidget(m_okButton, 0, Qt::AlignVCenter | Qt::AlignHCenter);
	button->addSpacing(10);
	button->addWidget(m_cancelButton, 0, Qt::AlignVCenter | Qt::AlignHCenter);
	button->setContentsMargins(5, 5, 5, 5);

	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->addLayout(name);
	mainLayout->addLayout(path);
	mainLayout->addLayout(button);
	mainLayout->setContentsMargins(5, 5, 5, 5);
}
UI_activeFileChooserWindow::UI_activeFileChooserWindow(int *file_nr, QWidget *mainwndw)
{
  int i;

  mainwindow = (UI_Mainwindow *)mainwndw;

  file_num = file_nr;

  *file_num = -1;

  chooserDialog = new QDialog;

  chooserDialog->setMinimumSize(QSize(800, 200));
  chooserDialog->setMaximumSize(QSize(800, 200));
  chooserDialog->setWindowTitle("Choose file");
  chooserDialog->setModal(true);
  chooserDialog->setAttribute(Qt::WA_DeleteOnClose, true);

  filelist = new QListWidget(chooserDialog);
  filelist->setGeometry(QRect(10, 10, 780, 110));
  filelist->setSelectionBehavior(QAbstractItemView::SelectRows);
  filelist->setSelectionMode(QAbstractItemView::SingleSelection);
  for(i=0; i<mainwindow->files_open; i++)
  {
    new QListWidgetItem(QString::fromLocal8Bit(mainwindow->edfheaderlist[i]->filename), filelist);
  }

  okButton = new QPushButton(chooserDialog);
  okButton->setGeometry(10, 140, 100, 25);
  okButton->setText("OK");

  cancelButton = new QPushButton(chooserDialog);
  cancelButton->setGeometry(690, 140, 100, 25);
  cancelButton->setText("Cancel");

  QObject::connect(cancelButton, SIGNAL(clicked()), chooserDialog, SLOT(close()));
  QObject::connect(okButton,     SIGNAL(clicked()), this,          SLOT(okButtonClicked()));

  filelist->setCurrentRow(mainwindow->files_open - 1);

  chooserDialog->exec();
}
PreferencesDialog::PreferencesDialog(QWidget *parent) :
    QDialog(parent)
{
    okButtonPressed = false;
    setWindowTitle(tr("User Settings"));
    mainLayout = new QVBoxLayout();
    setLayout(mainLayout);

    tabs = new QTabWidget(this);
    mainLayout->addWidget(tabs);
    this->setFont(global.getGuiFont(font()));

    this->setupAppearancePanel();
    this->setupLocalePanel();
    this->setupSyncPanel();
    this->setupSearchPanel();
    this->setupDebugPanel();

    cancelButton = new QPushButton(tr("Cancel"), this);
    okButton = new QPushButton(tr("OK"), this);

    connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));

    QSpacerItem *spacer1 = new QSpacerItem(0,0,QSizePolicy::MinimumExpanding);
    QSpacerItem *spacer2 = new QSpacerItem(0,0,QSizePolicy::MinimumExpanding);


    buttonLayout = new QHBoxLayout();
    buttonLayout->addSpacerItem(spacer1);
    buttonLayout->addWidget(okButton);
    buttonLayout->addWidget(cancelButton);
    buttonLayout->addSpacerItem(spacer2);
    buttonLayout->setStretch(0,100);
    buttonLayout->setStretch(3,100);

    mainLayout->addLayout(buttonLayout);

    connect(appearancePanel->showTrayIcon, SIGNAL(clicked(bool)),
            syncPanel->enableSyncNotifications, SLOT(setEnabled(bool)));
    syncPanel->enableSyncNotifications->setEnabled(appearancePanel->showTrayIcon->isChecked());
}
void FeedDialog::initGUI() {
	layout = new QGridLayout(this);
	feedLabel = new QLabel(i18n("URL Of RSS Feed: "), this);
	feedEdit = new KLineEdit(this);
	okButton = new KPushButton(KStdGuiItem::ok(), this);
	cancelButton = new KPushButton(KStdGuiItem::cancel(), this);

	connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));

	layout->addMultiCellWidget(feedLabel, 0, 0, 0, 1);
	layout->addMultiCellWidget(feedEdit, 1, 1, 0, 1);
	layout->addWidget(okButton, 2, 0);
	layout->addWidget(cancelButton, 2, 1);
	layout->setSpacing(10);
	layout->setMargin(10);
	setCaption(i18n("Add Package Server Feed"));
	resize(350,50);
	show();
}
BankEditDialog::BankEditDialog(QWidget *parent, Qt::WFlags flags)
	: QDialog(parent, flags)
{
	setupUi(this);
	tableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
	tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);

	//-------------------
	QSqlQuery query("SELECT bank.id, bank.title, country.title AS country, bank.attribute "
		"FROM work.bank INNER JOIN work.country ON bank.countryid = country.id ORDER BY bank.id ASC;");
	if(!query.isActive())
		QMessageBox::critical(this, tr("Error!"), tr("Could not select from database!<p>"
			"The database connection was probably lost. Try to reconnect"));
	
	int j = 0;
	while(query.next())
	{
		tableWidget->insertRow(j);
		for(int i = 1; i < 4; i++)
		{
			QString t = query.value(i).toString();
			QTableWidgetItem *item = new QTableWidgetItem(t.isNull() ? "" : t );
			tableWidget->setItem(j, i-1, item);
		}
		j++;
	}
	tableWidget->setCurrentCell(0,0);
	okButton->setEnabled(true);
	

	connect(tableWidget, SIGNAL( clicked(const QModelIndex &) ), this, SLOT( enableOkButton() ) );
	connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
	connect(addButton, SIGNAL(clicked()), this, SLOT(addBank()));
	connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteBank()));
}
示例#21
0
ReaderInfoDialog::ReaderInfoDialog(const QString &u, const QString &num, QWidget *parent) :
    QDialog(parent), str(num), user_name(u)
{
    IDLabel = new QLabel(tr("&ID:"));
    IDLineEdit = new QLineEdit;
    IDLabel->setBuddy(IDLineEdit);
    queryButton = new QPushButton(tr("Quer&y"));

    passwordLabel = new QLabel(tr("&Password:"******"&Affirm Password:"******"&Name:"));
    nameLineEdit = new QLineEdit;
    nameLabel->setBuddy(nameLineEdit);

    sexLabel = new QLabel(tr("&Sex:"));
    sexComboBox = new QComboBox;
    sexComboBox->addItems(QStringList() << tr("male") << tr("female"));
    sexLabel->setBuddy(sexComboBox);

    birthdayLabel = new QLabel(tr("&Birthday:"));
    birthdayDateEdit = new QDateEdit;
    birthdayLabel->setBuddy(birthdayDateEdit);

    cardDateLabel = new QLabel(tr("&Card Date:"));
    cardDateEdit = new QDateEdit;
    cardDateLabel->setBuddy(cardDateEdit);
    cardDateEdit->setDate(QDate::currentDate());

    validDateLabel = new QLabel(tr("&Valid Date:"));
    validDateEdit = new QDateEdit;
    validDateEdit->setDate(QDate::currentDate().addYears(1));
    validDateLabel->setBuddy(validDateEdit);

    IDCardLabel = new QLabel(tr("&ID Card:"));
    IDCardLineEdit = new QLineEdit;
    IDCardLabel->setBuddy(IDCardLineEdit);

    phoneLabel = new QLabel(tr("&Phone:"));
    phoneLineEdit = new QLineEdit;
    phoneLabel->setBuddy(phoneLineEdit);

    stateLabel = new QLabel(tr("&State:"));
    stateComboBox = new QComboBox;
    stateComboBox->addItems(QStringList() << tr("normal") << tr("logout"));
    stateLabel->setBuddy(stateComboBox);

    typeLabel = new QLabel(tr("&Type:"));
    typeComboBox = new QComboBox;
    typeComboBox->addItems(QStringList() << tr("normal") << tr("VIP"));
    typeLabel->setBuddy(typeComboBox);


    QGridLayout *gridLayout = new QGridLayout;
    gridLayout->addWidget(IDLabel, 0, 0);
    gridLayout->addWidget(IDLineEdit, 0, 1);
    gridLayout->addWidget(queryButton, 0, 2);
    gridLayout->addWidget(passwordLabel, 1, 0);
    gridLayout->addWidget(passwordLineEdit, 1, 1);
    gridLayout->addWidget(againPasswordLabel, 2, 0);
    gridLayout->addWidget(againPasswordLineEdit, 2, 1);
    gridLayout->addWidget(nameLabel, 3, 0);
    gridLayout->addWidget(nameLineEdit, 3, 1);
    gridLayout->addWidget(sexLabel, 4, 0);
    gridLayout->addWidget(sexComboBox, 4, 1);
    gridLayout->addWidget(birthdayLabel, 5, 0);
    gridLayout->addWidget(birthdayDateEdit, 5, 1);
    gridLayout->addWidget(cardDateLabel, 6, 0);
    gridLayout->addWidget(cardDateEdit, 6, 1);
    gridLayout->addWidget(validDateLabel, 7, 0);
    gridLayout->addWidget(validDateEdit, 7, 1);
    gridLayout->addWidget(IDCardLabel, 8, 0);
    gridLayout->addWidget(IDCardLineEdit, 8, 1);
    gridLayout->addWidget(phoneLabel, 9, 0);
    gridLayout->addWidget(phoneLineEdit, 9, 1);
    gridLayout->addWidget(stateLabel, 10, 0);
    gridLayout->addWidget(stateComboBox, 10, 1);
    gridLayout->addWidget(typeLabel, 11, 0);
    gridLayout->addWidget(typeComboBox, 11, 1);

    groupBox = new QGroupBox(tr("Reader Information"));
    groupBox->setLayout(gridLayout);

    okButton = new QPushButton(tr("&OK"));
    cancelButton = new QPushButton(tr("Cancel"));

    QHBoxLayout *bottomLayout = new QHBoxLayout;
    bottomLayout->addStretch();
    bottomLayout->addWidget(okButton);
    bottomLayout->addWidget(cancelButton);


    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(groupBox);
    mainLayout->addLayout(bottomLayout);

    setLayout(mainLayout);

    if (str.isEmpty())
    {
        connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    }
    else
    {
        init();
        connect(okButton, SIGNAL(clicked()), this, SLOT(modifyClicked()));
    }
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
    connect(queryButton, SIGNAL(clicked()), this, SLOT(queryClicked()));
}
示例#22
0
PrintDialog::PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions, bool gcr, QStringList spots)
		: QDialog( parent )
{
	setupUi(this);
	setModal(true);
	cdia = 0;
	m_doc = doc;
	unit = doc->unitIndex();
	unitRatio = unitGetRatioFromIndex(doc->unitIndex());
	prefs = PrefsManager::instance()->prefsFile->getContext("print_options");
	DevMode = printOptions.devMode;
	PrinterOpts = "";
	setWindowIcon(QIcon(loadIcon("AppIcon.png")));
 	pageNrButton->setIcon(QIcon(loadIcon("ellipsis.png")));
	printEngines->addItem( CommonStrings::trPostScript1 );
	printEngines->addItem( CommonStrings::trPostScript2 );
	printEngines->addItem( CommonStrings::trPostScript3 );
	markLength->setNewUnit(unit);
	markLength->setMinimum(1*unitRatio);
	markLength->setMaximum(3000*unitRatio);
	markOffset->setNewUnit(unit);
	markOffset->setMinimum(0);
	markOffset->setMaximum(3000*unitRatio);
	BleedBottom->setNewUnit(unit);
	BleedBottom->setMinimum(0);
	BleedBottom->setMaximum(3000*unitRatio);
	BleedLeft->setNewUnit(unit);
	BleedLeft->setMinimum(0);
	BleedLeft->setMaximum(3000*unitRatio);
	BleedRight->setNewUnit(unit);
	BleedRight->setMinimum(0);
	BleedRight->setMaximum(3000*unitRatio);
	BleedTop->setNewUnit(unit);
	BleedTop->setMinimum(0);
	BleedTop->setMaximum(3000*unitRatio);
	previewButton->setEnabled(!previewDinUse);
	// Fill printer list
	QString Pcap;
	QString printerName;
	QStringList printerNames = PrinterUtil::getPrinterNames();
	int numPrinters = printerNames.count();
	for( int i = 0; i < numPrinters; i++)
	{
		printerName = printerNames[i];
		PrintDest->addItem(printerName);
		if( printerName == printOptions.printer )
		{
			PrintDest->setCurrentIndex(PrintDest->count()-1);
			prefs->set("CurrentPrn", PrintDest->currentText());
		}
	}

	PrintDest->addItem( tr("File"));

	// Fill Separation list
	QString sep[] =
	    {
	        tr("All"), tr("Cyan"), tr("Magenta"), tr("Yellow"),
	        tr("Black")
	    };
	size_t sepArray = sizeof(sep) / sizeof(*sep);
	for (uint prop = 0; prop < sepArray; ++prop)
		SepArt->addItem(sep[prop]);
	SepArt->addItems(spots);

	if (m_doc->pagePositioning() != 0)
	{
		BleedTxt3->setText( tr( "Inside:" ) );
		BleedTxt4->setText( tr( "Outside:" ) );
	}

	QString prnDevice = printOptions.printer;
	if (prnDevice.isEmpty())
		prnDevice = PrintDest->currentText();
	if ((prnDevice == tr("File")) || (PrintDest->count() == 1))
	{
		PrintDest->setCurrentIndex(PrintDest->count()-1);
		prefs->set("CurrentPrn", PrintDest->currentText());
		DateiT->setEnabled(true);
		LineEdit1->setEnabled(true);
		if (!printOptions.filename.isEmpty())
			LineEdit1->setText(QDir::toNativeSeparators(printOptions.filename));
		ToolButton1->setEnabled(true);
	}

	setMaximumSize(sizeHint());
	PrintDest->setFocus();
	// signals and slots connections
	connect( OKButton, SIGNAL( clicked() ), this, SLOT( okButtonClicked() ) );
	connect( OKButton_2, SIGNAL( clicked() ), this, SLOT( reject() ) );
	connect( PrintDest, SIGNAL(activated(const QString&)), this, SLOT(SelPrinter(const QString&)));
	connect( printEngines, SIGNAL(activated(const QString&)), this, SLOT(SelEngine(const QString&)));
	connect( RadioButton1, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
	connect( CurrentPage, SIGNAL(toggled(bool)), this, SLOT(SelRange(bool)));
	connect( pageNrButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
	connect( PrintSep, SIGNAL(activated(int)), this, SLOT(SelMode(int)));
	connect( ToolButton1, SIGNAL(clicked()), this, SLOT(SelFile()));
	connect( OtherCom, SIGNAL(clicked()), this, SLOT(SelComm()));
	connect( previewButton, SIGNAL(clicked()), this, SLOT(previewButtonClicked()));
	connect( docBleeds, SIGNAL(clicked()), this, SLOT(doDocBleeds()));
	connect( OptButton, SIGNAL( clicked() ), this, SLOT( SetOptions() ) );

	setStoredValues(printOptions.filename, gcr);
#if defined(_WIN32)
	if (!outputToFile())
		PrinterUtil::initDeviceSettings( PrintDest->currentText(), DevMode );
#endif

	printEngineMap = PrinterUtil::getPrintEngineSupport(PrintDest->currentText(), outputToFile());
	refreshPrintEngineBox();

	bool ps1Supported = printEngineMap.contains(CommonStrings::trPostScript1);
	bool ps2Supported = printEngineMap.contains(CommonStrings::trPostScript2);
	bool ps3Supported = printEngineMap.contains(CommonStrings::trPostScript3);
	bool psSupported  = (ps1Supported || ps2Supported || ps3Supported);
	printEngines->setEnabled(psSupported || outputToFile());
	UseICC->setEnabled(m_doc->HasCMS && psSupported);
}
示例#23
0
void Settings::init(){
    QList<versionInfo_s>::iterator  liVersion;
    QList<serverInfo_s>::iterator   liServer;
    QList<engineInfo_s>::iterator   liEngine;
    QString currentVersionName;
    QString currentServerName;
    QString currentEngineName;

    okButton = new QPushButton(this);
    okButton->setText("Ok");
    okButton->move(260, 170);
    okButton->show();

    cancelButton = new QPushButton(this);
    cancelButton->setText("Back");
    cancelButton->move(174, 170);
    cancelButton->show();

    versionLabel = new QLabel(this);
    versionLabel->setText("Version:");
    versionLabel->move(30, 20);
    versionLabel->show();

    engineLabel = new QLabel(this);
    engineLabel->setText("Game engine:");
    engineLabel->move(30, 90);
    engineLabel->show();

    serverLabel = new QLabel(this);
    serverLabel->setText("Download mirror:");
    serverLabel->move(285, 20);
    serverLabel->show();

    updateLabel = new QLabel(this);
    updateLabel->setText("Update policy:");
    updateLabel->move(285, 90);
    updateLabel->show();

    versionList = new QComboBox(this);

    for(liVersion = versionsList.begin(); liVersion != versionsList.end(); ++liVersion){
        versionList->addItem(liVersion->versionName);
    }

    currentVersionName = getVersionNameById(currentVersion);

    if(!currentVersionName.isEmpty()){
        versionList->setCurrentIndex((int)versionList->findText(currentVersionName));
    }

    versionList->move(29, 40);
    versionList->setMinimumWidth(190);
    versionList->show();

    engineList = new QComboBox(this);

    for(liEngine = enginesList.begin(); liEngine != enginesList.end(); ++liEngine){
        engineList->addItem(liEngine->engineName);
    }

    currentEngineName = getEngineNameById(currentEngine);

    if(!currentEngineName.isEmpty()){
        engineList->setCurrentIndex((int)engineList->findText(currentEngineName));
    }

    engineList->move(29, 110);
    engineList->setMinimumWidth(190);
    engineList->show();

    serverList = new QComboBox(this);

    for(liServer = downloadServers.begin(); liServer != downloadServers.end(); ++liServer){
        if(liServer->serverLocation != ""){
            serverList->addItem(QIcon(QString(":/images/flags/%1.png").arg(liServer->serverLocation)), liServer->serverName);
        }
        else {
            serverList->addItem(liServer->serverName);
        }
    }

    currentServerName = getServerNameById(currentServer);

    if(!currentServerName.isEmpty()){
        serverList->setCurrentIndex((int)serverList->findText(currentServerName));
    }

    serverList->move(284, 40);
    serverList->setMinimumWidth(190);
    serverList->show();

    updateBehaviorList = new QComboBox(this);
    updateBehaviorList->addItem(QString("Automatic (default)"));
    updateBehaviorList->addItem(QString("Ask me"));

    if(currentUpdateBehavior != -1){
        updateBehaviorList->setCurrentIndex(currentUpdateBehavior);
    }
    else {
        updateBehaviorList->setCurrentIndex(0);
    }

    updateBehaviorList->move(284, 110);
    updateBehaviorList->setMinimumWidth(190);
    updateBehaviorList->show();

    connect(cancelButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));

    setWindowTitle("Settings");
    setFixedSize(515, 220);
    setModal(true);
}
示例#24
0
文件: settings.cpp 项目: hhrt/tranrem
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) {

  okButton = new QPushButton(tr("&OK"));
  connect(okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
  okButton->setEnabled(false);
  cancelButton = new QPushButton(tr("&Cancel"));
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));

  host = "";
  port = "";
  url  = "";
  autoRefresh = Qt::Unchecked;
  interval = 3;

  hostLineEdit = new QLineEdit();
  hostLineEdit->setText(host);
  connect(hostLineEdit, SIGNAL(textChanged(QString)), this, SLOT(hostChanged(QString)));
  portLineEdit = new QLineEdit();
  portLineEdit->setText(port);
  connect(portLineEdit, SIGNAL(textChanged(QString)), this, SLOT(portChanged(QString)));
  urlLineEdit  = new QLineEdit();
  urlLineEdit->setText(url);
  connect(urlLineEdit, SIGNAL(textChanged(QString)), this, SLOT(urlChanged(QString)));
  intervalSpinBox = new QSpinBox();
  intervalSpinBox->setMaximum(600);
  intervalSpinBox->setMinimum(3);
  intervalSpinBox->setValue(interval);
  intervalSpinBox->setEnabled(false);
  connect(intervalSpinBox, SIGNAL(valueChanged(int)), this, SLOT(intervalChanged(int)));
  autoRefreshCheckBox = new QCheckBox();
  autoRefreshCheckBox->setCheckState(autoRefresh); 
  connect(autoRefreshCheckBox, SIGNAL(stateChanged(int)), this, SLOT(autoRefreshChanged(int)));
  

  hostLabel = new QLabel(tr("Host name: "));
  hostLabel->setBuddy(hostLineEdit);
  portLabel = new QLabel(tr("Port: "));
  portLabel->setBuddy(portLineEdit);
  urlLabel  = new QLabel(tr("URL: "));
  urlLabel->setBuddy(urlLineEdit);
  intervalLabel = new QLabel(tr("Interval: "));
  intervalLabel->setBuddy(intervalSpinBox);
  autoRefreshLabel = new QLabel(tr("Auto Refresh: "));
  autoRefreshLabel->setBuddy(autoRefreshCheckBox);


  //Layouts
  QHBoxLayout *buttonsLayout = new QHBoxLayout();
  buttonsLayout->addWidget(okButton);
  buttonsLayout->addWidget(cancelButton);

  QHBoxLayout *hostLayout = new QHBoxLayout();
  hostLayout->addWidget(hostLabel);
  hostLayout->addWidget(hostLineEdit);

  QHBoxLayout *portLayout = new QHBoxLayout();
  portLayout->addWidget(portLabel);
  portLayout->addWidget(portLineEdit);

  QHBoxLayout *urlLayout = new QHBoxLayout();
  urlLayout->addWidget(urlLabel);
  urlLayout->addWidget(urlLineEdit);

  QHBoxLayout *autoRefreshLayout = new QHBoxLayout();
  autoRefreshLayout->addWidget(autoRefreshLabel);
  autoRefreshLayout->addWidget(autoRefreshCheckBox);

  QHBoxLayout *intervalLayout = new QHBoxLayout();
  intervalLayout->addWidget(intervalLabel);
  intervalLayout->addWidget(intervalSpinBox);

  QVBoxLayout *itemsLayout = new QVBoxLayout();
  itemsLayout->addLayout(hostLayout);
  itemsLayout->addLayout(portLayout);
  itemsLayout->addLayout(urlLayout);
  itemsLayout->addLayout(autoRefreshLayout);
  itemsLayout->addLayout(intervalLayout);
  
  QVBoxLayout *mainLayout = new QVBoxLayout();
  mainLayout->addLayout(itemsLayout);
  mainLayout->addLayout(buttonsLayout);

  setLayout(mainLayout);
};