proxyDialog::proxyDialog(QWidget *parent) : QDialog(parent), ui(new Ui::proxyDialog) { ui->setupUi(this); if(parent==0||parent==NULL) { QMessageBox::critical(this,tr("Błąd aplikacji"), tr("Do okna ustawień przekazany został błędny wskaźnik. " "Skontaktuj się z autorem programu.") ,QMessageBox::Ok); this->hide(); } else { this->parent=parent; ok=new QPushButton(tr("Ok"),this); cancel=new QPushButton(tr("Anuluj"),this); ui->buttons->addWidget(ok); ui->buttons->addWidget(cancel); connect(ui->type,SIGNAL(currentIndexChanged(int)),this,SLOT(type_change(int))); connect(ok,SIGNAL(clicked()),this,SLOT(slot_ok())); connect(cancel,SIGNAL(clicked()),this,SLOT(slot_cancel())); ui->name->setDisabled(true); ui->port->setDisabled(true); ui->password->setDisabled(true); ui->user->setDisabled(true); ui->type->setCurrentIndex(2); } }
UnitExchange::UnitExchange( QWidget * parent, const char * /* name */) : QDialog( parent, Qt::Dialog ) { QVBoxLayout * layout = new QVBoxLayout( this ); layout->addStretch( 1 ); QHBoxLayout * layH1 = new QHBoxLayout(); layH1->addStretch( 1 ); _icoLeft = new Icon( this ); layH1->addWidget( _icoLeft ); layH1->addStretch( 2 ); _icoRight = new Icon( this ); layH1->addWidget( _icoRight ); layH1->addStretch( 1 ); layout->addLayout( layH1 ); QHBoxLayout * layH2 = new QHBoxLayout(); layH2->addStretch( 1 ); _leftLCD = new QLCDNumber( this ); layH2->addWidget( _leftLCD ); layH2->addStretch( 2 ); _rightLCD = new QLCDNumber( this ); layH2->addWidget( _rightLCD ); layH2->addStretch( 1 ); layout->addLayout( layH2 ); QHBoxLayout * layH3 = new QHBoxLayout(); layH3->addStretch( 1 ); _scroll = new QScrollBar( Qt::Horizontal, this ); layH3->addWidget( _scroll, 2 ); layH3->addStretch( 1 ); layout->addLayout( layH3 ); layout->addSpacing( 5 ); layout->addStretch( 1 ); QHBoxLayout * layH4 = new QHBoxLayout(); layH4->addStretch( 1 ); AttalButton * pbCancel = new AttalButton( this, AttalButton::BT_CANCEL ); layH4->addWidget( pbCancel ); layH4->addStretch( 1 ); AttalButton * pbOk = new AttalButton( this, AttalButton::BT_OK ); layH4->addWidget( pbOk ); layH4->addStretch( 1 ); layout->addLayout( layH4 ); layout->addSpacing( 5 ); layout->activate(); connect( _scroll, SIGNAL( valueChanged( int ) ), SLOT( slot_barScrolled( int ) ) ); connect( pbOk, SIGNAL( clicked() ), SLOT( slot_ok() ) ); connect( pbCancel, SIGNAL( clicked() ), SLOT( slot_cancel() ) ); setFixedSize( 190, 220 ); }
CForwardDlg::CForwardDlg(CSignalManager *sigMan, CUserEvent *e, QWidget *p) : LicqDialog(p, "UserForwardDialog", false, WDestructiveClose | WType_TopLevel) { sigman = sigMan; m_nEventType = e->SubCommand(); m_nUin = 0; m_szId = 0; m_nPPID = 0; QString t; switch (e->SubCommand()) { case ICQ_CMDxSUB_MSG: t = tr("Message"); s1 = QString::fromLocal8Bit(((CEventMsg *)e)->Message()); break; case ICQ_CMDxSUB_URL: t = tr("URL"); s1 = QString::fromLocal8Bit(((CEventUrl *)e)->Url()); s2 = QString::fromLocal8Bit(((CEventUrl *)e)->Description()); break; default: WarnUser(this, tr("Unable to forward this message type (%d).").arg(e->SubCommand())); return; } setCaption(tr("Forward %1 To User").arg(t)); setAcceptDrops(true); QGridLayout *lay = new QGridLayout(this, 3, 5, 10, 5); QLabel *lbl = new QLabel(tr("Drag the user to forward to here:"), this); lay->addMultiCellWidget(lbl, 0, 0, 0, 4); edtUser = new CInfoField(this, true); edtUser->setAcceptDrops(false); lay->addMultiCellWidget(edtUser, 1, 1, 0, 4); lay->setColStretch(0, 2); btnOk = new QPushButton(tr("&Forward"), this); lay->addWidget(btnOk, 2, 1); lay->addColSpacing(2, 10); btnCancel = new QPushButton(tr("&Cancel"), this); lay->addWidget(btnCancel, 2, 3); lay->setColStretch(4, 2); int bw = 75; bw = QMAX(bw, btnOk->sizeHint().width()); bw = QMAX(bw, btnCancel->sizeHint().width()); btnOk->setFixedWidth(bw); btnCancel->setFixedWidth(bw); connect(btnOk, SIGNAL(clicked()), SLOT(slot_ok())); connect(btnCancel, SIGNAL(clicked()), SLOT(close())); }
// ------------------------------------------------------- // -------- WGDownloadOptionsDlg // ------------------------------------------------------- WGDownloadOptionsDlg::WGDownloadOptionsDlg( QWidget* parent, const char* name, bool modal, WFlags fl ): WGDownloadOptionsDlgBase( parent, name, modal, fl ) { QIconSet image_open( QPixmap((const char**)image_open_data) ); image_open.setPixmap( QPixmap((const char**)image_open_d_data), QIconSet::Automatic, QIconSet::Disabled ); DirectoryB->setIconSet( image_open ); LogDirectoryB->setIconSet( image_open ); RetriesNumberLE->setValidator( new WGIntValidator( RetriesNumberLE ) ); RetriesWaitLE->setValidator( new WGIntValidator( RetriesWaitLE ) ); connect( OkB , SIGNAL(clicked()) , this, SLOT(slot_ok()) ); connect( CancelB , SIGNAL(clicked()) , this, SLOT(slot_cancel()) ); connect( DirectoryB , SIGNAL(clicked()) , this, SLOT(slot_directory()) ); connect( RestartCB , SIGNAL(clicked()) , this, SLOT(slot_restart()) ); connect( PasswordCB , SIGNAL(clicked()) , this, SLOT(slot_password()) ); connect( LogCB , SIGNAL(clicked()) , this, SLOT(slot_log()) ); connect( LogDirectoryB , SIGNAL(clicked()) , this, SLOT(slot_log_directory()) ); connect( URLLE , SIGNAL(returnPressed()), this, SLOT(slot_ok()) ); connect( PasswordUsrLE , SIGNAL(returnPressed()), this, SLOT(slot_ok()) ); connect( PasswordPassLE , SIGNAL(returnPressed()), this, SLOT(slot_ok()) ); connect( RetriesNumberLE, SIGNAL(returnPressed()), this, SLOT(slot_ok()) ); connect( RetriesWaitLE , SIGNAL(returnPressed()), this, SLOT(slot_ok()) ); updateControls(); URLLE->setFocus(); }
Getgraphptr::Getgraphptr(QWidget *parent, const char *name,const char* message ) : QDialog(parent,Qt::WindowStaysOnTopHint) { //was false,Qt::WStyle_StaysOnTop this->setWindowTitle(name); specptr=0; //show the message and an OK and cancel button this->setFocusPolicy(Qt::NoFocus); QGridLayout *vbox = new QGridLayout( this ); QLabel* mylabel=new QLabel(message,this); vbox->addWidget(mylabel,0,0,1,2); QPushButton *OK = new QPushButton( "&OK", this); QPushButton *cancel = new QPushButton( "&Cancel", this); vbox->addWidget(OK,1,0); vbox->addWidget(cancel,1,2); //wait for a user to click either OK or cancel connect( OK, SIGNAL( clicked()), this, SLOT( slot_ok() ) ); connect( cancel, SIGNAL( clicked()), this, SLOT( slot_cancel() ) ); }
PrinterCmdDialog::PrinterCmdDialog ( QString* cmd, bool* stdinpr, bool* ps, QWidget* parent ) : QDialog ( parent ) { ui.setupUi ( this ); printCmd=cmd; printStdIn=stdinpr; printPs=ps; ui.leCmd->setText ( *printCmd ); if ( *printStdIn ) ui.rbStdIn->setChecked ( true ); else ui.rbParam->setChecked ( true ); if ( *printPs ) ui.rbPS->setChecked ( true ); else ui.rbPDF->setChecked ( true ); connect ( ui.buttonBox, SIGNAL ( accepted() ),this,SLOT ( slot_ok() ) ); #ifdef Q_OS_WIN QString txt=tr ( "Please enter your customized or" " individual printing command.\n" "Example:\n"); QString ver,path; if(PrintWidget::gsViewInfo(ver,path)) txt+=path+" -query -color"; else txt+=tr("<Path to gsprint.exe> -query -color"); ui.label->setText (txt); if(!PrintWidget::gsInfo(ver,path)) { ui.rbPDF->setChecked ( true ); ui.rbPS->setEnabled(false); } #endif }
Hello::Hello(QWidget *parent, const char *name ) : QDialog(parent,Qt::Dialog) { this->setWindowModality(Qt::ApplicationModal); //QDialog(parent,name,true,0) //create a nice hello screen in the center of the parent // Create Widgets which allow easy layouting // vbox = new QVBoxLayout( this ); //box1 = new QHBoxLayout( this ); //bgrp2 = new QVBoxLayout(this); QGridLayout* lay=new QGridLayout(this); lay->setSizeConstraint(QLayout::SetMinimumSize); //bgrp2->setMargin(5); //bgrp2->setSpacing(2); //parentptr=parent; //a picture dummylabel=new QLabel(""); lay->addWidget(dummylabel,0,0,1,2); //a spacer const QPixmap helloimg=QPixmap(eelsmodel_4_1_xpm); dummylabel->setPixmap(helloimg); //some text authorlabel=new QLabel("Copyright 2003 by Jo Verbeeck"); lay->addWidget(authorlabel,1,0,1,2); emaillabel=new QLabel("email: [email protected]"); lay->addWidget(emaillabel,2,0,1,2); githublabel = new QLabel("github: https://github.com/joverbee/eelsmodel"); lay->addWidget(githublabel,3,0,1,2); std::string gnustring="This program is free\n" "software;you can redistribute it and/or modify it under the terms of the\n" "GNU General Public License as published by the Free Software Foundation\n" "either version 2 of the License, or (at your option) any later\n" "version. \n\n When publishing results obtained with this software, please cite as: \n J. Verbeeck, S. Van Aert, Ultramicroscopy, Volume 101, 2-4, (2004) 207-224\n"; gnu=new QTextEdit(gnustring.c_str()); lay->addWidget(gnu,4,0,1,2); gnu->setReadOnly(true); //OK button OK = new QPushButton( "OK"); lay->addWidget(OK,5,0); licenceb = new QPushButton( "Licence info"); lay->addWidget(licenceb,5,1); this->setLayout(lay); this->show(); connect( OK, SIGNAL( pressed () ), this, SLOT( slot_ok() ) ); connect( licenceb, SIGNAL( pressed () ), this, SLOT( slot_licence() ) ); this->exec(); // licencewidget=0; // vboxl=0; // box1l=0; // bgrp2l=0; gnul=0; }
ScenarioInfo::ScenarioInfo( QWidget * parent, const char * /* name */ ) : QDialog( parent, Qt::Dialog ) { setWindowTitle( tr( "General Scenario Informations" ) ); QVBoxLayout * layout = new QVBoxLayout( this ); layout->setMargin( 5 ); QLabel * title = new QLabel( tr( "General Information" ), this ); title->setFont( QFont( "Helvetica", 20, QFont::Bold ) ); title->setAlignment( Qt::AlignCenter ); FIXEDSIZE( title ); layout->addWidget( title ); layout->addSpacing( 15 ); QHBoxLayout * layH1 = new QHBoxLayout(); QLabel * scenarName = new QLabel( tr( "Name: " ), this ); FIXEDSIZE( scenarName ); layH1->addWidget( scenarName ); _name = new QLineEdit( this ); _name->setFixedSize( 200, 20 ); layH1->addWidget( _name ); layH1->addStretch( 1 ); layout->addLayout( layH1 ); layout->addSpacing( 5 ); QHBoxLayout * layH2 = new QHBoxLayout(); QLabel * theme = new QLabel( tr( "Theme: " ), this ); FIXEDSIZE( theme ); layH2->addWidget( theme ); _theme = new QComboBox( this ); searchThemes( _theme ); FIXEDSIZE( _theme ); layH2->addWidget( _theme ); layH2->addStretch( 1 ); QLabel * nbPlayer = new QLabel( tr( "Number of players: " ), this ); FIXEDSIZE( nbPlayer ); layH2->addWidget( nbPlayer ); _nbPlayers = new QSpinBox( this ); FIXEDSIZE( _nbPlayers ); layH2->addWidget( _nbPlayers ); layH2->addStretch( 1 ); layout->addLayout( layH2 ); layout->addSpacing( 5 ); QHBoxLayout * layH3 = new QHBoxLayout(); QLabel * height = new QLabel( tr( "Map height: " ), this ); FIXEDSIZE( height ); layH3->addWidget( height ); _editHeight = new QLineEdit( this ); _editHeight->setFixedSize( 50, 20 ); layH3->addWidget( _editHeight ); layH3->addStretch( 1 ); QLabel * width = new QLabel( tr( "Map width: " ), this ); FIXEDSIZE( width ); layH3->addWidget( width ); _editWidth = new QLineEdit( this ); _editWidth->setFixedSize( 50, 25 ); layH3->addWidget( _editWidth ); layH3->addStretch( 1 ); layout->addLayout( layH3 ); layout->addSpacing( 5 ); QHBoxLayout * layH5 = new QHBoxLayout(); QLabel * day = new QLabel( tr( "Day: " ), this ); FIXEDSIZE( day ); layH5->addWidget( day ); _day = new QSpinBox( this ); FIXEDSIZE( _day ); layH5->addWidget( _day ); _day->setValue( 1 ); QLabel * week = new QLabel( tr( "Week: " ), this ); FIXEDSIZE( week ); layH5->addWidget( week ); _week = new QSpinBox( this ); FIXEDSIZE( _week ); layH5->addWidget( _week ); _week->setValue( 1 ); QLabel * month = new QLabel( tr( "Month: " ), this ); FIXEDSIZE( month ); layH5->addWidget( month ); _month = new QSpinBox( this ); FIXEDSIZE( _month ); layH5->addWidget( _month ); _month->setValue( 1 ); QLabel * year = new QLabel( tr( "Year: " ), this ); FIXEDSIZE( year ); layH5->addWidget( year ); _year = new QSpinBox( this ); _year->setMaximum( 9999 ); _year->setValue( 1044 ); FIXEDSIZE( _year ); layH5->addWidget( _year ); layH5->addStretch( 1 ); layout->addLayout( layH5 ); layout->addSpacing( 5 ); QHBoxLayout * layH4 = new QHBoxLayout(); QLabel * desc = new QLabel( tr( "Description: " ), this ); FIXEDSIZE( desc ); layH4->addWidget( desc ); layH4->addStretch( 1 ); layout->addLayout( layH4 ); _desc = new QTextEdit( this ); layout->addWidget( _desc, 1 ); QPushButton * butOk = new QPushButton( this ); butOk->setText( tr( "Ok" ) ); FIXEDSIZE( butOk ); QPushButton * butCan = new QPushButton( this ); butCan->setText( tr( "Cancel" ) ); FIXEDSIZE( butCan ); QHBoxLayout * layH6 = new QHBoxLayout(); layH6->addStretch( 1 ); layH6->addWidget( butOk ); layH6->addStretch( 1 ); layH6->addWidget( butCan ); layH6->addStretch( 1 ); layout->addSpacing( 5 ); layout->addLayout( layH6 ); layout->activate(); connect( butCan, SIGNAL( clicked() ), SLOT( reject() ) ); connect( butOk, SIGNAL( clicked() ), SLOT( slot_ok() ) ); setMapHeight( 50 ); setMapWidth( 50 ); setNbPlayer( 2 ); setName( tr( "Map " ) + QString::number( _defaultVal ) ); setDescription( tr( "Map for Attal" ) ); setTheme( "medieval" ); _defaultVal++; }