void QProgressDialog::setCancelButtonText( const char *cancelButtonText )
{
    if ( cancelButtonText ) {
	if ( d->cancel )
	    d->cancel->setText(cancelButtonText);
	else
	    setCancelButton(new QPushButton(cancelButtonText, this, "cancel"));
    } else {
	setCancelButton(0);
    }
    resize(sizeHint());
}
Beispiel #2
0
ComponentDialog::ComponentDialog(SimpleData * nd)
    : TabDialog(0, 0, FALSE, Qt::WA_DeleteOnClose), data(nd)
{
    nd->get_browser_node()->edit_start();

    if (nd->get_browser_node()->is_writable()) {
        setOkButton(tr("OK"));
        setCancelButton(tr("Cancel"));
    }
    else {
        setOkButton(QString());
        setCancelButton(tr("Close"));
    }

    setWindowTitle(tr("component dialog"));

    BrowserComponent * bn = (BrowserComponent *) nd->get_browser_node();

    init_uml_tab();
    rqs = bn->get_required_classes();
    init_l_tab(rq_page, rq_stereotypefilter, &ComponentDialog::rq_stereotypeFilterActivated,
               SLOT(rq_stereotypeFilterActivated(const QString &)),
               SLOT(require_cls()), SLOT(unrequire_cls()),
               lb_rq_available, lb_rq, rqs, tr("Required classes"));
    prs = bn->get_provided_classes();
    init_l_tab(pr_page, pr_stereotypefilter, &ComponentDialog::pr_stereotypeFilterActivated,
               SLOT(pr_stereotypeFilterActivated(const QString &)),
               SLOT(provide_cls()), SLOT(unprovide_cls()),
               lb_pr_available, lb_pr, prs, tr("Provided classes"));
    rzs = bn->get_realizing_classes();
    init_l_tab(rz_page, rz_stereotypefilter, &ComponentDialog::rz_stereotypeFilterActivated,
               SLOT(rz_stereotypeFilterActivated(const QString &)),
               SLOT(realize_cls()), SLOT(unrealize_cls()),
               lb_rz_available, lb_rz, rzs, tr("Realizing classes"));

    // USER : list key - value

    GridBox * grid = new GridBox(2, this);
    grid->setMargin(5);
    grid->setSpacing(5);

    grid->addWidget(kvtable = new KeyValuesTable((BrowserComponent *) data->get_browser_node(),
                                 grid, !hasOkButton()));
    addTab(grid, tr("Properties"));

    //

    connect(this, SIGNAL(currentChanged(QWidget *)),
            this, SLOT(change_tabs(QWidget *)));

    open_dialog(this);
}
Beispiel #3
0
void QProgressDialog::setCancelButtonText( const QString &cancelButtonText )
{
    if ( !cancelButtonText.isNull() ) {
	if ( d->cancel )
	    d->cancel->setText(cancelButtonText);
	else
	    setCancelButton(new QPushButton(cancelButtonText, this, "cancel"));
    } else {
	setCancelButton(0);
    }
    int w = QMAX( isVisible() ? width() : 0, sizeHint().width() );
    int h = QMAX( isVisible() ? height() : 0, sizeHint().height() );
    resize( w, h );
}
void UpgradeMessage::createPage031 ()
{
  QWidget *w = new QWidget(this);
  
  QVBoxLayout *vbox = new QVBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(5);

  QString s = tr("This version of Qtstalker uses a new data format.");
  s.append(tr(" It can not read data files from previous versions."));
  s.append(tr(" This means that you will start with an empty workspace."));
  s.append(tr(" Your old data files have been preserved in $HOME/Qtstalker"));
  s.append(tr(" and can still be accessed by older Qtstalker versions."));
  s.append(tr(" If you don't intend to downgrade to a previous Qtstalker"));
  s.append(tr(" version, then you can remove that directory."));

  QTextEdit *message = new QTextEdit(w);
  message->setReadOnly(TRUE);
  message->setText(s);
  vbox->addWidget(message);

  check = new QCheckBox(tr("Do not show this message again."), w);
  vbox->addWidget(check);

  addTab(w, tr("Warning"));
  
  setOkButton(tr("&OK"));
  setCancelButton(tr("&Cancel"));
}
Preferences::Preferences(QWidget *w) : Q3TabDialog(w, "Preferences", FALSE, Qt::WDestructiveClose)
{
  helpFile = "preferences.html";

  setCaption(tr("Edit Prefs"));

  loadSettings();
  createGeneralPage();
  createColorPage();
  createFontPage();
  createMTPage(); // main tool bar
  createCTPage(); // chart tool bar
  createETPage(); // extra tool bar

  setApplyButton(tr("&Apply"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(slotSave()));

  setCancelButton(tr("&Ok"));
  //connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog()));

  setOkButton(QString::null);

  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp()));
  resize(sz);

}
Beispiel #6
0
KRPleaseWait::KRPleaseWait(QString msg, QWidget *parent, int count, bool cancel):
        QProgressDialog(cancel ? 0 : parent) , inc(true)
{
    setModal(!cancel);

    timer = new QTimer(this);
    setWindowTitle(i18n("Krusader::Wait"));

    setMinimumDuration(500);
    setAutoClose(false);
    setAutoReset(false);

    connect(timer, SIGNAL(timeout()), this, SLOT(cycleProgress()));

    QProgressBar* progress = new QProgressBar(this);
    progress->setMaximum(count);
    progress->setMinimum(0);
    setBar(progress);

    QLabel* label = new QLabel(this);
    setLabel(label);

    QPushButton* btn = new QPushButton(i18n("&Cancel"), this);
    setCancelButton(btn);

    btn->setEnabled(canClose = cancel);
    setLabelText(msg);

    show();
}
StocksDialog::StocksDialog (QString p, DbPlugin *d, DBIndex *i) : Q3TabDialog (0, "StocksDialog", TRUE)
{
    helpFile = p;
    db = d;
    index = i;
    reloadFlag = FALSE;
    currentDate = QDateTime::currentDateTime();

    setCaption(tr("Qtstalker: Edit Stock"));

    QString s;
    d->getSymbol(s);
    QFileInfo fi(s);
    symbol = fi.fileName();

    createDetailsPage();
    createDataPage();
    createFundamentalsPage();
    createSplitPage();

    setOkButton(tr("&OK"));
    setCancelButton(tr("&Cancel"));
    connect(this, SIGNAL(applyButtonPressed()), this, SLOT(saveChart()));

    setHelpButton();
    QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));

    RcFile rcfile;
    QSize sz;
    rcfile.loadSize(RcFile::EditStockWindowSize, sz);
    resize(sz);
}
ccProgressDialog::ccProgressDialog(	bool showCancelButton,
									QWidget *parent/*=0*/ )
	: QProgressDialog(parent)
	, m_currentValue(0)
	, m_lastValue(-1)
	, m_timer(this)
	, m_refreshInterval(1)
{
	setAutoClose(true);
	setWindowModality(Qt::ApplicationModal);

	setRange(0,100);
	setMinimumDuration(0);

	QPushButton* cancelButton = 0;
	if (showCancelButton)
	{
		cancelButton = new QPushButton("Cancel");
		cancelButton->setDefault(false);
		cancelButton->setFocusPolicy(Qt::NoFocus);
	}
	setCancelButton(cancelButton);

	connect(&m_timer, SIGNAL(timeout()), this, SLOT(refresh())/*, Qt::DirectConnection*/); //can't use DirectConnection here!
}
Beispiel #9
0
CSV::CSV ()
{
  pluginName = "CSV";
  delim = ',';
  helpFile = "csv.html";
  cancelFlag = FALSE;

  reloadTimer = new QTimer(this);
  connect(reloadTimer, SIGNAL(timeout()), SLOT(parse()));

  config.getData(Config::QuotePluginStorage, ruleDir);
  ruleDir.append("/CSV");
  QDir dir;
  if (! dir.exists(ruleDir))
  {
    if (! dir.mkdir(ruleDir, TRUE))
      qDebug("CSVDialog::could not create storage directory %s", ruleDir.latin1());
  }

  createMainPage();
  setOkButton();
  setCancelButton();
  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));
  loadSettings();
  updateRules();
  resize(640, 480);
}
void Preferences::slotModified()
{
  // FIXME: The goal is to change the caption of the
  // Cancel-button "Cancel/OK" 	depending on a change
  // of any data by the user
  //qDebug("changed");
  setCancelButton(tr("&Cancel"));
}
Beispiel #11
0
MyProgressDialog::MyProgressDialog(QString title, QWidget *parent): QProgressDialog(parent)
{
    setWindowTitle(title);
    setModal(true);
    setFixedWidth(600);
    setCancelButton(NULL);
    connect(this , SIGNAL(canceled()),this,SLOT(cancel()));
}
Beispiel #12
0
void QProgressDialog::setCancelButtonText(const QString &cancelButtonText)
{
    Q_D(QProgressDialog);
    d->useDefaultCancelText = false;

    if (!cancelButtonText.isNull()) {
        if (d->cancel)
            d->cancel->setText(cancelButtonText);
        else
            setCancelButton(new QPushButton(cancelButtonText, this));
    } else {
        setCancelButton(0);
    }
    int w = qMax(isVisible() ? width() : 0, sizeHint().width());
    int h = qMax(isVisible() ? height() : 0, sizeHint().height());
    resize(w, h);
}
Beispiel #13
0
QgsWFSProgressDialog::QgsWFSProgressDialog( const QString &labelText,
    const QString &cancelButtonText,
    int minimum, int maximum, QWidget *parent )
  : QProgressDialog( labelText, cancelButtonText, minimum, maximum, parent )
{
  mCancel = new QPushButton( cancelButtonText, this );
  setCancelButton( mCancel );
  mHide = new QPushButton( tr( "Hide" ), this );
  connect( mHide, &QAbstractButton::clicked, this, &QgsWFSProgressDialog::hideRequest );
}
Beispiel #14
0
ProgressBox::ProgressBox(const QString& label, int n_steps,
                         QWidget* parent) :
    QProgressDialog(label,
                    "",  // cancelButtonText
                    0,  // minimum
                    n_steps,  // maximum
                    parent,
                    Qt::WindowFlags())
{
    setCancelButton(nullptr);  // don't show cancel button
}
CheckRepoRootDirPermDialog::CheckRepoRootDirPermDialog(const Account &account,
                                                       const ServerRepo& repo,
                                                       const QString& local_path,
                                                       QWidget *parent)
    : QProgressDialog(parent),
      account_(account),
      repo_(repo),
      local_path_(local_path),
      has_write_perm_(false)
{
    // Here we use the data manager class to fetch the dir instead of doing it
    // directly, because DataManager class would make use of the shared
    // in-memory dirents cache.
    data_mgr_ = seafApplet->dataManager();

    setWindowModality(Qt::WindowModal);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    setWindowIcon(QIcon(":/images/seafile.png"));

    QVBoxLayout *layout_ = new QVBoxLayout;
    progress_bar_ = new QProgressBar;
    description_label_ = new QLabel;

    layout_->addWidget(description_label_);
    layout_->addWidget(progress_bar_);

    QHBoxLayout *hlayout_ = new QHBoxLayout;
    more_details_label_ = new QLabel;
    more_details_label_->setText(tr("Checking Permission"));
    QPushButton *cancel_button_ = new QPushButton(tr("Cancel"));
    QWidget *spacer = new QWidget;
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

    hlayout_->addWidget(more_details_label_);
    hlayout_->addWidget(spacer);
    hlayout_->addWidget(cancel_button_);
    hlayout_->setContentsMargins(-1, 0, -1, 6);
    layout_->setContentsMargins(-1, 0, -1, 6);
    layout_->addLayout(hlayout_);

    setLayout(layout_);
    setLabel(description_label_);
    setBar(progress_bar_);
    setCancelButton(cancel_button_);

    data_mgr_notify_ = new DataManagerNotify(repo_.id);
    connect(data_mgr_notify_, SIGNAL(getDirentsSuccess(bool, const QList<SeafDirent>&)),
            this, SLOT(onGetDirentsSuccess(bool)));
    connect(data_mgr_notify_, SIGNAL(getDirentsFailed(const ApiError&)),
            this, SLOT(onGetDirentsFailed()));

    setValue(minimum());
    QTimer::singleShot(0, this, SLOT(checkPerm()));
}
MusicProgressWidget::MusicProgressWidget(QWidget *parent)
    : QProgressDialog(parent)
{
    setModal(true);
    setWindowFlags( Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
    setWindowModality(Qt::ApplicationModal);
    setAttribute(Qt::WA_TranslucentBackground, true);
    setCancelButton(nullptr);
    setLabel(nullptr);
    setFixedSize(400, 155);

    initWidget();
}
void QtStereoEditorDialogue::build_layout(void)
{
	//Create the tabs

	stereosettings_tab = new QtStereoSettingsWidget(this, "stereosettings_tab");
	stereosettings_tab->create();

	addTab(stereosettings_tab, "Stereo Rendering");

	//only add a close button
	setOkButton(NULL);
	setCancelButton("Close");
}
Beispiel #18
0
DBusyDlg::DBusyDlg(const QString& txt, QWidget* const parent)
    : QProgressDialog(parent, Qt::FramelessWindowHint),
      d(new Private)
{
    setLabelText(txt);
    setCancelButton(0);
    setMinimumDuration(0);
    setModal(true);
    setAutoClose(false);

    setMaximum(0);
    setMinimum(0);
    setValue(0);
}
void QtMeasuringEditorDialogue::build_layout(void)
{
//	printf("creating measuretab\n");

	//measuring tab
	measuring_tab = new QtMeasuringWidget(this, "measuretab", apppath);
	measuring_tab->create();

	//our tab pages
	addTab(measuring_tab, "Measuring");

	setCancelButton("Close");
	setOkButton(0);
}
Beispiel #20
0
ParameterSetDialog::ParameterSetDialog(ParameterSetData * nd)
    : Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(nd)
{
    nd->browser_node->edit_start();

    if (nd->browser_node->is_writable()) {
        setOkButton(TR("OK"));
        setCancelButton(TR("Cancel"));
    }
    else {
        setOkButton(QString());
        setCancelButton(TR("Close"));
    }

    setCaption(TR("ParameterSet dialog"));

    init_uml_tab();
    init_pins_tab();

    // USER : list key - value

    Q3Grid * grid = new Q3Grid(2, this);

    grid->setMargin(5);
    grid->setSpacing(5);

    kvtable = new KeyValuesTable((BrowserParameterSet *) data->get_browser_node(),
                                 grid, !hasOkButton());
    addTab(grid, TR("Properties"));

    //

    connect(this, SIGNAL(currentChanged(QWidget *)),
            this, SLOT(change_tabs(QWidget *)));

    open_dialog(this);
}
SpreadDialog::SpreadDialog (QString &nam, QString &fs, QString &ss) : QTabDialog (0, "SpreadDialog", TRUE)
{
  helpFile = "spread.html";

  setCaption(tr("Spread Dialog"));
  
  QWidget *w = new QWidget(this);
  
  QVBoxLayout *vbox = new QVBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(0);

  QGridLayout *grid = new QGridLayout(vbox, 1, 2);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  QLabel *label = new QLabel(tr("Name"), w);
  grid->addWidget(label, 0, 0);

  name = new QLineEdit(nam, w);
  grid->addWidget(name, 0, 1);

  label = new QLabel(tr("First Symbol"), w);
  grid->addWidget(label, 1, 0);

  Config config;
  QString path;
  config.getData(Config::DataPath, path);

  firstSymbol = new SymbolButton(w, path, fs);
  grid->addWidget(firstSymbol, 1, 1);

  label = new QLabel(tr("Second Symbol"), w);
  grid->addWidget(label, 2, 0);

  secondSymbol = new SymbolButton(w, path, ss);
  grid->addWidget(secondSymbol, 2, 1);
  
  vbox->insertStretch(-1, 1);
  
  addTab(w, tr("Settings"));

  setOkButton();
  setCancelButton();
  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));

  resize(400, 300);
}
Beispiel #22
0
KfOptions::KfOptions( QWidget *parent, const char *name ):QTabDialog( parent, name) 
  {
    resize(400,330);
    insertPages();

    setOKButton( i18n("OK"));
    setCancelButton( i18n("Cancel"));
    setCaption(i18n("Preferences"));
    
    this->setMinimumSize(400,330);
    this->setMaximumSize(400,330);
 
    connect(this,SIGNAL(applyButtonPressed()),this,SLOT(applyChanges()));
 
  };
Beispiel #23
0
//***********************************************
Options::Options( QWidget *parent, const char *name)
    : Q3TabDialog( parent, name)
{

  setCaption("Settings");

  set_general();
  set_directories();
  set_logedit();
  set_interpreter();

  connect( this, SIGNAL( applyButtonPressed() ), SLOT( apply() ) );
  setDefaultButton();
  connect( this, SIGNAL( defaultButtonPressed() ), SLOT( defaults() ) );
  setCancelButton();
  set_settings();

}
Beispiel #24
0
CODBCConfig::CODBCConfig( QWidget* parent, const char* name, Qt::WFlags nFlags )
	: Q3TabDialog( parent, name, nFlags )
#else
CODBCConfig::CODBCConfig( QWidget* parent, const char* name, WFlags nFlags )
	: QTabDialog( parent, name, nFlags )
#endif
{
    setIcon( QPixmap( xpmODBC ) );
    setCaption( "ODBC Data Source Administrator" );
    setSizeGripEnabled( true );

    pUserDSN       = new CUserDSN( this );
    addTab( pUserDSN, "&User DSN" );

    pSystemDSN     = new CSystemDSN( this );
    addTab( pSystemDSN, "&System DSN" );

    pFileDSN       = new CFileDSN( this, NULL );
    addTab( pFileDSN, "&File DSN" );

    pDrivers       = new CDrivers( this );
    addTab( pDrivers, "&Drivers" );

    pStats         = new CStats( this );
    addTab( pStats, "St&ats" );

    pTracing       = new CTracing( this );
    addTab( pTracing, "Ad&vanced" );

    pAbout         = new CAbout( this );
    addTab( pAbout, "&About" );

#ifdef QT_V4LAYOUT
	setOkButton();
	setCancelButton();
#endif

	resize( 500,330 );

	setMinimumSize( 0, 0 );
	setMaximumSize( 32767, 32767 );

    LoadState();
}
void UpgradeMessage::createPage034 ()
{
  QWidget *w = new QWidget(this);
  
  QVBoxLayout *vbox = new QVBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(5);

  QString s = tr("Your workspace will be converted into the ~/.qtstalker/data1/ directory.");
  s.append(tr(" It could take a long time if there are many data items."));
  s.append(tr(" When satisfied, the old workspace can be manually removed from ~/.qtstalker/data0/\n"));
  s.append(tr("\n"));
  s.append(tr(" If you choose Cancel, then Quit immediately and see the cleanup notes in docs/install.html"));
  QTextEdit *message = new QTextEdit(w);
  message->setReadOnly(TRUE);
  message->setText(s);
  vbox->addWidget(message);

  QHBoxLayout *hbox = new QHBoxLayout(vbox);
  hbox->setSpacing(2);

  QLabel *label = new QLabel(tr("Progress"), w);
  hbox->addWidget(label);

  progBar = new QProgressBar(w);
  hbox->addWidget(progBar);

  addTab(w, tr("Chart Conversion"));

  QPushButton *button = new QPushButton(tr("Perform Conversion"), w);
  QObject::connect(button, SIGNAL(clicked()), this, SLOT(convert034()));
  vbox->addWidget(button);

  vbox->addStretch(1);
  
  setOkButton(QString::null);  

  setCancelButton(tr("&Cancel"));

  resize(500, 300);
}
Beispiel #26
0
  RDProgressDialog(const QString &labelText, QWidget *parent)
      // we add 1 so that the progress value never hits maximum until we are actually finished
      : QProgressDialog(labelText, QString(), 0, maxProgress + 1, parent),
        m_Label(this)
  {
    setWindowTitle(tr("Please Wait"));
    setWindowFlags(Qt::CustomizeWindowHint | Qt::Dialog | Qt::WindowTitleHint);
    setWindowIcon(QIcon());
    setMinimumSize(QSize(250, 0));
    setMaximumSize(QSize(250, 10000));
    setCancelButton(NULL);
    setMinimumDuration(0);
    setWindowModality(Qt::ApplicationModal);
    setValue(0);

    m_Label.setText(labelText);
    m_Label.setAlignment(Qt::AlignCenter);
    m_Label.setWordWrap(true);

    setLabel(&m_Label);
  }
AppTabDialog::AppTabDialog( QWidget *p_parent, const QString &captionKey,
        const char *p_name, const QString &acceptKey, const QString &rejectKey ) :
    QTabDialog( p_parent, p_name, true,
        WStyle_Customize |          // Use following flags
        WStyle_SysMenu |            // System menu in upper left
        WStyle_Title |              // Window title
        WStyle_MinMax |             // Min/max in system menu
        WStyle_Dialog |             // Modal toplevel window
        WStyle_NormalBorder ),      // Resizeable corners
    m_contextMenu(0)
{
    // Set the dialog caption
    QString l_caption("");
    translate( l_caption, captionKey );
    setCaption( appWindow()->m_program + " "
              + appWindow()->m_version + " " + l_caption );

    // Add the standard QTabDialog Ok button.
    QString text("");
    translate( text, acceptKey );
    setOkButton( text );
    connect( this, SIGNAL( applyButtonPressed() ),
             this, SLOT( store() ) );

    // Optionally add the QTabDialog cancel button.
    if ( ! rejectKey.isNull() && ! rejectKey.isEmpty() )
    {
        translate( text, rejectKey );
        setCancelButton( text );
        connect( this, SIGNAL( cancelButtonPressed() ),
                 this, SLOT( reject() ) );
    }
    // Create the context menu.
    m_contextMenu = new QPopupMenu( this, "m_contextMenu" );
    Q_CHECK_PTR( m_contextMenu );
    translate( text, "AppDialog:ContextMenu:Print" );
    int mid = m_contextMenu->insertItem( text );
    m_contextMenu->setItemParameter( mid, ContextPrintDialog );
    return;
}
Beispiel #28
0
KNewIcon::KNewIcon(QWidget *parent) : KWizard( parent, 0, true)
{
  debug("KNewIcon - constructor");
  if(isTopLevel())
    debug("isTopLevel");
  else
    debug("not TopLevel");
  //hide();
  connect(this, SIGNAL(selected(int)), SLOT(checkPage(int)));
  openstyle = -1;
  setOkButton();
  getNextButton()->setEnabled(false);
  getOkButton()->setEnabled(false);
  setCancelButton();
  setEnableArrowButtons(true);

  select = new NewSelect(this);
  connect(select, SIGNAL(iconopenstyle(int)), SLOT(iconOpenStyle(int)));
  //scratch = new NewFromScratch(this);
  scratch = new KResize(this, 0, false, QSize(32, 32));
  connect(scratch, SIGNAL(validsize(bool)), SLOT(checkPage(bool)));
  scratch->hide();
  templ = new NewFromTemplate(this);
  templ->hide();

  p1 = new KWizardPage;
  p1->title = i18n("Select icontype");
  p1->w = select;
  p1->enabled = true;
  addPage(p1);

  p2 = new KWizardPage;
  p2->title = i18n("Create from scratch");
  p2->w = scratch;
  p2->enabled = true;
  addPage(p2);

  setCaption(i18n("Create new icon"));
  resize(400, 250);
}
Beispiel #29
0
CuboidDialog::CuboidDialog()
    : QTabDialog( 0, "CuboidDialog", true )
{
    setCaption( trUtf8( "Cuboid Dialog" ) );

    // Cuboid dimensions
    cub_dimension_box = new QVGroupBox( this );
    cub_dimension_box->setFrameShape( QFrame::NoFrame );
    cub_dimension_box->setTitle( trUtf8( "Cuboid dimensions (nb of cells)" ) );

    len_label = new QLabel( "Length", cub_dimension_box );
    cubLen = new DistributionSelector( cub_dimension_box, "cubLen" );

    wid_label = new QLabel( "Width", cub_dimension_box );
    cubWid = new DistributionSelector( cub_dimension_box, "cubWid" );

    hgt_label = new QLabel( "Height", cub_dimension_box );
    cubHgt = new DistributionSelector( cub_dimension_box, "cubHgt" );

    addTab( cub_dimension_box , "Dimensions" );

    // Cuboid orientation
    cub_orientation_box = new QVGroupBox( this );
    cub_orientation_box->setFrameShape( QFrame::NoFrame );

    rot_label1 = new QLabel( "Azimuth (0.0=North, 90.0=East)", cub_orientation_box );
    cubRotStrike = new DistributionSelector( cub_orientation_box, "cubRotStrike" );

    rot_label2 = new QLabel( "Dip (0.0=Horizontal, 90.0=Vertical)", cub_orientation_box );
    cubRotDip = new DistributionSelector( cub_orientation_box, "cubRotDip" );

    addTab( cub_orientation_box, "Orientation" );

    setOKButton();
    setApplyButton();
    setCancelButton();

}
Beispiel #30
0
/**
 * Constructs the dialog.
 */
SettingsDialog::SettingsDialog(int tabIndex, QWidget* parent,
                               const char* name, bool modal,
                               WFlags fl)
    : QTabDialog(parent, name, modal, fl)
{
    setCaption(tr("Settings"));
    setApplyButton(tr("Apply"));
    setCancelButton(tr("Cancel"));
    setOkButton(tr("OK"));
    setHelpButton(tr("Help"));

    this->addTab(createGeneralTab(), tr("General"));
    this->addTab(createPathTab(), tr("Paths"));
    this->addTab(createDownloadTab(), tr("Download"));
    setup();

    if (tabIndex >= 0 && tabIndex < tabBar()->count()) {
        tabBar()->setCurrentTab(tabIndex);
    }

    resize(sizeHint());//resize(400, 400);

    connect(this, SIGNAL(applyButtonPressed()), this, SLOT(applySettings()));
}