Esempio n. 1
0
NewGameView::NewGameView( QWidget *parent )
  : QWidget( parent )
{
  QBoxLayout *topLayout = new QVBoxLayout( this );
  topLayout->setSpacing( 8 );
  topLayout->setMargin( 8 );
  
  topLayout->addStretch( 1 );

  m_timesTableCheck = new QCheckBox( i18n("Times Table"), this );
  topLayout->addWidget( m_timesTableCheck );
  m_timesTableCheck->setChecked( true );

  topLayout->addLayout( createRowChecks( m_multiplicationRowChecks ) );
  
  m_divisionCheck = new QCheckBox( i18n("Division"), this );
  topLayout->addWidget( m_divisionCheck );

  topLayout->addLayout( createRowChecks( m_divisionRowChecks ) );
  
  m_squareNumbersCheck = new QCheckBox( i18n("Square Numbers"), this );
  topLayout->addWidget( m_squareNumbersCheck );
  
  m_cubicNumbersCheck = new QCheckBox( i18n("Cubic Numbers"), this );
  topLayout->addWidget( m_cubicNumbersCheck );

  topLayout->addStretch( 1 );
  
  QPushButton *startButton = new QPushButton( i18n("Start"), this );
  topLayout->addWidget( startButton );
  connect( startButton, SIGNAL( clicked() ), SLOT( slotStartClicked() ) );

  topLayout->addStretch( 1 );  
}
Esempio n. 2
0
//TODO Add a drop down list of the avaialable protocols
//     that a user may be added for
AddUserDlg::AddUserDlg(CICQDaemon *s, const char* szId, unsigned long PPID,
                       QWidget *parent)
   : LicqDialog(parent, "AddUserDialog")
{
	server = s;

        QBoxLayout *lay = new QBoxLayout(this, QBoxLayout::Down, 8);
        QFrame *frmProtocol = new QFrame(this);
        QFrame *frmUin = new QFrame(this);
	QFrame *frmBtn = new QFrame(this);
        lay->addWidget(frmProtocol);
        lay->addWidget(frmUin);
	lay->addSpacing(5);
	lay->addStretch();
	lay->addWidget(frmBtn);

        QBoxLayout *layProtocol = new QBoxLayout(frmProtocol, QBoxLayout::LeftToRight);
        lblProtocol = new QLabel(tr("Protocol:"), frmProtocol);
        cmbProtocol = new QComboBox(frmProtocol);
        layProtocol->addWidget(lblProtocol);
        layProtocol->addWidget(cmbProtocol);
        
        // Fill the combo list now
        ProtoPluginsList pl;
        ProtoPluginsListIter it;
        server->ProtoPluginList(pl);
        uint index = 0;
        uint ppidIndex = 0;
        for (it = pl.begin(); it != pl.end(); it++, ++index)
        {
          cmbProtocol->insertItem((*it)->Name());
          if ((*it)->PPID() == PPID) ppidIndex = index;
        }
        cmbProtocol->setCurrentItem(ppidIndex);
        
        QBoxLayout *layUin = new QBoxLayout(frmUin, QBoxLayout::LeftToRight);
	lblUin = new QLabel(tr("New User ID:"), frmUin);
	edtUin = new QLineEdit(frmUin);
	layUin->addWidget(lblUin);
	layUin->addWidget(edtUin);

    if (szId != 0) edtUin->setText(szId);
    
	QBoxLayout *layBtn = new QBoxLayout(frmBtn, QBoxLayout::LeftToRight);
	btnOk = new QPushButton(tr("&Ok"), frmBtn);
	btnCancel = new QPushButton(tr("&Cancel"), frmBtn);
	layBtn->addStretch();
	layBtn->addWidget(btnOk);
	layBtn->addSpacing(20);
	layBtn->addWidget(btnCancel);

	setCaption(tr("Licq - Add User"));
	connect (btnOk, SIGNAL(clicked()), SLOT(ok()) );
	connect (edtUin, SIGNAL(returnPressed()), SLOT(ok()) );
	connect (btnCancel, SIGNAL(clicked()), SLOT(reject()) );

	// Set Tab Order
	setTabOrder(edtUin, btnOk);
	setTabOrder(btnOk, btnCancel);
}
RecipientsEditorSideWidget::RecipientsEditorSideWidget(RecipientsEditor *view, QWidget *parent)
    : QWidget(parent), mEditor(view), mRecipientPicker(Q_NULLPTR), mPickerPositioner(Q_NULLPTR)
{
    QBoxLayout *topLayout = new QVBoxLayout(this);

    topLayout->setMargin(0);
    topLayout->addStretch(1);

    mTotalLabel = new QLabel(this);
    mTotalLabel->setAlignment(Qt::AlignCenter);
    topLayout->addWidget(mTotalLabel);
    mTotalLabel->hide();

    topLayout->addStretch(1);

    mDistributionListButton = new QPushButton(
        i18nc("@action:button", "Save List..."), this);
    topLayout->addWidget(mDistributionListButton);
    mDistributionListButton->hide();
    connect(mDistributionListButton, &QAbstractButton::clicked,
            this, &RecipientsEditorSideWidget::saveDistributionList);
    mDistributionListButton->setToolTip(
        i18nc("@info:tooltip", "Save recipients as distribution list"));

    mSelectButton = new QPushButton(
        i18nc("@action:button Open recipient selection dialog.", "Se&lect..."), this);
    topLayout->addWidget(mSelectButton);
    connect(mSelectButton, &QPushButton::clicked, this, &RecipientsEditorSideWidget::pickRecipient);
    mSelectButton->setToolTip(i18nc("@info:tooltip", "Select recipients from address book"));
    updateTotalToolTip();
}
Esempio n. 4
0
WaitingOverlay::WaitingOverlay(KJob *job, QWidget *baseWidget, QWidget *parent)
    : QWidget(parent ? parent : baseWidget->window())
    , mBaseWidget(baseWidget)
{
    Q_ASSERT(baseWidget);
    Q_ASSERT(parentWidget() != baseWidget);

    connect(baseWidget, &QObject::destroyed, this, &QObject::deleteLater);
    connect(job, &KJob::result, this, &QObject::deleteLater);
    mPreviousState = mBaseWidget->isEnabled();

    QBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addStretch();
    QLabel *description = new QLabel(this);
    description->setText(i18n("<p style=\"color: white;\"><b>Waiting for operation</b><br/></p>"));
    description->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    topLayout->addWidget(description);
    topLayout->addStretch();

    QPalette p = palette();
    p.setColor(backgroundRole(), QColor(0, 0, 0, 128));
    setPalette(p);
    setAutoFillBackground(true);

    mBaseWidget->installEventFilter(this);

    reposition();
}
Esempio n. 5
0
void KOTodoEditor::setupGeneral()
{
    mGeneral = new KOEditorGeneralTodo(this);

    if(KOPrefs::instance()->mCompactDialogs)
    {
        QFrame *topFrame = addPage(i18n("General"));

        QBoxLayout *topLayout = new QVBoxLayout(topFrame);
        topLayout->setMargin(marginHint());
        topLayout->setSpacing(spacingHint());

        mGeneral->initHeader(topFrame, topLayout);
        mGeneral->initTime(topFrame, topLayout);
        QHBoxLayout *priorityLayout = new QHBoxLayout(topLayout);
        mGeneral->initPriority(topFrame, priorityLayout);
        topLayout->addStretch(1);

        QFrame *topFrame2 = addPage(i18n("Details"));

        QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
        topLayout2->setMargin(marginHint());
        topLayout2->setSpacing(spacingHint());

        QHBoxLayout *completionLayout = new QHBoxLayout(topLayout2);
        mGeneral->initCompletion(topFrame2, completionLayout);

        mGeneral->initAlarm(topFrame, topLayout);

        mGeneral->initSecrecy(topFrame2, topLayout2);
        mGeneral->initDescription(topFrame2, topLayout2);
    }
    else
    {
        QFrame *topFrame = addPage(i18n("&General"));

        QBoxLayout *topLayout = new QVBoxLayout(topFrame);
        topLayout->setSpacing(spacingHint());

        mGeneral->initHeader(topFrame, topLayout);
        mGeneral->initTime(topFrame, topLayout);
        mGeneral->initStatus(topFrame, topLayout);
        QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
        mGeneral->initAlarm(topFrame, alarmLineLayout);
        alarmLineLayout->addStretch(1);
        mGeneral->initDescription(topFrame, topLayout);
        mGeneral->initAttachments(topFrame, topLayout);
        connect(mGeneral, SIGNAL(openURL(const KURL &)),
                this, SLOT(openURL(const KURL &)));
        connect(this, SIGNAL(signalAddAttachments(const QStringList &, const QStringList &, bool)),
                mGeneral, SLOT(addAttachments(const QStringList &, const QStringList &, bool)));
    }
    mGeneral->enableAlarm(true);

    mGeneral->finishSetup();
}
Esempio n. 6
0
GTrans::GTrans() {
    QLayout *mainLayout = new QVBoxLayout;

    // The input section
    QLayout *top = new QHBoxLayout;
    QBoxLayout *tl = new QVBoxLayout;
    QLabel *inLabel = new QLabel(tr("Input:"));
    fromLang = new QComboBox;
    tl->addWidget(inLabel);
    tl->addSpacing(10);
    tl->addWidget(fromLang);
    tl->addStretch();
    top->addItem(tl);
    inputTxt = new QTextEdit;

    top->addWidget(inputTxt);

    // The output section
    QLayout *bottom = new QHBoxLayout;
    QBoxLayout *bl = new QVBoxLayout;
    QLabel *outLabel = new QLabel(tr("Output:"));
    toLang = new QComboBox;
    bl->addWidget(outLabel);
    bl->addSpacing(10);
    bl->addWidget(toLang);
    bl->addStretch();
    bottom->addItem(bl);
    outputTxt = new QTextEdit;
    outputTxt->setReadOnly(true);
    bottom->addWidget(outputTxt);

    mainLayout->addItem(top);
    mainLayout->addItem(bottom);

    // Translate button
    trans_b = new QPushButton(tr("Translate"));
    mainLayout->addWidget(trans_b);

    fillInLanguages();

    setLayout(mainLayout);
    setWindowTitle(tr("Translate"));
    
    trans_b->setDefault(true);
    connect(trans_b, SIGNAL(clicked()), this, SLOT(doTrans()));

    // Setup foxus and tab order.
    inputTxt->setTabChangesFocus(true);
    inputTxt->setFocus(Qt::ActiveWindowFocusReason);
    setTabOrder(inputTxt, toLang);
    setTabOrder(toLang, trans_b);
    setTabOrder(trans_b, fromLang);
    setTabOrder(fromLang, inputTxt);
    outputTxt->setFocusProxy(trans_b);
}
Esempio n. 7
0
static void addToolBarToLayout( QMainWindowPrivate::ToolBarDock * dock,
				QBoxLayout * tl,
				QBoxLayout::Direction direction,
				QBoxLayout::Direction dockDirection,
				bool mayNeedDockLayout,
				bool justify,
				GUIStyle style )
{
    if ( !dock || dock->isEmpty() )
	return;

    bool moreThanOneRow = FALSE;
    bool anyToolBars = FALSE;

    dock->first();
    while ( dock->next() ) {
	if ( dock->current()->nl ) {
	    moreThanOneRow = TRUE;
	    break;
	}
    }

    QBoxLayout * dockLayout;
    if ( mayNeedDockLayout && moreThanOneRow ) {
	dockLayout = new QBoxLayout( dockDirection );
	tl->addLayout( dockLayout );
    } else {
	dockLayout = tl;
    }

    QBoxLayout * toolBarRowLayout = 0;
    QMainWindowPrivate::ToolBar * t = dock->first();
    do {
	if ( !toolBarRowLayout || t->nl ) {
	    if ( toolBarRowLayout ) {
		if ( !justify )
		    toolBarRowLayout->addStretch( 1 );
	    }
	    toolBarRowLayout = new QBoxLayout( direction );
	    dockLayout->addLayout( toolBarRowLayout, 0 );
	}
	if ( t->t->isVisible() && !t->t->testWFlags( WState_DoHide ) ) {
	    toolBarRowLayout->addWidget( t->t, 0 );
	    anyToolBars = TRUE;
	}
    } while ( (t=dock->next()) != 0 );

    if ( anyToolBars && style == MotifStyle )
	dockLayout->addSpacing( 2 );

    if ( toolBarRowLayout && (!justify || !anyToolBars) )
	toolBarRowLayout->addStretch( 1 );
}
Esempio n. 8
0
GreetingPage::GreetingPage( QWidget* parent )
    : QWidget()
{
    QBoxLayout *mainLayout = new QHBoxLayout;
    setLayout( mainLayout );

    QLabel* text = new QLabel( tr( "<h1>Welcome to Calamares.</h1><br/>"
                                   "This is some random welcome text. "
                                   "It should change depending on the branding config." ), this );
    text->setAlignment( Qt::AlignCenter );

    mainLayout->addStretch();
    mainLayout->addWidget( text );
    mainLayout->addStretch();
}
Esempio n. 9
0
gtImporterDialog::gtImporterDialog(const QStringList& importers, int currentSelection)
{
	setWindowTitle( tr("Choose the importer to use"));
	setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));

	QBoxLayout* layout = new QVBoxLayout(this);

	QBoxLayout* llayout = new QHBoxLayout;
	llayout->setMargin(5);
	llayout->setSpacing(5);
	QLabel* label = new QLabel( tr("Choose the importer to use"), this);
	llayout->addWidget(label);
	layout->addLayout(llayout);

	QBoxLayout* ilayout = new QHBoxLayout;
	ilayout->setMargin(5);
	ilayout->setSpacing(5);
	importerCombo = new ScComboBox(this);
	importerCombo->setMinimumSize(QSize(150, 0));
	importerCombo->setToolTip( tr("Choose the importer to use"));
	importerCombo->addItems(importers);
	if (static_cast<int>(importers.count()) > currentSelection)
		importerCombo->setCurrentIndex(currentSelection);
	else
		importerCombo->setCurrentIndex(0);
	ilayout->addWidget(importerCombo);
	layout->addLayout(ilayout);

	QBoxLayout* dlayout = new QHBoxLayout;
	dlayout->setMargin(5);
	dlayout->setSpacing(5);
	rememberCheck = new QCheckBox( tr("Remember association"), this);
	rememberCheck->setChecked(false);
	rememberCheck->setToolTip( "<qt>" + tr("Remember the file extension - importer association and do not ask again to select an importer for files of this type.") + "</qt>" );
	dlayout->addStretch(10);
	dlayout->addWidget(rememberCheck);
	layout->addLayout(dlayout);

	QBoxLayout* blayout = new QHBoxLayout;
	blayout->setMargin(5);
	blayout->setSpacing(5);
	blayout->addStretch(10);
	okButton = new QPushButton( CommonStrings::tr_OK, this);
	blayout->addWidget(okButton);
	layout->addLayout(blayout);

	connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
}
Esempio n. 10
0
int drv_boxlayout(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
    handle_head* head = (handle_head*)a0;
    QBoxLayout *self = (QBoxLayout*)head->native;
    switch (drvid) {
    case BOXLAYOUT_ADDLAYOUTWITH: {
        self->addLayout((QLayout*)drvGetNative(a1),drvGetInt(a2));
        break;
    }
    case BOXLAYOUT_ADDWIDGETWITH: {
        self->addWidget((QWidget*)drvGetNative(a1),drvGetInt(a2),Qt::Alignment(drvGetInt(a3)));
        break;
    }
    case BOXLAYOUT_ADDSPACING: {
        self->addSpacing(drvGetInt(a1));
        break;
    }
    case BOXLAYOUT_ADDSTRETCH: {
        self->addStretch(drvGetInt(a1));
        break;
    }
    default:
        return 0;
    }
    return 1;
}
Esempio n. 11
0
SettingsWidget::SettingsWidget( MainModel *model, QWidget *parent)
  : QWidget( parent ), m_model( model )
{
  QBoxLayout *topLayout = new QVBoxLayout( this );

  QBoxLayout *controlLayout = new QHBoxLayout;
  topLayout->addLayout( controlLayout );

  m_syncingCheck = new QCheckBox( i18n("Syncing enabled") );
  controlLayout->addWidget( m_syncingCheck );
  connect( m_syncingCheck, SIGNAL( stateChanged( int ) ),
    SLOT( slotSyncingCheckChanged() ) );

  QLabel *label = new QLabel;
  controlLayout->addWidget( label );
  connect( m_model, SIGNAL( syncingStatusChanged( const QString & ) ),
    label, SLOT( setText( const QString & ) ) );

  controlLayout->addStretch( 1 );

  QPushButton *button = new QPushButton( i18n("Hide Settings") );
  controlLayout->addWidget( button );
  connect( button, SIGNAL( clicked() ), SLOT( hide() ) );

  readConfig();
}
void NameStatWidget::configLeftArea(const StatisticsExtractor& statsExtractor)
{
    sitesCombo_->addItem("lenta.ru");
    fillNamesCombo(statsExtractor);

    QBoxLayout* leftLayout = new QBoxLayout(QBoxLayout::TopToBottom);
    leftLayout->addWidget(sitesCombo_);
    leftLayout->addWidget(namesCombo_);

    QIntValidator* pagesValidator = new QIntValidator(MinPagesCount, MaxPagesCount, this);
    pageCountEdit_->setValidator(pagesValidator); // Разрешим вводить в поле только цифры.
    QLabel* pages = new QLabel(tr("Страниц (шт):"));
    pages->setBuddy(pageCountEdit_);
    leftLayout->addWidget(pages);
    leftLayout->addWidget(pageCountEdit_);

    QLabel* labelFrom = new QLabel(tr("&От:"));
    labelFrom->setBuddy(beginPeriod_);
    leftLayout->addWidget(labelFrom);
    leftLayout->addWidget(beginPeriod_);

    QLabel* labelTo = new QLabel(tr("&До:"));
    labelTo->setBuddy(endPeriod_);
    leftLayout->addWidget(labelTo);
    leftLayout->addWidget(endPeriod_);

    leftLayout->addWidget(okBt_, 2, Qt::AlignRight);
    leftLayout->addStretch();
    leftGroup_->setLayout(leftLayout);

    connect(okBt_, &QPushButton::clicked, this, [&](){
        showResults(statsExtractor);
    });
}
Esempio n. 13
0
VidaliaExitWidget::VidaliaExitWidget(VidaliaConfigManager *vc, QWidget *parent)
    : QWidget(parent), vidaliaConfig(vc)
{
    QBoxLayout *layout = new QVBoxLayout(this);

    QLabel *title = new QLabel(tr("To continue, you must exit Vidalia"));
    title->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
    title->setStyleSheet(QLatin1String("font-size:13pt"));
    layout->addWidget(title);

    layout->addSpacing(20);

    QLabel *desc = new QLabel(tr("Look for the vidalia icon (<img src=':/graphics/vidalia-tray.png'>) in "
                                 "the system tray and choose to exit.<br>Anything currently using Tor (such "
                                 "as web downloads) will be interrupted."));
    desc->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
    layout->addWidget(desc);
    layout->addSpacing(30);

    QLabel *desc2 = new QLabel(tr("Configuration will continue automatically when Vidalia is closed."));
    desc2->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
    layout->addWidget(desc2);
    layout->addStretch();

    exitTimer = new QTimer(this);
    connect(exitTimer, SIGNAL(timeout()), SLOT(checkVidalia()));
    exitTimer->start(5000);
}
Esempio n. 14
0
//-----------------------------------------------------------------------------
About::About (QWidget * aParent, const char *aName, bool aInit)
  : AboutInherited(aParent, aName)
{
  QBoxLayout* box;
  QLabel* lbl;
  QFrame* frm;
  QString str;
  QFont fnt;

  if (aInit) return;

  box = new QVBoxLayout(this, 20, 6);

  lblTheme = new QLabel(" ", this);
  fnt = lblTheme->font();
  fnt.setPointSize(fnt.pointSize() * 1.2);
  lblTheme->setFont(fnt);
  lblTheme->setMinimumSize(lblTheme->sizeHint());
  lblTheme->setAutoResize(true);
  box->addWidget(lblTheme);

  lblVersion = new QLabel(" ", this);
  lblVersion->setMinimumSize(lblVersion->sizeHint());
  lblVersion->setAutoResize(true);
  box->addWidget(lblVersion);

  lblAuthor = new QLabel(" ", this);
  lblAuthor->setMinimumSize(lblAuthor->sizeHint());
  lblAuthor->setAutoResize(true);
  box->addWidget(lblAuthor);

  lblHomepage = new QLabel(" ", this);
  lblHomepage->setMinimumSize(lblHomepage->sizeHint());
  lblHomepage->setAutoResize(true);
  box->addWidget(lblHomepage);

  frm = new QFrame(this);
  frm->setFrameStyle(QFrame::HLine|QFrame::Raised);
  box->addSpacing(5);
  box->addWidget(frm);
  box->addSpacing(5);

  lbl = new QLabel(i18n("KDE Theme Manager"), this);
  lbl->setFont(fnt);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  str.sprintf(i18n("Version %s\n\n"
		   "Copyright (C) 1998 by\n%s\n\n"
		   "Gnu Public License (GPL)"),
	           KTHEME_VERSION, 
                   "Stefan Taferner <*****@*****.**>\n"
                   "Waldo Bastian <*****@*****.**>");
  lbl = new QLabel(str, this);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  box->addStretch(1000);
  box->activate();
}
Esempio n. 15
0
InfoPanel::InfoPanel(QWidget *parent) :QWidget(parent)
{
    #ifdef K_DEBUG
        #ifdef Q_OS_WIN
            qDebug() << "[InfoPanel()]";
        #else
            TINIT;
        #endif
    #endif

    QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);

    QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom);
    QLabel *label = new QLabel(tr("Tips"));
    label->setAlignment(Qt::AlignHCenter); 
    layout->addWidget(label);

    mainLayout->addLayout(layout);

    QTextEdit *textArea = new QTextEdit; 
    textArea->setFixedHeight(250);
    textArea->setHtml("<p><b>" + tr("X Key or Right Mouse Button") + ":</b> " + tr("Close line") + "</p>"); 
    mainLayout->addWidget(textArea);
   
    mainLayout->addStretch(2);
}
Esempio n. 16
0
CaptionFrame::CaptionFrame(QWidget *parent)
	: QFrame(parent)
{
	qfLogFuncFrame();
	setFrameShape(QFrame::StyledPanel);
	setFrameShadow(QFrame::Raised);
	QBoxLayout *ly = new QHBoxLayout(this);
	//ly->setMargin(0);
	ly->setContentsMargins(5, 1, 5, 1);
	ly->setSpacing(6);
	m_captionIconLabel = new QLabel();
		//captionLabel->setPixmap(icon.pixmap(32));
	ly->addWidget(m_captionIconLabel);

	m_captionLabel = new QLabel();
	ly->addWidget(m_captionLabel);
	ly->addStretch();
	m_closeButton = new QToolButton();
	m_closeButton->setVisible(false);
	QStyle *sty = style();
	m_closeButton->setIcon(sty->standardIcon(QStyle::SP_DialogDiscardButton));
	connect(m_closeButton, SIGNAL(clicked()), this, SIGNAL(closeButtonClicked()));
	m_closeButton->setAutoRaise(true);
	ly->addWidget(m_closeButton);
	setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
	//setFrameStyle(StyleDefault);
	connect(this, &CaptionFrame::alertChanged, this, &CaptionFrame::update);
}
QLayout* TransFuncEditorIntensityTexture::createButtonLayout() {
    QBoxLayout* buttonLayout;
    if (orientation_ == Qt::Vertical)
        buttonLayout = new QHBoxLayout();
    else
        buttonLayout = new QVBoxLayout();

    clearButton_ = new QToolButton();
    clearButton_->setIcon(QIcon(":/qt/icons/eraser.png"));
    clearButton_->setToolTip(tr("Reset to default transfer function"));

    loadButton_ = new QToolButton();
    loadButton_->setIcon(QIcon(":/qt/icons/open.png"));
    loadButton_->setToolTip(tr("Load transfer function"));

    saveButton_ = new QToolButton();
    saveButton_->setIcon(QIcon(":/qt/icons/save.png"));
    saveButton_->setToolTip(tr("Save transfer function"));

    repaintButton_ = new QToolButton();
    repaintButton_->setIcon(QIcon(":/qt/icons/view-refresh.png"));
    repaintButton_->setToolTip(tr("Repaint the volume rendering"));

    buttonLayout->setSpacing(0);
    buttonLayout->addWidget(clearButton_);
    buttonLayout->addWidget(loadButton_);
    buttonLayout->addWidget(saveButton_);
    buttonLayout->addWidget(repaintButton_);

    buttonLayout->addStretch();

    return buttonLayout;
}
Esempio n. 18
0
int main(int argc, char *argv[]) {
    QApplication app(argc, argv);

    QString filename("unknown");
    if (argc == 2) {
        filename = argv[1];
    }

    RWindow window;
    QBoxLayout *layout = qobject_cast<QBoxLayout *>(window.layout());

    QLabel heading("Could not open file.");
    heading.setFont(QFont("Liberation Serif", 30));
    layout->addWidget(&heading);

    layout->addStrut(8);

    QLabel detail(
        QString("The file %1 is of an unrecognized type and cannot be opened.")
        .arg(runcible::quote(filename)));
    detail.setFont(QFont("Liberation Serif", 12));
    detail.setWordWrap(true);
    layout->addWidget(&detail);

    layout->addStretch(1);

    QObject::connect(&window, SIGNAL(back()), &app, SLOT(quit()));

    window.showMessage("How unfortunate.");
    window.showMaximized();

    return app.exec();
}
void ResourceSelection::initGUI()
{
  QBoxLayout *topLayout = new QVBoxLayout( this );
  topLayout->setSpacing( KDialog::spacingHint() );
  QBoxLayout *buttonLayout = new QHBoxLayout();
  buttonLayout->setSpacing( KDialog::spacingHint() );
  topLayout->addLayout( buttonLayout );

  QLabel *abLabel = new QLabel( i18n( "Address Books" ), this );
  buttonLayout->addWidget( abLabel );
  buttonLayout->addStretch( 1 );

  mAddButton = new QToolButton( this );
  mAddButton->setIcon( KIcon( "list-add" ) );
  mAddButton->setToolTip( i18n( "Add address book" ) );
  buttonLayout->addWidget( mAddButton );
  mEditButton = new QToolButton( this );
  mEditButton->setIcon( KIcon( "document-properties" ) );
  mEditButton->setEnabled( false );
  mEditButton->setToolTip( i18n( "Edit address book settings" ) );
  buttonLayout->addWidget( mEditButton );
  mRemoveButton = new QToolButton( this );
  mRemoveButton->setIcon( KIcon( "edit-delete" ) );
  mRemoveButton->setEnabled( false );
  mRemoveButton->setToolTip( i18n( "Remove address book" ) );
  buttonLayout->addWidget( mRemoveButton );

  mListView = new QTreeWidget( this );
  mListView->setRootIsDecorated( false );
  mListView->setHeaderLabel( i18n( "Address Books" ) );
  mListView->header()->hide();
  topLayout->addWidget( mListView );
}
Esempio n. 20
0
LinkerTab::LinkerTab( QWidget * parent, const char * name )
    : QWidget(parent, name), radioController(new FlagRadioButtonController()),
      pathController(new FlagPathEditController()),
      editController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *map_group = new QVButtonGroup(i18n("Map File"), this);
    QRadioButton *m_defaultMap = new QRadioButton(i18n("Off"), map_group);
    m_defaultMap->setChecked(true);
    new FlagRadioButton(map_group, radioController,
                        "-GS", i18n("Segments"));
    new FlagRadioButton(map_group, radioController,
                        "-GP", i18n("Publics"));
    new FlagRadioButton(map_group, radioController,
                        "-GD", i18n("Detailed"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagPathEdit(this, "", pathController,
                     "--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
                     "-$M", i18n("Reserved address space:"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    layout->addStretch();
}
Esempio n. 21
0
void NewslineWidget::setItems(const QList<NewsItemData>& Items)
{
  QBoxLayout* Layout = dynamic_cast<QBoxLayout*>(ui->NewslineContents->layout());
  QLayoutItem* LayoutItem;

  while ((LayoutItem = Layout->takeAt(0)) != NULL)
  {
    if (LayoutItem->widget() != NULL)
      LayoutItem->widget()->deleteLater();

    delete LayoutItem;
  }


  bool isFirst = true;

  foreach (NewsItemData IData, Items)
  {
    if (isFirst) isFirst = false;
    else
    {
      QFrame* SepFrame = new QFrame(this);
      SepFrame->setFrameShape(QFrame::HLine);
      SepFrame->setStyleSheet("color : grey;");
      Layout->addWidget(SepFrame);
    }
    Layout->addWidget(new NewsItemWidget(IData,this));
  }

  Layout->addStretch();
}
Esempio n. 22
0
void GNumericalExpression::PopulateDeviceWidget(GDeviceWidget* theDeviceWidget)
{
	QBoxLayout* pDeviceLayout = new QVBoxLayout();
	theDeviceWidget->AddSubLayout(pDeviceLayout);
	pDeviceLayout->setContentsMargins(1, 1, 1, 1);
	pDeviceLayout->setSpacing(1);

	QBoxLayout* pVariablesAndValueLayout = new QHBoxLayout();
	QBoxLayout* pExpressionLayout = new QVBoxLayout();
	pExpressionLayout->addWidget(m_Expression.ProvideNewParamLineEdit(theDeviceWidget));
	pExpressionLayout->addWidget(m_Expression.ProvideNewLabel(theDeviceWidget));

	pVariablesAndValueLayout->addWidget(m_VariableBucket.ProvideNewParamWidget(theDeviceWidget));
	pVariablesAndValueLayout->addWidget(m_ValueBucket.ProvideNewParamWidget(theDeviceWidget));

//	QPushButton* pSettingsButton = new QPushButton("Settings");
//	GNumericalExpressionSettingsWidget* pSettingsWindow = new GNumericalExpressionSettingsWidget(this);
//	connect(pSettingsButton, SIGNAL(clicked(bool)), pSettingsWindow, SLOT(show()));
//	pVariablesAndValueLayout->insertWidget(1, pSettingsButton);

	pDeviceLayout->addLayout(pExpressionLayout);
	pDeviceLayout->addLayout(pVariablesAndValueLayout);

	pDeviceLayout->addStretch();
}
Esempio n. 23
0
void MiniProgrammerUI::setVertical(bool vertical)
{
    if(m_isVertical == vertical)
        return;

    m_isVertical = vertical;

    QBoxLayout *from = ui->horLayout;
    QBoxLayout *to = ui->vertLayout;

    if(!vertical)
        std::swap(from, to);

    while(from->count() != 0)
    {
        QLayoutItem *i = from->takeAt(0);
        if(i->layout())
        {
            i->layout()->setParent(0);
            to->addLayout(i->layout());
        }
        else
            to->addItem(i);
    }

    delete to->takeAt(to->count()-1);
    to->addStretch(1);
}
Esempio n. 24
0
OdtDialog::OdtDialog(bool update, bool prefix, bool pack) : QDialog(0)
{
    setModal(true);
    setWindowIcon(QIcon(IconManager::instance()->loadIcon ( "AppIcon.png" )));
    setWindowTitle( tr("OpenDocument Importer Options"));

    QBoxLayout* layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);

    QBoxLayout* hlayout = new QHBoxLayout;
    hlayout->setMargin(5);
    hlayout->setSpacing(5);
    updateCheck = new QCheckBox( tr("Overwrite Paragraph Styles"), this);
    updateCheck->setChecked(update);
    updateCheck->setToolTip( "<qt>" + tr("Enabling this will overwrite existing styles in the current Scribus document") + "</qt>");
    hlayout->addWidget(updateCheck);
    layout->addLayout(hlayout);

    QBoxLayout* palayout = new QHBoxLayout;
    palayout->setMargin(5);
    palayout->setSpacing(5);
    packCheck = new QCheckBox( tr("Merge Paragraph Styles"), this);
    packCheck->setChecked(pack);
    packCheck->setToolTip( "<qt>" + tr("Merge paragraph styles by attributes. This will result in fewer similar paragraph styles, will retain style attributes, even if the original document's styles are named differently.") +"</qt>");
    palayout->addWidget(packCheck);
    layout->addLayout(palayout);

    QBoxLayout* playout = new QHBoxLayout;
    playout->setMargin(5);
    playout->setSpacing(5);
    prefixCheck = new QCheckBox( tr("Use document name as a prefix for paragraph styles"), this);
    prefixCheck->setChecked(prefix);
    prefixCheck->setToolTip( "<qt>" + tr("Prepend the document name to the paragraph style name in Scribus") +"</qt>");
    playout->addWidget(prefixCheck);
    layout->addLayout(playout);

    QBoxLayout* dlayout = new QHBoxLayout;
    dlayout->setMargin(5);
    dlayout->setSpacing(5);
    doNotAskCheck = new QCheckBox( tr("Do not ask again"), this);
    doNotAskCheck->setChecked(false);
    doNotAskCheck->setToolTip( "<qt>" + tr("Make these settings the default and do not prompt again when importing an OASIS OpenDocument") +"</qt>");
    //dlayout->addStretch(10);
    dlayout->addWidget(doNotAskCheck);
    layout->addLayout(dlayout);

    QBoxLayout* blayout = new QHBoxLayout;
    blayout->setMargin(5);
    blayout->setSpacing(5);
    blayout->addStretch(10);
    okButton = new QPushButton( tr("OK"), this);
    blayout->addWidget(okButton);
    cancelButton = new QPushButton( tr("Cancel"), this);
    blayout->addWidget(cancelButton);
    layout->addLayout(blayout);

    connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}
Esempio n. 25
0
FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( QWidget * parent, const char * name )
    :QWidget(parent, name), controller(new FlagCheckBoxController()),
    pathController(new FlagPathEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, "", pathController,
                     "-FE", i18n("Write executables and units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-FU", i18n("Write units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-o", i18n("Executable name:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-e", i18n("Location of as and ld programs:"));
    new FlagPathEdit(this, "", pathController,
                     "-FL", i18n("Dynamic linker executable:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-Fr", i18n("Compiler messages file:"), KFile::File);
    new FlagPathEdit(this, "", pathController,
                     "-Fe", i18n("Write compiler messages to file:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
Esempio n. 26
0
ShowAwayMsgDlg::ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager* _sigman,
  const char *szId, unsigned long nPPID, QWidget *parent)
  : LicqDialog(parent, "ShowAwayMessageDialog")
{
  m_szId = szId ? strdup(szId) : 0;
  m_nPPID = nPPID;
  sigman = _sigman;
  server = _server;

  QBoxLayout* top_lay = new QVBoxLayout(this, 10);
  mleAwayMsg = new MLEditWrap(true, this);
  // ICQ99b allows 37 chars per line, so we do the same
  //mleAwayMsg->setWordWrap(QMultiLineEditNew::FixedColumnWidth);
  //mleAwayMsg->setWrapColumnOrWidth(37);
  mleAwayMsg->setReadOnly(true);
  mleAwayMsg->setMinimumSize(230, 110);
  connect(mleAwayMsg, SIGNAL(signal_CtrlEnterPressed()), SLOT(accept()));
  top_lay->addWidget(mleAwayMsg);

  QBoxLayout* lay = new QHBoxLayout(top_lay, 10);

  chkShowAgain = new QCheckBox(tr("&Show Again"), this);
  lay->addWidget(chkShowAgain);

  lay->addStretch(1);
  lay->addSpacing(30);

  ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R);
  QTextCodec * codec = UserCodec::codecForICQUser(u);
//  chkShowAgain->setChecked(u->ShowAwayMsg());

  setCaption(QString(tr("%1 Response for %2")).arg(u->StatusStr()).arg(QString::fromUtf8(u->GetAlias())));

  btnOk = new QPushButton(tr("&Ok"), this);
  btnOk->setMinimumWidth(75);
  btnOk->setDefault(true);
  btnOk->setFocus();
  connect(btnOk, SIGNAL(clicked()), SLOT(accept()));
  lay->addWidget(btnOk);

  // Check if this is an active request or not
  if (sigman == NULL || server == NULL)
  {
    mleAwayMsg->setText(codec->toUnicode(u->AutoResponse()));
    gUserManager.DropUser(u);
    icqEventTag = 0;
  }
  else
  {
    bool bSendServer = (u->SocketDesc(ICQ_CHNxNONE) <= 0 && u->Version() > 6);
    gUserManager.DropUser(u);
    mleAwayMsg->setEnabled(false);
    mleAwayMsg->setBackgroundMode(PaletteBackground);
    connect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(doneEvent(ICQEvent *)));
    icqEventTag = server->icqFetchAutoResponse(szId, nPPID, bSendServer);
  }

  show();
}
QmitkNewSegmentationDialog::QmitkNewSegmentationDialog(QWidget* parent)
:QDialog(parent), // true, modal
 selectedOrgan("undefined"),
 newOrganEntry(false)
{
  QDialog::setFixedSize(250, 105);

  QBoxLayout * verticalLayout = new QVBoxLayout( this );
  verticalLayout->setMargin(5);
  verticalLayout->setSpacing(5);

  mitk::OrganTypeProperty::Pointer organTypes = mitk::OrganTypeProperty::New();

  // to enter a name for the segmentation
  lblPrompt = new QLabel( "Name and color of the segmentation", this );
  verticalLayout->addWidget( lblPrompt );

  // to choose a color
  btnColor = new QPushButton( "", this );
  btnColor->setFixedWidth(25);
  btnColor->setAutoFillBackground(true);
  btnColor->setStyleSheet("background-color:rgb(255,0,0)");

  connect( btnColor, SIGNAL(clicked()), this, SLOT(onColorBtnClicked()) );

  edtName = new QLineEdit( "", this );
  QStringList completionList;
  completionList << "";
  completer = new QCompleter(completionList);
  completer->setCaseSensitivity(Qt::CaseInsensitive);
  edtName->setCompleter(completer);

  connect( completer, SIGNAL(activated(const QString&)), this, SLOT(onColorChange(const QString&)) );

  QBoxLayout * horizontalLayout2 = new QHBoxLayout();
  verticalLayout->addLayout(horizontalLayout2);
  horizontalLayout2->addWidget( btnColor );
  horizontalLayout2->addWidget( edtName );



  //buttons for closing the dialog
  btnOk = new QPushButton( tr("Ok"), this );
  btnOk->setDefault(true);
  connect( btnOk, SIGNAL(clicked()), this, SLOT(onAcceptClicked()) );

  QPushButton* btnCancel = new QPushButton( tr("Cancel"), this );
  connect( btnCancel, SIGNAL(clicked()), this, SLOT(reject()) );

  QBoxLayout * horizontalLayout = new QHBoxLayout();
  verticalLayout->addLayout(horizontalLayout);
  horizontalLayout->setSpacing(5);
  horizontalLayout->addStretch();
  horizontalLayout->addWidget( btnOk );
  horizontalLayout->addWidget( btnCancel );

  edtName->setFocus();
}
Esempio n. 28
0
SpeedDialWidget::SpeedDialWidget(QWidget* parent, Qt::WindowFlags flags)
    : QWidget(parent, flags)
    , m_fadeIn(NULL)
    , m_fadeOut(NULL)
    , m_hold(NULL)
    , m_optionalTextGroup(NULL)
    , m_optionalTextEdit(NULL)
{
    QSettings settings;
    QVariant var;
    QBoxLayout* lay = NULL;

    /* Layout with customizable direction */
    var = settings.value(SETTINGS_DIRECTION);
    if (var.isValid() == true)
        lay = new QBoxLayout(QBoxLayout::Direction(var.toInt()), this);
    else
        lay = new QBoxLayout(QBoxLayout::TopToBottom, this);

    /* Create dials */
    m_fadeIn = new SpeedDial(this);
    m_fadeIn->setTitle(tr("Fade In"));
    layout()->addWidget(m_fadeIn);
    connect(m_fadeIn, SIGNAL(valueChanged(int)), this, SIGNAL(fadeInChanged(int)));
    connect(m_fadeIn, SIGNAL(tapped()), this, SIGNAL(fadeInTapped()));

    m_fadeOut = new SpeedDial(this);
    m_fadeOut->setTitle(tr("Fade Out"));
    layout()->addWidget(m_fadeOut);
    connect(m_fadeOut, SIGNAL(valueChanged(int)), this, SIGNAL(fadeOutChanged(int)));
    connect(m_fadeOut, SIGNAL(tapped()), this, SIGNAL(fadeOutTapped()));

    m_hold = new SpeedDial(this);
    m_hold->setTitle(tr("Hold"));
    layout()->addWidget(m_hold);
    connect(m_hold, SIGNAL(valueChanged(int)), this, SIGNAL(holdChanged(int)));
    connect(m_hold, SIGNAL(tapped()), this, SIGNAL(holdTapped()));

    /* Optional text */
    m_optionalTextGroup = new QGroupBox(this);
    layout()->addWidget(m_optionalTextGroup);
    new QVBoxLayout(m_optionalTextGroup);
    m_optionalTextEdit = new QLineEdit(m_optionalTextGroup);
    m_optionalTextGroup->layout()->addWidget(m_optionalTextEdit);
    m_optionalTextGroup->setVisible(false);
    connect(m_optionalTextEdit, SIGNAL(textEdited(const QString&)),
            this, SIGNAL(optionalTextEdited(const QString&)));

    lay->addStretch();

    /* Position */
    var = settings.value(SETTINGS_GEOMETRY);
    if (var.isValid() == true)
        this->restoreGeometry(var.toByteArray());
    AppUtil::ensureWidgetIsVisible(this);
}
Esempio n. 29
0
void KOEditorGeneralTodo::initStatus(QWidget *parent, QBoxLayout *topLayout)
{
    QBoxLayout *statusLayout = new QHBoxLayout(topLayout);

    initCompletion(parent, statusLayout);

    statusLayout->addStretch(1);

    initPriority(parent, statusLayout);
}
Esempio n. 30
0
DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
      radioController(new FlagRadioButtonController)
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    QVButtonGroup *optim_group = new QVButtonGroup(i18n("Optimization"), this);
    new FlagCheckBox(optim_group, controller,
                     "'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
    layout->addWidget(optim_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());

    QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
    new FlagCheckBox(debug_group, controller,
                     "'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
    new FlagCheckBox(debug_group, controller,
                     "'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
    gdb = new FlagCheckBox(debug_group, controller,
                           "-V", i18n("Debug information for GDB"));
    namespacedb = new FlagCheckBox(debug_group, controller,
                                   "-VN", i18n("Namespace debug info"));
    symboldb = new FlagCheckBox(debug_group, controller,
                                "-VR", i18n("Write symbol info in an .rsm file"));
    layout2->addWidget(debug_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    QVButtonGroup *debug_add = new QVButtonGroup(i18n("Symbol Reference Information"), this);
    QRadioButton *m_default = new QRadioButton(i18n("Default (-$YD)"), debug_add);
    m_default->setChecked(true);
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y-'", i18n("No information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$YD'", i18n("Definition information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y+'", i18n("Full reference information"));
    layout2->addWidget(debug_add);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QHBoxLayout *layout3 = new QHBoxLayout(layout, KDialog::spacingHint());
    QPushButton *release = new QPushButton(i18n("Release"), this);
    QPushButton *debug = new QPushButton(i18n("Debug"), this);
    layout3->addWidget(release);
    layout3->addWidget(debug);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
    connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));

    layout->addStretch();
}