Beispiel #1
0
void SettingsWindow::genCustomise()
{
    QLabel *lblBgColor = new QLabel(tr("Background color"));
    lblBgColor->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
    editBgColor = new QLineEdit;
    editBgColor->setEnabled(false);
    editBgColor->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    QToolButton *btnBgColor = new QToolButton;
    btnBgColor->setText(tr("Change color"));
    btnBgColor->setIcon(QIcon(":/img/config.png"));
    btnBgColor->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    btnBgColor->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
    connect(btnBgColor,SIGNAL(clicked()),this,SLOT(chooseColor()));

    QLabel *lblBgImageMain = new QLabel(tr("Background image of the main window"));
    editBgImageMain = new QLineEdit;
    editBgImageMain->setEnabled(false);
    editBgImageMain->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    btnBgImageMain = new QToolButton;
    btnBgImageMain->setText(tr("Explore"));
    btnBgImageMain->setIcon(QIcon(":/img/config.png"));
    btnBgImageMain->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    btnBgImageMain->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
    connect(btnBgImageMain,SIGNAL(clicked()),this,SLOT(chooseBgImage()));

    QLabel *lblBgImageLock = new QLabel(tr("Background image of the lock screen"));
    editBgImageLock = new QLineEdit;
    editBgImageLock->setEnabled(false);
    editBgImageLock->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    btnBgImageLock = new QToolButton;
    btnBgImageLock->setText(tr("Explore"));
    btnBgImageLock->setIcon(QIcon(":/img/config.png"));
    btnBgImageLock->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    btnBgImageLock->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
    connect(btnBgImageLock,SIGNAL(clicked()),this,SLOT(chooseBgImage()));

    QLabel *lblAnimation = new QLabel(tr("Animations Effects / Transitions"));
    checkAnimation = new QCheckBox(tr("Enable"));
    checkAnimation->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);

    QGridLayout *layCustomise = new QGridLayout;
    layCustomise->setContentsMargins(10,10,10,10);
    layCustomise->setSpacing(10);

    layCustomise->addWidget(lblAnimation,0,0);
    layCustomise->addWidget(checkAnimation,0,1,1,2);

    layCustomise->addWidget(lblBgColor,1,0);
    layCustomise->addWidget(editBgColor,1,1);
    layCustomise->addWidget(btnBgColor,1,2);

    layCustomise->addWidget(lblBgImageMain,2,0);
    layCustomise->addWidget(editBgImageMain,2,1);
    layCustomise->addWidget(btnBgImageMain,2,2);

    layCustomise->addWidget(lblBgImageLock,3,0);
    layCustomise->addWidget(editBgImageLock,3,1);
    layCustomise->addWidget(btnBgImageLock,3,2);

    QGroupBox *boxCustomize = new QGroupBox(tr("Customize"));
    boxCustomize->setLayout(layCustomise);

    // ----------------------------

    previewBgImageMain = new QToolButton;
    previewBgImageMain->setText(tr("Background image of the main window"));
    previewBgImageMain->setIconSize(QSize(400,300));
    previewBgImageMain->setIcon(QIcon(":/img/file.png"));
    previewBgImageMain->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    previewBgImageMain->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    connect(previewBgImageMain,SIGNAL(clicked()),this,SLOT(chooseBgImage()));

    previewBgImageLock = new QToolButton;
    previewBgImageLock->setText(tr("Background image of the lock screen"));
    previewBgImageLock->setIconSize(QSize(400,300));
    previewBgImageLock->setIcon(QIcon(":/img/file.png"));
    previewBgImageLock->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    previewBgImageLock->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    connect(previewBgImageLock,SIGNAL(clicked()),this,SLOT(chooseBgImage()));

    QGridLayout *layBgImageMain = new QGridLayout;
    layBgImageMain->setContentsMargins(10,10,10,10);
    layBgImageMain->setSpacing(10);

    layBgImageMain->addWidget(previewBgImageMain,0,0);
    layBgImageMain->addWidget(previewBgImageLock,0,1);

    HideBlock *boxBgImage = new HideBlock(tr("Background images preview"));
    boxBgImage->setBlockLayout(layBgImageMain);

    // ----------------------------

    QWidget *spacer = new QWidget;
    spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(boxCustomize,0,0);
    mainLayout->addWidget(boxBgImage,1,0);
    mainLayout->addWidget(spacer,2,0);

    tabCustomise = new SettingsPanel;
    tabCustomise->setTitle(tr("Customise"));
    tabCustomise->setMainLayout(mainLayout);
}
MailingListFolderPropertiesDialog::MailingListFolderPropertiesDialog(QWidget *parent, KMFolder *folder)
    : KDialogBase(parent, "mailinglist_properties", false, i18n("Mailinglist Folder Properties"),
                  KDialogBase::Ok | KDialogBase::Cancel,
                  KDialogBase::Ok, true),
      mFolder(folder)
{
    setWFlags(getWFlags() | WDestructiveClose);
    QLabel *label;
    mLastItem = 0;

    QVBoxLayout *topLayout = new QVBoxLayout(layout(), spacingHint(),
            "topLayout");

    QGroupBox *mlGroup = new QGroupBox(i18n("Associated Mailing List"), this);
    mlGroup->setColumnLayout(0,  Qt::Vertical);
    QGridLayout *groupLayout = new QGridLayout(mlGroup->layout(), 6, 3, spacingHint());
    topLayout->addWidget(mlGroup);
    setMainWidget(mlGroup);

    mHoldsMailingList = new QCheckBox(i18n("&Folder holds a mailing list"), mlGroup);
    QObject::connect(mHoldsMailingList, SIGNAL(toggled(bool)),
                     SLOT(slotHoldsML(bool)));
    groupLayout->addMultiCellWidget(mHoldsMailingList, 0, 0, 0, 2);

    groupLayout->addItem(new QSpacerItem(0, 10), 1, 0);

    mDetectButton = new QPushButton(i18n("Detect Automatically"), mlGroup);
    mDetectButton->setEnabled(false);
    QObject::connect(mDetectButton, SIGNAL(pressed()), SLOT(slotDetectMailingList()));
    groupLayout->addWidget(mDetectButton, 2, 1);

    groupLayout->addItem(new QSpacerItem(0, 10), 3, 0);

    label = new QLabel(i18n("Mailing list description:"), mlGroup);
    label->setEnabled(false);
    QObject::connect(mHoldsMailingList, SIGNAL(toggled(bool)),
                     label, SLOT(setEnabled(bool)));
    groupLayout->addWidget(label, 4, 0);
    mMLId = new QLabel(label, "", mlGroup);
    groupLayout->addMultiCellWidget(mMLId, 4, 4, 1, 2);
    mMLId->setEnabled(false);

    //FIXME: add QWhatsThis
    label = new QLabel(i18n("Preferred handler:"), mlGroup);
    label->setEnabled(false);
    QObject::connect(mHoldsMailingList, SIGNAL(toggled(bool)),
                     label, SLOT(setEnabled(bool)));
    groupLayout->addWidget(label, 5, 0);
    mMLHandlerCombo = new QComboBox(mlGroup);
    mMLHandlerCombo->insertItem(i18n("KMail"), MailingList::KMail);
    mMLHandlerCombo->insertItem(i18n("Browser"), MailingList::Browser);
    mMLHandlerCombo->setEnabled(false);
    groupLayout->addMultiCellWidget(mMLHandlerCombo, 5, 5, 1, 2);
    QObject::connect(mMLHandlerCombo, SIGNAL(activated(int)),
                     SLOT(slotMLHandling(int)));
    label->setBuddy(mMLHandlerCombo);

    label = new QLabel(i18n("&Address type:"), mlGroup);
    label->setEnabled(false);
    QObject::connect(mHoldsMailingList, SIGNAL(toggled(bool)),
                     label, SLOT(setEnabled(bool)));
    groupLayout->addWidget(label, 6, 0);
    mAddressCombo = new QComboBox(mlGroup);
    label->setBuddy(mAddressCombo);
    groupLayout->addWidget(mAddressCombo, 6, 1);
    mAddressCombo->setEnabled(false);

    //FIXME: if the mailing list actions have either KAction's or toolbar buttons
    //       associated with them - remove this button since it's really silly
    //       here
    QPushButton *handleButton = new QPushButton(i18n("Invoke Handler"), mlGroup);
    handleButton->setEnabled(false);
    if(mFolder)
    {
        QObject::connect(mHoldsMailingList, SIGNAL(toggled(bool)),
                         handleButton, SLOT(setEnabled(bool)));
        QObject::connect(handleButton, SIGNAL(clicked()),
                         SLOT(slotInvokeHandler()));
    }
    groupLayout->addWidget(handleButton, 6, 2);

    mEditList = new KEditListBox(mlGroup);
    mEditList->setEnabled(false);
    groupLayout->addMultiCellWidget(mEditList, 7, 7, 0, 3);

    QStringList el;

    //Order is important because the activate handler and fillMLFromWidgets
    //depend on it
    el << i18n("Post to List")
       << i18n("Subscribe to List")
       << i18n("Unsubscribe from List")
       << i18n("List Archives")
       << i18n("List Help");
    mAddressCombo->insertStringList(el);
    QObject::connect(mAddressCombo, SIGNAL(activated(int)),
                     SLOT(slotAddressChanged(int)));

    load();
    resize(QSize(295, 204).expandedTo(minimumSizeHint()));
    clearWState(WState_Polished);
}
void JabberCreateAccountWidget::createGui(bool showButtons)
{
	QVBoxLayout *mainLayout = new QVBoxLayout(this);

	QWidget *formWidget = new QWidget(this);
	mainLayout->addWidget(formWidget);

	QFormLayout *layout = new QFormLayout(formWidget);

	QWidget *jidWidget = new QWidget(this);
	QGridLayout *jidLayout = new QGridLayout(jidWidget);
	jidLayout->setSpacing(0);
	jidLayout->setMargin(0);
	jidLayout->setColumnStretch(0, 2);
	jidLayout->setColumnStretch(2, 2);

	Username = new QLineEdit(this);
	connect(Username, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	jidLayout->addWidget(Username);

	QLabel *atLabel = new QLabel("@", this);
	jidLayout->addWidget(atLabel, 0, 1);

	Domain = new QComboBox();
	Domain->setEditable(true);
	connect(Domain, SIGNAL(currentIndexChanged(QString)), this, SLOT(dataChanged()));
	connect(Domain, SIGNAL(editTextChanged(QString)), this, SLOT(dataChanged()));
	jidLayout->addWidget(Domain, 0, 2);

	layout->addRow(tr("Username") + ':', jidWidget);

	NewPassword = new QLineEdit(this);
	connect(NewPassword, SIGNAL(textEdited(const QString &)), this, SLOT(dataChanged()));
	NewPassword->setEchoMode(QLineEdit::Password);
	layout->addRow(tr("Password") + ':', NewPassword);

	ReNewPassword = new QLineEdit(this);
	connect(ReNewPassword, SIGNAL(textEdited(const QString &)), this, SLOT(dataChanged()));
	ReNewPassword->setEchoMode(QLineEdit::Password);
	layout->addRow(tr("Retype Password") + ':', ReNewPassword);

	RememberPassword = new QCheckBox(tr("Remember password"), this);
	layout->addWidget(RememberPassword);

	IdentityCombo = new IdentitiesComboBox(true, this);
	connect(IdentityCombo, SIGNAL(identityChanged(Identity)), this, SLOT(dataChanged()));
	layout->addRow(tr("Account Identity") + ':', IdentityCombo);

	QLabel *infoLabel = new QLabel(tr("<font size='-1'><i>Select or enter the identity that will be associated with this account.</i></font>"), this);
	infoLabel->setWordWrap(true);
	infoLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
	infoLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
	layout->addRow(0, infoLabel);

	QLabel *moreOptionsLabel = new QLabel;
	moreOptionsLabel->setText(tr("More options:"));

	ExpandConnectionOptionsButton = new QPushButton(">");
	ExpandConnectionOptionsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	connect(ExpandConnectionOptionsButton, SIGNAL(clicked()), this, SLOT(connectionOptionsChanged()));

	QWidget *moreOptions = new QWidget;
	QHBoxLayout *moreOptionsLayout = new QHBoxLayout(moreOptions);
	moreOptionsLayout->addWidget(moreOptionsLabel);
	moreOptionsLayout->addWidget(ExpandConnectionOptionsButton);
	moreOptionsLayout->setAlignment(ExpandConnectionOptionsButton, Qt::AlignLeft);
	moreOptionsLayout->insertStretch(-1);
	moreOptions->setLayout(moreOptionsLayout);

	mainLayout->addWidget(moreOptions);

	OptionsWidget = new QWidget(this);
	QHBoxLayout *optionsLayout = new QHBoxLayout((OptionsWidget));
	QGroupBox *connectionOptions = new QGroupBox(OptionsWidget);
	optionsLayout->addWidget(connectionOptions);
	connectionOptions->setTitle(tr("Connection settings"));

	QVBoxLayout *vboxLayout2 = new QVBoxLayout(connectionOptions);
	vboxLayout2->setSpacing(6);
	vboxLayout2->setMargin(9);

	CustomHostPort = new QCheckBox(connectionOptions);
	CustomHostPort->setText(tr("Manually Specify Server Host/Port") + ':');
	vboxLayout2->addWidget(CustomHostPort);
	connect(CustomHostPort, SIGNAL(toggled(bool)), SLOT(hostToggled(bool)));

	HostPortLayout = new QHBoxLayout();
	HostPortLayout->setSpacing(6);
	HostPortLayout->setMargin(0);

	CustomHostLabel = new QLabel(connectionOptions);
	CustomHostLabel->setText(tr("Host") + ':');
	HostPortLayout->addWidget(CustomHostLabel);

	CustomHost = new QLineEdit(connectionOptions);
	HostPortLayout->addWidget(CustomHost);

	CustomPortLabel = new QLabel(connectionOptions);
	CustomPortLabel->setText(tr("Port") + ':');
	HostPortLayout->addWidget(CustomPortLabel);

	CustomPort = new QLineEdit(connectionOptions);
	CustomPort->setMinimumSize(QSize(56, 0));
	CustomPort->setMaximumSize(QSize(56, 32767));
	CustomPort->setText(QString::number(port_));
	HostPortLayout->addWidget(CustomPort);

	vboxLayout2->addLayout(HostPortLayout);

	QHBoxLayout *EncryptionLayout = new QHBoxLayout();
	EncryptionLayout->setSpacing(6);
	EncryptionLayout->setMargin(0);
	EncryptionModeLabel = new QLabel(connectionOptions);
	EncryptionModeLabel->setText(tr("Encrypt connection") + ':');
	EncryptionLayout->addWidget(EncryptionModeLabel);

	EncryptionMode = new QComboBox(connectionOptions);
	EncryptionMode->addItem(tr("Always"), 0);
	EncryptionMode->addItem(tr("When available"), 1);
	EncryptionMode->addItem(tr("Legacy SSL"), 2);
	connect(EncryptionMode, SIGNAL(activated(int)), SLOT(sslActivated(int)));
	EncryptionLayout->addWidget(EncryptionMode);

	QSpacerItem *spacerItem = new QSpacerItem(151, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
	EncryptionLayout->addItem(spacerItem);
	vboxLayout2->addLayout(EncryptionLayout);

	LegacySSLProbe = new QCheckBox(connectionOptions);
	LegacySSLProbe->setText(tr("Probe legacy SSL port"));
	vboxLayout2->addWidget(LegacySSLProbe);

	mainLayout->addWidget(OptionsWidget);

	mainLayout->addStretch(100);

	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);
	mainLayout->addWidget(buttons);

	RegisterAccountButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogApplyButton), tr("Register Account"), this);
	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"), this);

	buttons->addButton(RegisterAccountButton, QDialogButtonBox::ApplyRole);
	buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);

	connect(RegisterAccountButton, SIGNAL(clicked(bool)), this, SLOT(apply()));
	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(cancel()));

	if (!showButtons)
		buttons->hide();
}
Beispiel #4
0
void PathDeformControls::layoutForDesktop()
{
    QGroupBox* mainGroup = new QGroupBox(this);
    mainGroup->setTitle(tr("Controls"));

    QGroupBox *radiusGroup = new QGroupBox(mainGroup);
    radiusGroup->setTitle(tr("Lens Radius"));
    QSlider *radiusSlider = new QSlider(Qt::Horizontal, radiusGroup);
    radiusSlider->setRange(15, 150);
    radiusSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

    QGroupBox *deformGroup = new QGroupBox(mainGroup);
    deformGroup->setTitle(tr("Deformation"));
    QSlider *deformSlider = new QSlider(Qt::Horizontal, deformGroup);
    deformSlider->setRange(-100, 100);
    deformSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

    QGroupBox *fontSizeGroup = new QGroupBox(mainGroup);
    fontSizeGroup->setTitle(tr("Font Size"));
    QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, fontSizeGroup);
    fontSizeSlider->setRange(16, 200);
    fontSizeSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);

    QGroupBox *textGroup = new QGroupBox(mainGroup);
    textGroup->setTitle(tr("Text"));
    QLineEdit *textInput = new QLineEdit(textGroup);

    QPushButton *animateButton = new QPushButton(mainGroup);
    animateButton->setText(tr("Animated"));
    animateButton->setCheckable(true);

    QPushButton *showSourceButton = new QPushButton(mainGroup);
    showSourceButton->setText(tr("Show Source"));

#ifdef QT_OPENGL_SUPPORT
    QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
    enableOpenGLButton->setText(tr("Use OpenGL"));
    enableOpenGLButton->setCheckable(true);
    enableOpenGLButton->setChecked(m_renderer->usesOpenGL());
    if (!QGLFormat::hasOpenGL())
        enableOpenGLButton->hide();
#endif

    QPushButton *whatsThisButton = new QPushButton(mainGroup);
    whatsThisButton->setText(tr("What's This?"));
    whatsThisButton->setCheckable(true);


    mainGroup->setFixedWidth(180);

    QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup);
    mainGroupLayout->addWidget(radiusGroup);
    mainGroupLayout->addWidget(deformGroup);
    mainGroupLayout->addWidget(fontSizeGroup);
    mainGroupLayout->addWidget(textGroup);
    mainGroupLayout->addWidget(animateButton);
    mainGroupLayout->addStretch(1);
#ifdef QT_OPENGL_SUPPORT
    mainGroupLayout->addWidget(enableOpenGLButton);
#endif
    mainGroupLayout->addWidget(showSourceButton);
    mainGroupLayout->addWidget(whatsThisButton);

    QVBoxLayout *radiusGroupLayout = new QVBoxLayout(radiusGroup);
    radiusGroupLayout->addWidget(radiusSlider);

    QVBoxLayout *deformGroupLayout = new QVBoxLayout(deformGroup);
    deformGroupLayout->addWidget(deformSlider);

    QVBoxLayout *fontSizeGroupLayout = new QVBoxLayout(fontSizeGroup);
    fontSizeGroupLayout->addWidget(fontSizeSlider);

    QVBoxLayout *textGroupLayout = new QVBoxLayout(textGroup);
    textGroupLayout->addWidget(textInput);

    QVBoxLayout * mainLayout = new QVBoxLayout(this);
    mainLayout->addWidget(mainGroup);
    mainLayout->setMargin(0);

    connect(radiusSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setRadius(int)));
    connect(deformSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setIntensity(int)));
    connect(fontSizeSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setFontSize(int)));
    connect(animateButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setAnimated(bool)));
#ifdef QT_OPENGL_SUPPORT
    connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool)));
#endif

    connect(textInput, SIGNAL(textChanged(QString)), m_renderer, SLOT(setText(QString)));
    connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
            whatsThisButton, SLOT(setChecked(bool)));
    connect(whatsThisButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setDescriptionEnabled(bool)));
    connect(showSourceButton, SIGNAL(clicked()), m_renderer, SLOT(showSource()));

    animateButton->animateClick();
    deformSlider->setValue(80);
    fontSizeSlider->setValue(120);
    radiusSlider->setValue(100);
    textInput->setText(tr("Qt"));
}
BehaviorSettingsPage::BehaviorSettingsPage(const KUrl& url, QWidget* parent) :
    SettingsPageBase(parent),
    m_url(url),
    m_localProps(0),
    m_globalProps(0),
    m_confirmMoveToTrash(0),
    m_confirmDelete(0),
    m_renameInline(0),
    m_showToolTips(0),
    m_showSelectionToggle(0),
    m_naturalSorting(0)
{
    QVBoxLayout* topLayout = new QVBoxLayout(this);

    // 'View Properties' box
    QGroupBox* propsBox = new QGroupBox(i18nc("@title:group", "View Properties"), this);
    propsBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

    m_localProps = new QRadioButton(i18nc("@option:radio", "Remember view properties for each folder"), propsBox);

    m_globalProps = new QRadioButton(i18nc("@option:radio", "Use common view properties for all folders"), propsBox);

    QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox);
    propsBoxLayout->addWidget(m_localProps);
    propsBoxLayout->addWidget(m_globalProps);

    // 'Ask Confirmation For' box
    QGroupBox* confirmBox = new QGroupBox(i18nc("@title:group", "Ask For Confirmation When"), this);
    confirmBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
    m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for Confirmation When",
                                               "Moving files or folders to trash"), confirmBox);
    m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for Confirmation When",
                                          "Deleting files or folders"), confirmBox);
    m_confirmClosingMultipleTabs = new QCheckBox(i18nc("@option:check Ask for Confirmation When",
                                                       "Closing windows with multiple tabs"), confirmBox);

    QVBoxLayout* confirmBoxLayout = new QVBoxLayout(confirmBox);
    confirmBoxLayout->addWidget(m_confirmMoveToTrash);
    confirmBoxLayout->addWidget(m_confirmDelete);
    confirmBoxLayout->addWidget(m_confirmClosingMultipleTabs);

    // 'Rename inline'
    m_renameInline = new QCheckBox(i18nc("@option:check", "Rename inline"), this);

    // 'Show tooltips'
    m_showToolTips = new QCheckBox(i18nc("@option:check", "Show tooltips"), this);

    // 'Show selection marker'
    m_showSelectionToggle = new QCheckBox(i18nc("@option:check", "Show selection marker"), this);

    // 'Natural sorting of items'
    m_naturalSorting = new QCheckBox(i18nc("option:check", "Natural sorting of items"), this);

    topLayout->addWidget(propsBox);
    topLayout->addWidget(confirmBox);
    topLayout->addWidget(m_renameInline);
    topLayout->addWidget(m_showToolTips);
    topLayout->addWidget(m_showSelectionToggle);
    topLayout->addWidget(m_naturalSorting);
    topLayout->addStretch();

    loadSettings();

    connect(m_localProps, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_globalProps, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_confirmMoveToTrash, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_confirmDelete, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_confirmClosingMultipleTabs, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_renameInline, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_showToolTips, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_showSelectionToggle, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
    connect(m_naturalSorting, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
}
Beispiel #6
0
AvatarSpiritPage::AvatarSpiritPage(QWidget *parent) :
    ConfigPage(parent)
{
    // life
    QGroupBox *lifeGroup = new QGroupBox(tr("Default Life Value"));
    QLabel *mouseLifeLabel = new QLabel(tr("Mouse Life"));
    mouseLifeEdit = new QLineEdit(g_config.getValue("AvatarSpirit/Life/Mouse").toString());
    mouseLifeEdit->setToolTip(tr("float (>0)"));
    QLabel *catLifeLabel = new QLabel(tr("Cat Life"));
    catLifeEdit = new QLineEdit(g_config.getValue("AvatarSpirit/Life/Cat").toString());
    catLifeEdit->setToolTip(tr("float (>0)"));
    QLabel *elephantLifeLabel = new QLabel(tr("Elephant Life"));
    elephantLifeEdit = new QLineEdit(g_config.getValue("AvatarSpirit/Life/Elephant").toString());
    elephantLifeEdit->setToolTip(tr("float (>0)"));

    QGridLayout *lifeLayout = new QGridLayout;
    lifeLayout->addWidget(mouseLifeLabel, 0, 0);
    lifeLayout->addWidget(mouseLifeEdit, 0, 1);
    lifeLayout->addWidget(catLifeLabel, 1, 0);
    lifeLayout->addWidget(catLifeEdit, 1, 1);
    lifeLayout->addWidget(elephantLifeLabel, 2, 0);
    lifeLayout->addWidget(elephantLifeEdit, 2, 1);
    lifeGroup->setLayout(lifeLayout);

    // sharing
    QGroupBox *shareGroup = new QGroupBox(tr("Default Sharing Params"));
    QLabel *rangeLabel = new QLabel(tr("Share Range"));
    rangeEdit = new QLineEdit(g_config.getValue("AvatarSpirit/ShareParams/ShareRange").toString());
    rangeEdit->setToolTip(tr("int (>=0, 0 to turn off sharing)"));
    QLabel *freqLabel = new QLabel(tr("Share Freq"));
    freqEdit = new QLineEdit(g_config.getValue("AvatarSpirit/ShareParams/ShareFreq").toString());
    freqEdit->setToolTip(tr("int (>0)"));

    QGridLayout *shareLayout = new QGridLayout;
    shareLayout->addWidget(rangeLabel, 0, 0);
    shareLayout->addWidget(rangeEdit, 0, 1);
    shareLayout->addWidget(freqLabel, 1, 0);
    shareLayout->addWidget(freqEdit, 1, 1);
    shareGroup->setLayout(shareLayout);

    // gamcs params
    QGroupBox *paramsGroup = new QGroupBox(tr("Default GAMCS Parameters"));
    QLabel *drLabel = new QLabel(tr("Discount Rate"));
    drEdit = new QLineEdit(g_config.getValue("AvatarSpirit/GAMCSParams/DiscountRate").toString());
    drEdit->setToolTip(tr("float (>=0, <1)"));
    QLabel *acuLabel = new QLabel(tr("Accuracy"));
    acuEdit = new QLineEdit(g_config.getValue("AvatarSpirit/GAMCSParams/Accuracy").toString());
    acuEdit->setToolTip(tr("float (>=0)"));
    QLabel *lmLabel = new QLabel(tr("Learning Mode"));
    lmCombo = new QComboBox;
    lmCombo->addItem(tr("Online"));
    lmCombo->addItem(tr("Explore"));
    if (g_config.getValue("AvatarSpirit/GAMCSParams/LearningMode").toString() == "Explore")
        lmCombo->setCurrentIndex(1);
    else	// online is the default
        lmCombo->setCurrentIndex(0);

    QGridLayout *paramsLayout = new QGridLayout;
    paramsLayout->addWidget(drLabel, 0, 0);
    paramsLayout->addWidget(drEdit, 0, 1);
    paramsLayout->addWidget(acuLabel, 1, 0);
    paramsLayout->addWidget(acuEdit, 1, 1);
    paramsLayout->addWidget(lmLabel, 2, 0);
    paramsLayout->addWidget(lmCombo, 2, 1);
    paramsGroup->setLayout(paramsLayout);

    QPushButton *defaultButton = new QPushButton(tr("Default"));
    connect(defaultButton, SIGNAL(clicked()), this, SLOT(resetDefault()));
    QHBoxLayout *defaultLayout = new QHBoxLayout;
    defaultLayout->addWidget(defaultButton, 0, Qt::AlignRight);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(lifeGroup);
    mainLayout->addSpacing(10);
    mainLayout->addWidget(shareGroup);
    mainLayout->addSpacing(10);
    mainLayout->addWidget(paramsGroup);
    mainLayout->addStretch(1);
    mainLayout->addLayout(defaultLayout);
    setLayout(mainLayout);
}
Beispiel #7
0
void
QvisMoleculePlotWindow::CreateWindowContents()
{
    QTabWidget *topTab = new QTabWidget(central);
    topLayout->addWidget(topTab);


    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    //                            Atoms Tab
    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    QWidget *atomsGroup = new QWidget(central);
    topTab->addTab(atomsGroup, tr("Atoms"));

    QGridLayout *atomsLayout = new QGridLayout(atomsGroup);

    drawAtomsAsLabel = new QLabel(tr("Draw atoms as"), atomsGroup);
    atomsLayout->addWidget(drawAtomsAsLabel, 0,0, 1,2);
    drawAtomsAs = new QComboBox(atomsGroup);
    drawAtomsAs->addItem(tr("None"));
    drawAtomsAs->addItem(tr("Spheres"));
    drawAtomsAs->addItem(tr("Sphere imposters"));
    connect(drawAtomsAs, SIGNAL(activated(int)),
            this, SLOT(drawAtomsAsChanged(int)));
    atomsLayout->addWidget(drawAtomsAs, 0,2);
    

    atomSphereQualityLabel = new QLabel(tr("Atom sphere quality"), atomsGroup);
    atomsLayout->addWidget(atomSphereQualityLabel,1,0, 1,2);
    atomSphereQuality = new QComboBox(atomsGroup);
    atomSphereQuality->addItem(tr("Low"));
    atomSphereQuality->addItem(tr("Medium"));
    atomSphereQuality->addItem(tr("High"));
    atomSphereQuality->addItem(tr("Super"));
    connect(atomSphereQuality, SIGNAL(activated(int)),
            this, SLOT(atomSphereQualityChanged(int)));
    atomsLayout->addWidget(atomSphereQuality, 1,2);

    scaleRadiusByLabel = new QLabel(tr("Radius based on"), atomsGroup);
    atomsLayout->addWidget(scaleRadiusByLabel, 2,0, 1,2);
    scaleRadiusBy = new QComboBox(atomsGroup);
    scaleRadiusBy->addItem(tr("Fixed value"));
    scaleRadiusBy->addItem(tr("Covalent radius"));
    scaleRadiusBy->addItem(tr("Atomic radius"));
    scaleRadiusBy->addItem(tr("Scalar variable"));
    connect(scaleRadiusBy, SIGNAL(activated(int)),
            this, SLOT(scaleRadiusByChanged(int)));
    atomsLayout->addWidget(scaleRadiusBy, 2,2);

    radiusVariableLabel = new QLabel(tr("Variable for atom radius"), atomsGroup);
    atomsLayout->addWidget(radiusVariableLabel,3,1);
    int radiusVariableMask = QvisVariableButton::Scalars;
    radiusVariable = new QvisVariableButton(true, true, true, radiusVariableMask, atomsGroup);
    connect(radiusVariable, SIGNAL(activated(const QString&)),
            this, SLOT(radiusVariableChanged(const QString&)));
    atomsLayout->addWidget(radiusVariable, 3,2);

    radiusScaleFactorLabel = new QLabel(tr("Atom radius scale factor"), atomsGroup);
    atomsLayout->addWidget(radiusScaleFactorLabel,4,1);
    radiusScaleFactor = new QLineEdit(atomsGroup);
    connect(radiusScaleFactor, SIGNAL(returnPressed()),
            this, SLOT(radiusScaleFactorProcessText()));
    atomsLayout->addWidget(radiusScaleFactor, 4,2);

    radiusFixedLabel = new QLabel(tr("Fixed atom radius"), atomsGroup);
    atomsLayout->addWidget(radiusFixedLabel,5,1);
    radiusFixed = new QLineEdit(atomsGroup);
    connect(radiusFixed, SIGNAL(returnPressed()),
            this, SLOT(radiusFixedProcessText()));
    atomsLayout->addWidget(radiusFixed, 5,2);
    atomsLayout->setRowStretch(6,2);

    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    //                            Bonds Tab
    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    QWidget *bondsGroup = new QWidget(central);
    topTab->addTab(bondsGroup, tr("Bonds"));

    QGridLayout *bondsLayout = new QGridLayout(bondsGroup);

    int row = 0;
    drawBondsAsLabel = new QLabel(tr("Draw bonds as"), bondsGroup);
    bondsLayout->addWidget(drawBondsAsLabel, row,0, 1,2);
    drawBondsAs = new QComboBox(bondsGroup);
    drawBondsAs->addItem(tr("None"));
    drawBondsAs->addItem(tr("Lines"));
    drawBondsAs->addItem(tr("Cylinders"));
    connect(drawBondsAs, SIGNAL(activated(int)),
            this, SLOT(drawBondsAsChanged(int)));
    bondsLayout->addWidget(drawBondsAs, row,2);
    row++;

    bondCylinderQualityLabel = new QLabel(tr("Bond cylinder quality"), bondsGroup);
    bondsLayout->addWidget(bondCylinderQualityLabel, row,1);
    bondCylinderQuality = new QComboBox(bondsGroup);
    bondCylinderQuality->addItem(tr("Low"));
    bondCylinderQuality->addItem(tr("Medium"));
    bondCylinderQuality->addItem(tr("High"));
    bondCylinderQuality->addItem(tr("Super"));
    connect(bondCylinderQuality, SIGNAL(activated(int)),
            this, SLOT(bondCylinderQualityChanged(int)));
    bondsLayout->addWidget(bondCylinderQuality, row,2);
    row++;

    bondRadiusLabel = new QLabel(tr("Bond radius"), bondsGroup);
    bondsLayout->addWidget(bondRadiusLabel, row,1);
    bondRadius = new QLineEdit(bondsGroup);
    connect(bondRadius, SIGNAL(returnPressed()),
            this, SLOT(bondRadiusProcessText()));
    bondsLayout->addWidget(bondRadius, row,2);
    row++;

    bondLineWidthLabel = new QLabel(tr("Bond line width"), bondsGroup);
    bondsLayout->addWidget(bondLineWidthLabel, row,1);
    bondLineWidth = new QvisLineWidthWidget(0, bondsGroup);
    connect(bondLineWidth, SIGNAL(lineWidthChanged(int)),
            this, SLOT(bondLineWidthChanged(int)));
    bondsLayout->addWidget(bondLineWidth, row,2);
    row++;

    bondLineStyleLabel = new QLabel(tr("Bond line style"), bondsGroup);
    bondsLayout->addWidget(bondLineStyleLabel, row,1);
    bondLineStyle = new QvisLineStyleWidget(0, bondsGroup);
    connect(bondLineStyle, SIGNAL(lineStyleChanged(int)),
            this, SLOT(bondLineStyleChanged(int)));
    bondsLayout->addWidget(bondLineStyle, row,2);
    row++;

    colorBondsLabel = new QLabel(tr("Color bonds by"), bondsGroup);
    bondsLayout->addWidget(colorBondsLabel, row,0, 1,2);
 
    colorBondsWidget = new QWidget(bondsGroup);
    colorBondsGroup = new QButtonGroup(colorBondsWidget);
    
    QGridLayout *colorBondsLayout = new QGridLayout(colorBondsWidget);
    colorBondsLayout->setMargin(0);
    
    QRadioButton *colorBondsBondColoringModeColorByAtom = new QRadioButton(tr("Adjacent atom color"),
                                                                           colorBondsWidget);
    QRadioButton *colorBondsBondColoringModeSingleColor = new QRadioButton(tr("Single color"), 
                                                                           colorBondsWidget);
    
    colorBondsLayout->addWidget(colorBondsBondColoringModeColorByAtom, 0,0, 1,2);
    colorBondsLayout->addWidget(colorBondsBondColoringModeSingleColor, 1,0);
    
    colorBondsGroup->addButton(colorBondsBondColoringModeColorByAtom, 0);
    colorBondsGroup->addButton(colorBondsBondColoringModeSingleColor, 1);
    connect(colorBondsGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(colorBondsChanged(int)));
    bondSingleColor = new QvisColorButton(bondsGroup);
    connect(bondSingleColor, SIGNAL(selectedColor(const QColor&)),
            this, SLOT(bondSingleColorChanged(const QColor&)));
    colorBondsLayout->addWidget(bondSingleColor, 1,1);
    bondsLayout->addWidget(colorBondsWidget, row,2);
    row++;
    bondsLayout->setRowStretch(row,2);



    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    //                            Colors Tab
    // ------------------------------------------------------------------------
    // ------------------------------------------------------------------------
    QWidget *colorsGroup = new QWidget(central);
    topTab->addTab(colorsGroup, tr("Colors"));

    QVBoxLayout *colorsLayout = new QVBoxLayout(colorsGroup);
    

    QGroupBox *discreteGroup = new QGroupBox(colorsGroup);
    discreteGroup->setTitle(tr("Discrete colors"));
    colorsLayout->addWidget(discreteGroup);
    
    QGridLayout *discreteLayout = new QGridLayout(discreteGroup);

    QLabel *discreteColorTableLabel = new QLabel(tr("Color table for:"), discreteGroup);
    discreteLayout->addWidget(discreteColorTableLabel,0,0,1,2);
    
    elementColorTableLabel = new QLabel(tr("Element types"), discreteGroup);
    discreteLayout->addWidget(elementColorTableLabel, 1,0);
    elementColorTable = new QvisColorTableButton(discreteGroup);
    connect(elementColorTable, SIGNAL(selectedColorTable(bool, const QString&)),
            this, SLOT(elementColorTableChanged(bool, const QString&)));
    discreteLayout->addWidget(elementColorTable, 1,1);

    residueTypeColorTableLabel = new QLabel(tr("Residue types"), discreteGroup);
    discreteLayout->addWidget(residueTypeColorTableLabel, 2,0);
    residueTypeColorTable = new QvisColorTableButton(discreteGroup);
    connect(residueTypeColorTable, SIGNAL(selectedColorTable(bool, const QString&)),
            this, SLOT(residueTypeColorTableChanged(bool, const QString&)));
    discreteLayout->addWidget(residueTypeColorTable, 2,1);

    residueSequenceColorTableLabel = new QLabel(tr("Other discrete fields"), discreteGroup);
    discreteLayout->addWidget(residueSequenceColorTableLabel, 3,0);
    residueSequenceColorTable = new QvisColorTableButton(discreteGroup);
    connect(residueSequenceColorTable, SIGNAL(selectedColorTable(bool, const QString&)),
            this, SLOT(residueSequenceColorTableChanged(bool, const QString&)));
    discreteLayout->addWidget(residueSequenceColorTable, 3,1);

    QGroupBox *continuousGroup = new QGroupBox(colorsGroup);
    continuousGroup->setTitle(tr("Continuous colors"));
    colorsLayout->addWidget(continuousGroup);
    QVBoxLayout *continuousTopLayout = new QVBoxLayout(continuousGroup);

    QGridLayout *continuousLayout = new QGridLayout();
    continuousTopLayout->addLayout(continuousLayout);


    continuousColorTableLabel = new QLabel(tr("Color table for scalars"), continuousGroup);
    continuousLayout->addWidget(continuousColorTableLabel, 0,0);
    continuousColorTable = new QvisColorTableButton(continuousGroup);
    connect(continuousColorTable, SIGNAL(selectedColorTable(bool, const QString&)),
            this, SLOT(continuousColorTableChanged(bool, const QString&)));
    continuousLayout->addWidget(continuousColorTable, 0,1);

    minFlag = new QCheckBox(tr("Clamp minimum"), continuousGroup);
    connect(minFlag, SIGNAL(toggled(bool)),
            this, SLOT(minFlagChanged(bool)));
    continuousLayout->addWidget(minFlag, 1,0);

    scalarMin = new QLineEdit(continuousGroup);
    connect(scalarMin, SIGNAL(returnPressed()),
            this, SLOT(scalarMinProcessText()));
    continuousLayout->addWidget(scalarMin, 1,1);

    maxFlag = new QCheckBox(tr("Clamp maximum"), continuousGroup);
    connect(maxFlag, SIGNAL(toggled(bool)),
            this, SLOT(maxFlagChanged(bool)));
    continuousLayout->addWidget(maxFlag, 2,0);

    scalarMax = new QLineEdit(continuousGroup);
    connect(scalarMax, SIGNAL(returnPressed()),
            this, SLOT(scalarMaxProcessText()));
    continuousLayout->addWidget(scalarMax, 2,1);
    colorsLayout->addStretch(2);

    // ------------------------------------------------------------------

    //
    // Create the misc stuff
    //
    QGroupBox * miscGroup = new QGroupBox(central);
    miscGroup->setTitle(tr("Misc"));
    topLayout->addWidget(miscGroup);

    QGridLayout *miscLayout = new QGridLayout(miscGroup);
    miscLayout->setMargin(5);
    miscLayout->setSpacing(10);
 
    // Create the legend toggle
    legendToggle = new QCheckBox(tr("Legend"), central);
    connect(legendToggle, SIGNAL(toggled(bool)),
            this, SLOT(legendToggled(bool)));
    miscLayout->addWidget(legendToggle, 0, 0);
}
Beispiel #8
0
		ValidationResultDialog::ValidationResultDialog(ValidationItem* item)
		{
			//return if there's no parent
			if (item == NULL)
			{
				return;
			}

			QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok,Qt::Horizontal, this);
			QPushButton* print_button = new QPushButton("Save to File", buttons);

			QVBoxLayout* mainLayout = new QVBoxLayout();
			QGroupBox* resultGroup = new QGroupBox(tr("Validation Results"),this);
			QGridLayout* layout = new QGridLayout();
			QVBoxLayout* resultGroupLayout = new QVBoxLayout();

			int type = item->getValidationType();

			if (type < 4 || type==5)
			{
				String train_fit ="R^2";
				String pred_qual="Q^2";
				String n = item->modelItem()->getRegistryEntry()->getStatName(item->getValidationStatistic());
				
				if(n!="") 
				{
					train_fit = n+"<br>on training data";
					pred_qual = "predictive<br>"+n;			
				}
				
				QLabel* rlabel = new QLabel(train_fit.c_str(),this);
				layout->addWidget(rlabel, 0,1);
				QString tmp;
				QLabel* qlabel=NULL;
				
				if(type<3)
				{
					qlabel = new QLabel(tmp.setNum(item->k())+ " fold "+pred_qual.c_str(),this);
				}
				else if(type==3) // boostrap
				{
					qlabel = new QLabel(QString(pred_qual.c_str())+" of "+tmp.setNum(item->numOfSamples())+ "\nbootstrap samples",this);
				}
				else if(type==5)
				{
					qlabel = new QLabel(tmp.setNum(item->getNoExternalFolds())+ " fold nested "+pred_qual.c_str(),this);
				}
				
				layout->addWidget(qlabel, 0,2);

				QLabel* rvaluelabel = new QLabel(QString(((String)(item->getR2())).c_str()),this);
				layout->addWidget(rvaluelabel,1,1);
				QLabel* qvaluelabel = new QLabel(QString(((String)(item->getQ2())).c_str()),this);
				layout->addWidget(qvaluelabel,1,2);

				resultGroup->setLayout(layout);
			}	
			else if (type == 4)
			{
				QString value;
				float num;

				QStringList labels;
				labels << "# Tests" << "R^2" << "Q^2";

				QTableWidget* table = new QTableWidget(item->resultOfRandTest()->rows(), 3, this);
				table->verticalHeader()->hide();
				table->setHorizontalHeaderLabels (labels);
				table->setAlternatingRowColors(true);
				table->setDragDropMode(QAbstractItemView::NoDragDrop);
				table->setEditTriggers(QAbstractItemView::NoEditTriggers);
				table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
				table->horizontalHeader()->setResizeMode(2,QHeaderView::Stretch); 
			
				for (int i = 0; i < item->resultOfRandTest()->rows();i++)
				{
					value.setNum(i);
					QTableWidgetItem* num_of_Test = new QTableWidgetItem(value);
					table->setItem(i, 0, num_of_Test);

					num = (*(item->resultOfRandTest()))(i,item->resultOfRandTest()->cols()-2);
					value.setNum(num);
					QTableWidgetItem* r = new QTableWidgetItem(value);
					table->setItem(i, 1, r);

					num = (*(item->resultOfRandTest()))(i,item->resultOfRandTest()->cols()-1);
					value.setNum(num);
					QTableWidgetItem* q = new QTableWidgetItem(value);
					table->setItem(i, 2, q);
				}

				QScrollArea* scrollArea = new QScrollArea(this);
				scrollArea->setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
				scrollArea->setVerticalScrollBarPolicy ( Qt::ScrollBarAsNeeded );
				scrollArea->setFrameShape(QFrame::NoFrame);
				scrollArea->setWidget(table);
				scrollArea->setWidgetResizable(true);
			
				resultGroupLayout->addWidget(scrollArea);
				resultGroup->setLayout(resultGroupLayout);
			}
			mainLayout->addWidget(resultGroup);
			mainLayout->addWidget(buttons);
			mainLayout->addStretch(1);
			setLayout(mainLayout);	
			setWindowTitle("Validation Results for " + item->name());

			connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
			connect(print_button, SIGNAL(clicked()), this, SLOT(saveToFile()));
		}
bool QVideoCapture::open_resolutionDialog()
{
    if (m_cvCapture.isOpened() && deviceFlag)
    {
        //GUI CONSTRUCTION//
        QDialog dialog;
        dialog.setFixedSize(200,180);
        dialog.setWindowTitle(tr("Camcorder resolution"));

        QVBoxLayout toplevellayout;
        toplevellayout.setMargin(5);

        QVBoxLayout layout;
        layout.setMargin(5);
        QGroupBox groupbox;
        groupbox.setTitle("Resolution & framerate");
        QVBoxLayout comboboxes;
        comboboxes.setMargin(5);
        QComboBox CBresolution;
        CBresolution.addItem("640 x 360"); // 0
        CBresolution.addItem("640 x 480"); // 1
        CBresolution.addItem("800 x 600"); // 2
        CBresolution.addItem("960 x 720"); // 3
        CBresolution.addItem("1280 x 720"); // 4
        CBresolution.addItem("1920 x 1080"); // 5
        CBresolution.setSizeAdjustPolicy(QComboBox::AdjustToContents);
        CBresolution.setCurrentIndex(1);
        QLabel Lresolution("Set resolution:");
        QComboBox CBm_framerate(&dialog);
        CBm_framerate.addItem("30 fps"); // 0
        CBm_framerate.addItem("25 fps"); // 1
        CBm_framerate.addItem("20 fps"); // 2
        CBm_framerate.addItem("15 fps"); // 3
        CBm_framerate.addItem("60 fps"); // 4
        CBm_framerate.setSizeAdjustPolicy(QComboBox::AdjustToContents);
        CBm_framerate.setCurrentIndex(0);
        QLabel Lm_framerate("Set framerate:");
        comboboxes.addWidget(&Lresolution,1,Qt::AlignLeft);
        comboboxes.addWidget(&CBresolution);
        comboboxes.addWidget(&Lm_framerate,1,Qt::AlignLeft);
        comboboxes.addWidget(&CBm_framerate);
        groupbox.setLayout(&comboboxes);
        layout.addWidget(&groupbox);

        QHBoxLayout buttons;
        buttons.setMargin(5);
        QPushButton Baccept;
        Baccept.setText("Accept");
        connect(&Baccept, SIGNAL(clicked()), &dialog, SLOT(accept()));
        QPushButton Bcancel;
        Bcancel.setText("Cancel");
        connect(&Bcancel, SIGNAL(clicked()), &dialog, SLOT(reject()));
        buttons.addWidget(&Baccept);
        buttons.addWidget(&Bcancel);

        toplevellayout.addLayout(&layout);
        toplevellayout.addLayout(&buttons);
        dialog.setLayout(&toplevellayout);
        //GUI CONSTRUCTION END//

        if(dialog.exec() == QDialog::Accepted)
        {
            m_cvCapture.set( CV_CAP_PROP_FRAME_WIDTH, CBresolution.itemText(CBresolution.currentIndex()).section(" x ",0,0).toDouble() );
            m_cvCapture.set( CV_CAP_PROP_FRAME_HEIGHT, CBresolution.itemText(CBresolution.currentIndex()).section(" x ",1,1).toDouble() );
            pt_timer->setInterval( 1000/CBm_framerate.itemText(CBm_framerate.currentIndex()).section(" ",0,0).toDouble() );
        }
        return true;
    }
    return false; // will return false if device was not opened or dialog.exec() == QDialog::Rejected
}
Beispiel #10
0
void KWStatisticsDialog::addBox( QFrame *page, QLabel **resultLabel, bool calcWithFootNoteCheckbox )
{
    // Layout Managers
    QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 7 );
    if ( calcWithFootNoteCheckbox )
    {
        QWidget *w = new QWidget(page);
        topLayout->addWidget( w );
        QVBoxLayout *noteLayout = new QVBoxLayout( w, KDialog::marginHint(), 0 );
        QCheckBox *calcWithFootNote = new QCheckBox( i18n("&Include text from foot- and endnotes"), w);
        noteLayout->addWidget( calcWithFootNote );
        connect( calcWithFootNote, SIGNAL(toggled ( bool )), this, SLOT( slotRefreshValue(bool)));
    }


    QGroupBox *box = new QGroupBox( i18n( "Statistics" ), page );
    QGridLayout *grid = new QGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() );
    grid->setRowStretch (9, 1);

    // margins
    int fHeight = box->fontMetrics().height();
    grid->setMargin( fHeight );
    grid->addColSpacing( 1, fHeight );
    grid->addRowSpacing( 0, fHeight );

    //maximum size for result column (don't know how to do this better..)
    QString init = i18n("approximately %1").arg( "00000000" );

    // insert labels
    QLabel *label1 = new QLabel( i18n( "Characters including spaces:" ), box );
    grid->addWidget( label1, 1, 0, 1 );
    resultLabel[0] = new QLabel( "", box );
    grid->addWidget( resultLabel[0], 1, 2, 2 );

    QLabel *label2 = new QLabel( i18n( "Characters without spaces:" ), box );
    grid->addWidget( label2, 2, 0, 1 );
    resultLabel[1] = new QLabel( "", box );
    grid->addWidget( resultLabel[1], 2, 2, 2 );

    QLabel *label3 = new QLabel( i18n( "Syllables:" ), box );
    grid->addWidget( label3, 3, 0, 1 );
    resultLabel[2] = new QLabel( "", box );
    grid->addWidget( resultLabel[2], 3, 2, 2 );

    QLabel *label4 = new QLabel( i18n( "Words:" ), box );
    grid->addWidget( label4, 4, 0, 1 );
    resultLabel[3] = new QLabel( "", box );
    grid->addWidget( resultLabel[3], 4, 2, 2 );

    QLabel *label5 = new QLabel( i18n( "Sentences:" ), box );
    grid->addWidget( label5, 5, 0, 1 );
    resultLabel[4] = new QLabel( "", box );
    grid->addWidget( resultLabel[4], 5, 2, 2 );

    QLabel *label6 = new QLabel( i18n( "Lines:" ), box );
    grid->addWidget( label6, 6, 0, 1 );
    resultLabel[5] = new QLabel( "", box );
    grid->addWidget( resultLabel[5], 6, 2, 2 );


    QLabel *label7 = new QLabel( i18n( "Flesch reading ease:" ), box );
    grid->addWidget( label7, 7, 0, 1 );
    resultLabel[6] = new QLabel( init, box );
    grid->addWidget( resultLabel[6], 7, 2, 2 );

    topLayout->addWidget( box );
}
Beispiel #11
0
ElmDlg::ElmDlg(SpatialDataView* pView, ElmInteractive* pElmInteractive, QWidget* pParent) :
   QDialog(pParent),
   mPixelOffset(1.0, 1.0),
   mMaxDisplayedPixels(10000),
   mCurrentIndex(-1),
   mpElmInteractive(pElmInteractive),
   mpView(pView, SIGNAL_NAME(Subject, Deleted), Slot(this, &ElmDlg::viewDeleted))
{
   // Initialization
   VERIFYNRV(mpView.get() != NULL);
   VERIFYNRV(mpElmInteractive != NULL);
   setWindowTitle(QString::fromStdString("Empirical Line Method - " + mpView->getDisplayName()));
   mpAoiElement.addSignal(SIGNAL_NAME(Subject, Modified), Slot(this, &ElmDlg::aoiModified));
   mpAoiElement.addSignal(SIGNAL_NAME(Subject, Deleted), Slot(this, &ElmDlg::aoiDeleted));

   // "Use Existing Gains/Offsets File" Layout Begin
   mpExistingFileBrowser = new FileBrowser;

   QHBoxLayout* pUseExistingFileLayout = new QHBoxLayout;
   pUseExistingFileLayout->addWidget(mpExistingFileBrowser);

   QGroupBox* pUseExistingFileGroup = new QGroupBox;
   pUseExistingFileGroup->setLayout(pUseExistingFileLayout);
   pUseExistingFileGroup->setEnabled(false);
   // "Use Existing Gains/Offsets File" Layout End


   // Element Layout Begin
   mpElementComboBox = new QComboBox;
   mpElementComboBox->setToolTip("This is the list of available ELM Elements.");
   mpElementComboBox->setWhatsThis("This is the list of available ELM Elements. "
      "ELM elements are simply a group of selected pixels, similar to an AOI, that specify the location "
      "of an object whose signature matches a corresponding input reflectance signature. "
      "At least two elements must be created to run the ELM algorithm.");

   QPushButton* pNewElementButton = new QPushButton("New Element");
   pNewElementButton->setToolTip("Click this button to create a new ELM element.");
   pNewElementButton->setWhatsThis("Click this button to create a new ELM element. "
      "Pixels must be selected and a corresponding signature must be selected for each element. "
      "At least two elements must be created to run the ELM algorithm.");

   QPushButton* pDeleteElementButton = new QPushButton("Delete Element");
   pDeleteElementButton->setToolTip("Click this button to delete the currently selected ELM Element.");
   pDeleteElementButton->setWhatsThis("Click this button to delete the currently selected ELM Element. "
      "The Element will be removed from the list and its pixels will be deleted from the scene.");

   QVBoxLayout* pElementLayout = new QVBoxLayout;
   pElementLayout->addWidget(mpElementComboBox);
   pElementLayout->addWidget(pNewElementButton);
   pElementLayout->addWidget(pDeleteElementButton);

   QGroupBox* pElementGroup = new QGroupBox("Current Element");
   pElementGroup->setLayout(pElementLayout);
   // Element Layout End


   // Pixel Layout Begin
   mpPixelList = new QListWidget;
   mpPixelList->setSortingEnabled(false);
   mpPixelList->setSelectionMode(QAbstractItemView::ExtendedSelection);
   mpPixelList->setToolTip("When pixels in the scene are selected, their coordinates are listed in this box.");
   mpPixelList->setWhatsThis("When pixels in the scene are selected, their coordinates are listed in this box. "
      "To remove pixels from the list, highlight the pixels to remove and click the \"Delete Pixels\" button.");

   QPushButton* pDeletePixelButton = new QPushButton("Delete Pixels");
   pDeletePixelButton->setToolTip("Click this button to exclude the currently selected "
      "pixel(s) in the list from any further processing.");
   pDeletePixelButton->setWhatsThis("Click this button to exclude the currently selected "
      "pixel(s) in the list from any further processing. The pixels will be removed from "
      "the list so that they cannot be considered during execution.");

   QVBoxLayout* pPixelLayout = new QVBoxLayout;
   pPixelLayout->addWidget(mpPixelList);
   pPixelLayout->addWidget(pDeletePixelButton);

   QGroupBox* pPixelGroup = new QGroupBox(QString("Pixels (Up to %1 displayed)").arg(mMaxDisplayedPixels));
   pPixelGroup->setLayout(pPixelLayout);
   // Pixel Layout End


   // Signature Layout Begin
   mpSignature = new QLineEdit;
   mpSignature->setReadOnly(true);

   QPushButton* pSignatureButton = new QPushButton("Change...");
   pSignatureButton->setToolTip("Select the corresponding reflectance signature for the selected Element.");
   pSignatureButton->setWhatsThis("Select the corresponding reflectance signature for the selected Element. ");

   QHBoxLayout* pSignatureLayout = new QHBoxLayout;
   pSignatureLayout->addWidget(mpSignature);
   pSignatureLayout->addWidget(pSignatureButton);

   QGroupBox* pSignatureGroup = new QGroupBox("Signature");
   pSignatureGroup->setLayout(pSignatureLayout);
   // Signature Layout End


   QGridLayout* pCalculateLayout = new QGridLayout;
   pCalculateLayout->addWidget(pElementGroup, 1, 0);
   pCalculateLayout->addWidget(pPixelGroup, 1, 1, 2, 1);
   pCalculateLayout->addWidget(pSignatureGroup, 3, 0, 1, 3);

   QGroupBox* pCalculateGroup = new QGroupBox;
   pCalculateGroup->setLayout(pCalculateLayout);
   pCalculateGroup->setEnabled(false);
   // "Calculate Gains/Offsets" Layout End


   // Button Box Begin
   QDialogButtonBox* pButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
      Qt::Horizontal, this);
   // Button Box End


   // Overall Layout Begin
   mpUseExistingFileRadio = new QRadioButton("Use Existing Gains/Offsets File");
   mpCalculateRadio = new QRadioButton("Calculate Gains/Offsets");

   QVBoxLayout* pOverallLayout = new QVBoxLayout(this);
   pOverallLayout->setMargin(10);
   pOverallLayout->setSpacing(5);
   pOverallLayout->addWidget(mpUseExistingFileRadio);
   pOverallLayout->addWidget(pUseExistingFileGroup);
   pOverallLayout->addWidget(mpCalculateRadio);
   pOverallLayout->addWidget(pCalculateGroup);
   pOverallLayout->addWidget(pButtonBox);
   // Overall Layout End


   // Make GUI connections
   VERIFYNRV(connect(mpUseExistingFileRadio, SIGNAL(toggled(bool)), pUseExistingFileGroup, SLOT(setEnabled(bool))));
   VERIFYNRV(connect(mpCalculateRadio, SIGNAL(toggled(bool)), pCalculateGroup, SLOT(setEnabled(bool))));
   VERIFYNRV(connect(mpElementComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentIndexChanged(int))));
   VERIFYNRV(connect(pNewElementButton, SIGNAL(clicked()), this, SLOT(newElement())));
   VERIFYNRV(connect(pDeleteElementButton, SIGNAL(clicked()), this, SLOT(deleteElement())));
   if (ElmCore::hasSettingElmHelp())
   {
      pButtonBox->addButton(QDialogButtonBox::Help);
      VERIFYNRV(connect(pButtonBox, SIGNAL(helpRequested()), this, SLOT(help())));
   }
   VERIFYNRV(connect(pButtonBox, SIGNAL(accepted()), this, SLOT(accept())));
   VERIFYNRV(connect(pButtonBox, SIGNAL(rejected()), this, SLOT(reject())));
   VERIFYNRV(connect(pDeletePixelButton, SIGNAL(clicked()), this, SLOT(deletePixels())));
   VERIFYNRV(connect(pSignatureButton, SIGNAL(clicked()), this, SLOT(selectSignature())));


   // AOI toolbar defaults
   Service<DesktopServices> pDesktopServices;
   pDesktopServices->setAoiSelectionTool(RECTANGLE_OBJECT, DRAW);


   // Create an initial element
   newElement();


   // Enable the appropriate GroupBox
   const QString defaultFilename = QString::fromStdString(mpElmInteractive->getDefaultGainsOffsetsFilename());
   if (QFile::exists(defaultFilename) == true)
   {
      mpUseExistingFileRadio->setChecked(true);
      mpExistingFileBrowser->setFilename(defaultFilename);
   }
   else
   {
      mpCalculateRadio->setChecked(true);
   }
}
Beispiel #12
0
MainDialog::MainDialog(QWidget *parent)
    : QDialog(parent)
    , mHostEdit(new QLineEdit)
    , mPortEdit(new QLineEdit)
    , mUserEdit(new QLineEdit)
    , mPswdEdit(new QLineEdit)
    , mLAddrEdit(new QLineEdit)
    , mLPortEdit(new QLineEdit)
    , mWaitEdit(new QLineEdit)
    , mCtrlBtn(new QPushButton(tr("Start")))
    , mQuitBtn(new QPushButton(tr("Quit")))
    , mLogList(new QListWidget)
    , mInfoIcon(QPixmap(":/icon-info.png"))
    , mWarnIcon(QPixmap(":/icon-warn.png"))
    , mErrorIcon(QPixmap(":/icon-error.png"))
    , mStoppedIcon(QPixmap(":/icon-stopped.png"))
    , mConnectingIcon(QPixmap(":/icon-connecting.png"))
    , mConnectedIcon(QPixmap(":/icon-connected.png"))
    , mSleepingIcon(QPixmap(":/icon-sleeping.png"))
    , mSettings(new QSettings(QSettings::IniFormat, QSettings::UserScope,
                              "glacjay", "sshproxy", this))
    , mIsKeepRunning(false)
    , mProcess(new QProcess(this))
    , mRestartTimer(new QTimer(this))
{
    setWindowTitle(tr("SSH Proxy"));
    setWindowIcon(mConnectedIcon);

    mHostEdit->setText(mSettings->value("ssh/host").toString());
    mPortEdit->setText(mSettings->value("ssh/port", "22").toString());
    mUserEdit->setText(mSettings->value("ssh/user").toString());
    mLAddrEdit->setText(mSettings->value("ssh/laddr", "127.0.0.1").toString());
    mLPortEdit->setText(mSettings->value("ssh/lport", "1077").toString());
    mWaitEdit->setText(mSettings->value("ssh/wait", "10").toString());

    mPortEdit->setValidator(new QIntValidator(1, 65535));
    mPswdEdit->setEchoMode(QLineEdit::Password);
    mLPortEdit->setValidator(new QIntValidator(1, 65535));
    mWaitEdit->setValidator(new QIntValidator);
    mLogList->setWordWrap(true);

    mProcess->setProcessChannelMode(QProcess::MergedChannels);

    QLabel *hostLabel = new QLabel(tr("SSH Host:"));
    hostLabel->setBuddy(mHostEdit);
    QLabel *portLabel = new QLabel(tr("SSH Port:"));
    portLabel->setBuddy(mPortEdit);
    QLabel *userLabel = new QLabel(tr("Username:"******"Password:"******"Listen Addr:"));
    lAddrLabel->setBuddy(mLAddrEdit);
    QLabel *lPortLabel = new QLabel(tr("Listen Port:"));
    lPortLabel->setBuddy(mLPortEdit);
    QLabel *waitLabel = new QLabel(tr("Seconds wait to reconnect:"));
    waitLabel->setBuddy(mWaitEdit);

    QVBoxLayout *inputLayout = new QVBoxLayout;
    inputLayout->addWidget(hostLabel);
    inputLayout->addWidget(mHostEdit);
    inputLayout->addWidget(portLabel);
    inputLayout->addWidget(mPortEdit);
    inputLayout->addWidget(userLabel);
    inputLayout->addWidget(mUserEdit);
    inputLayout->addWidget(pswdLabel);
    inputLayout->addWidget(mPswdEdit);
    inputLayout->addWidget(lAddrLabel);
    inputLayout->addWidget(mLAddrEdit);
    inputLayout->addWidget(lPortLabel);
    inputLayout->addWidget(mLPortEdit);
    inputLayout->addWidget(waitLabel);
    inputLayout->addWidget(mWaitEdit);
    inputLayout->insertStretch(-1);
    inputLayout->addWidget(mCtrlBtn);
    inputLayout->addWidget(mQuitBtn);

    QGroupBox *inputGroup = new QGroupBox(tr("Settings"));
    inputGroup->setLayout(inputLayout);

    QVBoxLayout *logLayout = new QVBoxLayout;
    logLayout->addWidget(mLogList);

    QGroupBox *logGroup = new QGroupBox(tr("Log"));
    logGroup->setLayout(logLayout);

    QSplitter *splitter = new QSplitter(Qt::Horizontal);
    splitter->addWidget(inputGroup);
    splitter->addWidget(logGroup);
    splitter->setStretchFactor(1, 5);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(splitter);

    setLayout(mainLayout);
    resize(1000, 600);

    connect(mCtrlBtn, SIGNAL(clicked(void)), this, SLOT(on_mCtrlBtn_clicked(void)));
    connect(mQuitBtn, SIGNAL(clicked(void)), this, SLOT(onQuit(void)));

    mTray = new QSystemTrayIcon(mStoppedIcon);
    mTray->show();

    setSshStatus(StatStopped);

    connect(mTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(on_mTray_activated(QSystemTrayIcon::ActivationReason)));

    QAction *toggleAction = new QAction(tr("Toggle Main Dialog"), this);
    connect(toggleAction, SIGNAL(triggered(void)),
            this, SLOT(on_toggleAction_triggered(void)));

    QAction *quitAction = new QAction(tr("Quit"), this);
    connect(quitAction, SIGNAL(triggered(void)),
            this, SLOT(onQuit(void)));

    QMenu *trayMenu = new QMenu;
    trayMenu->addAction(toggleAction);
    trayMenu->addSeparator();
    trayMenu->addAction(quitAction);

    mTray->setContextMenu(trayMenu);

    connect(qApp, SIGNAL(aboutToQuit(void)), this, SLOT(onQuit(void)));

    connect(mProcess, SIGNAL(started(void)), this, SLOT(on_mProcess_started(void)));
    connect(mProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
            this, SLOT(on_mProcess_finished(int, QProcess::ExitStatus)));
    connect(mProcess, SIGNAL(error(QProcess::ProcessError)),
            this, SLOT(on_mProcess_error(QProcess::ProcessError)));
    connect(mProcess, SIGNAL(readyReadStandardOutput(void)),
            this, SLOT(on_mProcess_readyReadStandardOutput(void)));

    connect(mRestartTimer, SIGNAL(timeout(void)), this, SLOT(startRunning(void)));

    if (mHostEdit->text().isEmpty())
        mHostEdit->setFocus();
    else if (mPortEdit->text().isEmpty())
        mPortEdit->setFocus();
    else if (mUserEdit->text().isEmpty())
        mUserEdit->setFocus();
    else if (mPswdEdit->text().isEmpty())
        mPswdEdit->setFocus();
    else if (mLAddrEdit->text().isEmpty())
        mLAddrEdit->setFocus();
    else if (mLPortEdit->text().isEmpty())
        mLPortEdit->setFocus();
    else if (mWaitEdit->text().isEmpty())
        mWaitEdit->setFocus();
}
void CameraTab::init() {
   int i;

   // Lay them all out
   layout = new QGridLayout();
   this->setLayout(layout);

   // Set up pixmaps for camera image and RGB, YUV, HSV histograms
   for (i = 0; i < NUM_IMG_TYPES; i++) {
      // Create pixmap and label
      imagePixmaps[i] = QPixmap(320, 240);
      imagePixmaps[i].fill(Qt::darkGray);
      imageLabels[i] = new QLabel();
      imageLabels[i]->setPixmap(imagePixmaps[i]);

      // Set alignment and size of pixmaps
      imageLabels[i]->setAlignment(Qt::AlignTop);
      imageLabels[i]->setMinimumSize(IMAGE_COLS/2, IMAGE_ROWS/2);
      imageLabels[i]->setMaximumSize(IMAGE_COLS/2, IMAGE_ROWS/2);
   }

   // Position image and histogram pixmaps
   layout->addWidget(imageLabels[CAMERA], 0,0,1,1); // Camera image top left
   //layout->addWidget(imageLabels[RGB], 1,0,1,1); // RGB histogram below camera
   layout->addWidget(&pointCloud,      1,0,1,1);
   layout->addWidget(imageLabels[YUV], 0,1,1,1); // YUV histogram to right
   layout->addWidget(imageLabels[HSV], 1,1,1,1); // HSV histogram below YUV

   // Add controls
   QVBoxLayout *controlLayout = new QVBoxLayout();
   QButtonGroup *cameraGroup = new QButtonGroup();

   // Camera selector
   QGroupBox *cameraBox = new QGroupBox(tr("Camera"));
   QVBoxLayout *cameraGroupLayout = new QVBoxLayout();
   cameraBox->setLayout(cameraGroupLayout);
   controlLayout->addWidget(cameraBox);
   cameraGroupLayout->setAlignment(Qt::AlignTop);
   // Add top and bottom camera selector radio buttons
   QRadioButton *radioButton = new QRadioButton(QString("Top"), cameraBox);
   cameraGroupLayout->addWidget(radioButton);
   cameraGroup->addButton(radioButton, 0);
   radioButton = new QRadioButton(QString("Bottom"), cameraBox);
   cameraGroupLayout->addWidget(radioButton);
   cameraGroup->addButton(radioButton, 0);

   // Camera controls
   QGroupBox *controlsBox = new QGroupBox(tr("Camera Controls"));
   QGridLayout *controlsGroupLayout = new QGridLayout();
   controlsBox->setLayout(controlsGroupLayout);
   controlLayout->addWidget(controlsBox);

   for (i = 0; i < cNUM_CAM_CONTROLS; i++) {
      //QHBoxLayout *settingsGroupLayout = new QHBoxLayout();
      QLabel *nameLabel = new QLabel(ControlNames[i]);
      //QLabel *minLabel = new QLabel("0");
      QPushButton *decButton = new QPushButton("-");
      decButton->setMaximumSize(30,30);
      QLineEdit *currentValue =
            new QLineEdit(QString::number(controlValues[TOP_CAMERA][i]));
      QPushButton *incButton = new QPushButton("+");
      incButton->setMaximumSize(30,30);
      //QLabel *maxLabel = new QLabel("255");

      connect(decButton, SIGNAL(clicked(bool)),
              new CameraButtonHandler(this, i, decButton, currentValue),
              SLOT(clicked(bool)));
      connect(incButton, SIGNAL(clicked(bool)),
              new CameraButtonHandler(this, i, incButton, currentValue),
              SLOT(clicked(bool)));
      connect(currentValue, SIGNAL(editingFinished()),
              new CameraButtonHandler(this, i, NULL, currentValue),
              SLOT(clicked()));

      controlsGroupLayout->addWidget(nameLabel, i * 3, 0, 3, 1);
      //controlsGroupLayout->addWidget(minLabel, i * 3, 1, 3, 1);
      controlsGroupLayout->addWidget(decButton, i * 3, 2, 3, 1);
      controlsGroupLayout->addWidget(currentValue, i * 3, 3, 3, 1);
      controlsGroupLayout->addWidget(incButton, i * 3, 4, 3, 1);
      //controlsGroupLayout->addWidget(maxLabel, i * 3, 5, 3, 1);
      //controlsGroupLayout->addWidget(settingsGroupLayout);
   }

   // Add auto tuning button
   QPushButton *autoTuneButton = new QPushButton("Auto Tune");
   controlsGroupLayout->addWidget(autoTuneButton, i * 3, 2, 3, 3);
   connect(autoTuneButton, SIGNAL(clicked(bool)), this,
              SLOT(autoTuner()));
   layout->addLayout(controlLayout, 0,2,2,1);

   // Save default camera values so we can reset them after auto tuning
   for (int i = 0; i < cNUM_CONTROL_ATTRIBUTES; i++) {
      // THIS ASSUMES WE'RE ONLY USING THE BOTTOM CAMERA - FIX! morri
      for (int j = 0; j < NUM_CONTROLS; j++) {
         if (ControlValues[i].control == controlIds[j]) {
            ControlValues[i].current = controlValues[TOP_CAMERA][j];
         }
      }
   }

   // Initialise entropy
   bestEntropy = 0.0;
}
Beispiel #14
0
GeoDialog::GeoDialog( QWidget *parent, const char *name )
    : KDialogBase( Plain, i18n( "Geo Data Input" ), Ok | Cancel, Ok,
                   parent, name, true, true ),
      mUpdateSexagesimalInput( true )
{
    QFrame *page = plainPage();

    QGridLayout *topLayout = new QGridLayout( page, 2, 2, marginHint(),
            spacingHint() );
    topLayout->setRowStretch( 1, 1 );

    mMapWidget = new GeoMapWidget( page );
    topLayout->addMultiCellWidget( mMapWidget, 0, 1, 0, 0 );

    mCityCombo = new KComboBox( page );
    topLayout->addWidget( mCityCombo, 0, 1 );

    QGroupBox *sexagesimalGroup = new QGroupBox( 0, Vertical, i18n( "Sexagesimal" ), page );
    QGridLayout *sexagesimalLayout = new QGridLayout( sexagesimalGroup->layout(),
            2, 5, spacingHint() );

    QLabel *label = new QLabel( i18n( "Latitude:" ), sexagesimalGroup );
    sexagesimalLayout->addWidget( label, 0, 0 );

    mLatDegrees = new QSpinBox( 0, 90, 1, sexagesimalGroup );
    mLatDegrees->setSuffix( "°" );
    mLatDegrees->setWrapping( false );
    label->setBuddy( mLatDegrees );
    sexagesimalLayout->addWidget( mLatDegrees, 0, 1 );

    mLatMinutes = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLatMinutes->setSuffix( "'" );
    sexagesimalLayout->addWidget( mLatMinutes, 0, 2 );

    mLatSeconds = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLatSeconds->setSuffix( "\"" );
    sexagesimalLayout->addWidget( mLatSeconds, 0, 3 );

    mLatDirection = new KComboBox( sexagesimalGroup );
    mLatDirection->insertItem( i18n( "North" ) );
    mLatDirection->insertItem( i18n( "South" ) );
    sexagesimalLayout->addWidget( mLatDirection, 0, 4 );

    label = new QLabel( i18n( "Longitude:" ), sexagesimalGroup );
    sexagesimalLayout->addWidget( label, 1, 0 );

    mLongDegrees = new QSpinBox( 0, 180, 1, sexagesimalGroup );
    mLongDegrees->setSuffix( "°" );
    label->setBuddy( mLongDegrees );
    sexagesimalLayout->addWidget( mLongDegrees, 1, 1 );

    mLongMinutes = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLongMinutes->setSuffix( "'" );
    sexagesimalLayout->addWidget( mLongMinutes, 1, 2 );

    mLongSeconds = new QSpinBox( 0, 59, 1, sexagesimalGroup );
    mLongSeconds->setSuffix( "\"" );
    sexagesimalLayout->addWidget( mLongSeconds, 1, 3 );

    mLongDirection = new KComboBox( sexagesimalGroup );
    mLongDirection->insertItem( i18n( "East" ) );
    mLongDirection->insertItem( i18n( "West" ) );
    sexagesimalLayout->addWidget( mLongDirection, 1, 4 );

    topLayout->addWidget( sexagesimalGroup, 1, 1 );

    loadCityList();

    connect( mMapWidget, SIGNAL( changed() ),
             SLOT( geoMapChanged() ) );
    connect( mCityCombo, SIGNAL( activated( int ) ),
             SLOT( cityInputChanged() ) );
    connect( mLatDegrees, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatMinutes, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatSeconds, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLatDirection, SIGNAL( activated( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongDegrees, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongMinutes, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongSeconds, SIGNAL( valueChanged( int ) ),
             SLOT( sexagesimalInputChanged() ) );
    connect( mLongDirection, SIGNAL( activated( int ) ),
             SLOT( sexagesimalInputChanged() ) );

    KAcceleratorManager::manage( this );
}
Beispiel #15
0
void TupThemeSelector::setupChooseColor()
{
    TVHBox *hbox = new TVHBox(this, Qt::Horizontal);
    TVHBox *box1 = new TVHBox(hbox, Qt::Vertical);
    box1->boxLayout()->setMargin(10);
    m_general = new QGroupBox(tr("General"), box1);
    
    QGridLayout *layout1 = new QGridLayout(m_general);
    
    QStringList labels1 = QStringList() << tr("Text") << tr("Base") << tr("Foreground") << tr("Background") 
                << tr("Button") << tr("Button Text");
    
    QStringList names = QStringList() << "Text" << "Base" << "Foreground" << "Background" << "Button" << "ButtonText";
    
    QPalette colorGroup = QApplication::palette();
    
    QList<QColor> colors = QList<QColor>() << colorGroup.text ().color() << colorGroup.base().color() 
                << colorGroup.foreground().color() << colorGroup.background().color() 
                << colorGroup.button().color() << colorGroup.buttonText().color();
    
    for (int i = 0; i < labels1.count(); i++) {
         layout1->addWidget(new QLabel(labels1[i], m_general), i, 0 );
         TColorButton *button = new TColorButton(m_general);
         button->setObjectName(names[i]);
         QPalette pal = button->palette();
         pal.setColor(QPalette::Button, colors[i]);
         button->setPalette(pal);
        
         m_generalButtonGroup.addButton(button);
         layout1->addWidget(button, i, 1);
         m_generalSection.insert(names[i], colors[i].name());
    }
    
    m_effects = new QGroupBox(tr("Effects"), box1);
    
    QGridLayout *layout2 = new QGridLayout(m_effects);
    
    QStringList labels2 = QStringList() << tr("Light") << tr("Midlight") << tr("Dark") << tr("Mid");
    QStringList names2 = QStringList() << "Light" << "Midlight" << "Dark" << "Mid";
    
    colors.clear();
    colors << colorGroup.light().color() << colorGroup.midlight().color() << colorGroup.dark().color() 
        << colorGroup.mid().color();
    
    for (int i = 0; i < labels2.count(); i++) {
         layout2->addWidget(new QLabel(labels2[i], m_effects), i, 0);
         TColorButton *button = new TColorButton(m_effects);
         button->setObjectName(names2[i]);
         QPalette pal = button->palette();
         pal.setColor(QPalette::Button, colors[i]);
         button->setPalette(pal);
         m_effectsButtonGroup.addButton(button);
         layout2->addWidget(button, i, 1);
         m_effectsSection.insert(names2[i], colors[i].name());
    }
    ////////////
    
    TVHBox *box2 = new TVHBox(hbox, Qt::Vertical);
    box2->boxLayout()->setMargin(10);
    m_selections = new QGroupBox(tr("Selections"), box2);
    
    QGridLayout *layout3 = new QGridLayout(m_selections);
    
    QStringList labels3 = QStringList() << tr("Highlight") << tr("Highlighted Text");
    QStringList names3 = QStringList() << "Highlight" << "HighlightedText";
    colors.clear();
    colors << colorGroup.highlight().color() << colorGroup.highlightedText().color();
    
    for (int i = 0; i < labels3.count(); i++) {
         layout3->addWidget(new QLabel(labels3[i], m_selections), i, 0);
         TColorButton *button = new TColorButton(m_selections);
         button->setObjectName(names3[i]);
         QPalette pal = button->palette();
         pal.setColor(QPalette::Button, colors[i]);
         button->setPalette(pal);
         m_selectionsButtonGroup.addButton(button);
         layout3->addWidget(button, i, 1);
         m_selectionsSection.insert(names3[i], colors[i].name());
    }
    
    m_textEffects = new QGroupBox(tr("Text effects"), box2);
    
    QGridLayout *layout4 = new QGridLayout(m_textEffects);
    QStringList labels4 = QStringList() << tr("Bright Text") << tr("Link") << tr("Link Visited");
    QStringList names4 = QStringList() << "BrightText" << "Link" << "LinkVisited";
    
    colors.clear();
    colors << colorGroup.brightText().color() << colorGroup.link().color() << colorGroup.linkVisited().color();
    
    for (int i = 0; i < labels4.count(); i++) {
         layout4->addWidget(new QLabel(labels4[i], m_textEffects), i, 0 );
         TColorButton *button = new TColorButton(m_textEffects);
         button->setObjectName(names4[i]);
         QPalette pal = button->palette();
         pal.setColor(QPalette::Button, colors[i]);
         button->setPalette(pal);
         m_textEffectsButtonGroup.addButton(button);
         layout4->addWidget(button, i, 1);
         m_textEffectsSection.insert(names4[i], colors[i].name());
    }
    
    QGroupBox *schemeWidget = new QGroupBox(tr("Schema"), box2); // FIXME: add vertical layout
    QVBoxLayout *schemaLayout = new QVBoxLayout;
    
    m_allSchemes = new QTreeWidget;
    m_allSchemes->setHeaderLabels(QStringList() << tr("Schema") << tr("Owner") << tr("Date"));
    // m_allSchemes->header()->setResizeMode(QHeaderView::Stretch);
    m_allSchemes->header()->setSectionResizeMode(QHeaderView::Stretch);
    
    schemaLayout->addWidget(m_allSchemes);
    
    connect(m_allSchemes, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, 
                    SLOT(loadSchemaFromListView(QTreeWidgetItem *, int)));
    
    QPushButton *saveSchemeButton = new QPushButton(tr("Save schema"));
    connect(saveSchemeButton, SIGNAL(clicked()), SLOT(saveSchema()));
    
    schemaLayout->addWidget(saveSchemeButton);
    schemeWidget->setLayout(schemaLayout);
    
    new TSeparator(this);
    new QLabel(tr("Style"), this);
    new TStyleComboBox(this);
    
    new TSeparator(this);
    m_useColors = new QCheckBox(tr("Use this colors"), this);
    
    connect(&m_generalButtonGroup, SIGNAL(buttonClicked(QAbstractButton * )), 
        SLOT(chooseGeneralColor(QAbstractButton * )));
    connect(&m_effectsButtonGroup, SIGNAL(buttonClicked(QAbstractButton * )), 
        SLOT(chooseEffectsColor(QAbstractButton * )));
    connect(&m_selectionsButtonGroup, SIGNAL(buttonClicked(QAbstractButton * )), 
        SLOT(chooseSelectionsColor(QAbstractButton * )));
    connect(&m_textEffectsButtonGroup, SIGNAL(buttonClicked(QAbstractButton * )), 
        SLOT(chooseTextEffectsColor(QAbstractButton * )));
}
TableDialog::TableDialog(Table *t, QWidget* parent, Qt::WFlags fl )
    : QDialog( parent, fl),
    d_table(t)
{
    setName( "TableDialog" );
    setWindowTitle( tr( "QtiPlot - Column options" ) );
    setSizeGripEnabled(true);

	QHBoxLayout *hboxa = new QHBoxLayout();
	hboxa->addWidget(new QLabel(tr( "Column Name:" )));
    colName = new QLineEdit();
    hboxa->addWidget(colName);

	enumerateAllBox = new QCheckBox(tr("Enumerate all to the right" ));

	buttonPrev = new QPushButton("&<<");
	buttonPrev->setAutoDefault(false);

	buttonNext = new QPushButton("&>>");
	buttonNext->setAutoDefault(false);

#ifndef Q_OS_MAC
	buttonPrev->setMaximumWidth(40);
	buttonNext->setMaximumWidth(40);
#endif

	QHBoxLayout *hboxb = new QHBoxLayout();
    hboxb->addWidget(buttonPrev);
    hboxb->addWidget(buttonNext);
    hboxb->addStretch();

    QVBoxLayout *vbox1 = new QVBoxLayout();
    vbox1->addLayout(hboxa);
    vbox1->addWidget(enumerateAllBox);
    vbox1->addLayout(hboxb);

	buttonOk = new QPushButton(tr( "&OK" ));
    buttonOk->setDefault(true);

	buttonApply = new QPushButton(tr("&Apply"));
	buttonApply->setAutoDefault(false);

	buttonCancel = new QPushButton(tr( "&Cancel" ));
	buttonCancel->setAutoDefault(false);

	QVBoxLayout  *vbox2 = new QVBoxLayout();
	vbox2->setSpacing(5);
	vbox2->setMargin(5);
	vbox2->addWidget(buttonOk);
	vbox2->addWidget(buttonApply);
	vbox2->addWidget(buttonCancel);

    QHBoxLayout  *hbox1 = new QHBoxLayout();
	hbox1->setSpacing(5);
	hbox1->addLayout(vbox1);
	hbox1->addLayout(vbox2);

	QGridLayout *gl1 = new QGridLayout();
    gl1->addWidget(new QLabel( tr("Plot Designation:")), 0, 0);

   	columnsBox = new QComboBox();
	columnsBox->addItem(tr("None"));
	columnsBox->addItem(tr("X (abscissae)"));
	columnsBox->addItem(tr("Y (ordinates)"));
	columnsBox->addItem(tr("Z (height)"));
	columnsBox->addItem(tr("X Error"));
	columnsBox->addItem(tr("Y Error"));
	columnsBox->addItem(tr("Label"));
    gl1->addWidget(columnsBox, 0, 1);

    gl1->addWidget(new QLabel(tr("Display")), 1, 0);

   	displayBox = new QComboBox();
	displayBox->addItem(tr("Numeric"));
	displayBox->addItem(tr("Text"));
	displayBox->addItem(tr("Date"));
	displayBox->addItem(tr("Time"));
	displayBox->addItem(tr("Month"));
	displayBox->addItem(tr("Day of Week"));
    gl1->addWidget(displayBox, 1, 1);

    labelFormat = new QLabel(tr( "Format:" ));
 	gl1->addWidget(labelFormat, 2, 0);

    formatBox = new QComboBox(false);
    gl1->addWidget(formatBox, 2, 1);

	labelNumeric = new QLabel(tr( "Precision:" ));
	gl1->addWidget(labelNumeric, 3, 0);

    precisionBox = new QSpinBox();
    precisionBox->setRange(0, 14);
    gl1->addWidget(precisionBox, 3, 1);

    boxReadOnly = new QCheckBox(tr("&Read-only" ));
    gl1->addWidget(boxReadOnly, 4, 0);

	boxHideColumn = new QCheckBox(tr("&Hidden" ));
    gl1->addWidget(boxHideColumn, 4, 1);

	applyToRightCols = new QCheckBox(tr( "Apply to all columns to the right" ));

    QVBoxLayout *vbox3 = new QVBoxLayout();
    vbox3->addLayout(gl1);
    vbox3->addWidget(applyToRightCols);

    QGroupBox *gb = new QGroupBox(tr("Options"));
    gb->setLayout(vbox3);

    QHBoxLayout  *hbox2 = new QHBoxLayout();
    hbox2->addWidget(new QLabel(tr( "Column Width:" )));

	colWidth = new QSpinBox();
    colWidth->setRange(0, 1000);
	colWidth->setSingleStep(10);

	hbox2->addWidget(colWidth);

    applyToAllBox = new QCheckBox(tr( "Apply to all" ));
	hbox2->addWidget(applyToAllBox);

	comments = new QTextEdit();
	boxShowTableComments = new QCheckBox(tr("&Display Comments in Header"));
	boxShowTableComments->setChecked(d_table->commentsEnabled());

	QVBoxLayout* vbox4 = new QVBoxLayout();
    vbox4->addLayout(hbox1);
	vbox4->addWidget(gb);
	vbox4->addLayout(hbox2);
	vbox4->addWidget(new QLabel(tr( "Comment:" )));
	vbox4->addWidget(comments);
	vbox4->addWidget(boxShowTableComments);

    setLayout(vbox4);
    setFocusProxy (colName);

    updateColumn(d_table->selectedColumn());

   // signals and slots connections
	connect(colWidth, SIGNAL(valueChanged(int)), this, SLOT(setColumnWidth(int)));
	connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
    connect(buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) );
	connect(columnsBox, SIGNAL(activated(int)), this, SLOT(setPlotDesignation(int)) );
	connect(displayBox, SIGNAL(activated(int)), this, SLOT(updateDisplay(int)));
	connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn()));
	connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn()));
	connect(precisionBox, SIGNAL(valueChanged(int)), this, SLOT(updatePrecision(int)));
	connect(boxShowTableComments, SIGNAL(toggled(bool)), d_table, SLOT(showComments(bool)));
}
QWidget* AutoReply::options() {
	if (!enabled) {
		return 0;
	}
	QWidget *optionsWid = new QWidget();
	messageWidget = new QTextEdit();
	messageWidget->setMaximumHeight(60);
	messageWidget->setText(Message);
	disableforWidget = new QTextEdit();
	disableforWidget->setText(DisableFor);
	enabledisableWidget = new QComboBox();
	enabledisableWidget->addItem(tr("Enable"));
	enabledisableWidget->addItem(tr("Disable"));
	enabledisableWidget->setCurrentIndex(EnableDisable);
	DisableForAccWidget = new QTextEdit();
	DisableForAccWidget->setText(DisableForAcc);
	spinWidget = new QSpinBox();
	spinWidget->setMinimum(-1);
	spinWidget->setValue(Times);
	resetWidget = new QSpinBox();
	resetWidget->setMaximum(2000);
	resetWidget->setMinimum(1);
	resetWidget->setValue(ResetTime);
	activetabWidget = new QCheckBox(tr("Disable if chat window is active"));
	activetabWidget->setChecked(ActiveTabIsEnable);
	NotInRosterWidget = new QCheckBox(tr("Disable if contact isn't from your roster"));
	NotInRosterWidget->setChecked(NotInRoster);

	sonlineWidget = new QCheckBox(tr("Online"));
	sonlineWidget->setChecked(SOnline);
	sawayWidget = new QCheckBox(tr("Away"));
	sawayWidget->setChecked(SAway);
	sdndWidget = new QCheckBox(tr("Dnd"));
	sdndWidget->setChecked(SDnd);
	sxaWidget = new QCheckBox(tr("XA"));
	sxaWidget->setChecked(SXa);
	schatWidget = new QCheckBox(tr("Chat"));
	schatWidget->setChecked(SChat);
	sinvisWidget = new QCheckBox(tr("Invisible"));
	sinvisWidget->setChecked(SInvis);

	QGroupBox *groupBox = new QGroupBox(tr("Enable if status is:"));
	QHBoxLayout *statusLayout = new QHBoxLayout;
	statusLayout->addWidget(sonlineWidget);
	if(psiOptions->getGlobalOption("options.ui.menu.status.chat").toBool()) {
		statusLayout->addWidget(schatWidget); }
	statusLayout->addWidget(sawayWidget);
	statusLayout->addWidget(sdndWidget);
	if(psiOptions->getGlobalOption("options.ui.menu.status.xa").toBool()) {
		statusLayout->addWidget(sxaWidget); }
	if(psiOptions->getGlobalOption("options.ui.menu.status.invisible").toBool()) {
		statusLayout->addWidget(sinvisWidget); }
	statusLayout->addStretch();
	groupBox->setLayout(statusLayout);

	QVBoxLayout *Layout = new QVBoxLayout;
	Layout->addWidget(new QLabel(tr("Auto Reply Message:")));
	Layout->addWidget(messageWidget);
	QVBoxLayout *disableLayout = new QVBoxLayout;
	QHBoxLayout *EnDis = new QHBoxLayout;
	EnDis->addWidget(enabledisableWidget);
	EnDis->addWidget(new QLabel(tr("for JIDs and conferences:")));
	QLabel *Label = new QLabel(tr("You can also specify a part of JID\n(without any additional symbols)"));
	QFont font;
	font.setPointSize(8);
	Label->setFont(font);
	disableLayout->addLayout(EnDis);
	disableLayout->addWidget(disableforWidget);
	disableLayout->addWidget(Label);
	QVBoxLayout *AccLayout = new QVBoxLayout;
	AccLayout->addWidget(new QLabel(tr("Disable for your accounts (specify your JIDs):")));
	AccLayout->addWidget(DisableForAccWidget);
	QHBoxLayout *resetLayout = new QHBoxLayout;
	resetLayout->addWidget(new QLabel(tr("Timeout to reset counter:")));
	resetLayout->addWidget(resetWidget);
	resetLayout->addWidget(new QLabel(tr("min.")));
	resetLayout->addStretch();
	QHBoxLayout *timesLayout = new QHBoxLayout;
	timesLayout->addWidget(new QLabel(tr("Send maximum")));
	timesLayout->addWidget(spinWidget);
	timesLayout->addWidget(new QLabel(tr("times (-1=infinite)")));
	timesLayout->addStretch();
	QVBoxLayout *flags = new QVBoxLayout;
	flags->addLayout(AccLayout);
	flags->addStretch();
	flags->addLayout(timesLayout);
	flags->addLayout(resetLayout);
	flags->addWidget(activetabWidget);
	flags->addWidget(NotInRosterWidget);
	QHBoxLayout *hLayout = new QHBoxLayout;
	hLayout->addLayout(disableLayout);
	QFrame *frame = new QFrame();
	frame->setMinimumWidth(8);
	hLayout->addWidget(frame);
	hLayout->addLayout(flags);
	QLabel *wikiLink = new QLabel(tr("<a href=\"http://psi-plus.com/wiki/plugins#autoreply_plugin\">Wiki (Online)</a>"));
	wikiLink->setOpenExternalLinks(true);
	QVBoxLayout *tab1Layout = new QVBoxLayout(optionsWid);
	tab1Layout->addLayout(Layout);
	tab1Layout->addStretch();
	tab1Layout->addLayout(hLayout);
	tab1Layout->addWidget(groupBox);
	tab1Layout->addWidget(wikiLink);

	connect(enabledisableWidget, SIGNAL(currentIndexChanged(int)), SLOT(setEnableDisableText(int)));

	return optionsWid;
}
DevFindDialog::DevFindDialog(QTextEdit *e)
 : QDialog(e), edit(e)
{
	setWindowTitle("Find text");
	
	connect(this, SIGNAL( accepted() ),
			this, SLOT  ( setVars() ) );
	
	QLabel *lbl;
	QGroupBox *g;
	QVBoxLayout *b;
	QGridLayout *l = new QGridLayout;
	
	text = new QLineEdit;
	lbl = new QLabel("Text to Find");
	l->addWidget(lbl, 0, 0, 1, 1);
	l->addWidget(text, 0, 1, 1, 3);
	
	g = new QGroupBox("Options");
	b = new QVBoxLayout;
	
	sensitive = new QCheckBox("Case &sensitive");
	b->addWidget(sensitive);
	
	bound = new QCheckBox("&Whole words only");
	b->addWidget(bound);
	
	g->setLayout(b);
	l->addWidget(g, 1, 0, 3, 2);
	
	g = new QGroupBox("Direction");
	b = new QVBoxLayout;
	
	forward = new QRadioButton("Forward");
	forward->toggle();
	b->addWidget(forward);
	
	backward = new QRadioButton("Backward");
	b->addWidget(backward);
	
	g->setLayout(b);
	l->addWidget(g, 1, 2, 3, 2);
	
	g = new QGroupBox("Scope");
	b = new QVBoxLayout;
	
	global = new QRadioButton("Global");
	global->toggle();
	b->addWidget(global);
	
	selection = new QRadioButton("Selected only");
	b->addWidget(selection);
	
	g->setLayout(b);
	l->addWidget(g, 4, 0, 3, 2);
	
	g = new QGroupBox("Origin");
	b = new QVBoxLayout;
	
	cursor = new QRadioButton("Cursor");
	cursor->toggle();
	b->addWidget(cursor);
	
	whole = new QRadioButton("Entire scope");
	b->addWidget(whole);
	
	g->setLayout(b);
	l->addWidget(g, 4, 2, 3, 2);
	
	b_accept = new QPushButton("&Find");
	connect(b_accept, SIGNAL( clicked() ),
			this	, SLOT  ( accept() ) );
	l->addWidget(b_accept, 7, 0, 1, 1);
	
	b_cancel = new QPushButton("&Cancel");
	connect(b_cancel, SIGNAL( clicked() ),
			this	, SLOT  ( reject() ) );
	l->addWidget(b_cancel, 7, 3, 1, 1);
	
	setLayout(l);
}
Beispiel #19
0
GradientWidget::GradientWidget(QWidget *parent)
    : QWidget(parent)
{
    setWindowTitle(tr("Gradients"));

    m_renderer = new GradientRenderer(this);

    QGroupBox *mainGroup = new QGroupBox(this);
    mainGroup->setTitle(tr("Gradients"));

    QGroupBox *editorGroup = new QGroupBox(mainGroup);
    editorGroup->setTitle(tr("Color Editor"));
    m_editor = new GradientEditor(editorGroup);

    QGroupBox *typeGroup = new QGroupBox(mainGroup);
    typeGroup->setTitle(tr("Gradient Type"));
    m_linearButton = new QRadioButton(tr("Linear Gradient"), typeGroup);
    m_radialButton = new QRadioButton(tr("Radial Gradient"), typeGroup);
    m_conicalButton = new QRadioButton(tr("Conical Gradient"), typeGroup);

    QGroupBox *spreadGroup = new QGroupBox(mainGroup);
    spreadGroup->setTitle(tr("Spread Method"));
    m_padSpreadButton = new QRadioButton(tr("Pad Spread"), spreadGroup);
    m_reflectSpreadButton = new QRadioButton(tr("Reflect Spread"), spreadGroup);
    m_repeatSpreadButton = new QRadioButton(tr("Repeat Spread"), spreadGroup);

    QGroupBox *defaultsGroup = new QGroupBox(mainGroup);
    defaultsGroup->setTitle(tr("Defaults"));
    QPushButton *default1Button = new QPushButton(tr("1"), defaultsGroup);
    QPushButton *default2Button = new QPushButton(tr("2"), defaultsGroup);
    QPushButton *default3Button = new QPushButton(tr("3"), defaultsGroup);
    QPushButton *default4Button = new QPushButton(tr("Reset"), editorGroup);

    QPushButton *showSourceButton = new QPushButton(mainGroup);
    showSourceButton->setText(tr("Show Source"));
#ifdef QT_OPENGL_SUPPORT
    QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
    enableOpenGLButton->setText(tr("Use OpenGL"));
    enableOpenGLButton->setCheckable(true);
    enableOpenGLButton->setChecked(m_renderer->usesOpenGL());
    if (!QGLFormat::hasOpenGL())
        enableOpenGLButton->hide();
#endif
    QPushButton *whatsThisButton = new QPushButton(mainGroup);
    whatsThisButton->setText(tr("What's This?"));
    whatsThisButton->setCheckable(true);

    // Layouts
    QHBoxLayout *mainLayout = new QHBoxLayout(this);
    mainLayout->addWidget(m_renderer);
    mainLayout->addWidget(mainGroup);

    mainGroup->setFixedWidth(180);
    QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup);
    mainGroupLayout->addWidget(editorGroup);
    mainGroupLayout->addWidget(typeGroup);
    mainGroupLayout->addWidget(spreadGroup);
    mainGroupLayout->addWidget(defaultsGroup);
    mainGroupLayout->addStretch(1);
    mainGroupLayout->addWidget(showSourceButton);
#ifdef QT_OPENGL_SUPPORT
    mainGroupLayout->addWidget(enableOpenGLButton);
#endif
    mainGroupLayout->addWidget(whatsThisButton);

    QVBoxLayout *editorGroupLayout = new QVBoxLayout(editorGroup);
    editorGroupLayout->addWidget(m_editor);

    QVBoxLayout *typeGroupLayout = new QVBoxLayout(typeGroup);
    typeGroupLayout->addWidget(m_linearButton);
    typeGroupLayout->addWidget(m_radialButton);
    typeGroupLayout->addWidget(m_conicalButton);

    QVBoxLayout *spreadGroupLayout = new QVBoxLayout(spreadGroup);
    spreadGroupLayout->addWidget(m_padSpreadButton);
    spreadGroupLayout->addWidget(m_repeatSpreadButton);
    spreadGroupLayout->addWidget(m_reflectSpreadButton);

    QHBoxLayout *defaultsGroupLayout = new QHBoxLayout(defaultsGroup);
    defaultsGroupLayout->addWidget(default1Button);
    defaultsGroupLayout->addWidget(default2Button);
    defaultsGroupLayout->addWidget(default3Button);
    editorGroupLayout->addWidget(default4Button);

    connect(m_editor, SIGNAL(gradientStopsChanged(QGradientStops)),
            m_renderer, SLOT(setGradientStops(QGradientStops)));

    connect(m_linearButton, SIGNAL(clicked()), m_renderer, SLOT(setLinearGradient()));
    connect(m_radialButton, SIGNAL(clicked()), m_renderer, SLOT(setRadialGradient()));
    connect(m_conicalButton, SIGNAL(clicked()), m_renderer, SLOT(setConicalGradient()));

    connect(m_padSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setPadSpread()));
    connect(m_reflectSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setReflectSpread()));
    connect(m_repeatSpreadButton, SIGNAL(clicked()), m_renderer, SLOT(setRepeatSpread()));

    connect(default1Button, SIGNAL(clicked()), this, SLOT(setDefault1()));
    connect(default2Button, SIGNAL(clicked()), this, SLOT(setDefault2()));
    connect(default3Button, SIGNAL(clicked()), this, SLOT(setDefault3()));
    connect(default4Button, SIGNAL(clicked()), this, SLOT(setDefault4()));

    connect(showSourceButton, SIGNAL(clicked()), m_renderer, SLOT(showSource()));
#ifdef QT_OPENGL_SUPPORT
    connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool)));
#endif
    connect(whatsThisButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setDescriptionEnabled(bool)));
    connect(whatsThisButton, SIGNAL(clicked(bool)),
            m_renderer->hoverPoints(), SLOT(setDisabled(bool)));
    connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
            whatsThisButton, SLOT(setChecked(bool)));
    connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
            m_renderer->hoverPoints(), SLOT(setDisabled(bool)));

    m_renderer->loadSourceFile(":res/gradients/gradients.cpp");
    m_renderer->loadDescription(":res/gradients/gradients.html");

    QTimer::singleShot(50, this, SLOT(setDefault1()));
}
Beispiel #20
0
/*
 * displays the informations relative to a game on the board window
 */
void InterfaceHandler::updateCaption(GameData *gd)
{
	// Print caption
	// example: qGo 0.0.5 - Zotan 8k vs. tgmouse 10k
	// or if game name is given: qGo 0.0.5 - Kogo's Joseki Dictionary
	boardwindow->setWindowTitle( /* QString(isModified ? "* " : "") + */
		( (gd->number != 0 && gd->number < 10000) ?
			"(" + QString::number(gd->number) + ") " : 
			QString()) + (gd->gameName.isEmpty() ?
				gd->white_name 
				+ (!gd->white_rank.isEmpty() ?
					" " + gd->white_rank : 
					QString()) 
				+ " " + QObject::tr("vs.") + " " + gd->black_name 
				+ (!gd->black_rank.isEmpty() ?
					" " + gd->black_rank : 
					QString()) :
				gd->gameName) +	"   " + QString(PACKAGE));


	bool simple = gd->white_rank.length() == 0 && gd->black_rank.length() == 0;
	QGroupBox *gb = boardwindow->getUi()->whiteFrame;
	/* This name stuff is super redundant with below FIXME */
	QString player = gd->white_name;
	if (simple && player == QObject::tr("White"))
		gb->setTitle(QObject::tr("White"));	
	else if(!gd->nigiriToBeSettled)
	{
		// truncate to 13 characters max
		player.truncate(13);

		if (gd->white_rank.length() != 0)
			player = QObject::tr("W") + ": " + player + " " + gd->white_rank;
		else
			player = QObject::tr("W") + ": " + player;
		
		gb->setTitle(player);
	}

	gb = boardwindow->getUi()->blackFrame;

	player = gd->black_name;
	if (simple && player == QObject::tr("Black"))
		gb->setTitle(QObject::tr("Black"));	
	else if(!gd->nigiriToBeSettled)
	{
		// truncate to 13 characters max
		player.truncate(13);

		if (gd->black_rank.length() != 0)
			player = QObject::tr("B") + ": " + player + " " + gd->black_rank;
		else
			player = QObject::tr("B") + ": " + player;
		
		gb->setTitle(player);
	}
	
	//TODO set  clock
	
	if(gd->free_rated == RATED)
		boardwindow->getUi()->freeratedLabel->setText("Rated");
	else if(gd->free_rated == FREE)
		boardwindow->getUi()->freeratedLabel->setText("Free");
	else if(gd->free_rated == TEACHING)
		boardwindow->getUi()->freeratedLabel->setText("Teaching");
	
	boardwindow->getUi()->komi->setText(QString().setNum(gd->komi));
	boardwindow->getUi()->handicap->setText(QString().setNum(gd->handicap));
}
Beispiel #21
0
void PathDeformControls::layoutForSmallScreen()
{
    QGroupBox* mainGroup = new QGroupBox(this);
    mainGroup->setTitle(tr("Controls"));

    QLabel *radiusLabel = new QLabel(mainGroup);
    radiusLabel->setText(tr("Lens Radius:"));
    QSlider *radiusSlider = new QSlider(Qt::Horizontal, mainGroup);
    radiusSlider->setRange(15, 150);
    radiusSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QLabel *deformLabel = new QLabel(mainGroup);
    deformLabel->setText(tr("Deformation:"));
    QSlider *deformSlider = new QSlider(Qt::Horizontal, mainGroup);
    deformSlider->setRange(-100, 100);
    deformSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QLabel *fontSizeLabel = new QLabel(mainGroup);
    fontSizeLabel->setText(tr("Font Size:"));
    QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, mainGroup);
    fontSizeSlider->setRange(16, 200);
    fontSizeSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QPushButton *animateButton = new QPushButton(tr("Animated"), mainGroup);
    animateButton->setCheckable(true);

#ifdef QT_OPENGL_SUPPORT
    QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
    enableOpenGLButton->setText(tr("Use OpenGL"));
    enableOpenGLButton->setCheckable(mainGroup);
    enableOpenGLButton->setChecked(m_renderer->usesOpenGL());
    if (!QGLFormat::hasOpenGL())
        enableOpenGLButton->hide();
#endif

    QPushButton *quitButton = new QPushButton(tr("Quit"), mainGroup);
    QPushButton *okButton = new QPushButton(tr("OK"), mainGroup);


    QGridLayout *mainGroupLayout = new QGridLayout(mainGroup);
    mainGroupLayout->setMargin(0);
    mainGroupLayout->addWidget(radiusLabel, 0, 0, Qt::AlignRight);
    mainGroupLayout->addWidget(radiusSlider, 0, 1);
    mainGroupLayout->addWidget(deformLabel, 1, 0, Qt::AlignRight);
    mainGroupLayout->addWidget(deformSlider, 1, 1);
    mainGroupLayout->addWidget(fontSizeLabel, 2, 0, Qt::AlignRight);
    mainGroupLayout->addWidget(fontSizeSlider, 2, 1);
    mainGroupLayout->addWidget(animateButton, 3,0, 1,2);
#ifdef QT_OPENGL_SUPPORT
    mainGroupLayout->addWidget(enableOpenGLButton, 4,0, 1,2);
#endif

    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    mainLayout->addWidget(mainGroup);
    mainLayout->addStretch(1);
    mainLayout->addWidget(okButton);
    mainLayout->addWidget(quitButton);

    connect(quitButton, SIGNAL(clicked()), this, SIGNAL(quitPressed()));
    connect(okButton, SIGNAL(clicked()), this, SIGNAL(okPressed()));
    connect(radiusSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setRadius(int)));
    connect(deformSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setIntensity(int)));
    connect(fontSizeSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setFontSize(int)));
    connect(animateButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setAnimated(bool)));
#ifdef QT_OPENGL_SUPPORT
    connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool)));
#endif


    animateButton->animateClick();
    deformSlider->setValue(80);
    fontSizeSlider->setValue(120);

    QRect screen_size = QApplication::desktop()->screenGeometry();
    radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/5);

    m_renderer->setText(tr("Qt"));
}
Beispiel #22
0
int main(int argc, char **argv)
{

    QApplication app(argc, argv);

    // Initializing the graph and its container
    Q3DScatter *graph = new Q3DScatter();
    QWidget *container = QWidget::createWindowContainer(graph);
    //! [0]

    QSize screenSize = graph->screen()->size();
    container->setMinimumSize(QSize(screenSize.width() / 2.25, screenSize.height() / 4));
    container->setMaximumSize(screenSize);
    container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    container->setFocusPolicy(Qt::StrongFocus);

    //! [1]
    QWidget *widget = new QWidget;
    QGroupBox *menuLayout = new QGroupBox;
    QGroupBox *optionLayout = new QGroupBox;
    QVBoxLayout *vLayout = new QVBoxLayout(widget);
    vLayout->addWidget(menuLayout);
    vLayout->addWidget(container, 1);
    vLayout->addWidget(optionLayout);
    //! [1]

    widget->setWindowTitle(QStringLiteral("CRN Dava Visualization"));

    //! [4]
    /*
    QComboBox *themeList = new QComboBox(widget);
    themeList->addItem(QStringLiteral("Qt"));
    themeList->addItem(QStringLiteral("Primary Colors"));
    themeList->addItem(QStringLiteral("Digia"));
    themeList->addItem(QStringLiteral("Stone Moss"));
    themeList->addItem(QStringLiteral("Army Blue"));
    themeList->addItem(QStringLiteral("Retro"));
    themeList->addItem(QStringLiteral("Ebony"));
    themeList->addItem(QStringLiteral("Isabelle"));
    themeList->setCurrentIndex(6);

    QPushButton *labelButton = new QPushButton(widget);
    labelButton->setText(QStringLiteral("Change label style"));
    */
    int logoHeight = 100, logoWidth = 300;
    int buttonSize = 100;
    QGridLayout *gridMenu = new QGridLayout();
    QPushButton *taLogoLabel = new QPushButton();
    QPushButton *configLabel = new QPushButton();
    QPushButton *saveLabel = new QPushButton();
    QPushButton *openLabel = new QPushButton();
    QPushButton *globeLabel = new QPushButton();
    QPixmap taLogoPix("/home/adityarputra/Pictures/placeholder.png");
    QIcon taLogoIcon(taLogoPix);
    QPixmap configPix("/home/adityarputra/Pictures/placeholder.png");
    QIcon configIcon(configPix);
    QPixmap savePix("/home/adityarputra/Pictures/placeholder.png");
    QIcon saveIcon(savePix);
    QPixmap openPix("/home/adityarputra/Pictures/placeholder.png");
    QIcon openIcon(openPix);
    QPixmap globePix("/home/adityarputra/Pictures/placeholder.png");
    QIcon globeIcon(globePix);

    taLogoLabel->setIcon(taLogoIcon);
    taLogoLabel->setMaximumSize(logoWidth,logoHeight);
    //taLogoLabel->setText("TA logo label");
    configLabel->setIcon(configIcon);
    configLabel->setMaximumSize(buttonSize,buttonSize);
    //configLabel->setText("Config Icon");
    saveLabel->setIcon(saveIcon);
    saveLabel->setMaximumSize(buttonSize,buttonSize);
    //saveLabel->setText("Save Icon");
    openLabel->setIcon(openIcon);
    openLabel->setMaximumSize(buttonSize,buttonSize);
    //openLabel->setText("Open Icon");
    globeLabel->setIcon(globeIcon);
    globeLabel->setMaximumSize(buttonSize,buttonSize);
    //globeLabel->setText("Globe Icon");

    gridMenu->addWidget(taLogoLabel,0,0);
    gridMenu->addWidget(configLabel,0,2);
    gridMenu->addWidget(saveLabel,0,3);
    gridMenu->addWidget(openLabel,0,4);
    gridMenu->addWidget(globeLabel,0,5);

    gridMenu->setColumnStretch(0,300);
    gridMenu->setRowMinimumHeight(0,100);
    gridMenu->setColumnStretch(1,100);
    gridMenu->setColumnStretch(2,100);
    gridMenu->setColumnStretch(3,100);
    gridMenu->setColumnStretch(4,100);
    gridMenu->setColumnStretch(5,100);

    menuLayout->setLayout(gridMenu);

    //-----------------------------------//
    QGridLayout *gridOption = new QGridLayout();
    QComboBox *gasTypeCombo = new QComboBox();
    QPushButton *rewindButton = new QPushButton();
    QPushButton *prevButton = new QPushButton();
    QPushButton *startButton = new QPushButton();
    QPushButton *nextButton = new QPushButton();
    QPushButton *forwardButton = new QPushButton();
    QTableWidget *sensorDataTable = new QTableWidget();
    QPlainTextEdit *console = new QPlainTextEdit();

    sensorDataTable->setRowCount(60);
    sensorDataTable->setColumnCount(9);

    QPixmap buttonPix("/home/adityarputra/Pictures/placeholder.png");
    QIcon buttonIcon(buttonPix);

    rewindButton->setIcon(buttonIcon);
    rewindButton->setMaximumWidth(50);
    prevButton->setIcon(buttonIcon);
    prevButton->setMaximumWidth(50);
    startButton->setIcon(buttonIcon);
    startButton->setMaximumWidth(50);
    nextButton->setIcon(buttonIcon);
    nextButton->setMaximumWidth(50);
    forwardButton->setIcon(buttonIcon);
    forwardButton->setMaximumWidth(50);

    gridOption->addWidget(sensorDataTable,0,6,3,1);
    gridOption->addWidget(gasTypeCombo,0,0,1,5);
    gridOption->addWidget(rewindButton,1,0);
    gridOption->addWidget(prevButton,1,1);
    gridOption->addWidget(startButton,1,2);
    gridOption->addWidget(nextButton,1,3);
    gridOption->addWidget(forwardButton,1,4);
    gridOption->addWidget(console,2,0,1,5);
    gridOption->setColumnStretch(0,50);
    gridOption->setColumnStretch(1,50);
    gridOption->setColumnStretch(2,50);
    gridOption->setColumnStretch(3,50);
    gridOption->setColumnStretch(4,50);
    gridOption->setColumnStretch(5,50);
    gridOption->setColumnStretch(6,400);

    optionLayout->setLayout(gridOption);

    //----------------------------------To be deleted---------------------------------
    /*QCheckBox *smoothCheckBox = new QCheckBox(widget);
    smoothCheckBox->setText(QStringLiteral("Smooth dots"));
    smoothCheckBox->setChecked(true);

    QComboBox *itemStyleList = new QComboBox(widget);
    itemStyleList->addItem(QStringLiteral("Sphere"), int(QAbstract3DSeries::MeshSphere));
    itemStyleList->addItem(QStringLiteral("Cube"), int(QAbstract3DSeries::MeshCube));
    itemStyleList->addItem(QStringLiteral("Minimal"), int(QAbstract3DSeries::MeshMinimal));
    itemStyleList->addItem(QStringLiteral("Point"), int(QAbstract3DSeries::MeshPoint));
    itemStyleList->setCurrentIndex(0);

    QPushButton *cameraButton = new QPushButton(widget);
    cameraButton->setText(QStringLiteral("Change camera preset"));

    QPushButton *itemCountButton = new QPushButton(widget);
    itemCountButton->setText(QStringLiteral("Toggle item count"));

    QCheckBox *backgroundCheckBox = new QCheckBox(widget);
    backgroundCheckBox->setText(QStringLiteral("Show background"));
    backgroundCheckBox->setChecked(true);

    QCheckBox *gridCheckBox = new QCheckBox(widget);
    gridCheckBox->setText(QStringLiteral("Show grid"));
    gridCheckBox->setChecked(true);

    QComboBox *shadowQuality = new QComboBox(widget);
    shadowQuality->addItem(QStringLiteral("None"));
    shadowQuality->addItem(QStringLiteral("Low"));
    shadowQuality->addItem(QStringLiteral("Medium"));
    shadowQuality->addItem(QStringLiteral("High"));
    shadowQuality->addItem(QStringLiteral("Low Soft"));
    shadowQuality->addItem(QStringLiteral("Medium Soft"));
    shadowQuality->addItem(QStringLiteral("High Soft"));
    shadowQuality->setCurrentIndex(4);

    QFontComboBox *fontList = new QFontComboBox(widget);
    fontList->setCurrentFont(QFont("Arial"));*/
    //----------------------------------------------------------------

    // Adding widget to respective layout
    /*
    vLayout->addWidget(labelButton, 0, Qt::AlignTop);
    vLayout->addWidget(cameraButton, 0, Qt::AlignTop);
    vLayout->addWidget(itemCountButton, 0, Qt::AlignTop);
    vLayout->addWidget(backgroundCheckBox);
    vLayout->addWidget(gridCheckBox);
    vLayout->addWidget(smoothCheckBox, 0, Qt::AlignTop);
    vLayout->addWidget(new QLabel(QStringLiteral("Change dot style")));
    vLayout->addWidget(itemStyleList);
    vLayout->addWidget(new QLabel(QStringLiteral("Change theme")));
    vLayout->addWidget(themeList);
    vLayout->addWidget(new QLabel(QStringLiteral("Adjust shadow quality")));
    vLayout->addWidget(shadowQuality);
    vLayout->addWidget(new QLabel(QStringLiteral("Change font")));
    vLayout->addWidget(fontList, 1, Qt::AlignTop);
    */
    //! [5]

    //! [2]
    ScatterDataModifier *modifier = new ScatterDataModifier(graph);
    //! [2]

    connect(configLabel,SIGNAL(clicked(bool)),this,
    /*
    QObject::connect(cameraButton, &QPushButton::clicked, modifier,
                     &ScatterDataModifier::changePresetCamera);
    QObject::connect(labelButton, &QPushButton::clicked, modifier,
                     &ScatterDataModifier::changeLabelStyle);
    QObject::connect(itemCountButton, &QPushButton::clicked, modifier,
                     &ScatterDataModifier::toggleItemCount);

    QObject::connect(backgroundCheckBox, &QCheckBox::stateChanged, modifier,
                     &ScatterDataModifier::setBackgroundEnabled);
    QObject::connect(gridCheckBox, &QCheckBox::stateChanged, modifier,
                     &ScatterDataModifier::setGridEnabled);
    QObject::connect(smoothCheckBox, &QCheckBox::stateChanged, modifier,
                     &ScatterDataModifier::setSmoothDots);

    QObject::connect(modifier, &ScatterDataModifier::backgroundEnabledChanged,
                     backgroundCheckBox, &QCheckBox::setChecked);
    QObject::connect(modifier, &ScatterDataModifier::gridEnabledChanged,
                     gridCheckBox, &QCheckBox::setChecked);
    QObject::connect(itemStyleList, SIGNAL(currentIndexChanged(int)), modifier,
                     SLOT(changeStyle(int)));

    QObject::connect(themeList, SIGNAL(currentIndexChanged(int)), modifier,
                     SLOT(changeTheme(int)));

    QObject::connect(shadowQuality, SIGNAL(currentIndexChanged(int)), modifier,
                     SLOT(changeShadowQuality(int)));

    QObject::connect(modifier, &ScatterDataModifier::shadowQualityChanged, shadowQuality,
                     &QComboBox::setCurrentIndex);
    QObject::connect(graph, &Q3DScatter::shadowQualityChanged, modifier,
                     &ScatterDataModifier::shadowQualityUpdatedByVisual);

    QObject::connect(fontList, &QFontComboBox::currentFontChanged, modifier,
                     &ScatterDataModifier::changeFont);
    QObject::connect(modifier, &ScatterDataModifier::fontChanged, fontList,
                     &QFontComboBox::setCurrentFont);
    */
    //! [6]

    //! [3]
    widget->show();
    return app.exec();
    //! [3]
}
Beispiel #23
0
CompositionWidget::CompositionWidget(void)
{
	/* ViewGroup */
	QGroupBox* viewGroup = new QGroupBox(this);
	QGroupBox* meshViewGroup = new QGroupBox(viewGroup);
	meshViewGroup->setTitle(tr("Mesh View"));
	mMeshViewer = new MeshViewer(meshViewGroup);
	QGroupBox* skeletonViewGroup = new QGroupBox(viewGroup);
	skeletonViewGroup->setTitle(tr("Skeleton View"));
	mSkeletonViewer = new SkeletonViewer(skeletonViewGroup);
	 
	/* ControlGroup */
	QGroupBox* buttonGroup = new QGroupBox(this);
	buttonGroup->setTitle(QObject::tr("Drape"));
	QPushButton* extractSkeletonButton = new QPushButton(buttonGroup);
	extractSkeletonButton->setText(QObject::tr("Extract Skeleton"));	 
	QPushButton* findNeckButton = new QPushButton(buttonGroup);
	findNeckButton->setText(QObject::tr("Deform Cloth"));
	QPushButton* moveClothButton = new QPushButton(buttonGroup);
	moveClothButton->setText(QObject::tr("Move Cloth"));
	QPushButton* resolvePenetrationButton = new QPushButton(buttonGroup);
	resolvePenetrationButton->setText(QObject::tr("Resolve Penetration"));
	QPushButton* physicalSimuationButton = new QPushButton(buttonGroup);
	physicalSimuationButton->setText(QObject::tr("PhysicalSimuate"));
	QPushButton* physicalSimuationStopButton = new QPushButton(buttonGroup);
	physicalSimuationStopButton->setText(QObject::tr("Stop PhysicalSimuation"));
	 
	/* Layout */
	QHBoxLayout* mainLayout = new QHBoxLayout(this);
	QSizePolicy sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
	sizePolicy.setHorizontalStretch(4);
	viewGroup->setSizePolicy(sizePolicy);
	sizePolicy.setHorizontalStretch(1);
	buttonGroup->setSizePolicy(sizePolicy);
	mainLayout->addWidget(viewGroup);
	mainLayout->addWidget(buttonGroup);


	QVBoxLayout* viewGroupLayout = new QVBoxLayout(viewGroup);
	viewGroupLayout->addWidget(meshViewGroup);
	viewGroupLayout->addWidget(skeletonViewGroup);
	QVBoxLayout* meshViewGroupLayout = new QVBoxLayout(meshViewGroup);
	meshViewGroupLayout->addWidget(mMeshViewer);
	QVBoxLayout* skeletonViewGroupLayout = new QVBoxLayout(skeletonViewGroup);
	skeletonViewGroupLayout->addWidget(mSkeletonViewer);
	
	QVBoxLayout* buttonGroupLayout = new QVBoxLayout(buttonGroup);
	buttonGroupLayout->addWidget(extractSkeletonButton);
	buttonGroupLayout->addWidget(findNeckButton);
	buttonGroupLayout->addWidget(moveClothButton);
	buttonGroupLayout->addWidget(resolvePenetrationButton);
	buttonGroupLayout->addWidget(physicalSimuationButton);
	buttonGroupLayout->addWidget(physicalSimuationStopButton);

	connect(extractSkeletonButton, SIGNAL(clicked()), this, SLOT(extractSkeleton()));
	connect(moveClothButton, SIGNAL(clicked()), this, SLOT(moveCloth()));
	connect(findNeckButton, SIGNAL(clicked()), this, SLOT(deformCloth()));
	connect(resolvePenetrationButton, SIGNAL(clicked()), this, SLOT(resolvePenetration()));
	connect(physicalSimuationButton, SIGNAL(clicked()), this, SLOT(startPhysicalSimulation()));
	connect(physicalSimuationStopButton, SIGNAL(clicked()), this, SLOT(stopPhysicalSimulation()));

//	SkeletonUtility utility;
//	utility.readIntoContainer("humanskeleton.txt");
//	utility.readIntoContainer("clothskeleton.txt");
//
// 	for (int i = 0; i < globalSkeletonContainer.size(); i++)
// 	{
// 		Skeleton& skeleton = globalSkeletonContainer.getSkeletonRef(i);
// 		skeleton.findNeck();
// 		skeleton.findHand();
// 	}
//  	utility.skeletonMatch(globalSkeletonContainer.getSkeletonRef(0), globalSkeletonContainer.getSkeletonRef(1));
// 
//  	mSkeletonViewer->updateSkeleton();		

	mInterval = 1000/25;
}
Beispiel #24
0
QWidget* RenderingWidget::createNavigationControlWidget()
{
  QWidget* panel = new QWidget();
  QVBoxLayout* layout = new QVBoxLayout();

  {
    QPushButton* but = new QPushButton("reset");
    but->setToolTip("move the camera to initial position (with animation)");
    layout->addWidget(but);
    connect(but, SIGNAL(clicked()), this, SLOT(resetCamera()));
  }
  {
    // navigation mode
    QGroupBox* box = new QGroupBox("navigation mode");
    QVBoxLayout* boxLayout = new QVBoxLayout;
    QButtonGroup* group = new QButtonGroup(panel);
    QRadioButton* but;
    but = new QRadioButton("turn around");
    but->setToolTip("look around an object");
    group->addButton(but, NavTurnAround);
    boxLayout->addWidget(but);
    but = new QRadioButton("fly");
    but->setToolTip("free navigation like a spaceship\n(this mode can also be enabled pressing the \"shift\" key)");
    group->addButton(but, NavFly);
    boxLayout->addWidget(but);
    group->button(mNavMode)->setChecked(true);
    connect(group, SIGNAL(buttonClicked(int)), this, SLOT(setNavMode(int)));
    box->setLayout(boxLayout);
    layout->addWidget(box);
  }
  {
    // track ball, rotation mode
    QGroupBox* box = new QGroupBox("rotation mode");
    QVBoxLayout* boxLayout = new QVBoxLayout;
    QButtonGroup* group = new QButtonGroup(panel);
    QRadioButton* but;
    but = new QRadioButton("stable trackball");
    group->addButton(but, RotationStable);
    boxLayout->addWidget(but);
    but->setToolTip("use the stable trackball implementation mapping\nthe 2D coordinates to 3D points on a sphere");
    but = new QRadioButton("standard rotation");
    group->addButton(but, RotationStandard);
    boxLayout->addWidget(but);
    but->setToolTip("standard approach mapping the x and y displacements\nas rotations around the camera's X and Y axes");
    group->button(mRotationMode)->setChecked(true);
    connect(group, SIGNAL(buttonClicked(int)), this, SLOT(setRotationMode(int)));
    box->setLayout(boxLayout);
    layout->addWidget(box);
  }
  {
    // interpolation mode
    QGroupBox* box = new QGroupBox("spherical interpolation");
    QVBoxLayout* boxLayout = new QVBoxLayout;
    QButtonGroup* group = new QButtonGroup(panel);
    QRadioButton* but;
    but = new QRadioButton("quaternion slerp");
    group->addButton(but, LerpQuaternion);
    boxLayout->addWidget(but);
    but->setToolTip("use quaternion spherical interpolation\nto interpolate orientations");
    but = new QRadioButton("euler angles");
    group->addButton(but, LerpEulerAngles);
    boxLayout->addWidget(but);
    but->setToolTip("use Euler angles to interpolate orientations");
    group->button(mNavMode)->setChecked(true);
    connect(group, SIGNAL(buttonClicked(int)), this, SLOT(setLerpMode(int)));
    box->setLayout(boxLayout);
    layout->addWidget(box);
  }
  layout->addItem(new QSpacerItem(0,0,QSizePolicy::Minimum,QSizePolicy::Expanding));
  panel->setLayout(layout);
  return panel;
}
Beispiel #25
0
GeneralPage::GeneralPage(QWidget* parent) : QWidget(parent)
{
    QSettings settings("Pencil","Pencil");
    QVBoxLayout* lay = new QVBoxLayout();

    QGroupBox* windowOpacityBox = new QGroupBox(tr("Window opacity"));
    QGroupBox* backgroundBox = new QGroupBox(tr("Background"));
    QGroupBox* appearanceBox = new QGroupBox(tr("Appearance"));
    QGroupBox* displayBox = new QGroupBox(tr("Rendering"));
    QGroupBox* editingBox = new QGroupBox(tr("Editing"));

    QLabel* windowOpacityLabel = new QLabel(tr("Opacity"));
    QSlider* windowOpacityLevel = new QSlider(Qt::Horizontal);
    windowOpacityLevel->setMinimum(30);
    windowOpacityLevel->setMaximum(100);
    int value = settings.value("windowOpacity").toInt();
    windowOpacityLevel->setValue( 100 - value );

    QButtonGroup* backgroundButtons = new QButtonGroup();
    QRadioButton* checkerBackgroundButton = new QRadioButton();
    QRadioButton* whiteBackgroundButton = new QRadioButton();
    QRadioButton* greyBackgroundButton = new QRadioButton();
    QRadioButton* dotsBackgroundButton = new QRadioButton();
    QRadioButton* weaveBackgroundButton = new QRadioButton();
    QPixmap previewCheckerboard(32,32);
    QPixmap previewWhite(32,32);
    QPixmap previewGrey(32,32);
    QPixmap previewDots(32,32);
    QPixmap previewWeave(32,32);
    QPainter painter(&previewCheckerboard);
    painter.fillRect( QRect(0,0,32,32), ScribbleArea::getBackgroundBrush("checkerboard") );
    painter.end();
    painter.begin(&previewDots);
    painter.fillRect( QRect(0,0,32,32), ScribbleArea::getBackgroundBrush("dots") );
    painter.end();
    painter.begin(&previewWeave);
    painter.fillRect( QRect(0,0,32,32), ScribbleArea::getBackgroundBrush("weave") );
    painter.end();
    previewWhite.fill( Qt::white );
    previewGrey.fill( Qt:: lightGray );
    checkerBackgroundButton->setIcon( previewCheckerboard );
    whiteBackgroundButton->setIcon( previewWhite );
    greyBackgroundButton->setIcon( previewGrey );
    dotsBackgroundButton->setIcon( previewDots );
    dotsBackgroundButton->setIcon( previewWeave );
    backgroundButtons->addButton(checkerBackgroundButton);
    backgroundButtons->addButton(whiteBackgroundButton);
    backgroundButtons->addButton(greyBackgroundButton);
    backgroundButtons->addButton(dotsBackgroundButton);
    backgroundButtons->addButton(weaveBackgroundButton);
    backgroundButtons->setId(checkerBackgroundButton, 1);
    backgroundButtons->setId(whiteBackgroundButton, 2);
    backgroundButtons->setId(greyBackgroundButton, 3);
    backgroundButtons->setId(dotsBackgroundButton, 4);
    backgroundButtons->setId(weaveBackgroundButton, 5);
    QHBoxLayout* backgroundLayout = new QHBoxLayout();
    backgroundBox->setLayout(backgroundLayout);
    backgroundLayout->addWidget(checkerBackgroundButton);
    backgroundLayout->addWidget(whiteBackgroundButton);
    backgroundLayout->addWidget(greyBackgroundButton);
    backgroundLayout->addWidget(dotsBackgroundButton);
    backgroundLayout->addWidget(weaveBackgroundButton);
    if ( settings.value("background").toString() == "checkerboard" ) checkerBackgroundButton->setChecked(true);
    if ( settings.value("background").toString() == "white" ) whiteBackgroundButton->setChecked(true);
    if ( settings.value("background").toString() == "grey" ) greyBackgroundButton->setChecked(true);
    if ( settings.value("background").toString() == "dots" ) dotsBackgroundButton->setChecked(true);
    if ( settings.value("background").toString() == "weave" ) weaveBackgroundButton->setChecked(true);

    QCheckBox* shadowsBox = new QCheckBox(tr("Shadows"));
    shadowsBox->setChecked(false); // default
    if (settings.value("shadows").toString()=="true") shadowsBox->setChecked(true);

    QCheckBox* toolCursorsBox = new QCheckBox(tr("Tool Cursors"));
    toolCursorsBox->setChecked(true); // default
    if (settings.value("toolCursors").toString()=="false") toolCursorsBox->setChecked(false);

    QCheckBox* aquaBox = new QCheckBox(tr("Aqua Style"));
    aquaBox->setChecked(false); // default
    if (settings.value("style").toString()=="aqua") aquaBox->setChecked(true);

    QCheckBox* antialiasingBox = new QCheckBox(tr("Antialiasing"));
    antialiasingBox->setChecked(true); // default
    if (settings.value("antialiasing").toString()=="false") antialiasingBox->setChecked(false);

    QButtonGroup* gradientsButtons = new QButtonGroup();
    QRadioButton* gradient1Button = new QRadioButton(tr("None"));
    QRadioButton* gradient2Button = new QRadioButton(tr("Quick"));
    QRadioButton* gradient3Button = new QRadioButton(tr("Gradient1"));
    QRadioButton* gradient4Button = new QRadioButton(tr("Gradient2"));
    gradientsButtons->addButton(gradient1Button);
    gradientsButtons->addButton(gradient2Button);
    gradientsButtons->addButton(gradient3Button);
    gradientsButtons->addButton(gradient4Button);
    gradientsButtons->setId(gradient1Button, 1);
    gradientsButtons->setId(gradient2Button, 2);
    gradientsButtons->setId(gradient3Button, 3);
    gradientsButtons->setId(gradient4Button, 4);
    QGroupBox* gradientsBox = new QGroupBox(tr("Gradients"));
    QHBoxLayout* gradientsLayout = new QHBoxLayout();
    gradientsBox->setLayout(gradientsLayout);
    gradientsLayout->addWidget(gradient1Button);
    gradientsLayout->addWidget(gradient2Button);
    gradientsLayout->addWidget(gradient3Button);
    gradientsLayout->addWidget(gradient4Button);
    if ( settings.value("gradients").toString() == "1" ) gradient1Button->setChecked(true);
    if ( settings.value("gradients").toString() == "2" ) gradient2Button->setChecked(true);
    if ( settings.value("gradients").toString() == "" )  gradient2Button->setChecked(true); // default
    if ( settings.value("gradients").toString() == "3" ) gradient3Button->setChecked(true);
    if ( settings.value("gradients").toString() == "4" ) gradient4Button->setChecked(true);


    /*QCheckBox *gradientsBox = new QCheckBox(tr("Gradients"));
    gradientsBox->setChecked(true); // default
    if (settings.value("gradients").toString()=="0") gradientsBox->setChecked(false);*/

    QLabel* curveOpacityLabel = new QLabel(tr("Vector curve opacity"));
    QSlider* curveOpacityLevel = new QSlider(Qt::Horizontal);
    curveOpacityLevel->setMinimum(0);
    curveOpacityLevel->setMaximum(100);
    curveOpacityLevel->setValue( 100 - settings.value("curveOpacity").toInt() );

    QGridLayout* windowOpacityLayout = new QGridLayout();
    windowOpacityBox->setLayout(windowOpacityLayout);
    windowOpacityLayout->addWidget(windowOpacityLabel, 0, 0);
    windowOpacityLayout->addWidget(windowOpacityLevel, 0, 1);

    QVBoxLayout* appearanceLayout = new QVBoxLayout();
    appearanceBox->setLayout(appearanceLayout);
    appearanceLayout->addWidget(shadowsBox);
    appearanceLayout->addWidget(toolCursorsBox);
#ifdef Q_WS_MAC
    appearanceLayout->addWidget(aquaBox);
#endif

    QGridLayout* displayLayout = new QGridLayout();
    displayBox->setLayout(displayLayout);
    displayLayout->addWidget(antialiasingBox, 0, 0);
    displayLayout->addWidget(gradientsBox, 1, 0);
    displayLayout->addWidget(curveOpacityLabel, 2, 0);
    displayLayout->addWidget(curveOpacityLevel, 3, 0);

    QLabel* curveSmoothingLabel = new QLabel(tr("Vector curve smoothing"));
    QSlider* curveSmoothingLevel = new QSlider(Qt::Horizontal);
    curveSmoothingLevel->setMinimum(1);
    curveSmoothingLevel->setMaximum(100);
    value = settings.value("curveSmoothing").toInt();
    curveSmoothingLevel->setValue( value );

    QCheckBox* highResBox = new QCheckBox(tr("Tablet high-resolution position"));
    if (settings.value("highResPosition")=="true") highResBox->setChecked(true);
    else highResBox->setChecked(false);

    QGridLayout* editingLayout = new QGridLayout();
    editingBox->setLayout(editingLayout);
    editingLayout->addWidget(curveSmoothingLabel, 0, 0);
    editingLayout->addWidget(curveSmoothingLevel, 1, 0);
    editingLayout->addWidget(highResBox, 2, 0);

    //QLabel *fontSizeLabel = new QLabel(tr("Labels font size"));
    //QDoubleSpinBox *fontSize = new QDoubleSpinBox();

    /*fontSize->setMinimum(4);
    fontSize->setMaximum(20);
    frameSize->setMinimum(4);
    frameSize->setMaximum(20);

    fontSize->setFixedWidth(50);
    frameSize->setFixedWidth(50);
    lengthSize->setFixedWidth(50);

    if (settings.value("drawLabel")=="false") drawLabel->setChecked(false);
    else drawLabel->setChecked(true);
    fontSize->setValue(settings.value("labelFontSize").toInt());
    frameSize->setValue(settings.value("frameSize").toInt());
    if (settings.value("labelFontSize").toInt()==0) fontSize->setValue(12);
    if (settings.value("frameSize").toInt()==0) frameSize->setValue(6);
    lengthSize->setText(settings.value("length").toString());
    if (settings.value("length").toInt()==0) lengthSize->setText("240");

    connect(fontSize, SIGNAL(valueChanged(int)), this, SIGNAL(fontSizeChange(int)));
    connect(frameSize, SIGNAL(valueChanged(int)), this, SIGNAL(frameSizeChange(int)));
    connect(lengthSize, SIGNAL(textChanged(QString)), this, SIGNAL(lengthSizeChange(QString)));
    connect(drawLabel, SIGNAL(stateChanged(int)), this, SIGNAL(labelChange(int)));*/

    lay->addWidget(windowOpacityBox);
    lay->addWidget(appearanceBox);
    lay->addWidget(backgroundBox);
    lay->addWidget(displayBox);
    lay->addWidget(editingBox);

    connect(windowOpacityLevel, SIGNAL(valueChanged(int)), parent, SIGNAL(windowOpacityChange(int)));
    connect(backgroundButtons, SIGNAL(buttonClicked(int)), parent, SIGNAL(backgroundChange(int)));
    connect(gradientsButtons, SIGNAL(buttonClicked(int)), parent, SIGNAL(gradientsChange(int)));
    connect(shadowsBox, SIGNAL(stateChanged(int)), parent, SIGNAL(shadowsChange(int)));
    connect(toolCursorsBox, SIGNAL(stateChanged(int)), parent, SIGNAL(toolCursorsChange(int)));
    connect(aquaBox, SIGNAL(stateChanged(int)), parent, SIGNAL(styleChange(int)));
    connect(antialiasingBox, SIGNAL(stateChanged(int)), parent, SIGNAL(antialiasingChange(int)));
    connect(curveOpacityLevel, SIGNAL(valueChanged(int)), parent, SIGNAL(curveOpacityChange(int)));
    connect(curveSmoothingLevel, SIGNAL(valueChanged(int)), parent, SIGNAL(curveSmoothingChange(int)));
    connect(highResBox, SIGNAL(stateChanged(int)), parent, SIGNAL(highResPositionChange(int)));

    /*lay->addWidget(fontSizeLabel);
    lay->addWidget(fontSize);
    lay->addWidget(frameSizeLabel);
    lay->addWidget(frameSize);
    lay->addWidget(lengthSizeLabel);
    lay->addWidget(lengthSize);*/
    setLayout(lay);
}
Beispiel #26
0
DigiSettingsDialog::DigiSettingsDialog(TextDoc *Doc_)
                  : QDialog(Doc_) 
{
  Doc = Doc_;
  setWindowTitle(tr("Document Settings"));

  Expr.setPattern("[0-9][0-9a-zA-Z ]+"); // valid expression for LineEdit
  Validator = new QRegExpValidator(Expr, this);

  QVBoxLayout *all = new QVBoxLayout(this);
  all->setMargin(5);

  QGroupBox *setGroup = new QGroupBox(tr("Digital Simulation Settings"));
  all->addWidget(setGroup);
 
  QVBoxLayout *group = new QVBoxLayout();
  setGroup->setLayout(group);
   
  QButtonGroup *toggleGroup = new QButtonGroup();
  simRadio = new QRadioButton(tr("Simulation"));
  group->addWidget(simRadio);
  simRadio->setChecked(Doc->simulation);

  QHBoxLayout *hb1 = new QHBoxLayout();
  hb1->setSpacing(5);
  TimeLabel = new QLabel(tr("Duration of Simulation:"));
  hb1->addWidget(TimeLabel);
  Doc->loadSimulationTime(SimTime);
  TimeEdit = new QLineEdit();
  hb1->addWidget(TimeEdit);
  TimeEdit->setValidator(Validator);
  TimeEdit->setText(SimTime);
  group->addLayout(hb1);

  QRadioButton *comRadio = new QRadioButton(tr("Precompile Module"));
  group->addWidget(comRadio);
  toggleGroup->addButton(simRadio);
  toggleGroup->addButton(comRadio);
  connect(toggleGroup, SIGNAL(buttonClicked(int)), SLOT(slotChangeMode(int)));

  QHBoxLayout *hb3 = new QHBoxLayout();
  hb3->setSpacing(5);
  NameLabel = new QLabel(tr("Library Name:"));
  hb3->addWidget(NameLabel);
  NameEdit = new QLineEdit();
  hb3->addWidget(NameEdit);
  NameEdit->setText(Doc->Library);
  group->addLayout(hb3);

  group->addSpacing(15);
  
  QHBoxLayout *hb2 = new QHBoxLayout();
  hb2->setSpacing(5);
  LibLabel = new QLabel(tr("Libraries:"));
  hb2->addWidget(LibLabel);
  LibEdit = new QLineEdit();
  hb2->addWidget(LibEdit);
  LibEdit->setText(Doc->Libraries);
  group->addLayout(hb2);

  all->addSpacing(5);
  all->addStretch();
  QHBoxLayout *Buttons = new QHBoxLayout();
  QPushButton *ButtonOk = new QPushButton(tr("Ok"));
  QPushButton *ButtonCancel = new QPushButton(tr("Cancel"));
  Buttons->addWidget(ButtonOk);
  Buttons->addWidget(ButtonCancel);
  connect(ButtonOk, SIGNAL(clicked()), SLOT(slotOk()));
  connect(ButtonCancel, SIGNAL(clicked()), SLOT(reject()));
  all->addLayout(Buttons);

  simRadio->setChecked(Doc->simulation);
  Doc->SimOpenDpl = Doc->simulation ? true : false;
  comRadio->setChecked(!Doc->simulation);
  slotChangeMode(!Doc->simulation);

  ButtonOk->setDefault(true);
  if(Doc->simulation) {
    setFocusProxy(TimeEdit);
    TimeEdit->setFocus();
  }
  else {
    setFocusProxy(NameEdit);
    NameEdit->setFocus();
  }
}
void MainWindow::addWidgets()
{
    Q_D(MainWindow);

    int i = 0;

    d->mainContainer = new QWidget(this);

    // Selectors and file chooser
    d->deviceSel = new QComboBox(d->mainContainer);
    d->instLocSel = new QComboBox(d->mainContainer);
    d->instLocDesc = new QLabel(d->mainContainer);

    // Labels
    d->deviceLbl = new QLabel(tr("Device:"), d->mainContainer);
    d->instLocLbl = new QLabel(tr("Install to:"), d->mainContainer);

    // Text boxes
    d->instLocLe = new QLineEdit(d->mainContainer);
    d->instLocLe->setPlaceholderText(tr("Enter an ID"));
    QRegExp re(QStringLiteral("[a-z0-9]+"));
    QValidator *validator = new QRegExpValidator(re, this);
    d->instLocLe->setValidator(validator);

    QGridLayout *layout = new QGridLayout(d->mainContainer);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(d->deviceLbl, i, 0);
    layout->addWidget(d->deviceSel, i, 1, 1, -1);
    layout->addWidget(d->instLocLbl, ++i, 0);
    layout->addWidget(d->instLocSel, i, 1, 1, -1);
    layout->addWidget(d->instLocLe, ++i, 1, 1, -1);
    layout->addWidget(d->instLocDesc, ++i, 1, 1, -1);

    // Add items for unsupported files
    d->messageLbl = new QLabel(d->mainContainer);
    // Don't allow the window to grow too big
    d->messageLbl->setWordWrap(true);
    d->messageLbl->setMaximumWidth(550);
    d->presetLbl = new QLabel(tr("Preset:"), d->mainContainer);
    d->presetSel = new QComboBox(d->mainContainer);
    d->deviceCheckLbl = new QLabel(tr("Remove device check"), d->mainContainer);
    d->deviceCheckCb = new QCheckBox(d->mainContainer);
    d->hasBootImageLbl = new QLabel(tr("Has boot image"), d->mainContainer);
    d->hasBootImageCb = new QCheckBox(d->mainContainer);
    d->bootImageLbl = new QLabel(tr("Boot image"), d->mainContainer);
    d->bootImageLe = new QLineEdit(d->mainContainer);
    d->bootImageLe->setPlaceholderText(tr("Leave blank to autodetect"));

    d->chooseFileBtn = new QPushButton(tr("Choose file"), d->mainContainer);
    d->chooseAnotherFileBtn = new QPushButton(tr("Choose another file"), d->mainContainer);
    d->startPatchingBtn = new QPushButton(tr("Start patching"), d->mainContainer);

    d->buttons = new QDialogButtonBox(d->mainContainer);
    d->buttons->addButton(d->chooseFileBtn, QDialogButtonBox::ActionRole);
    d->buttons->addButton(d->chooseAnotherFileBtn, QDialogButtonBox::ActionRole);
    d->buttons->addButton(d->startPatchingBtn, QDialogButtonBox::ActionRole);

    QWidget *horiz1 = newHorizLine(d->mainContainer);
    QWidget *horiz2 = newHorizLine(d->mainContainer);
    QWidget *horiz3 = newHorizLine(d->mainContainer);

    layout->setColumnStretch(0, 0);
    layout->setColumnStretch(1, 0);
    layout->setColumnStretch(2, 0);
    layout->setColumnStretch(3, 1);

    layout->addWidget(horiz1,             ++i, 0, 1, -1);
    layout->addWidget(d->messageLbl,      ++i, 0, 1, -1);
    layout->addWidget(horiz2,             ++i, 0, 1, -1);
    layout->addWidget(d->presetLbl,       ++i, 0, 1,  1);
    layout->addWidget(d->presetSel,         i, 2, 1, -1);
    layout->addWidget(horiz3,             ++i, 0, 1, -1);
    layout->addWidget(d->deviceCheckLbl,  ++i, 0, 1,  1);
    layout->addWidget(d->deviceCheckCb,     i, 1, 1,  1);
    layout->addWidget(d->hasBootImageLbl, ++i, 0, 1,  1);
    layout->addWidget(d->hasBootImageCb,    i, 1, 1,  1);
    layout->addWidget(d->bootImageLbl,      i, 2, 1,  1);
    layout->addWidget(d->bootImageLe,       i, 3, 1, -1);


    layout->addWidget(newHorizLine(d->mainContainer), ++i, 0, 1, -1);

    layout->addWidget(d->buttons,         ++i, 0, 1, -1);


    d->mainContainer->setLayout(layout);

    // List of widgets related to the message label
    d->messageWidgets << horiz1;
    d->messageWidgets << d->messageLbl;

    // List of unsupported widgets
    d->unsupportedWidgets << horiz2;
    d->unsupportedWidgets << horiz3;
    d->unsupportedWidgets << d->presetLbl;
    d->unsupportedWidgets << d->presetSel;
    d->unsupportedWidgets << d->deviceCheckLbl;
    d->unsupportedWidgets << d->deviceCheckCb;
    d->unsupportedWidgets << d->hasBootImageLbl;
    d->unsupportedWidgets << d->hasBootImageCb;
    d->unsupportedWidgets << d->bootImageLbl;
    d->unsupportedWidgets << d->bootImageLe;

    // List of custom preset widgets
    d->customPresetWidgets << d->deviceCheckLbl;
    d->customPresetWidgets << d->deviceCheckCb;
    d->customPresetWidgets << d->hasBootImageLbl;
    d->customPresetWidgets << d->hasBootImageCb;
    d->customPresetWidgets << d->bootImageLbl;
    d->customPresetWidgets << d->bootImageLe;

    // List of boot image-related widgets
    d->bootImageWidgets << d->bootImageLbl;
    d->bootImageWidgets << d->bootImageLe;

    // Buttons
    d->progressContainer = new QWidget(this);
    QBoxLayout *progressLayout = new QVBoxLayout(d->progressContainer);
    progressLayout->setContentsMargins(0, 0, 0, 0);

    QGroupBox *detailsBox = new QGroupBox(d->progressContainer);
    detailsBox->setTitle(tr("Details"));

    d->detailsLbl = new QLabel(detailsBox);
    d->detailsLbl->setWordWrap(true);
    // Make sure the window doesn't change size while patching
    d->detailsLbl->setFixedWidth(500);

    QVBoxLayout *detailsLayout = new QVBoxLayout(detailsBox);
    detailsLayout->addWidget(d->detailsLbl);
    detailsBox->setLayout(detailsLayout);

    d->progressBar = new QProgressBar(d->progressContainer);
    //d->progressBar->setFormat(tr("%p% - %v / %m files"));
    d->progressBar->setMaximum(0);
    d->progressBar->setMinimum(0);
    d->progressBar->setValue(0);

    progressLayout->addWidget(detailsBox);
    //progressLayout->addStretch(1);
    progressLayout->addWidget(newHorizLine(d->progressContainer));
    progressLayout->addWidget(d->progressBar);
    d->progressContainer->setLayout(progressLayout);


    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    mainLayout->addWidget(d->mainContainer);
    mainLayout->addWidget(d->progressContainer);
    setLayout(mainLayout);
}
Beispiel #28
0
K3bWriterSelectionWidget::K3bWriterSelectionWidget( QWidget *parent, const char *name )
  : QWidget( parent, name )
{
  d = new Private;
  d->forceAutoSpeed = false;
  d->supportedWritingApps = K3b::CDRECORD|K3b::CDRDAO|K3b::GROWISOFS;
  d->lastSetSpeed = -1;

  QGroupBox* groupWriter = new QGroupBox( this );
  groupWriter->setTitle( i18n( "Burn Medium" ) );
  groupWriter->setColumnLayout(0, Qt::Vertical );
  groupWriter->layout()->setSpacing( 0 );
  groupWriter->layout()->setMargin( 0 );

  QGridLayout* groupWriterLayout = new QGridLayout( groupWriter->layout() );
  groupWriterLayout->setAlignment( Qt::AlignTop );
  groupWriterLayout->setSpacing( KDialog::spacingHint() );
  groupWriterLayout->setMargin( KDialog::marginHint() );

  QLabel* labelSpeed = new QLabel( groupWriter, "TextLabel1" );
  labelSpeed->setText( i18n( "Speed:" ) );

  m_comboSpeed = new KComboBox( false, groupWriter, "m_comboSpeed" );
  m_comboSpeed->setAutoMask( false );
  m_comboSpeed->setDuplicatesEnabled( false );

  m_comboMedium = new MediaSelectionComboBox( groupWriter );

  m_writingAppLabel = new QLabel( i18n("Writing app:"), groupWriter );
  m_comboWritingApp = new KComboBox( groupWriter );

  groupWriterLayout->addWidget( m_comboMedium, 0, 0 );
  groupWriterLayout->addWidget( labelSpeed, 0, 1 );
  groupWriterLayout->addWidget( m_comboSpeed, 0, 2 );
  groupWriterLayout->addWidget( m_writingAppLabel, 0, 3 );
  groupWriterLayout->addWidget( m_comboWritingApp, 0, 4 );
  groupWriterLayout->setColStretch( 0, 1 );


  QGridLayout* mainLayout = new QGridLayout( this );
  mainLayout->setAlignment( Qt::AlignTop );
  mainLayout->setSpacing( KDialog::spacingHint() );
  mainLayout->setMargin( 0 );

  mainLayout->addWidget( groupWriter, 0, 0 );

  // tab order
  setTabOrder( m_comboMedium, m_comboSpeed );
  setTabOrder( m_comboSpeed, m_comboWritingApp );

  connect( m_comboMedium, SIGNAL(selectionChanged(K3bDevice::Device*)), this, SIGNAL(writerChanged()) );
  connect( m_comboMedium, SIGNAL(selectionChanged(K3bDevice::Device*)),
	   this, SIGNAL(writerChanged(K3bDevice::Device*)) );
  connect( m_comboMedium, SIGNAL(newMedia()), this, SIGNAL(newMedia()) );
  connect( m_comboMedium, SIGNAL(newMedium(K3bDevice::Device*)), this, SIGNAL(newMedium(K3bDevice::Device*)) );
  connect( m_comboMedium, SIGNAL(newMedium(K3bDevice::Device*)), this, SLOT(slotNewBurnMedium(K3bDevice::Device*)) );
  connect( m_comboWritingApp, SIGNAL(activated(int)), this, SLOT(slotWritingAppSelected(int)) );
  connect( this, SIGNAL(writerChanged()), SLOT(slotWriterChanged()) );
  connect( m_comboSpeed, SIGNAL(activated(int)), this, SLOT(slotSpeedChanged(int)) );


  QToolTip::add( m_comboMedium, i18n("The medium that will be used for burning") );
  QToolTip::add( m_comboSpeed, i18n("The speed at which to burn the medium") );
  QToolTip::add( m_comboWritingApp, i18n("The external application to actually burn the medium") );

  QWhatsThis::add( m_comboMedium, i18n("<p>Select the medium that you want to use for burning."
				       "<p>In most cases there will only be one medium available which "
				       "does not leave much choice.") );
  QWhatsThis::add( m_comboSpeed, i18n("<p>Select the speed with which you want to burn."
				      "<p><b>Auto</b><br>"
				      "This will choose the maximum writing speed possible with the used "
				      "medium. "
				      "This is the recommended selection for most media.</p>"
				      "<p><b>Ignore</b> (DVD only)<br>"
				      "This will leave the speed selection to the writer device. "
				      "Use this if K3b is unable to set the writing speed."
				      "<p>1x refers to 1385 KB/s for DVD and 175 KB/s for CD.</p>"
				      "<p><b>Caution:</b> Make sure your system is able to send the data "
				      "fast enough to prevent buffer underruns.") );
  QWhatsThis::add( m_comboWritingApp, i18n("<p>K3b uses the command line tools cdrecord, growisofs, and cdrdao "
					   "to actually write a CD or DVD."
					   "<p>Normally K3b chooses the best "
					   "suited application for every task automatically but in some cases it "
					   "may be possible that one of the applications does not work as intended "
					   "with a certain writer. In this case one may select the "
					   "application manually.") );

  clearSpeedCombo();

  slotConfigChanged(k3bcore->config());
  slotWriterChanged();
}
Beispiel #29
0
KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *)
  : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone)
{
  QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3;
  QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint());
  QGrid *grid;
  QGroupBox *box;
  QLabel *label;
  QString strMouseButton1, strMouseButton3, strMouseWheel;
  QString txtButton1, txtButton3, txtButton4;
  QStringList items;
  bool leftHandedMouse = ( KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded);

/** Titlebar doubleclick ************/

  QHBoxLayout *hlayout = new QHBoxLayout(layout);

  label = new QLabel(i18n("&Titlebar double-click:"), this);
  hlayout->addWidget(label);
  QWhatsThis::add( label, i18n("Here you can customize mouse click behavior when double clicking on the"
    " titlebar of a window.") );

  QComboBox* combo = new QComboBox(this);
  combo->insertItem(i18n("Maximize"));
  combo->insertItem(i18n("Maximize (vertical only)"));
  combo->insertItem(i18n("Maximize (horizontal only)"));
  combo->insertItem(i18n("Minimize"));
  combo->insertItem(i18n("Shade"));
  combo->insertItem(i18n("Lower"));
  combo->insertItem(i18n("On All Desktops"));
  combo->insertItem(i18n("Nothing"));
  combo->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  hlayout->addWidget(combo);
  coTiDbl = combo;
  QWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar."));

  label->setBuddy(combo);

/** Mouse Wheel Events  **************/
  QHBoxLayout *hlayoutW = new QHBoxLayout(layout);
  strMouseWheel = i18n("Titlebar wheel event:");
  label = new QLabel(strMouseWheel, this);
  hlayoutW->addWidget(label);
  txtButton4 = i18n("Handle mouse wheel events");
  QWhatsThis::add( label, txtButton4);
  
  // Titlebar and frame mouse Wheel  
  QComboBox* comboW = new QComboBox(this);
  comboW->insertItem(i18n("Raise/Lower"));
  comboW->insertItem(i18n("Shade/Unshade"));
  comboW->insertItem(i18n("Maximize/Restore"));
  comboW->insertItem(i18n("Keep Above/Below"));  
  comboW->insertItem(i18n("Move to Previous/Next Desktop"));  
  comboW->insertItem(i18n("Change Opacity"));  
  comboW->insertItem(i18n("Nothing"));  
  comboW->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
  connect(comboW, SIGNAL(activated(int)), SLOT(changed()));
  hlayoutW->addWidget(comboW);
  coTiAct4 = comboW;
  QWhatsThis::add(comboW, txtButton4);
  label->setBuddy(comboW);
  
/** Titlebar and frame  **************/

  box = new QVGroupBox( i18n("Titlebar && Frame"), this, "Titlebar and Frame");
  box->layout()->setMargin(KDialog::marginHint());
  box->layout()->setSpacing(KDialog::spacingHint());
  layout->addWidget(box);
  QWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on the"
                             " titlebar or the frame of a window.") );

  grid = new QGrid(4, Qt::Vertical, box);


  new QLabel(grid); // dummy

  strMouseButton1 = i18n("Left button:");
  txtButton1 = i18n("In this row you can customize left click behavior when clicking into"
     " the titlebar or the frame.");

  strMouseButton3 = i18n("Right button:");
  txtButton3 = i18n("In this row you can customize right click behavior when clicking into"
     " the titlebar or the frame." );

  if ( leftHandedMouse )
  {
     qSwap(strMouseButton1, strMouseButton3);
     qSwap(txtButton1, txtButton3);
  }

  label = new QLabel(strMouseButton1, grid);
  QWhatsThis::add( label, txtButton1);

  label = new QLabel(i18n("Middle button:"), grid);
  QWhatsThis::add( label, i18n("In this row you can customize middle click behavior when clicking into"
    " the titlebar or the frame.") );

  label = new QLabel(strMouseButton3, grid);
  QWhatsThis::add( label, txtButton3);


  label = new QLabel(i18n("Active"), grid);
  label->setAlignment(AlignCenter);
  QWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar"
                               " or the frame of an active window.") );

  // Titlebar and frame, active, mouse button 1
  combo = new QComboBox(grid);
  combo->insertItem(i18n("Raise"));
  combo->insertItem(i18n("Lower"));
  combo->insertItem(i18n("Operations Menu"));
  combo->insertItem(i18n("Toggle Raise & Lower"));
  combo->insertItem(i18n("Nothing"));
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiAct1 = combo;

  txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an "
     "<em>active</em> window.");

  txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an "
     "<em>active</em> window.");

  // Be nice to left handed users
  if ( leftHandedMouse ) qSwap(txtButton1, txtButton3);

  QWhatsThis::add(combo, txtButton1);

  // Titlebar and frame, active, mouse button 2

  items << i18n("Raise")
        << i18n("Lower")
        << i18n("Operations Menu")
        << i18n("Toggle Raise & Lower")
        << i18n("Nothing")
        << i18n("Shade");

  combo = new QComboBox(grid);
  combo->insertStringList(items);
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiAct2 = combo;
  QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window."));

  // Titlebar and frame, active, mouse button 3
  combo = new QComboBox(grid);
  combo->insertStringList(items);
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiAct3 =  combo;
  QWhatsThis::add(combo, txtButton3 );

  txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an "
     "<em>inactive</em> window.");

  txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an "
     "<em>inactive</em> window.");

  // Be nice to left handed users
  if ( leftHandedMouse ) qSwap(txtButton1, txtButton3);

  label = new QLabel(i18n("Inactive"), grid);
  label->setAlignment(AlignCenter);
  QWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar"
                               " or the frame of an inactive window.") );

  items.clear();
  items  << i18n("Activate & Raise")
         << i18n("Activate & Lower")
         << i18n("Activate")
         << i18n("Shade")
         << i18n("Operations Menu")
         << i18n("Raise")
         << i18n("Lower")
         << i18n("Nothing");

  combo = new QComboBox(grid);
  combo->insertStringList(items);
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiInAct1 = combo;
  QWhatsThis::add(combo, txtButton1);

  combo = new QComboBox(grid);
  combo->insertStringList(items);
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiInAct2 = combo;
  QWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window."));

  combo = new QComboBox(grid);
  combo->insertStringList(items);
  connect(combo, SIGNAL(activated(int)), SLOT(changed()));
  coTiInAct3 = combo;
  QWhatsThis::add(combo, txtButton3);

/**  Maximize Button ******************/

  box = new QHGroupBox(i18n("Maximize Button"), this, "Maximize Button");
  box->layout()->setMargin(KDialog::marginHint());
  box->layout()->setSpacing(KDialog::spacingHint());
  layout->addWidget(box);
  QWhatsThis::add( box,
    i18n("Here you can customize behavior when clicking on the maximize button.") );

  QString strMouseButton[] = {
    i18n("Left button:"),
    i18n("Middle button:"),
    i18n("Right button:")};

  QString txtButton[] = {
    i18n("Behavior on <em>left</em> click onto the maximize button." ),
    i18n("Behavior on <em>middle</em> click onto the maximize button." ),
    i18n("Behavior on <em>right</em> click onto the maximize button." )};

  if ( leftHandedMouse ) // Be nice to lefties
  {
     qSwap(strMouseButton[0], strMouseButton[2]);
     qSwap(txtButton[0], txtButton[2]);
  }

  createMaxButtonPixmaps();
  for (int b = 0; b < 3; ++b)
  {
    if (b != 0) new QWidget(box); // Spacer

    QLabel * label = new QLabel(strMouseButton[b], box);
    QWhatsThis::add( label,    txtButton[b] );
    label   ->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ));

    coMax[b] = new ToolTipComboBox(box, tbl_Max);
    for (int t = 0; t < 3; ++t) coMax[b]->insertItem(maxButtonPixmaps[t]);
    connect(coMax[b], SIGNAL(activated(int)), SLOT(changed()));
    connect(coMax[b], SIGNAL(activated(int)), coMax[b], SLOT(changed()));
    QWhatsThis::add( coMax[b], txtButton[b] );
    coMax[b]->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ));
  }

  connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(paletteChanged()));

  layout->addStretch();

  load();
}
Beispiel #30
0
void SettingsWindow::genSecurity()
{
    /*QLabel *lblPhoto = new QLabel(tr("Your photo"));
    QLineEdit *editPhoto = new QLineEdit;*/

    QLabel *lblUserName = new QLabel(tr("Pseudo"));
    editUserName = new QLineEdit;

    QLabel *lblPass1 = new QLabel(tr("Password"));
    editPass1 = new QLineEdit;
    editPass1->setEchoMode(QLineEdit::Password);

    QLabel *lblPass2 = new QLabel(tr("Retype your Password"));
    lblPass2->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);
    editPass2 = new QLineEdit;
    editPass2->setEchoMode(QLineEdit::Password);

    QLabel *lblIndice = new QLabel(tr("Indication"));
    editIndice = new QLineEdit;

    QFormLayout *layUser = new QFormLayout;
    layUser->setContentsMargins(10,10,10,10);
    layUser->setSpacing(10);
   /* layUser->addWidget(lblPhoto,0,0);
    layUser->addWidget(editPhoto,0,1);*/

    layUser->addRow(lblUserName,editUserName);
    layUser->addRow(lblPass1,editPass1);
    layUser->addRow(lblPass2,editPass2);
    layUser->addRow(lblIndice,editIndice);

   /* for(int i(0);layUser->count();i++)
        layUser->itemAt(i)->widget()->setAlignment(Qt::AlignHCenter);*/

    /*lblPhoto->setAlignment(Qt::AlignVCenter);
    editPhoto->setAlignment(Qt::AlignVCenter);*/

    QGroupBox *boxUser = new QGroupBox(tr("Account"));
    boxUser->setLayout(layUser);

    // ----------------------------

    checkLockAtStartup = new QCheckBox(tr("At Startup"));
    checkUnlockToClose = new QCheckBox(tr("Closing"));
    checkLockConfig = new QCheckBox(tr("Open Config Window"));
    checkLockLocker = new QCheckBox(tr("To Unlock"));

    QToolButton *btnCheckAll = new QToolButton;
    btnCheckAll->setIcon(QIcon(":/img/menu.png"));
    btnCheckAll->setIconSize(QSize(0,0));
    btnCheckAll->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    btnCheckAll->setText(tr("Select all"));
    btnCheckAll->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum);

    QGridLayout *layAskPass = new QGridLayout;
    layAskPass->setSpacing(10);
    layAskPass->addWidget(checkLockAtStartup);
    layAskPass->addWidget(checkUnlockToClose);
    layAskPass->addWidget(checkLockConfig);
    layAskPass->addWidget(checkLockLocker);
    layAskPass->addWidget(btnCheckAll);

    HideBlock *boxAskPass = new HideBlock(tr("Ask password"));
    boxAskPass->setBlockLayout(layAskPass);

    // --------------------------

    QWidget *spacer = new QWidget;
    spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

    QGridLayout *mainLayout = new QGridLayout;
    mainLayout->setContentsMargins(10,10,10,10);
    mainLayout->setSpacing(10);
    mainLayout->addWidget(boxUser);
    mainLayout->addWidget(boxAskPass);
    mainLayout->addWidget(spacer);

    tabSecurity = new SettingsPanel;
    tabSecurity->setTitle(tr("Security"));
    tabSecurity->setMainLayout(mainLayout);
}