Beispiel #1
0
void DiffPage::addFormatTab()
{
	QWidget* page   = new QWidget( this );
	QVBoxLayout* layout = new QVBoxLayout( page );
	layout->setSpacing( KDialog::spacingHint() );
	layout->setMargin( KDialog::marginHint() );

	// add diff modes
	m_modeButtonGroup = new QButtonGroup( page );
        QGroupBox *box = new QGroupBox( page );
	box->setWhatsThis( i18n( "Select the format of the output generated by diff. Unified is the one that is used most frequently because it is very readable. The KDE developers like this format the best so use it for sending patches." ) );
	layout->addWidget( box );
	QVBoxLayout* bgLayout = new QVBoxLayout( box );
	box->setTitle( i18n( "Output Format" ) );
	//m_modeButtonGroup->setMargin( KDialog::marginHint() );

        QRadioButton *radioButton = new QRadioButton( i18n( "Context" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Context);
	bgLayout->addWidget( radioButton );
        radioButton = new QRadioButton( i18n( "Normal" ),  box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Normal);
        bgLayout->addWidget( radioButton );
        radioButton =  new QRadioButton( i18n( "Unified" ), box );
        m_modeButtonGroup->addButton( radioButton, Kompare::Unified);
        bgLayout->addWidget( radioButton );

	// #lines of context (loc)
	QGroupBox* groupBox = new QGroupBox( page );
        QHBoxLayout *groupLayout = new QHBoxLayout;
        groupBox->setLayout( groupLayout );
	layout->addWidget( groupBox );
	groupBox->setTitle( i18n( "Lines of Context" ) );
	groupBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	//groupBox->setMargin( KDialog::marginHint() );

	QLabel* label = new QLabel( i18n( "Number of context lines:" ));
        groupLayout->addWidget( label );
	label->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	m_locSpinBox = new QSpinBox( groupBox );
	m_locSpinBox->setRange( 0, 100 );
	groupLayout->addWidget( m_locSpinBox );
	m_locSpinBox->setWhatsThis( i18n( "The number of context lines is normally 2 or 3. This makes the diff readable and applicable in most cases. More than 3 lines will only bloat the diff unnecessarily." ) );
	label->setBuddy( m_locSpinBox );

	layout->addStretch( 1 );
	page->setMinimumSize( sizeHintForWidget( page ) );

	m_tabWidget->addTab( page, i18n( "Format" ) );
}
KateProjectConfigPage::KateProjectConfigPage(QWidget *parent, KateProjectPlugin *plugin)
    :  KTextEditor::ConfigPage(parent)
    , m_plugin(plugin)
    , m_changed(false)
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(0);

    QVBoxLayout *vbox = new QVBoxLayout;
    QGroupBox *group = new QGroupBox(i18n("Autoload repositories"), this);
    group->setWhatsThis(i18n(
        "Project plugin is able to autoload repository working copies when "
        "there is no .kateproject file defined yet."));

    m_cbAutoGit = new QCheckBox(i18n("&Git"), this);
    vbox->addWidget(m_cbAutoGit);

    m_cbAutoSubversion = new QCheckBox(i18n("&Subversion"), this);
    vbox->addWidget(m_cbAutoSubversion);
    m_cbAutoMercurial = new QCheckBox(i18n("&Mercurial"), this);
    vbox->addWidget(m_cbAutoMercurial);

    vbox->addStretch(1);
    group->setLayout(vbox);

    layout->addWidget(group);
    layout->insertStretch(-1, 10);

    reset();

    connect(m_cbAutoGit, &QCheckBox::stateChanged, this, &KateProjectConfigPage::slotMyChanged);
    connect(m_cbAutoSubversion, &QCheckBox::stateChanged, this, &KateProjectConfigPage::slotMyChanged);
    connect(m_cbAutoMercurial, &QCheckBox::stateChanged, this, &KateProjectConfigPage::slotMyChanged);
}
FolderShortcutDialog::FolderShortcutDialog( KMFolder *folder,
                                            KMMainWidget *mainwidget,
                                            QWidget *parent )
:  KDialog( parent ),
   mFolder( folder ), mMainWidget( mainwidget )
{
  setCaption( i18n( "Shortcut for Folder %1", folder->label() ) );
  setButtons( Ok | Cancel );
  QFrame *box = new KVBox( this );
  setMainWidget( box );
  QGroupBox *gb = new QGroupBox(i18n("Select Shortcut for Folder"),box );
  QHBoxLayout *layout = new QHBoxLayout;
  gb->setWhatsThis( i18n( "<qt>To choose a key or a combination "
                             "of keys which select the current folder, "
                             "click the button below and then press the key(s) "
                             "you wish to associate with this folder.</qt>" ) );
  gb->setLayout( layout );
  KHBox *hb = new KHBox;
  layout->addWidget( hb );
  new QWidget(hb);
  mKeySeqWidget = new KKeySequenceWidget( hb );
  mKeySeqWidget->setObjectName( "FolderShortcutSelector" );
  new QWidget(hb);

  connect( this, SIGNAL( okClicked() ), SLOT( slotOk() ) );
  mKeySeqWidget->setKeySequence( folder->shortcut().primary(),
                                 KKeySequenceWidget::NoValidate );
  mKeySeqWidget->setCheckActionCollections( mMainWidget->actionCollections() );
}
Beispiel #4
0
FileGroupDetails::FileGroupDetails(QWidget *parent)
    : QWidget( parent )
{
    QVBoxLayout *secondLayout = new QVBoxLayout(this);

    QGroupBox *autoEmbedBox = new QGroupBox( i18n("Left Click Action (only for Konqueror file manager)") );
    m_autoEmbed = new QButtonGroup( autoEmbedBox );
    secondLayout->addWidget( autoEmbedBox );
    // The order of those two items is very important. If you change it, fix typeslistitem.cpp !
    QRadioButton *r1 = new QRadioButton( i18n("Show file in embedded viewer"));
    QRadioButton *r2 = new QRadioButton( i18n("Show file in separate viewer"));
    QVBoxLayout *autoEmbedBoxLayout = new QVBoxLayout(autoEmbedBox);
    autoEmbedBoxLayout->addWidget(r1);
    autoEmbedBoxLayout->addWidget(r2);
    m_autoEmbed->addButton(r1, 0);
    m_autoEmbed->addButton(r2, 1);
    connect(m_autoEmbed, SIGNAL( buttonClicked( int ) ), SLOT( slotAutoEmbedClicked( int ) ));

    autoEmbedBox->setWhatsThis( i18n("Here you can configure what the Konqueror file manager"
                                     " will do when you click on a file belonging to this group. Konqueror can display the file in"
                                     " an embedded viewer or start up a separate application. You can change this setting for a"
                                     " specific file type in the 'Embedding' tab of the file type configuration. Dolphin "
                                     " shows files always in a separate viewer") );

    secondLayout->addStretch();
}
Beispiel #5
0
ClientSettings::ClientSettings(ClientInterface* par)
{
    m_parent = par;
    setParent(par);
    setWhatsThis(tr("Ici, vous pouvez régler bon nombre d'options du logiciel."));

    setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint|Qt::WindowTitleHint|Qt::WindowCloseButtonHint|Qt::WindowContextHelpButtonHint);

    m_settings = allocateSettings(this);

    QVBoxLayout* la = new QVBoxLayout;
    QVBoxLayout* la2 = new QVBoxLayout;
    QHBoxLayout* hla= new QHBoxLayout;
    setLayout(hla);
    hla->addLayout(la);
    hla->addLayout(la2);

    {
        QGroupBox *gb = new QGroupBox(tr("Général"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        {
            QHBoxLayout* h_la = new QHBoxLayout;
            v_la->addLayout(h_la);

            m_nickname = new QLineEdit(m_settings->value(PARAM_NICK).toString(), this);
            m_nickname->setMaxLength(MAX_NICKNAME_LENGHT);
            m_nickname->setWhatsThis(tr("Entrez ici le pseudo que vous utiliserez sur le chat. A contrario de la commande /pseudo, ce pseudo sera automatiquement appliqué à chaque connexion."));
            h_la->addWidget(new QLabel(tr("Pseudo :")));
            h_la->addWidget(m_nickname);
        }

    }

    {
        QGroupBox *gb = new QGroupBox(tr("Interface"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectInterface = new QPushButton("...", this);
        m_selectInterface->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectInterface, SIGNAL(pressed()), this, SLOT(selectInterface()));
        m_interfacePath = new QLineEdit(m_settings->value(PARAM_INTERFACE, DEFAULT_INTERFACE).toString(), this);
        connect(m_interfacePath, SIGNAL(returnPressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_interfacePath);
        h_la->addWidget(m_selectInterface);
        }

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_saveInterface = new QPushButton(tr("Sauvegarder"), this);
        m_saveInterface->setWhatsThis(tr("Sauvegarder une interface."));
        connect(m_saveInterface, SIGNAL(pressed()), this, SLOT(saveInterface()));
        h_la->addWidget(m_saveInterface);

        m_openInterface = new QPushButton(tr("Charger"), this);
        m_openInterface->setWhatsThis(tr("Charger l'interface marquée plus haut."));
        connect(m_openInterface, SIGNAL(pressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_openInterface);
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Thème"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectCSS = new QPushButton("...", this);
        m_selectCSS->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectCSS, SIGNAL(pressed()), this, SLOT(selectCSS()));
        m_CSSPath = new QLineEdit(m_settings->value(PARAM_CSS).toString(), this);
        connect(m_CSSPath, SIGNAL(returnPressed()), this, SLOT(openCSS()));
        h_la->addWidget(m_CSSPath);
        h_la->addWidget(m_selectCSS);

        m_openCSS = new QPushButton(tr("Charger"), this);
        m_openCSS->setWhatsThis(tr("Charger la feuille de style indiquée plus haut."));
        connect(m_openCSS, SIGNAL(pressed()), this, SLOT(openCSS()));
        v_la->addWidget(m_openCSS);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres de connexion"));
        gb->setWhatsThis(tr("Ces options ne sont disponibles que lorsque vous n'êtes pas connecté à un serveur."));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Addresse IP et port du serveur :")));

        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_serverIP = new QLineEdit(m_settings->value(PARAM_IP, SERVER_IP).toString(), this);
        m_serverIP->setInputMask("000.000.000.000;");
        m_serverPort = new QSpinBox(this);
        m_serverPort->setMinimum(1024);
        m_serverPort->setMaximum(65535);
        m_serverPort->setValue(m_settings->value(PARAM_PORT, SERVER_PORT).toInt());
        h_la->addWidget(m_serverIP);
        h_la->addWidget(new QLabel(":"));
        h_la->addWidget(m_serverPort);

        if(par->isConnected())
            gb->setEnabled(false);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres du son"));
        la2->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume des sons d'ambiance :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_sound = new QSlider(this);
        m_sound->setMaximum(1000);
        m_sound->setOrientation(Qt::Horizontal);
        m_sound->setValue(static_cast<int>(m_settings->value(PARAM_SOUND, 100.f).toFloat()*10));
        connect(m_sound, SIGNAL(valueChanged(int)), this, SLOT(soundSliderChanged(int)));
        m_soundSpinBox=new QDoubleSpinBox(this);
        m_soundSpinBox->setMaximum(100); m_soundSpinBox->setMinimum(0); m_soundSpinBox->setMaximum(100); m_soundSpinBox->setDecimals(1);
        m_soundSpinBox->setValue(m_settings->value(PARAM_SOUND, 100.f).toFloat());
        connect(m_soundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(soundSpinBoxChanged(double)));
        h_la->addWidget(m_sound);
        h_la->addWidget(m_soundSpinBox);
        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques sonore :")));
        m_chb_dvc_out=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_out);
        m_cb_dvc_out=new QComboBox(this);
        m_cb_dvc_out->addItems(getOALDevices(true));
        m_cb_dvc_out->setCurrentIndex(m_cb_dvc_out->findText(getOALCurrentDevice(true)));
        h_la->addWidget(m_cb_dvc_out);

        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques de capture :")));
        m_chb_dvc_in=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_in);
        m_cb_dvc_in=new QComboBox(this);
        m_cb_dvc_in->addItems(getOALDevices(false));
        int ind=m_cb_dvc_in->findText(getOALCurrentDevice(false));
        if(ind==-1)
        {
            QString d=getOALCurrentDevice(false);
            m_cb_dvc_in->addItem(d);
            m_cb_dvc_in->setCurrentIndex(m_cb_dvc_in->findText(d));
        }
        else
            m_cb_dvc_in->setCurrentIndex(ind);

        h_la->addWidget(m_cb_dvc_in);
        }

    }

    {
        m_voip = new QGroupBox(tr("Paramètres de la VOIP"));
        m_voip->setCheckable(true);
        m_voip->setChecked(m_settings->value(PARAM_VOIP_ENABLED, true).toBool());
        la2->addWidget(m_voip);
        QVBoxLayout* v_la = new QVBoxLayout;
        m_voip->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume de la reception :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPSound = new QSlider(this);
        m_VOIPSound->setMaximum(1000);
        m_VOIPSound->setOrientation(Qt::Horizontal);
        m_VOIPSound->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat()*10));
        connect(m_VOIPSound, SIGNAL(valueChanged(int)), this, SLOT(VOIPSoundSliderChanged(int)));
        m_VOIPSoundSpinBox=new QDoubleSpinBox(this);
        m_VOIPSoundSpinBox->setMaximum(100); m_VOIPSoundSpinBox->setMinimum(0); m_VOIPSoundSpinBox->setDecimals(1);
        m_VOIPSoundSpinBox->setValue(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat());
        connect(m_VOIPSoundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VOIPSoundSpinBoxChanged(double)));
        h_la->addWidget(m_VOIPSound);
        h_la->addWidget(m_VOIPSoundSpinBox);
        }

        v_la->addWidget(new QLabel(tr("Qualité de la VOIP (sortant) :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPQuality = new QSlider(this);
        m_VOIPQuality->setMinimum(1); m_VOIPQuality->setMaximum(100);
        m_VOIPQuality->setOrientation(Qt::Horizontal);
        m_VOIPQuality->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_QUALITY, 4).toFloat()*10));
        connect(m_VOIPQuality, SIGNAL(valueChanged(int)), this, SLOT(VOIPQualitySliderChanged(int)));
        h_la->addWidget(new QLabel(tr("Plus rapide")));
        h_la->addWidget(m_VOIPQuality);
        h_la->addWidget(new QLabel(tr("Plus clair")));
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Bibliothèques de sons"));
        la2->addWidget(gb);

        QPushButton* m_libsListRefresh = new QPushButton(tr("Rafraichir"), this);
        connect(m_libsListRefresh, SIGNAL(pressed()), this, SLOT(refreshLibs()));
        QPushButton* m_libsListLoad = new QPushButton(tr("Charger"), this);
        connect(m_libsListLoad, SIGNAL(pressed()), this, SLOT(loadLibs()));

        QScrollArea* m_libsScroll=new QScrollArea(this);
        {
        QVBoxLayout* v = new QVBoxLayout;
        gb->setLayout(v);
        v->addWidget(m_libsListRefresh);
        v->addWidget(m_libsScroll);
        v->addWidget(m_libsListLoad);
        }
        m_libs_la = new QVBoxLayout;
        {
        gar=new QWidget(this);
        m_libsScroll->setWidget(gar);
        gar->setLayout(m_libs_la);
        }


    }

    {
        m_ok = new QPushButton(tr("Valider"), this);
        m_ok->setDefault(true);
        connect(m_ok, SIGNAL(pressed()), this, SLOT(ok()));
        m_cancel = new QPushButton(tr("Annuler"), this);
        connect(m_cancel, SIGNAL(pressed()), this, SLOT(reject()));
        QHBoxLayout* h_la = new QHBoxLayout;
        h_la->addWidget(m_ok);
        h_la->addWidget(m_cancel);
        la->addLayout(h_la);
    }
    refreshLibs();
}
Beispiel #6
0
SmugNewAlbum::SmugNewAlbum(QWidget* parent)
            : KDialog(parent)
{
    QString header(i18n("SmugMug New Album"));
    setWindowTitle(header);
    setButtons(Ok|Cancel);
    setDefaultButton(Cancel);
    setModal(false);

    QWidget *mainWidget = new QWidget(this);
    setMainWidget(mainWidget);
    mainWidget->setMinimumSize(400, 400);

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

    QGroupBox* albumBox = new QGroupBox(i18n("Album"), mainWidget);
    albumBox->setWhatsThis(
        i18n("These are basic settings for the new SmugMug album."));

    m_titleEdt          = new KLineEdit;
    m_titleEdt->setWhatsThis(
        i18n("Title of the album that will be created (required)."));

    m_categCoB          = new KComboBox;
    m_categCoB->setEditable(false);
    m_categCoB->setWhatsThis(
        i18n("Category of the album that will be created (required)."));

    m_subCategCoB       = new KComboBox;
    m_subCategCoB->setEditable(false);
    m_subCategCoB->setWhatsThis(
        i18n("Subcategory of the album that will be created (optional)."));

    m_descEdt           = new KTextEdit;
    m_descEdt->setWhatsThis(
        i18n("Description of the album that will be created (optional)."));

    m_templateCoB      = new KComboBox;
    m_templateCoB->setEditable(false);
    m_templateCoB->setWhatsThis(
        i18n("Album template for the new album (optional)."));

    QFormLayout* albumBoxLayout = new QFormLayout;
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Title:"), m_titleEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Category:"), m_categCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Subcategory:"), m_subCategCoB);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Description:"), m_descEdt);
    albumBoxLayout->addRow(i18nc("new smug album dialog", "Template:"), m_templateCoB);
    albumBoxLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
    albumBoxLayout->setSpacing(KDialog::spacingHint());
    albumBoxLayout->setMargin(KDialog::spacingHint());
    albumBox->setLayout(albumBoxLayout);

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

    m_privBox = new QGroupBox(i18n("Security && Privacy"), mainWidget);
    m_privBox->setWhatsThis(
        i18n("These are security and privacy settings for the new SmugMug album."));

    m_publicRBtn        = new QRadioButton(i18nc("smug album privacy", "Public"));
    m_publicRBtn->setChecked(true);
    m_publicRBtn->setWhatsThis(
        i18n("Public album is listed on your public SmugMug page."));
    m_unlistedRBtn      = new QRadioButton(i18nc("smug album privacy", "Unlisted"));
    m_unlistedRBtn->setWhatsThis(
        i18n("Unlisted album is only accessible via URL."));

    QHBoxLayout* radioLayout = new QHBoxLayout;
    radioLayout->addWidget(m_publicRBtn);
    radioLayout->addWidget(m_unlistedRBtn);

    m_passwdEdt         = new KLineEdit;
    m_passwdEdt->setWhatsThis(
        i18n("Require password to access the album (optional)."));

    m_hintEdt           = new KLineEdit;
    m_hintEdt->setWhatsThis(
        i18n("Password hint to present to users in the password prompt (optional)."));

    QFormLayout* privBoxLayout = new QFormLayout;
    privBoxLayout->addRow(i18n("Privacy:"), radioLayout);
    privBoxLayout->addRow(i18n("Password:"******"Password Hint:"), m_hintEdt);
    privBoxLayout->setSpacing(KDialog::spacingHint());
    privBoxLayout->setMargin(KDialog::spacingHint());
    m_privBox->setLayout(privBoxLayout);

    // ------------------------------------------------------------------------
    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->addWidget(albumBox);
    mainLayout->addWidget(m_privBox);
    mainLayout->setSpacing(KDialog::spacingHint());
    mainLayout->setMargin(0);
    mainWidget->setLayout(mainLayout);

    // ------------------------------------------------------------------------
}
Beispiel #7
0
Prefs::Prefs (QWidget * parent, OPTIONS *op, MISC *mi):
  QDialog (parent, (Qt::WindowFlags) Qt::WA_DeleteOnClose)
{
  options = op;
  misc = mi;

  mod_options = *op;
  mod_misc = *mi;

  setModal (TRUE);

  dataChanged = NVFalse;


  setWindowTitle (tr ("mosaicView Preferences"));


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

  QGroupBox *fbox = new QGroupBox (tr ("Position Format"), this);
  fbox->setWhatsThis (bGrpText);

  QRadioButton *hdms = new QRadioButton (tr ("Hemisphere Degrees Minutes Seconds.decimal"));
  QRadioButton *hdm_ = new QRadioButton (tr ("Hemisphere Degrees Minutes.decimal"));
  QRadioButton *hd__ = new QRadioButton (tr ("Hemisphere Degrees.decimal"));
  QRadioButton *sdms = new QRadioButton (tr ("+/-Degrees Minutes Seconds.decimal"));
  QRadioButton *sdm_ = new QRadioButton (tr ("+/-Degrees Minutes.decimal"));
  QRadioButton *sd__ = new QRadioButton (tr ("+/-Degrees.decimal"));

  bGrp = new QButtonGroup (this);
  bGrp->setExclusive (TRUE);
  connect (bGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotPositionClicked (int)));

  bGrp->addButton (hdms, 0);
  bGrp->addButton (hdm_, 1);
  bGrp->addButton (hd__, 2);
  bGrp->addButton (sdms, 3);
  bGrp->addButton (sdm_, 4);
  bGrp->addButton (sd__, 5);

  QHBoxLayout *fboxSplit = new QHBoxLayout;
  QVBoxLayout *fboxLeft = new QVBoxLayout;
  QVBoxLayout *fboxRight = new QVBoxLayout;
  fboxSplit->addLayout (fboxLeft);
  fboxSplit->addLayout (fboxRight);
  fboxLeft->addWidget (hdms);
  fboxLeft->addWidget (hdm_);
  fboxLeft->addWidget (hd__);
  fboxRight->addWidget (sdms);
  fboxRight->addWidget (sdm_);
  fboxRight->addWidget (sd__);
  fbox->setLayout (fboxSplit);

  vbox->addWidget (fbox, 1);


  QGroupBox *miscBox = new QGroupBox (tr ("Miscellaneous"), this);
  QHBoxLayout *miscBoxLayout = new QHBoxLayout;
  miscBox->setLayout (miscBoxLayout);


  QGroupBox *zoomBox = new QGroupBox (tr ("Zoom percentage"), this);
  QHBoxLayout *zoomBoxLayout = new QHBoxLayout;
  zoomBox->setLayout (zoomBoxLayout);
  zoomPercent = new QSpinBox (zoomBox);
  zoomPercent->setRange (10, 50);
  zoomPercent->setSingleStep (5);
  zoomPercent->setToolTip (tr ("Change the zoom in/out percentage (10-50)"));
  zoomPercent->setWhatsThis (zoomPercentText);
  zoomBoxLayout->addWidget (zoomPercent);
  miscBoxLayout->addWidget (zoomBox);


  QGroupBox *featureBox = new QGroupBox (tr ("Feature Circle Diameter"), this);
  QHBoxLayout *featureBoxLayout = new QHBoxLayout;
  featureBox->setLayout (featureBoxLayout);
  featureDiameter = new QLineEdit (featureBox);
  featureDiameter->setToolTip (tr ("Change the add feature circle diameter (meters)"));
  featureDiameter->setWhatsThis (featureDiameterText);
  featureBoxLayout->addWidget (featureDiameter);
  miscBoxLayout->addWidget (featureBox);


  QGroupBox *textSearchBox = new QGroupBox (tr ("Feature search string"), this);
  QHBoxLayout *textSearchBoxLayout = new QHBoxLayout;
  textSearchBox->setLayout (textSearchBoxLayout);
  textSearch = new QLineEdit (textSearchBox);
  textSearch->setToolTip (tr ("Highlight features based on text search"));
  textSearch->setWhatsThis (textSearchText);
  textSearchBoxLayout->addWidget (textSearch);
  miscBoxLayout->addWidget (textSearchBox);


  vbox->addWidget (miscBox);


  QGroupBox *cbox = new QGroupBox (tr ("Colors"), this);
  QVBoxLayout *cboxLayout = new QVBoxLayout;
  cbox->setLayout (cboxLayout);
  QHBoxLayout *cboxTopLayout = new QHBoxLayout;
  QHBoxLayout *cboxBottomLayout = new QHBoxLayout;
  cboxLayout->addLayout (cboxTopLayout);
  cboxLayout->addLayout (cboxBottomLayout);


  bMarkerColor = new QPushButton (tr ("Marker"), this);
  bMarkerColor->setToolTip (tr ("Change marker color"));
  bMarkerColor->setWhatsThis (markerColorText);
  bMarkerPalette = bMarkerColor->palette ();
  connect (bMarkerColor, SIGNAL (clicked ()), this, SLOT (slotMarkerColor ()));
  cboxTopLayout->addWidget (bMarkerColor);


  bCoastColor = new QPushButton (tr ("Coast"), this);
  bCoastColor->setToolTip (tr ("Change coastline color"));
  bCoastColor->setWhatsThis (coastColorText);
  bCoastPalette = bCoastColor->palette ();
  connect (bCoastColor, SIGNAL (clicked ()), this, SLOT (slotCoastColor ()));
  cboxBottomLayout->addWidget (bCoastColor);


  bLandmaskColor = new QPushButton (tr ("Landmask"), this);
  bLandmaskColor->setToolTip (tr ("Change landmask color"));
  bLandmaskColor->setWhatsThis (landmaskColorText);
  bLandmaskPalette = bLandmaskColor->palette ();
  connect (bLandmaskColor, SIGNAL (clicked ()), this, SLOT (slotLandmaskColor ()));
  cboxTopLayout->addWidget (bLandmaskColor);


  bRectColor = new QPushButton (tr ("Zoom box"), this);
  bRectColor->setToolTip (tr ("Change zomm rectangle color"));
  bRectColor->setWhatsThis (rectColorText);
  bRectPalette = bRectColor->palette ();
  connect (bRectColor, SIGNAL (clicked ()), this, SLOT (slotRectColor ()));
  cboxBottomLayout->addWidget (bRectColor);


  bFeatureColor = new QPushButton (tr ("Feature"), this);
  bFeatureColor->setToolTip (tr ("Change feature color"));
  bFeatureColor->setWhatsThis (featureColorText);
  bFeaturePalette = bFeatureColor->palette ();
  connect (bFeatureColor, SIGNAL (clicked ()), this, SLOT (slotFeatureColor ()));
  cboxTopLayout->addWidget (bFeatureColor);


  bFeatureInfoColor = new QPushButton (tr ("Feature information"), this);
  bFeatureInfoColor->setToolTip (tr ("Change feature information text color"));
  bFeatureInfoColor->setWhatsThis (featureInfoColorText);
  bFeatureInfoPalette = bFeatureInfoColor->palette ();
  connect (bFeatureInfoColor, SIGNAL (clicked ()), this, SLOT (slotFeatureInfoColor ()));
  cboxBottomLayout->addWidget (bFeatureInfoColor);


  bFeaturePolyColor = new QPushButton (tr ("Feature polygon"), this);
  bFeaturePolyColor->setToolTip (tr ("Change feature polygonal area color"));
  bFeaturePolyColor->setWhatsThis (featurePolyColorText);
  bFeaturePolyPalette = bFeaturePolyColor->palette ();
  connect (bFeaturePolyColor, SIGNAL (clicked ()), this, SLOT (slotFeaturePolyColor ()));
  cboxTopLayout->addWidget (bFeaturePolyColor);


  bHighlightColor = new QPushButton (tr ("Highlight"), this);
  bHighlightColor->setToolTip (tr ("Change feature highlight color"));
  bHighlightColor->setWhatsThis (highlightColorText);
  bHighlightPalette = bHighlightColor->palette ();
  connect (bHighlightColor, SIGNAL (clicked ()), this, SLOT (slotHighlightColor ()));
  cboxBottomLayout->addWidget (bHighlightColor);


  vbox->addWidget (cbox, 1);


  QGroupBox *mBox = new QGroupBox (tr ("Display startup message"), this);
  QHBoxLayout *mBoxLayout = new QHBoxLayout;
  mBox->setLayout (mBoxLayout);
  sMessage = new QCheckBox (mBox);
  sMessage->setToolTip (tr ("Toggle display of startup message when program starts"));
  mBoxLayout->addWidget (sMessage);


  vbox->addWidget (mBox, 1);


  setFields ();


  QHBoxLayout *actions = new QHBoxLayout (0);
  vbox->addLayout (actions);

  QPushButton *bHelp = new QPushButton (this);
  bHelp->setIcon (QIcon (":/icons/contextHelp.xpm"));
  bHelp->setToolTip (tr ("Enter What's This mode for help"));
  connect (bHelp, SIGNAL (clicked ()), this, SLOT (slotHelp ()));
  actions->addWidget (bHelp);

  actions->addStretch (10);

  bRestoreDefaults = new QPushButton (tr ("Restore Defaults"), this);
  bRestoreDefaults->setToolTip (tr ("Restore all preferences to the default state"));
  bRestoreDefaults->setWhatsThis (restoreDefaultsText);
  connect (bRestoreDefaults, SIGNAL (clicked ()), this, SLOT (slotRestoreDefaults ()));
  actions->addWidget (bRestoreDefaults);

  QPushButton *applyButton = new QPushButton (tr ("OK"), this);
  applyButton->setToolTip (tr ("Accept changes and close dialog"));
  applyButton->setWhatsThis (applyPrefsText);
  connect (applyButton, SIGNAL (clicked ()), this, SLOT (slotApplyPrefs ()));
  actions->addWidget (applyButton);

  QPushButton *closeButton = new QPushButton (tr ("Cancel"), this);
  closeButton->setToolTip (tr ("Discard changes and close dialog"));
  closeButton->setWhatsThis (closePrefsText);
  connect (closeButton, SIGNAL (clicked ()), this, SLOT (slotClosePrefs ()));
  actions->addWidget (closeButton);


  show ();
}
Beispiel #8
0
Prefs::Prefs (QWidget * parent, OPTIONS *op, MISC *mi):
  QDialog (parent, (Qt::WindowFlags) Qt::WA_DeleteOnClose)
{
  options = op;
  mod_options = *options;
  misc = mi;
  dataChanged = NVFalse;


  setWindowTitle (tr ("areaCheck preferences"));


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


  QGroupBox *fbox = new QGroupBox (tr ("Position Format"), this);
  fbox->setWhatsThis (bGrpText);

  QRadioButton *hdms = new QRadioButton (tr ("Hemisphere Degrees Minutes Seconds.decimal"));
  QRadioButton *hdm_ = new QRadioButton (tr ("Hemisphere Degrees Minutes.decimal"));
  QRadioButton *hd__ = new QRadioButton (tr ("Hemisphere Degrees.decimal"));
  QRadioButton *sdms = new QRadioButton (tr ("+/-Degrees Minutes Seconds.decimal"));
  QRadioButton *sdm_ = new QRadioButton (tr ("+/-Degrees Minutes.decimal"));
  QRadioButton *sd__ = new QRadioButton (tr ("+/-Degrees.decimal"));

  bGrp = new QButtonGroup (this);
  bGrp->setExclusive (TRUE);
  connect (bGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotPositionClicked (int)));

  bGrp->addButton (hdms, 0);
  bGrp->addButton (hdm_, 1);
  bGrp->addButton (hd__, 2);
  bGrp->addButton (sdms, 3);
  bGrp->addButton (sdm_, 4);
  bGrp->addButton (sd__, 5);

  QHBoxLayout *fboxSplit = new QHBoxLayout;
  QVBoxLayout *fboxLeft = new QVBoxLayout;
  QVBoxLayout *fboxRight = new QVBoxLayout;
  fboxSplit->addLayout (fboxLeft);
  fboxSplit->addLayout (fboxRight);
  fboxLeft->addWidget (hdms);
  fboxLeft->addWidget (hdm_);
  fboxLeft->addWidget (hd__);
  fboxRight->addWidget (sdms);
  fboxRight->addWidget (sdm_);
  fboxRight->addWidget (sd__);
  fbox->setLayout (fboxSplit);

  vbox->addWidget (fbox, 1);


  QGroupBox *cbox = new QGroupBox (tr ("Colors"), this);
  QHBoxLayout *cboxSplit = new QHBoxLayout;
  cbox->setLayout (cboxSplit);
  QVBoxLayout *cboxLeft = new QVBoxLayout;
  QVBoxLayout *cboxRight = new QVBoxLayout;
  cboxSplit->addLayout (cboxLeft);
  cboxSplit->addLayout (cboxRight);


  bCoastColor = new QPushButton (tr ("Coast"), this);
  bCoastPalette = bCoastColor->palette ();
  bCoastColor->setToolTip (tr ("Change coastline color"));
  bCoastColor->setWhatsThis (coastColorText);
  connect (bCoastColor, SIGNAL (clicked ()), this, SLOT (slotCoastColor ()));
  cboxLeft->addWidget (bCoastColor);


  bMaskColor = new QPushButton (tr ("Landmask"), this);
  bMaskPalette = bMaskColor->palette ();
  bMaskColor->setToolTip (tr ("Change landmask color"));
  bMaskColor->setWhatsThis (maskColorText);
  connect (bMaskColor, SIGNAL (clicked ()), this, SLOT (slotMaskColor ()));
  cboxLeft->addWidget (bMaskColor);


  bBackgroundColor = new QPushButton (tr ("Background"), this);
  bBackgroundPalette = bBackgroundColor->palette ();
  bBackgroundColor->setToolTip (tr ("Change display background color"));
  bBackgroundColor->setWhatsThis (backgroundColorText);
  connect (bBackgroundColor, SIGNAL (clicked ()), this, SLOT (slotBackgroundColor ()));
  cboxRight->addWidget (bBackgroundColor);


  bHighlightColor = new QPushButton (tr ("Highlight"), this);
  bHighlightPalette = bHighlightColor->palette ();
  bHighlightColor->setToolTip (tr ("Change highlight color"));
  bHighlightColor->setWhatsThis (highlightColorText);
  connect (bHighlightColor, SIGNAL (clicked ()), this, SLOT (slotHighlightColor ()));
  cboxRight->addWidget (bHighlightColor);


  vbox->addWidget (cbox, 1);


  QGroupBox *c2box = new QGroupBox (tr ("Data Type Colors"), this);
  c2box->setWhatsThis (colorGrpText);

  c2[0] = new QPushButton (misc->type_name[ISS60_AREA], this);
  c2Palette[0] = c2[0]->palette ();
  c2[1] = new QPushButton (misc->type_name[GENERIC_AREA], this);
  c2Palette[1] = c2[1]->palette ();
  c2[2] = new QPushButton (misc->type_name[ACE_AREA], this);
  c2Palette[2] = c2[2]->palette ();
  c2[3] = new QPushButton (misc->type_name[ISS60_ZONE], this);
  c2Palette[3] = c2[3]->palette ();
  c2[4] = new QPushButton (misc->type_name[GENERIC_ZONE], this);
  c2Palette[4] = c2[4]->palette ();
  c2[5] = new QPushButton (misc->type_name[SHAPE], this);
  c2Palette[5] = c2[5]->palette ();
  c2[6] = new QPushButton (misc->type_name[TRACK], this);
  c2Palette[6] = c2[6]->palette ();
  c2[7] = new QPushButton (misc->type_name[FEATURE], this);
  c2Palette[7] = c2[7]->palette ();
  c2[8] = new QPushButton (misc->type_name[YXZ], this);
  c2Palette[8] = c2[8]->palette ();
  c2[9] = new QPushButton (misc->type_name[LLZ_DATA], this);
  c2Palette[9] = c2[9]->palette ();
  c2[10] = new QPushButton (misc->type_name[GEOTIFF], this);
  c2Palette[10] = c2[10]->palette ();
  c2[11] = new QPushButton (misc->type_name[CHRTR], this);
  c2Palette[11] = c2[11]->palette ();
  c2[12] = new QPushButton (misc->type_name[BAG], this);
  c2Palette[12] = c2[12]->palette ();
  c2[13] = new QPushButton (misc->type_name[OPTECH_FLT], this);
  c2Palette[13] = c2[13]->palette ();


  colorGrp = new QButtonGroup (c2box);
  colorGrp->setExclusive (FALSE);
  connect (colorGrp, SIGNAL (buttonClicked (int)), this, SLOT (slotColor (int)));

  colorGrp->addButton (c2[0], ISS60_AREA);
  colorGrp->addButton (c2[1], GENERIC_AREA);
  colorGrp->addButton (c2[2], ACE_AREA);
  colorGrp->addButton (c2[3], ISS60_ZONE);
  colorGrp->addButton (c2[4], GENERIC_ZONE);
  colorGrp->addButton (c2[5], SHAPE);
  colorGrp->addButton (c2[6], TRACK);
  colorGrp->addButton (c2[7], FEATURE);
  colorGrp->addButton (c2[8], YXZ);
  colorGrp->addButton (c2[9], LLZ_DATA);
  colorGrp->addButton (c2[10], GEOTIFF);
  colorGrp->addButton (c2[11], CHRTR);
  colorGrp->addButton (c2[12], BAG);
  colorGrp->addButton (c2[13], OPTECH_FLT);

  QHBoxLayout *c2boxSplit = new QHBoxLayout;
  QVBoxLayout *c2boxLeft = new QVBoxLayout;
  QVBoxLayout *c2boxRight = new QVBoxLayout;
  c2boxSplit->addLayout (c2boxLeft);
  c2boxSplit->addLayout (c2boxRight);
  c2boxLeft->addWidget (c2[0]);
  c2boxLeft->addWidget (c2[1]);
  c2boxLeft->addWidget (c2[2]);
  c2boxLeft->addWidget (c2[3]);
  c2boxLeft->addWidget (c2[4]);
  c2boxLeft->addWidget (c2[5]);
  c2boxLeft->addWidget (c2[6]);
  c2boxRight->addWidget (c2[7]);
  c2boxRight->addWidget (c2[8]);
  c2boxRight->addWidget (c2[9]);
  c2boxRight->addWidget (c2[10]);
  c2boxRight->addWidget (c2[11]);
  c2boxRight->addWidget (c2[12]);
  c2boxRight->addWidget (c2[13]);
  c2box->setLayout (c2boxSplit);

  vbox->addWidget (c2box, 1);


  QGroupBox *sunBox = new QGroupBox (tr ("CHRTR/BAG Sun Shading"), this);
  QHBoxLayout *sunBoxLayout = new QHBoxLayout;
  sunBox->setLayout (sunBoxLayout);

  QGroupBox *angBox = new QGroupBox (tr ("Angle"), this);
  QHBoxLayout *angBoxLayout = new QHBoxLayout;
  angBox->setLayout (angBoxLayout);
  sunAz = new QDoubleSpinBox (angBox);
  sunAz->setDecimals (1);
  sunAz->setRange (0.0, 359.9);
  sunAz->setSingleStep (1.0);
  sunAz->setValue (mod_options.sunopts.azimuth);
  sunAz->setWrapping (TRUE);
  sunAz->setToolTip (tr ("Change the sun angle (0.0-360.0)"));
  sunAz->setWhatsThis (sunAzText);
  angBoxLayout->addWidget (sunAz);
  sunBoxLayout->addWidget (angBox);


  QGroupBox *eleBox = new QGroupBox (tr ("Elevation"), this);
  QHBoxLayout *eleBoxLayout = new QHBoxLayout;
  eleBox->setLayout (eleBoxLayout);
  sunEl = new QDoubleSpinBox (eleBox);
  sunEl->setDecimals (1);
  sunEl->setRange (0.0, 90.0);
  sunEl->setSingleStep (1.0);
  sunEl->setValue (mod_options.sunopts.elevation);
  sunEl->setWrapping (TRUE);
  sunEl->setToolTip (tr ("Change the sun elevation (0.0-90.0)"));
  sunEl->setWhatsThis (sunElText);
  eleBoxLayout->addWidget (sunEl);
  sunBoxLayout->addWidget (eleBox);


  QGroupBox *exaBox = new QGroupBox (tr ("Exaggeration"), this);
  QHBoxLayout *exaBoxLayout = new QHBoxLayout;
  exaBox->setLayout (exaBoxLayout);
  sunEx = new QDoubleSpinBox (exaBox);
  sunEx->setDecimals (1);
  sunEx->setRange (0.0, 359.9);
  sunEx->setSingleStep (1.0);
  sunEx->setValue (mod_options.sunopts.exag);
  sunEx->setWrapping (TRUE);
  sunEx->setToolTip (tr ("Change the sun Z exaggeration (1-10)"));
  sunEx->setWhatsThis (sunExText);
  exaBoxLayout->addWidget (sunEx);
  sunBoxLayout->addWidget (exaBox);


  vbox->addWidget (sunBox, 1);


  QGroupBox *mbox = new QGroupBox (tr ("MINMAX parameters"), this);
  mbox->setWhatsThis (colorGrpText);
  QHBoxLayout *mboxLayout = new QHBoxLayout;
  mbox->setLayout (mboxLayout);

  QGroupBox *sBox = new QGroupBox (tr ("Use stoplight colors"), this);
  QHBoxLayout *sBoxLayout = new QHBoxLayout;
  sBox->setLayout (sBoxLayout);
  stopLight = new QCheckBox (this);
  connect (stopLight, SIGNAL (clicked ()), this, SLOT (slotStopLightClicked ()));
  stopLight->setToolTip (tr ("Use stoplight colors when displaying MINMAX .trk files"));
  stopLight->setWhatsThis (stopLightText);
  sBoxLayout->addWidget (stopLight);
  mboxLayout->addWidget (sBox);

  QGroupBox *gBox = new QGroupBox (tr ("Green to yellow value"), this);
  QHBoxLayout *gBoxLayout = new QHBoxLayout;
  gBox->setLayout (gBoxLayout);
  minStop = new QLineEdit (this);
  mboxLayout->addWidget (minStop);
  minStop->setToolTip (tr ("Set value below which data is green"));
  minStop->setWhatsThis (minStopText);
  gBoxLayout->addWidget (minStop);
  mboxLayout->addWidget (gBox);

  QGroupBox *yBox = new QGroupBox (tr ("Yellow to red value"), this);
  QHBoxLayout *yBoxLayout = new QHBoxLayout;
  yBox->setLayout (yBoxLayout);
  maxStop = new QLineEdit (this);
  mboxLayout->addWidget (maxStop);
  maxStop->setToolTip (tr ("Set value above which data is red"));
  maxStop->setWhatsThis (maxStopText);
  yBoxLayout->addWidget (maxStop);
  mboxLayout->addWidget (yBox);


  vbox->addWidget (mbox, 1);


  setFields ();


  QHBoxLayout *actions = new QHBoxLayout (0);
  vbox->addLayout (actions);

  QPushButton *bHelp = new QPushButton (this);
  bHelp->setIcon (QIcon (":/icons/contextHelp.xpm"));
  bHelp->setToolTip (tr ("Enter What's This mode for help"));
  connect (bHelp, SIGNAL (clicked ()), this, SLOT (slotHelp ()));
  actions->addWidget (bHelp);

  actions->addStretch (10);

  bRestoreDefaults = new QPushButton (tr ("Restore Defaults"), this);
  bRestoreDefaults->setToolTip (tr ("Restore all preferences to the default state"));
  bRestoreDefaults->setWhatsThis (restoreDefaultsText);
  connect (bRestoreDefaults, SIGNAL (clicked ()), this, SLOT (slotRestoreDefaults ()));
  actions->addWidget (bRestoreDefaults);

  QPushButton *applyButton = new QPushButton (tr ("OK"), this);
  applyButton->setToolTip (tr ("Accept changes and close dialog"));
  applyButton->setWhatsThis (applyPrefsText);
  connect (applyButton, SIGNAL (clicked ()), this, SLOT (slotApplyPrefs ()));
  actions->addWidget (applyButton);

  QPushButton *closeButton = new QPushButton (tr ("Cancel"), this);
  closeButton->setToolTip (tr ("Discard changes and close dialog"));
  closeButton->setWhatsThis (closePrefsText);
  connect (closeButton, SIGNAL (clicked ()), this, SLOT (slotClosePrefs ()));
  actions->addWidget (closeButton);


  show ();
}
Beispiel #9
0
DsWidget::DsWidget(QWidget* parent, KIPI::Interface* iface)
    : QWidget(parent),
      m_lastTip( QString() ),
      m_lastQueryUrl( QUrl() ),
      m_httpManager( new KIO::AccessManager(this) ),
      m_jsonManager( new KIO::AccessManager(this) )
{
    setObjectName("DsWidget");

    QHBoxLayout* mainLayout = new QHBoxLayout(this);

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

    m_imgList  = new KIPIPlugins::ImagesList(iface, this);
    m_imgList->setControlButtonsPlacement(KIPIPlugins::ImagesList::ControlButtonsBelow);
    m_imgList->setAllowRAW(true);
    m_imgList->loadImagesFromCurrentSelection();
    m_imgList->listView()->setWhatsThis( i18n("This is the list of images to upload to Debian Screenshots.") );

    QWidget* settingsBox = new QWidget(this);
    QVBoxLayout* settingsBoxLayout = new QVBoxLayout(settingsBox);

//    m_headerLabel = new QLabel(settingsBox);
//    m_headerLabel->setText(QString("<b><h2><a href='%1'>"
//                                 "<font color=\"#BF1238\">Debian Screenshots</font>"
//                                 "</a></h2></b>").arg(KIPIDebianScreenshotsPlugin::debshotsUrl));
    m_headerLabel = new KClickableImageLabel(settingsBox);
    QPixmap sdnLogoPixmap(":/kipi_debianscreenshots/sdnlogo.png");
    m_headerLabel->setPixmap(sdnLogoPixmap);
    m_headerLabel->setUrl(KIPIDebianScreenshotsPlugin::debshotsUrl);
    m_headerLabel->setWhatsThis( i18n("This is a clickable link to open the Debian Screenshots home page in a web browser.") );
    m_headerLabel->setOpenExternalLinks(true);
    m_headerLabel->setFocusPolicy(Qt::NoFocus);

    QGroupBox* pkgGroupBox   = new QGroupBox(settingsBox);
    pkgGroupBox->setTitle(i18n("Package"));
    pkgGroupBox->setWhatsThis(i18n("This is the Debian Screenshots package to which selected photos will be uploaded."));

    QGridLayout* sdnLayout   = new QGridLayout(pkgGroupBox);

    QLabel* pkgLabel         = new QLabel(i18n("Package:"), pkgGroupBox);

    m_pkgLineEdit            = new KLineEdit(pkgGroupBox);
    QCompleter* pkgCompleter = new QCompleter(this);
    pkgCompleter->setCompletionMode(QCompleter::PopupCompletion);
    pkgCompleter->setCaseSensitivity(Qt::CaseInsensitive);
    m_pkgLineEdit->setCompleter(pkgCompleter);

    QListView* listView = new QListView;
    pkgCompleter->setPopup(listView);
    listView->setItemDelegateForColumn(0, new PackageDelegate);

    connect(m_pkgLineEdit, SIGNAL(textEdited(QString)),
            this, SLOT(slotCompletePackageName(QString)));

    connect(m_httpManager, SIGNAL(finished(QNetworkReply*)),
            this, SLOT(slotCompletePackageNameFinished(QNetworkReply*)));

    connect(pkgCompleter, SIGNAL(activated(QString)),
            this, SLOT(slotFindVersionsForPackage(QString)));

    connect(m_jsonManager, SIGNAL(finished(QNetworkReply*)),
            this, SLOT(slotFindVersionsForPackageFinished(QNetworkReply*)));

    QLabel* versionLabel = new QLabel(i18n("Software version:"), pkgGroupBox);
    m_versionsComboBox   = new KComboBox(pkgGroupBox);
    m_versionsComboBox->setEditable(false);
    m_versionsComboBox->setEnabled(false); // Disable until we have a package name
    m_versionsComboBox->setMinimumContentsLength(40);
    connect(m_versionsComboBox, SIGNAL(activated(int)),
            this, SLOT(slotEnableUpload()));

    QLabel* descriptionLabel  = new QLabel(i18n("Screenshot description:"), pkgGroupBox);
    m_descriptionLineEdit = new KLineEdit(pkgGroupBox);
    m_descriptionLineEdit->setMaxLength(40); // 40 is taken from screenshots.debian.net/upload page source
    m_descriptionLineEdit->setEnabled(false);

    sdnLayout->addWidget(pkgLabel,              1, 0, 1, 1);
    sdnLayout->addWidget(m_pkgLineEdit,         1, 1, 1, 4);
    sdnLayout->addWidget(versionLabel,          2, 0, 1, 1);
    sdnLayout->addWidget(m_versionsComboBox,    2, 1, 1, 4);
    sdnLayout->addWidget(descriptionLabel,      3, 0, 1, 1);
    sdnLayout->addWidget(m_descriptionLineEdit, 3, 1, 1, 4);

    m_progressBar = new QProgressBar(settingsBox);
    m_progressBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    m_progressBar->hide();

    settingsBoxLayout->addWidget(m_headerLabel);
    settingsBoxLayout->addWidget(pkgGroupBox);
    settingsBoxLayout->addWidget(m_progressBar);

    mainLayout->addWidget(m_imgList);
    mainLayout->addWidget(settingsBox);
    mainLayout->setSpacing(KDialog::spacingHint());
    mainLayout->setMargin(0);
}
Beispiel #10
0
startPage::startPage (QWidget *parent, QString parameter_file, PFM_GLOBAL *pfm_glb):
  QWizardPage (parent)
{
  pfm_global = pfm_glb;

  setPixmap (QWizard::WatermarkPixmap, QPixmap(":/icons/pfmLoadWatermark.png"));


  setTitle (tr ("Introduction"));

  setWhatsThis (tr ("See, it really works!"));

  QLabel *label = new QLabel (tr ("The pfmLoad program is used to create or append to PFM structures.  Context "
                                  "sensitive help is available by clicking on the Help button and then clicking, with the "
                                  "Question Arrow cursor, on the field of interest.  You can preload a previously saved "
                                  "parameters file (*.prm) by placing it on the command line.  Press <b>Next</b> to go to the "
                                  "first PFM definition page.<br><br>"
                                  "<b><i>IMPORTANT NOTE</i>: You may load up to 30 PFM structures in one run.  This only makes "
                                  "sense if all of the PFM areas contain data from the same set of input files.  "
                                  "Otherwise the program will be checking every data point against every PFM area "
                                  "bounds definition and you will be wasting lots of time.</b><br><br>"
                                  "<b><i>OTHER IMPORTANT NOTE</i>: You may save the parameters entered into this wizard to a "
                                  "new or preexisting parameter file.  There are two types of parameter files.  The normal "
                                  "parameter file (.prm) which can be used on the command line for pfmLoad or pfmLoader, "
                                  "or an <i>update</i> parameter file (.upr) that can only be used as a command line argument "
                                  "to pfmLoader.  The <i>update</i> parameter file (.upr) can only be created if you use the "
                                  "<i>Directories->Browse</i> button on the <i>Input Data Files</i> page.  For more information "
                                  "on why you would want to do this, use the <i>What's This</i> help on the <i>Save</i> button "
                                  "on the <i>Build PFM Structure(s)</i> page of this wizard."));

  label->setWordWrap(true);


  QVBoxLayout *vbox = new QVBoxLayout (this);
  vbox->addWidget (label);
  vbox->addStretch (10);


  QGroupBox *prmBox = new QGroupBox (this);
  prmBox->setWhatsThis (tr ("This box will show the name of the parameter file that was placed on the command line.  ") + 
                        tr ("If no command was placed on the command line it will say <b>No command line parameter file</b>"));
  prmBox->setToolTip (tr ("Parameter file from command line (if present)"));
  QHBoxLayout *prmBoxLayout = new QHBoxLayout;
  prmBoxLayout->setSpacing (5);
  prmBox->setLayout (prmBoxLayout);

  QLabel *prmlbl = new QLabel (this);
  prmlbl->setWhatsThis (tr ("This box will show the name of the parameter file that was placed on the command line.  ") + 
                        tr ("If no command was placed on the command line it will say <b>No command line parameter file</b>"));
  prmlbl->setToolTip (tr ("Parameter file from command line (if present)"));
  if (!parameter_file.isEmpty ())
    {
      prmlbl->setText (tr ("Command line parameter file: <b>") + parameter_file + "</b>");
    }
  else
    {
      prmlbl->setText (tr ("No command line parameter file"));
    }
  prmBoxLayout->addWidget (prmlbl);

  vbox->addWidget (prmBox);


  QGroupBox *memBox = new QGroupBox (tr ("Cache memory"), this);
  QHBoxLayout *memBoxLayout = new QHBoxLayout;
  memBox->setLayout (memBoxLayout);
  memBoxLayout->setSpacing (10);


  //  Had to do this as a QDoubleSpinBox because QSpinBox won't do no-wrap if the top end might exceed 
  //  a 32 bit signed integer max value.

  mem = new QDoubleSpinBox (memBox);
  mem->setRange (200000000.0, 2147483647.0);
  mem->setSingleStep (100000000.0);
  mem->setDecimals (0.0);
  mem->setValue ((NV_FLOAT64) pfm_global->cache_mem);
  mem->setWrapping (FALSE);
  mem->setToolTip (tr ("Set the amount of cache memory for each PFM to be loaded"));
  mem->setWhatsThis (tr ("Set the amount of cache memory used for each PFM file to be created or appended to.  ") +
                     tr ("The value is in bytes and ranges from a minimum of 200,000,000 up to 2,147,483,647.  The default is ") +
                     tr ("400,000,000.  If you set this to a large value (like 2,147,483,647) and you have a limited amount of ") +
                     tr ("memory and a large number of PFMs to be built you will end up using swap space and your ") +
                     tr ("build will be extremely slow ;-)"));
  memBoxLayout->addWidget (mem);

  vbox->addWidget (memBox);

  registerField ("mem", mem, "value");
}