Пример #1
0
NHypersurfaceCreator::NHypersurfaceCreator() {
    // Set up the basic layout.
    ui = new QWidget();
    QBoxLayout* layout = new QVBoxLayout(ui);

    QBoxLayout* coordArea = new QHBoxLayout();
    layout->addLayout(coordArea);
    QString expln = ui->tr("Specifies the coordinate system in which the "
        "normal hypersurfaces will be enumerated.");
    QLabel* label = new QLabel(ui->tr("Coordinate system:"), ui);
    label->setWhatsThis(expln);
    coordArea->addWidget(label);
    coords = new HyperCoordinateChooser();
    coords->insertAllCreators();
    coords->setCurrentSystem(
        ReginaPrefSet::global().hypersurfacesCreationCoords);
    coords->setWhatsThis(expln);
    coordArea->addWidget(coords, 1);

    QBoxLayout* basisArea = new QHBoxLayout();
    layout->addLayout(basisArea);
    expln = ui->tr("<qt>Specifies whether to enumerate only "
        "vertex hypersurfaces (at extremal rays of the normal hypersurface "
        "solution cone), or all fundamental surfaces (which form a Hilbert "
        "basis for the solution cone).<p>Fundamental surfaces are "
        "more numerous, and can be significantly slower to enumerate.</qt>");
    label = new QLabel(ui->tr("Enumerate:"), ui);
    label->setWhatsThis(expln);
    basisArea->addWidget(label);
    basis = new QComboBox(ui);
    // These insertions MUST happen in the same order in which the
    // BASIS_... constants are defined at the top of this file.
    basis->insertItem(BASIS_VERTEX, ui->tr("Vertex hypersurfaces"));
    basis->insertItem(BASIS_FUND, ui->tr("Fundamental hypersurfaces"));
    basis->setCurrentIndex(
        ReginaPrefSet::global().hypersurfacesCreationList.has(
        regina::HS_FUNDAMENTAL) ? BASIS_FUND : BASIS_VERTEX);
    basis->setWhatsThis(expln);
    basisArea->addWidget(basis, 1);

    embedded = new QCheckBox(ui->tr("Embedded hypersurfaces only"), ui);
    embedded->setChecked(
        ! ReginaPrefSet::global().hypersurfacesCreationList.has(
        regina::HS_IMMERSED_SINGULAR));
    embedded->setWhatsThis(ui->tr("Specifies whether only embedded "
        "normal hypersurfaces should be enumerated, or whether all normal "
        "hypersurfaces (embedded, immersed and singular) should be "
        "enumerated."));
    layout->addWidget(embedded);
}
        explicit UI( DeleteCertificatesDialog * qq )
            : selectedLB( i18n( "These are the certificates you have selected for deletion:" ), qq ),
              selectedKTV( qq ),
              unselectedLB( i18n("These certificates will be deleted even though you did <emphasis>not</emphasis><nl/> "
                                 "explicitly select them (<a href=\"whatsthis://\">Why?</a>):"), qq ),
              unselectedKTV( qq ),
              buttonBox( QDialogButtonBox::Ok|QDialogButtonBox::Cancel ),
              vlay( qq )
        {
            KDAB_SET_OBJECT_NAME( selectedLB );
            KDAB_SET_OBJECT_NAME( selectedKTV );
            KDAB_SET_OBJECT_NAME( unselectedLB );
            KDAB_SET_OBJECT_NAME( unselectedKTV );
            KDAB_SET_OBJECT_NAME( buttonBox );
            KDAB_SET_OBJECT_NAME( vlay );

            vlay.addWidget( &selectedLB );
            vlay.addWidget( &selectedKTV, 1 );
            vlay.addWidget( &unselectedLB );
            vlay.addWidget( &unselectedKTV, 1 );
            vlay.addWidget( &buttonBox );

            const QString unselectedWhatsThis
                = i18nc( "@info:whatsthis",
                         "<title>Why do you want to delete more certificates than I selected?</title>"
                         "<para>When you delete CA certificates (both root CAs and intermediate CAs), "
                         "the certificates issued by them will also be deleted.</para>"
                         "<para>This can be nicely seen in <application>Kleopatra</application>'s "
                         "hierarchical view mode: In this mode, if you delete a certificate that has "
                         "children, those children will also be deleted. Think of CA certificates as "
                         "folders containing other certificates: When you delete the folder, you "
                         "delete its contents, too.</para>" );

            unselectedLB.setWhatsThis( unselectedWhatsThis );
            unselectedKTV.setWhatsThis( unselectedWhatsThis );

            buttonBox.button( QDialogButtonBox::Ok )->setText( i18nc("@action:button","Delete") );

            connect( &unselectedLB, SIGNAL(linkActivated(QString)), qq, SLOT(slotWhatsThisRequested()) );

            selectedKTV.setFlatModel( AbstractKeyListModel::createFlatKeyListModel( &selectedKTV ) );
            unselectedKTV.setFlatModel( AbstractKeyListModel::createFlatKeyListModel( &unselectedKTV ) );

            selectedKTV.setHierarchicalView( false );
            selectedKTV.view()->setSelectionMode( QAbstractItemView::NoSelection );
            unselectedKTV.setHierarchicalView( false );
            unselectedKTV.view()->setSelectionMode( QAbstractItemView::NoSelection );

            connect( &buttonBox, SIGNAL(accepted()), qq, SLOT(accept()) );
            connect( &buttonBox, SIGNAL(rejected()), qq, SLOT(reject()) );
        }
Пример #3
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" ) );
}
Пример #4
0
Settings::FileVersionDetectionPage::FileVersionDetectionPage( QWidget* parent )
    : QWidget( parent )
{
    QVBoxLayout* topLayout = new QVBoxLayout( this );
    QString txt;

    // General file searching
    {
        QGroupBox* generalBox = new QGroupBox( i18n("New File Searches"), this );
        topLayout->addWidget( generalBox );
        QVBoxLayout* layout = new QVBoxLayout(generalBox);

        // Search for images on startup
        m_searchForImagesOnStart = new QCheckBox( i18n("Search for new images and videos on startup"), generalBox );
        layout->addWidget(m_searchForImagesOnStart);

        m_ignoreFileExtension = new QCheckBox( i18n("Ignore file extensions when searching for new images and videos"), generalBox);
        layout->addWidget(m_ignoreFileExtension);

        m_skipSymlinks = new QCheckBox( i18n("Skip symbolic links when searching for new images"), generalBox );
        layout->addWidget(m_skipSymlinks);

        m_skipRawIfOtherMatches = new QCheckBox( i18n("Do not read RAW files if a matching JPEG/TIFF file exists"), generalBox );
        layout->addWidget(m_skipRawIfOtherMatches);

        // Exclude directories from search
        QLabel* excludeDirectoriesLabel = new QLabel( i18n("Directories to exclude from new file search:" ), generalBox );
        layout->addWidget(excludeDirectoriesLabel);

        m_excludeDirectories = new QLineEdit( generalBox );
        layout->addWidget(m_excludeDirectories);
        excludeDirectoriesLabel->setBuddy( m_excludeDirectories );

        txt = i18n( "<p>KPhotoAlbum is capable of searching for new images and videos when started, this does, "
                    "however, take some time, so instead you may wish to manually tell KPhotoAlbum to search for new images "
                    "using <b>Maintenance->Rescan for new images</b></p>");
        m_searchForImagesOnStart->setWhatsThis( txt );

        txt = i18n( "<p>KPhotoAlbum will normally search new images and videos by their file extension. "
                    "If this option is set, <em>all</em> files neither in the database nor in the block list "
                    "will be checked by their Mime type, regardless of their extension. This will take "
                    "significantly longer than finding files by extension!</p>");
        m_ignoreFileExtension->setWhatsThis( txt );

        txt = i18n( "<p>KPhotoAlbum attempts to read all image files whether actual files or symbolic links. If you "
                    "wish to ignore symbolic links, check this option. This is useful if for some reason you have e.g. "
                    "both the original files and symbolic links to these files within your image directory.</p>");
        m_skipSymlinks->setWhatsThis( txt );

        txt = i18n( "<p>KPhotoAlbum is capable of reading certain kinds of RAW images. "
                    "Some cameras store both a RAW image and a matching JPEG or TIFF image. "
                    "This causes duplicate images to be stored in KPhotoAlbum, which may be undesirable. "
                    "If this option is checked, KPhotoAlbum will not read RAW files for which matching image files also exist.</p>");
        m_skipRawIfOtherMatches->setWhatsThis( txt );

        txt = i18n( "<p>Directories defined here (separated by comma <tt>,</tt>) are "
                    "skipped when searching for new photos. Thumbnail directories of different "
                    "tools should be configured here. E.g. <tt>xml,ThumbNails,.thumbs,.thumbnails</tt>.</p>" );
        excludeDirectoriesLabel->setWhatsThis( txt );

    }

    // Original/Modified File Support
    {
        QGroupBox* modifiedBox = new QGroupBox( i18n("File Version Detection Settings"), this );
        topLayout->addWidget( modifiedBox );
        QVBoxLayout* layout = new QVBoxLayout(modifiedBox);

        m_detectModifiedFiles = new QCheckBox(i18n("Try to detect multiple versions of files"), modifiedBox);
        layout->addWidget(m_detectModifiedFiles);

        QLabel* modifiedFileComponentLabel = new QLabel( i18n("File versions search regexp:" ), modifiedBox );
        layout->addWidget(modifiedFileComponentLabel);

        m_modifiedFileComponent = new QLineEdit(modifiedBox);
        layout->addWidget(m_modifiedFileComponent);

        QLabel* originalFileComponentLabel = new QLabel( i18n("Original file replacement text:" ), modifiedBox );
        layout->addWidget(originalFileComponentLabel);

        m_originalFileComponent = new QLineEdit(modifiedBox);
        layout->addWidget(m_originalFileComponent);

        m_moveOriginalContents = new QCheckBox(i18n("Move meta-data (i.e. delete tags from the original):"), modifiedBox);
        layout->addWidget(m_moveOriginalContents);

        m_autoStackNewFiles = new QCheckBox(i18n("Automatically stack new versions of images"), modifiedBox);
        layout->addWidget(m_autoStackNewFiles);

        txt = i18n( "<p>When KPhotoAlbum searches for new files and finds a file that matches the "
                    "<i>modified file search regexp</i> it is assumed that an original version of "
                    "the image may exist. The regexp pattern will be replaced with the <i>original "
                    "file replacement text</i> and if that file exists, all associated metadata (category "
                    "information, ratings, etc) will be copied or moved from the original file to the new one.</p>");
        m_detectModifiedFiles->setWhatsThis( txt );

        txt = i18n( "<p>A perl regular expression that should match a modified file. "
                    "<ul><li>A dot matches a single character (<tt>\\.</tt> matches a dot)</li> "
                    "  <li>You can use the quantifiers <tt>*</tt>,<tt>+</tt>,<tt>?</tt>, or you can "
                    "    match multiple occurrences of an expression by using curly brackets (e.g. "
                    "<tt>e{0,1}</tt> matches 0 or 1 occurrences of the character \"e\").</li> "
                    "  <li>You can group parts of the expression using parenthesis.</li> "
                    "</ul>Example: <tt>-modified\\.(jpg|tiff)</tt> </p>");
        modifiedFileComponentLabel->setWhatsThis( txt );
        m_modifiedFileComponent->setWhatsThis( txt );

        txt = i18n( "<p>A string that is used to replace the match from the <i>File versions search regexp</i>. "
                    "This can be a semicolon (<tt>;</tt>) separated list. Each string is used to replace the match "
                    "in the new file's name until an original file is found or we run out of options.</p>");
        originalFileComponentLabel->setWhatsThis( txt );
        m_originalFileComponent->setWhatsThis( txt );

        txt = i18n( "<p>The tagging is moved from the original file to the new file. This way "
                    "only the latest version of an image is tagged.</p>" );
        m_moveOriginalContents->setWhatsThis( txt );

        txt = i18n( "<p>If this option is set, new versions of an image are automatically stacked "
                    "and placed to the top of the stack. This way the new image is shown when the "
                    "stack is in collapsed state - the default state in KPhotoAlbum.</p>" );
        m_autoStackNewFiles->setWhatsThis( txt );
    }

    // Copy File Support
    {
        QGroupBox* copyBox = new QGroupBox( i18nc("Configure the feature to make a copy of a file first and then open the copied file with an external application", "Copy File and Open with an External Application"), this );
        topLayout->addWidget( copyBox );
        QVBoxLayout* layout = new QVBoxLayout(copyBox);

        QLabel* copyFileComponentLabel = new QLabel( i18n("Copy file search regexp:" ), copyBox );
        layout->addWidget(copyFileComponentLabel);

        m_copyFileComponent = new QLineEdit(copyBox);
        layout->addWidget(m_copyFileComponent);

        QLabel* copyFileReplacementComponentLabel = new QLabel( i18n("Copy file replacement text:" ), copyBox );
        layout->addWidget(copyFileReplacementComponentLabel);

        m_copyFileReplacementComponent = new QLineEdit(copyBox);
        layout->addWidget(m_copyFileReplacementComponent);

        txt = i18n("<p>KPhotoAlbum can make a copy of an image before opening it with an external application. This configuration defines how the new file is named.</p>"
                   "<p>The regular expression defines the part of the original file name that is replaced with the <i>replacement text</i>. "
                   "E.g. regexp <i>\"\\.(jpg|png)\"</i> and replacement text <i>\"-mod.\\1\"</i> would copy test.jpg to test-mod.jpg and open the new file in selected application.</p>");
        copyFileComponentLabel->setWhatsThis( txt );
        m_copyFileComponent->setWhatsThis( txt );
        copyFileReplacementComponentLabel->setWhatsThis( txt );
        m_copyFileReplacementComponent->setWhatsThis( txt );
    }

}
Settings::ViewerPage::ViewerPage( QWidget* parent )
    : QWidget( parent )
{
    QVBoxLayout* lay1 = new QVBoxLayout( this );

    _slideShowSetup = new ViewerSizeConfig( i18n( "Running Slide Show From Thumbnail View" ), this );
    lay1->addWidget( _slideShowSetup );

    _viewImageSetup = new ViewerSizeConfig( i18n( "Viewing Images and Videos From Thumbnail View" ), this );
    lay1->addWidget( _viewImageSetup );

    QGridLayout* glay = new QGridLayout;
    lay1->addLayout( glay );

    QLabel* label = new QLabel( i18n("Slideshow interval:" ), this );
    glay->addWidget( label, 0, 0 );

    _slideShowInterval = new QSpinBox;
    _slideShowInterval->setRange( 1, INT_MAX );
    glay->addWidget( _slideShowInterval, 0, 1 );
    _slideShowInterval->setSuffix( i18n( " sec" ) );
    label->setBuddy( _slideShowInterval );

    label = new QLabel( i18n("Image cache:"), this );
    glay->addWidget( label, 1, 0 );

    _cacheSize = new QSpinBox;
    _cacheSize->setRange( 0, 4096 );
    _cacheSize->setSingleStep( 10 );
    _cacheSize->setSuffix( i18n(" Mbytes") );
    glay->addWidget( _cacheSize, 1, 1 );
    label->setBuddy( _cacheSize );

    QString txt;

    QLabel* standardSizeLabel = new QLabel( i18n("Standard size in viewer:"), this );
    _viewerStandardSize = new KComboBox( this );
    _viewerStandardSize->addItems( QStringList() << i18n("Full Viewer Size") << i18n("Natural Image Size") << i18n("Natural Image Size If Possible") );
    glay->addWidget( standardSizeLabel, 2, 0);
    glay->addWidget( _viewerStandardSize, 2, 1 );
    standardSizeLabel->setBuddy( _viewerStandardSize );

    txt = i18n("<p>Set the standard size for images to be displayed in the viewer.</p> "
           "<p><b>Full Viewer Size</b> indicates that the image will be stretched or shrunk to fill the viewer window.</p> "
           "<p><b>Natural Image Size</b> indicates that the image will be displayed pixel for pixel.</p> "
           "<p><b>Natural Image Size If Possible</b> indicates that the image will be displayed pixel for pixel if it would fit the window, "
           "otherwise it will be shrunk to fit the viewer.</p>");
    _viewerStandardSize->setWhatsThis( txt);

    QLabel* scalingLabel = new QLabel( i18n("Scaling Algorithm"), this );
    _smoothScale = new KComboBox( this );
    _smoothScale->addItems( QStringList() << i18n("Fastest" ) << i18n("Best")  );
    scalingLabel->setBuddy( _smoothScale );

    glay->addWidget( scalingLabel, 3, 0 );
    glay->addWidget( _smoothScale, 3, 1 );
    txt = i18n("<p>When displaying images, KPhotoAlbum normally performs smooth scaling of the image. "
               "If this option is not set, KPhotoAlbum will use a faster but less smooth scaling method.</p>");
    scalingLabel->setWhatsThis( txt );
    _smoothScale->setWhatsThis( txt );
}
Пример #6
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");
}
Пример #7
0
NSurfaceCoordinateUI::NSurfaceCoordinateUI(regina::NNormalSurfaceList* packet,
        PacketTabbedUI* useParentUI, bool readWrite) :
        PacketEditorTab(useParentUI), surfaces(packet), appliedFilter(0),
        isReadWrite(readWrite), currentlyResizing(false) {
    // Set up the UI.
    ui = new QWidget();
    QBoxLayout* uiLayout = new QVBoxLayout(ui);
    uiLayout->setContentsMargins(0, 0, 0, 0);
    uiLayout->addSpacing(5);

    QBoxLayout* hdrLayout = new QHBoxLayout();
    uiLayout->addLayout(hdrLayout);

    // Set up the coordinate selector.
    QLabel* label = new QLabel(tr("Display coordinates:"));
    hdrLayout->addWidget(label);
    coords = new CoordinateChooser();
    coords->insertAllViewers(surfaces);
    coords->setCurrentSystem(surfaces->coords());
    connect(coords, SIGNAL(activated(int)), this, SLOT(refresh()));
    hdrLayout->addWidget(coords);
    QString msg = tr("Allows you to view these normal surfaces in a "
        "different coordinate system.");
    label->setWhatsThis(msg);
    coords->setWhatsThis(msg);

    hdrLayout->addStretch(1);

    // Set up the filter selector.
    label = new QLabel(tr("Apply filter:"));
    hdrLayout->addWidget(label);
    filter = new PacketChooser(surfaces->root(),
        new SingleTypeFilter<regina::NSurfaceFilter>(),
        PacketChooser::ROOT_AS_PACKET, true, 0, ui);
    filter->setAutoUpdate(true);
    connect(filter, SIGNAL(activated(int)), this, SLOT(refresh()));
    hdrLayout->addWidget(filter);
    msg = tr("<qt>Allows you to filter this list so that only normal "
        "surfaces satisfying particular properties are displayed.<p>"
        "To use this feature you need a separate surface filter.  You "
        "can create new surface filters through the <i>Packet Tree</i> "
        "menu.</qt>");
    label->setWhatsThis(msg);
    filter->setWhatsThis(msg);

    // Set up the coordinate table.
    model = new SurfaceModel(surfaces, readWrite);

    table = new QTreeView();
    table->setItemsExpandable(false);
    table->setRootIsDecorated(false);
    table->setAlternatingRowColors(true);
    table->header()->setStretchLastSection(false);
    table->setSelectionMode(QTreeView::SingleSelection);
    table->setWhatsThis(tr("Displays details of the individual normal "
        "surfaces in this list.<p>"
        "Each row represents a single normal (or almost normal) surface.  "
        "As well as various properties of the surface, each row contains "
        "a detailed representation of the surface in the currently selected "
        "coordinate system.<p>"
        "For details on what each property means or what each coordinate "
        "represents, hover the mouse over the column header (or refer "
        "to the users' handbook).</qt>"));
    // Add grid lines:
    // For some reason, when we set cell borders, the selection
    // background changes to white (-> white on white, which is unreadable).
    // So reluctantly we also break the native system style and explicitly
    // set a background ourselves.  I would love a better way of dealing
    // with this. :/
    table->setStyleSheet("QTreeView::item:selected { "
                            "background: qlineargradient(x1: 0, y1: 0, "
                                "x2: 0, y2: 1, stop: 0 #6ea1f1, "
                                "stop: 1 #567dbc); "
                         "} "
                         "QTreeView::item { "
                            "border: 1px solid #d9d9d9; "
                            "border-top-color: transparent; "
                            "border-left-color: transparent; "
                         "}");
    table->setModel(model);
    table->header()->resizeSections(QHeaderView::ResizeToContents);
    uiLayout->addWidget(table, 1);

    connect(table->header(), SIGNAL(sectionResized(int, int, int)),
        this, SLOT(columnResized(int, int, int)));

    actCutAlong = new QAction(this);
    actCutAlong->setText(tr("Cu&t Along Surface"));
    actCutAlong->setToolTip(tr("Cut the triangulation along the "
        "selected surface"));
    actCutAlong->setEnabled(false);
    actCutAlong->setWhatsThis(tr("<qt>Cuts open the surround triangulation "
        "along the selected surface.  This triangulation will not "
        "be changed; instead a new cut-open triangulation will be created.<p>"
        "This operation will never change the topology of the underlying "
        "3-manifold beyond just cutting along the surface (as opposed to "
        "the related <i>crushing</i> operation, which might).  However, "
        "because the new surface boundaries are created from real "
        "boundary triangles, the resulting number of tetrahedra might be very "
        "large.</qt>"));
    connect(actCutAlong, SIGNAL(triggered()), this, SLOT(cutAlong()));
    surfaceActionList.append(actCutAlong);

    actCrush = new QAction(this);
    actCrush->setText("Crus&h Surface");
    actCrush->setToolTip(tr("Crush the selected surface to a point"));
    actCrush->setEnabled(false);
    actCrush->setWhatsThis(tr("<qt>Crushes the selected surface to a point "
        "within the surrounding triangulation.  This triangulation will not "
        "be changed; instead a new crushed triangulation will be created.<p>"
        "<b>Warning:</b> This routine simply removes all tetrahedra "
        "containing quadrilateral discs and rejoins the others "
        "appropriately.  In some circumstances this might change the "
        "topology of the underlying 3-manifold beyond just slicing along "
        "the surface and shrinking the resulting boundary/boundaries "
        "to points.</qt>"));
    surfaceActionList.append(actCrush);
    connect(actCrush, SIGNAL(triggered()), this, SLOT(crush()));

    connect(table->selectionModel(),
        SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
        this, SLOT(updateActionStates()));

    connect(&ReginaPrefSet::global(), SIGNAL(preferencesChanged()),
        this, SLOT(updatePreferences()));
}
Пример #8
0
void KIGPDialog::setupDirectoryPage(const QString& path) {
    QFrame *page = new QFrame();
    KPageWidgetItem *pageItem = new KPageWidgetItem( page, i18n("Folders") );
    pageItem->setHeader(i18n("Folders"));
    pageItem->setIcon(KIcon(BarIcon("folder", KIconLoader::SizeMedium )) );
    addPage(pageItem);

    KConfigGroup group =  m_config->group("Directory");
    QVBoxLayout *dvlay = new QVBoxLayout( page );
    dvlay->setMargin( 0 );

    QLabel *label;
    label = new QLabel(i18n("&Save to HTML file:"), page);
    dvlay->addWidget( label );
    QString whatsThis;
    whatsThis = i18n("<p>The name of the HTML file this gallery will be saved to.</p>");
    label->setWhatsThis( whatsThis );

    m_imageNameReq = new KUrlRequester(QString(path + "images.html"), page);
    label->setBuddy( m_imageNameReq );
    dvlay->addWidget(m_imageNameReq);
    connect( m_imageNameReq, SIGNAL(textChanged(const QString&)),
             this, SLOT(imageUrlChanged(const QString&)) );
    m_imageNameReq->setWhatsThis( whatsThis );

    const bool recurseSubDir = group.readEntry("RecurseSubDirectories", false);
    m_recurseSubDir = new QCheckBox(i18n("&Recurse subfolders"), page);
    m_recurseSubDir->setChecked( recurseSubDir );
    whatsThis = i18n("<p>Whether subfolders should be included for the "
                     "image gallery creation or not.</p>");
    m_recurseSubDir->setWhatsThis( whatsThis );

    const int recursionLevel = group.readEntry("RecursionLevel", 0);
    m_recursionLevel = new KIntNumInput( recursionLevel, page );
    m_recursionLevel->setRange( 0, 99, 1);
    m_recursionLevel->setSliderEnabled(true);
    m_recursionLevel->setLabel( i18n("Rec&ursion depth:") );
    if ( recursionLevel == 0 )
      m_recursionLevel->setSpecialValueText( i18n("Endless"));
    m_recursionLevel->setEnabled(recurseSubDir);
    whatsThis = i18n("<p>You can limit the number of folders the "
                     "image gallery creator will traverse to by setting an "
                     "upper bound for the recursion depth.</p>");
    m_recursionLevel->setWhatsThis( whatsThis );


    connect(m_recurseSubDir, SIGNAL( toggled(bool) ),
            m_recursionLevel, SLOT( setEnabled(bool) ) );

    dvlay->addWidget(m_recurseSubDir);
    dvlay->addWidget(m_recursionLevel);

    m_copyOriginalFiles = new QCheckBox(i18n("Copy or&iginal files"), page);
    m_copyOriginalFiles->setChecked(group.readEntry("CopyOriginalFiles", false) );
    dvlay->addWidget(m_copyOriginalFiles);
    whatsThis = i18n("<p>This makes a copy of all images and the gallery will refer "
                     "to these copies instead of the original images.</p>");
    m_copyOriginalFiles->setWhatsThis( whatsThis );


    const bool useCommentFile = group.readEntry("UseCommentFile", false);
    m_useCommentFile = new QCheckBox(i18n("Use &comment file"), page);
    m_useCommentFile->setChecked(useCommentFile);
    dvlay->addWidget(m_useCommentFile);

    whatsThis = i18n("<p>If you enable this option you can specify "
                     "a comment file which will be used for generating "
                     "subtitles for the images.</p>"
                     "<p>For details about the file format please see "
                     "the \"What's This?\" help below.</p>");
    m_useCommentFile->setWhatsThis( whatsThis );

    label = new QLabel(i18n("Comments &file:"), page);
    label->setEnabled( useCommentFile );
    dvlay->addWidget( label );
    whatsThis = i18n("<p>You can specify the name of the comment file here. "
                     "The comment file contains the subtitles for the images. "
                     "The format of this file is:</p>"
                     "<p>FILENAME1:"
                     "<br />Description"
                     "<br />"
                     "<br />FILENAME2:"
                     "<br />Description"
                     "<br />"
                     "<br />and so on</p>");
    label->setWhatsThis( whatsThis );

    m_commentFileReq = new KUrlRequester(QString(path + "comments"), page);
    m_commentFileReq->setEnabled(useCommentFile);
    label->setBuddy( m_commentFileReq );
    dvlay->addWidget(m_commentFileReq);
    m_commentFileReq->setWhatsThis( whatsThis );

    connect(m_useCommentFile, SIGNAL(toggled(bool)),
            label, SLOT(setEnabled(bool)));
    connect(m_useCommentFile, SIGNAL(toggled(bool)),
            m_commentFileReq, SLOT(setEnabled(bool)));

    dvlay->addStretch(1);
}
Пример #9
0
ExportDialog::ExportDialog(const QString& tableName, QWidget* parent, Qt::WFlags fl )
    : QDialog( parent, fl )
{
	setWindowTitle( tr( "QtiPlot - Export ASCII" ) );
	setSizeGripEnabled( true );

	ApplicationWindow *app = (ApplicationWindow *)parent;

	QGridLayout *gl1 = new QGridLayout();
    gl1->addWidget(new QLabel(tr("Table")), 0, 0);
	boxTable = new QComboBox();
	QStringList tables = app->tableNames() + app->matrixNames();
	boxTable->addItems(tables);
	boxTable->setCurrentIndex(0);

	boxTable->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
	gl1->addWidget(boxTable, 0, 1);

	boxAllTables = new QCheckBox(tr( "&All" ));
    boxAllTables->setChecked(false);
	gl1->addWidget(boxAllTables, 0, 2);

    QLabel *sepText = new QLabel( tr( "Separator" ) );
	gl1->addWidget(sepText, 1, 0);

    boxSeparator = new QComboBox();
	boxSeparator->addItem(tr("TAB"));
    boxSeparator->addItem(tr("SPACE"));
	boxSeparator->addItem(";" + tr("TAB"));
	boxSeparator->addItem("," + tr("TAB"));
	boxSeparator->addItem(";" + tr("SPACE"));
	boxSeparator->addItem("," + tr("SPACE"));
    boxSeparator->addItem(";");
    boxSeparator->addItem(",");
	boxSeparator->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
	boxSeparator->setEditable( true );
	gl1->addWidget(boxSeparator, 1, 1);
	setColumnSeparator(app->d_export_col_separator);

	QString help = tr("The column separator can be customized. The following special codes can be used:\n\\t for a TAB character \n\\s for a SPACE");
	help += "\n"+tr("The separator must not contain the following characters: 0-9eE.+-");

	boxSeparator->setWhatsThis(help);
	sepText->setWhatsThis(help);
	boxSeparator->setToolTip(help);
	sepText->setToolTip(help);

	boxNames = new QCheckBox(tr( "Include Column &Names" ));
    boxNames->setChecked( app->d_export_col_names );

	boxComments = new QCheckBox(tr( "Include Column Co&mments" ));
    boxComments->setChecked( app->d_export_col_comment );

    boxSelection = new QCheckBox(tr( "Export &Selection" ));
    boxSelection->setChecked( app->d_export_table_selection );

	QVBoxLayout *vl1 = new QVBoxLayout();
	vl1->addLayout( gl1 );
	vl1->addWidget( boxNames );
	vl1->addWidget( boxComments );
	vl1->addWidget( boxSelection );

	QHBoxLayout *hbox3 = new QHBoxLayout();
	buttonOk = new QPushButton(tr( "&OK" ));
    buttonOk->setDefault( true );
	hbox3->addWidget( buttonOk );
    buttonCancel = new QPushButton(tr( "&Cancel" ));
	hbox3->addWidget( buttonCancel );
	buttonHelp = new QPushButton(tr( "&Help" ));
	hbox3->addWidget( buttonHelp );
	hbox3->addStretch();

	QVBoxLayout *vl = new QVBoxLayout( this );
    vl->addLayout(vl1);
	vl->addStretch();
	vl->addLayout(hbox3);

    // signals and slots connections
    connect( boxTable, SIGNAL(activated(const QString &)), this, SLOT(updateOptions(const QString &)));
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
	connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) );
    connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( help() ) );
	connect( boxAllTables, SIGNAL( toggled(bool) ), this, SLOT( enableTableName(bool) ) );

    if (tables.contains(tableName)){
		boxTable->setCurrentIndex(boxTable->findText(tableName));
		updateOptions(tableName);
    }
}
Пример #10
0
KBugReport::KBugReport( QWidget * _parent, bool modal, const KAboutData *aboutData )
  : KDialog( _parent ), d( new KBugReportPrivate(this) )
{
  setCaption( i18n("Submit Bug Report") );
  setButtons( Ok | Cancel );
  setModal(modal);

  // Use supplied aboutdata, otherwise the one from the active componentData
  // otherwise the KGlobal one. _activeInstance should neved be 0L in theory.
  d->m_aboutData = aboutData ? aboutData
      : (KGlobal::activeComponent().isValid() ? KGlobal::activeComponent().aboutData()
                                  : KGlobal::mainComponent().aboutData());
#ifndef EMSCRIPTEN
  d->m_process = 0;
#endif
  QWidget * parent = new QWidget(this);
  d->submitBugWeb = false;

  if ( d->m_aboutData->bugAddress() == QLatin1String("*****@*****.**") )
  {
    // This is a core KDE application -> redirect to the web form
    d->submitBugWeb = true;
    setButtonGuiItem( Cancel, KStandardGuiItem::close() );
  }

  QLabel * tmpLabel;
  QVBoxLayout * lay = new QVBoxLayout( parent);

  KTitleWidget *title = new KTitleWidget( this );
  title->setText(i18n( "Submit Bug Report" ) );
  title->setPixmap( KIcon( "tools-report-bug" ).pixmap( 32 ) );
  lay->addWidget( title );

  QGridLayout *glay = new QGridLayout();
  lay->addLayout(glay);

  int row = 0;

  if ( !d->submitBugWeb )
  {
    // From
    QString qwtstr = i18n( "Your email address. If incorrect, use the Configure Email button to change it" );
    tmpLabel = new QLabel( i18nc("Email sender address", "From:"), parent );
    glay->addWidget( tmpLabel, row,0 );
    tmpLabel->setWhatsThis(qwtstr );
    d->m_from = new QLabel( parent );
    glay->addWidget( d->m_from, row, 1 );
    d->m_from->setWhatsThis(qwtstr );


    // Configure email button
    d->m_configureEmail = new QPushButton( i18n("Configure Email..."),
                                        parent );
    connect( d->m_configureEmail, SIGNAL(clicked()), this,
             SLOT(_k_slotConfigureEmail()) );
    glay->addWidget( d->m_configureEmail, 0, 2, 3, 1, Qt::AlignTop|Qt::AlignRight );

    // To
    qwtstr = i18n( "The email address this bug report is sent to." );
    tmpLabel = new QLabel( i18nc("Email receiver address", "To:"), parent );
    glay->addWidget( tmpLabel, ++row,0 );
    tmpLabel->setWhatsThis(qwtstr );
    tmpLabel = new QLabel( d->m_aboutData->bugAddress(), parent );
    tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
    glay->addWidget( tmpLabel, row, 1 );
    tmpLabel->setWhatsThis(qwtstr );

    setButtonGuiItem( Ok,  KGuiItem( i18n("&Send"), "mail-send", i18n( "Send bug report." ),
                    i18n( "Send this bug report to %1." ,  d->m_aboutData->bugAddress() ) ) );
    row++;
  }
  else
  {
    d->m_configureEmail = 0;
    d->m_from = 0;
  }

  // Program name
  QString qwtstr = i18n( "The application for which you wish to submit a bug report - if incorrect, please use the Report Bug menu item of the correct application" );
  tmpLabel = new QLabel( i18n("Application: "), parent );
  glay->addWidget( tmpLabel, row, 0 );
  tmpLabel->setWhatsThis(qwtstr );
  d->appcombo = new KComboBox( false, parent );
  d->appcombo->setWhatsThis(qwtstr );
  QStringList packageList;
  for (int c = 0; packages[c]; ++c)
    packageList << QString::fromLatin1(packages[c]);
  d->appcombo->addItems(packageList);
  connect(d->appcombo, SIGNAL(activated(int)), SLOT(_k_appChanged(int)));
  d->appname = d->m_aboutData
                                    ? d->m_aboutData->productName()
                                    : qApp->applicationName() ;
  glay->addWidget( d->appcombo, row, 1 );
  int index = 0;
  for (; index < d->appcombo->count(); index++) {
      if (d->appcombo->itemText(index) == d->appname) {
          break;
      }
  }
  if (index == d->appcombo->count()) { // not present
      d->appcombo->addItem(d->appname);
  }
  d->appcombo->setCurrentIndex(index);

  tmpLabel->setWhatsThis(qwtstr );

  // Version
  qwtstr = i18n( "The version of this application - please make sure that no newer version is available before sending a bug report" );
  tmpLabel = new QLabel( i18n("Version:"), parent );
  glay->addWidget( tmpLabel, ++row, 0 );
  tmpLabel->setWhatsThis(qwtstr );
  if (d->m_aboutData)
      d->m_strVersion = d->m_aboutData->version();
  else
      d->m_strVersion = i18n("no version set (programmer error)");
  d->kde_version = QString::fromLatin1( KDE_VERSION_STRING );
  d->kde_version += ", " + QString::fromLatin1( KDE_DISTRIBUTION_TEXT );
  if ( !d->submitBugWeb )
      d->m_strVersion += ' ' + d->kde_version;
  d->m_version = new QLabel( d->m_strVersion, parent );
  d->m_version->setTextInteractionFlags(Qt::TextBrowserInteraction);
  //glay->addWidget( d->m_version, row, 1 );
  glay->addWidget( d->m_version, row, 1, 1, 2 );
  d->m_version->setWhatsThis(qwtstr );

  tmpLabel = new QLabel(i18n("OS:"), parent);
  glay->addWidget( tmpLabel, ++row, 0 );

  struct utsname unameBuf;
  uname( &unameBuf );
  d->os = QString::fromLatin1( unameBuf.sysname ) +
          " (" + QString::fromLatin1( unameBuf.machine ) + ") "
          "release " + QString::fromLatin1( unameBuf.release );

  tmpLabel = new QLabel(d->os, parent);
  tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
  glay->addWidget( tmpLabel, row, 1, 1, 2 );

  tmpLabel = new QLabel(i18n("Compiler:"), parent);
  glay->addWidget( tmpLabel, ++row, 0 );
  tmpLabel = new QLabel(QString::fromLatin1(KDE_COMPILER_VERSION), parent);
  tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
  glay->addWidget( tmpLabel, row, 1, 1, 2 );

  if ( !d->submitBugWeb )
  {
    // Severity
    d->m_bgSeverity = new QGroupBox( i18n("Se&verity"), parent );
    static const char * const sevNames[5] = { "critical", "grave", "normal", "wishlist", "i18n" };
    const QString sevTexts[5] = { i18n("Critical"), i18n("Grave"), i18nc("normal severity","Normal"), i18n("Wishlist"), i18n("Translation") };
    QHBoxLayout *severityLayout=new QHBoxLayout(d->m_bgSeverity);
    for (int i = 0 ; i < 5 ; i++ )
    {
      // Store the severity string as the name
      QRadioButton *rb = new QRadioButton( sevTexts[i], d->m_bgSeverity);
      rb->setObjectName(sevNames[i] );
      d->severityButtons.append(rb);
      severityLayout->addWidget(rb);
      if (i==2) rb->setChecked(true); // default : "normal"
    }

    lay->addWidget( d->m_bgSeverity );

    // Subject
    QHBoxLayout * hlay = new QHBoxLayout();
    lay->addItem(hlay);
    tmpLabel = new QLabel( i18n("S&ubject: "), parent );
    hlay->addWidget( tmpLabel );
    d->m_subject = new KLineEdit( parent );
    d->m_subject->setClearButtonShown(true);
    d->m_subject->setFocus();
    tmpLabel->setBuddy( d->m_subject );
    hlay->addWidget( d->m_subject );

    QString text = i18n("Enter the text (in English if possible) that you wish to submit for the "
                        "bug report.\n"
                        "If you press \"Send\", a mail message will be sent to the maintainer of "
                        "this program.\n");
    QLabel * label = new QLabel( parent);

    label->setText( text );
    lay->addWidget( label );

    // The multiline-edit
    d->m_lineedit = new KTextEdit( parent);
    d->m_lineedit->setMinimumHeight( 180 ); // make it big
    d->m_lineedit->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
    d->m_lineedit->setLineWrapMode(QTextEdit::WidgetWidth);
    d->m_lineedit->setCheckSpellingEnabled(true);
    d->m_lineedit->setSpellCheckingLanguage("en");
    lay->addWidget( d->m_lineedit, 10 /*stretch*/ );

    d->_k_slotSetFrom();
  } else {
    // Point to the web form

    lay->addSpacing(10);
    QString text = i18n("<qt>To submit a bug report, click on the button below. This will open a web browser "
                        "window on <a href=\"http://bugs.kde.org\">http://bugs.kde.org</a> where you will find "
                        "a form to fill in. The information displayed above will be transferred to that server.</qt>");
    QLabel * label = new QLabel( text, parent);
    label->setOpenExternalLinks( true );
    label->setTextInteractionFlags( Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard );
    label->setWordWrap( true );
    lay->addWidget( label );
    lay->addSpacing(10);

    d->appcombo->setFocus();

    d->_k_updateUrl();

    setButtonText(Ok, i18n("&Launch Bug Report Wizard"));
    setButtonIcon(Ok, KIcon("tools-report-bug"));
  }
  parent->setMinimumHeight( parent->sizeHint().height() + 20 ); // WORKAROUND: prevent "cropped" kcombobox
  setMainWidget(parent);
}
Пример #11
0
KgAdvanced::KgAdvanced(bool first, QWidget* parent) :
        KonfiguratorPage(first, parent)
{
    QWidget *innerWidget = new QFrame(this);
    setWidget(innerWidget);
    setWidgetResizable(true);
    QGridLayout *kgAdvancedLayout = new QGridLayout(innerWidget);
    kgAdvancedLayout->setSpacing(6);

    //  -------------------------- GENERAL GROUPBOX ----------------------------------

    QGroupBox *generalGrp = createFrame(i18n("General"), innerWidget);
    QGridLayout *generalGrid = createGridLayout(generalGrp);

    KONFIGURATOR_CHECKBOX_PARAM generalSettings[] =
        //   cfg_class  cfg_name             default              text                                                        restart tooltip
    {
//     {"Advanced", "PreserveAttributes", _PreserveAttributes, i18n("Preserve attributes for local copy/move (slower)"), false,  i18n("Krusader will try to preserve all attributes (time, owner, group) of the local files according to the source depending on your permissions:<ul><li>User preserving if you are root</li><li>Group preserving if you are root or member of the group</li><li>Preserving the timestamp</li></ul><b>Note</b>: This can slow down the copy process.") },
        {"Advanced", "AutoMount",          _AutoMount,          i18n("Automount filesystems"),                            false,  i18n("When stepping into a directory which is defined as a mount point in the <b>fstab</b>, try mounting it with the defined parameters.")}
    };

    KonfiguratorCheckBoxGroup *generals = createCheckBoxGroup(1, 0, generalSettings, 1, generalGrp);

    generalGrid->addWidget(generals, 1, 0);

    addLabel(generalGrid, 2, 0, i18n("MountMan will not (un)mount the following mount-points:"),
             generalGrp);
    KonfiguratorEditBox *nonMountPoints = createEditBox("Advanced", "Nonmount Points", _NonMountPoints, generalGrp, false);
    generalGrid->addWidget(nonMountPoints, 2, 1);


#ifdef BSD
    generals->find("AutoMount")->setEnabled(false);     /* disable AutoMount on BSD */
#endif

    kgAdvancedLayout->addWidget(generalGrp, 0 , 0);

    //  ----------------------- CONFIRMATIONS GROUPBOX -------------------------------

    QGroupBox *confirmGrp = createFrame(i18n("Confirmations"), innerWidget);
    QGridLayout *confirmGrid = createGridLayout(confirmGrp);

    addLabel(confirmGrid, 0, 0, i18n("\nRequest user confirmation for the following operations:\n"),
             confirmGrp);

    KONFIGURATOR_CHECKBOX_PARAM confirmations[] =
        //   cfg_class  cfg_name                default             text                                          restart ToolTip
    {{"Advanced", "Confirm Unempty Dir",   _ConfirmUnemptyDir, i18n("Deleting non-empty directories"),   false,  ""},
        {"Advanced", "Confirm Delete",        _ConfirmDelete,     i18n("Deleting files"),                   false,  ""},
        {"Advanced", "Confirm Copy",          _ConfirmCopy,       i18n("Copying files"),                    false,  ""},
        {"Advanced", "Confirm Move",          _ConfirmMove,       i18n("Moving files"),                     false,  ""},
        {"Advanced", "Confirm Feed to Listbox",  _ConfirmFeedToListbox, i18n("Confirm feed to listbox"), false, i18n("Ask for a result name when feeding items to the listbox. By default the standard value is used.")},
        {"Notification Messages", "Confirm Remove UserAction", true, i18n("Removing Useractions"), false,  ""}
    };

    KonfiguratorCheckBoxGroup *confWnd = createCheckBoxGroup(2, 0, confirmations, 6, confirmGrp);

    confirmGrid->addWidget(confWnd, 1, 0);

    kgAdvancedLayout->addWidget(confirmGrp, 1 , 0);


    //  ------------------------ FINE-TUNING GROUPBOX --------------------------------

    QGroupBox *fineTuneGrp = createFrame(i18n("Fine-Tuning"), innerWidget);
    QGridLayout *fineTuneGrid = createGridLayout(fineTuneGrp);
    fineTuneGrid->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    QLabel *label = new QLabel(i18n("Icon cache size (KB):"), fineTuneGrp);
    label->setWhatsThis(i18n("The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory."));
    fineTuneGrid->addWidget(label, 0, 0);
    KonfiguratorSpinBox *spinBox = createSpinBox("Advanced", "Icon Cache Size", _IconCacheSize,
                                   1, 8192, fineTuneGrp, false);
    spinBox->setWhatsThis(i18n("The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory."));
    spinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    fineTuneGrid->addWidget(spinBox, 0, 1);

    addLabel(fineTuneGrid, 1, 0, i18n("Arguments of updatedb:"),
             fineTuneGrp);
    KonfiguratorEditBox *updatedbArgs = createEditBox("Locate", "UpdateDB Arguments", "", fineTuneGrp, false);
    fineTuneGrid->addWidget(updatedbArgs, 1, 1);

    kgAdvancedLayout->addWidget(fineTuneGrp, 2 , 0);
}
Пример #12
0
NHyperCoordinateUI::NHyperCoordinateUI(regina::NNormalHypersurfaceList* packet,
        PacketTabbedUI* useParentUI, bool readWrite) :
        PacketEditorTab(useParentUI), surfaces(packet),
        isReadWrite(readWrite), currentlyResizing(false) {
    // Set up the UI.
    ui = new QWidget();
    QBoxLayout* uiLayout = new QVBoxLayout(ui);
    uiLayout->setContentsMargins(0, 0, 0, 0);
    uiLayout->addSpacing(5);

    QBoxLayout* hdrLayout = new QHBoxLayout();
    uiLayout->addLayout(hdrLayout);

    // Set up the coordinate selector.
    QLabel* label = new QLabel(tr("Display coordinates:"));
    hdrLayout->addWidget(label);
    coords = new HyperCoordinateChooser();
    coords->insertAllViewers(surfaces);
    coords->setCurrentSystem(surfaces->coords());
    connect(coords, SIGNAL(activated(int)), this, SLOT(refresh()));
    hdrLayout->addWidget(coords);
    QString msg = tr("Allows you to view these normal hypersurfaces in a "
        "different coordinate system.");
    label->setWhatsThis(msg);
    coords->setWhatsThis(msg);

    hdrLayout->addStretch(1);

    // Set up the coordinate table.
    model = new HyperModel(surfaces, readWrite);

    table = new QTreeView();
    table->setItemsExpandable(false);
    table->setRootIsDecorated(false);
    table->setAlternatingRowColors(true);
    table->header()->setStretchLastSection(false);
    table->setSelectionMode(QTreeView::SingleSelection);
    table->setWhatsThis(tr("Displays details of the individual normal "
        "hypersurfaces in this list.<p>"
        "Each row represents a single normal hypersurface.  "
        "As well as various properties of the hypersurface, each row contains "
        "a detailed representation of the hypersurface in the currently "
        "selected coordinate system.<p>"
        "For details on what each property means or what each coordinate "
        "represents, hover the mouse over the column header (or refer "
        "to the users' handbook).</qt>"));
    // Add grid lines:
    // For some reason, when we set cell borders, the selection
    // background changes to white (-> white on white, which is unreadable).
    // So reluctantly we also break the native system style and explicitly
    // set a background ourselves.  I would love a better way of dealing
    // with this. :/
    table->setStyleSheet("QTreeView::item:selected { "
                            "background: qlineargradient(x1: 0, y1: 0, "
                                "x2: 0, y2: 1, stop: 0 #6ea1f1, "
                                "stop: 1 #567dbc); "
                         "} "
                         "QTreeView::item { "
                            "border: 1px solid #d9d9d9; "
                            "border-top-color: transparent; "
                            "border-left-color: transparent; "
                         "}");
    table->setModel(model);
    table->header()->resizeSections(QHeaderView::ResizeToContents);
    uiLayout->addWidget(table, 1);

    connect(table->header(), SIGNAL(sectionResized(int, int, int)),
        this, SLOT(columnResized(int, int, int)));

    actTriangulate = new QAction(this);
    actTriangulate->setText(tr("&Triangulate Hypersurface"));
    actTriangulate->setToolTip(tr("Builds a 3-manifold triangulation "
        "of the selected hypersurface"));
    actTriangulate->setEnabled(false);
    actTriangulate->setWhatsThis(tr("<qt>Builds a 3-manifold triangulation "
        "of the selected hypersurface.<p>"
        "The new triangulation will have the same <i>topology</i> as the "
        "selected hypersurface.  However, it will be simplified, "
        "which means that information about the <i>combinatorics</i> "
        "of the hypersurface will be lost.</qt>"));
    connect(actTriangulate, SIGNAL(triggered()), this, SLOT(triangulate()));
    surfaceActionList.append(actTriangulate);

    connect(table->selectionModel(),
        SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
        this, SLOT(updateActionStates()));

    connect(&ReginaPrefSet::global(), SIGNAL(preferencesChanged()),
        this, SLOT(updatePreferences()));
}
Пример #13
0
PosterWidget::PosterWidget( QWidget *parent )
    : QWidget( parent )
{
        //WhatsThis strings.... (added by [email protected])
	QString whatsThis5_PosterPage = i18n( " <qt> "
			" 5. "
			" </qt>" );

	QString whatsThisEnablePosterPage = i18n( " <qt> "
                        " <b>Print Poster</b> (enabled or disabled). "
			" <p>If you enable this option, you can print posters of different sizes "
			" The printout will happen in the form <em>'tiles'</em> printed on smaller "
			" paper sizes, which you can stitch together later. <em>If you enable this "
			" option here, the <em>'Poster Printing' filter</em> will be auto-loaded in "
			" the 'Filters' tab of this dialog. </p>"
			" <p>This tab is only visible if the external <em>'poster'</em> utility is "
			" discovered by KDEPrint on your system. [<em>'poster'</em> is a commandline "
			" utility that enables you to convert PostScript files into tiled printouts "
			" which allow for oversized appearance of the stitched-together tiles.] </p>"
			" <p><b>Note:</b> The standard version of 'poster' will not work. Your system "
			" must use a patched version of 'poster'. Ask your operating system vendor to "
			" provide a patched version of 'poster' if he does not already.</p>"
			" </qt>" );

	QString whatsThisTileSelectionPosterPage = i18n( " <qt> "
                        " <b>Tile Selection widget</b> "
			" <p>This GUI element is <em>not only for viewing</em> your selections: it also "
			" lets you interactively select the tile(s) you want to print. "
			" </p>"
			" <p><b>Hints</b> "
			" <ul> "
			" <li>Click any tile to select it for printing.</li> "
			" <li>To select multiple tiles to be printed "
			" at once, <em>'shift-click'</em> on the tiles ('shift-click' means: hold down the "
			" [SHIFT]-key on your keyboard and click with the mouse while [SHIFT]-key is held.)  "
			" <em>Be aware</em> that the order "
			" of your clicking is also significant to the order of printing the different tiles. </li>"
			" </ul> "
			" <b>Note 1:</b> The order of your selection (and the order for printout of the tiles) "
			" is indicated by the contents of the text field below, "
			" labelled as <em>'Tile pages (to be printed):'</em><p>"
			" <b>Note 2:</b> By default no tile is selected. Before you can print (a part "
			" of) your poster, you must select at least one tile. </p> "
			" </qt>" );

	QString whatsThisPostersizePosterPage = i18n( " <qt> "
                        " <b>Poster Size</b> "
			" <p>Select the poster size you want from the dropdown list. </p> "
			" Available sizes are all standard paper sizes up to "
			" 'A0'. [A0 is the same size as 16 sheets of A4, or '84cm x 118.2cm'.] </p> "
			" <p><b>Notice</b>, how the little preview window below changes with your change of poster "
			" size. It indicates to you how many tiles need to be printed to make the poster, "
			" given the selected paper size.</p>  "
			" <p><b>Hint:</b> The little preview window below is not just a passive icon. You can click "
			" on its individual tiles to select them for printing. To select multiple tiles to be printed "
			" at once, you need to <em>'shift-click'</em> on the tiles ('shift-click' means: hold down the "
			" [SHIFT]-key on your keyboard and click with the mouse while [SHIFT]-key is held.) The order "
			" of your clicking is significant to the order of printing the different tiles. The order of "
			" your selection (and for the printed tiles) is indicated by the contents of the text field "
			" labelled as <em>'Tile pages (to be printed):'</em><p>"
			" <b>Note:</b> By default no tile is selected. Before you can print (a part "
			" of) your poster, you must select at least one tile. </p> "
			" </qt>" );

	QString whatsThisPrintsizePosterPage = i18n( " <qt> "
                        " <b>Paper Size</b> "
			" <p>This field indicates the paper size the poster tiles will be printed on. "
			" To select a different paper size for your poster tiles, go to the 'General' tab "
			" of this dialog and select one from the dropdown list. </p> "
			" Available sizes are most standard paper sizes supported by your printer. Your printer's "
			" supported paper sizes are read from the printer driver info (as laid down in the <em>'PPD'</em>, "
			" the printer description file). <em>Be aware that the 'Paper Size' selected may not be supported "
			" by 'poster' (example: 'HalfLetter') while it may well be supported by your printer.</em>  If "
			" you hit that obstacle, simply use another, supported Paper Size, like 'A4' or 'Letter'. "
			" <p><b>Notice</b>, how the little preview window below changes with your change of paper "
			" size. It indicates how many tiles need to be printed to make up the poster, "
			" given the selected paper and poster size.</p>  "
			" <p><b>Hint:</b> The little preview window below is not just a passive icon. You can click "
			" on its individual tiles to select them for printing. To select multiple tiles to be printed "
			" at once, you need to <em>'shift-click'</em> on the tiles ('shift-click' means: hold down the "
			" [SHIFT]-key on your keyboard and click with the mouse while [SHIFT]-key is held.) The order "
			" of your clicking is significant to the order of printing the different tiles. The order of "
			" your selection (and for the printed tiles) is indicated by the contents of the text field "
			" labelled as <em>'Tile pages (to be printed):'</em><p>"
			" <b>Note:</b> By default no tile is selected. Before you can print (a part "
			" of) your poster, you must select at least one tile. </p> "
			" </qt>" );

	QString whatsThisCutmarginPosterPage = i18n( " <qt> "
                        " <b>Cut Margin selection</b> "
			" <p>Slider and spinbox let you determine a <em>'cut margin'</em> which will be printed onto "
			" each tile of your poster to help you cut the pieces as needed. </p>"
			" <p><b>Notice</b>, how the little preview window above changes with your change of cut "
			" margins. It indicates to you how much space the cut margins will take away from each tile. "
			" <p><b>Be aware</b>, that your cut margins need to be equal to or greater than the margins your "
			" printer uses. The printer's capabilities are described in the <em>'ImageableArea'</em> "
			" keywords of its driver PPD file. </p> "
			" </qt>" );

	QString whatsThisTileOrderSelectionPosterPage = i18n( " <qt> "
                        " <b>Order and number of tile pages to be printed</b> "
			" <p>This field displays and sets the individual tiles to be printed, as well as the order "
			" for their printout. </p> "
			" You can file the field with 2 different methods: "
			" <ul> "
			" <li>Either use the interactive thumbnail preview above and '[SHIFT]-click' on the tiles. </li> "
			" <li>Or edit this text field accordingly. </li> "
			" </ul> "
			" <p>When editing the field, you can use a '3-7' syntax instead of a '3,4,5,6,7' one. </p> "
			" <p><b>Examples:</b></p> "
			" <pre> "
			"   \"2,3,7,9,3\" "
			" <br> "
			"   \"1-3,6,8-11\" "
			" </qt>" );

    setWindowTitle( i18n( "Poster" ) );

	m_postercheck = new QCheckBox( i18n( "&Print poster" ), this );
    m_postercheck->setWhatsThis(whatsThisEnablePosterPage);
	QWidget *dummy = new QWidget( this );
	m_preview = new PosterPreview( dummy );
    m_preview->setMediaSize(QPrinter::A4);
    m_preview->setWhatsThis(whatsThisTileSelectionPosterPage);
	m_postersize = new QComboBox( dummy );
    m_postersize->setWhatsThis(whatsThisPostersizePosterPage);
	m_printsize = new QComboBox( dummy );
    m_printsize->setWhatsThis(whatsThisPrintsizePosterPage);
	m_lockbtn = new KPushButton( dummy );
          //QWhatsThis::add(m_lockbtn, whatsThis5_PosterPage);           //FIXME ASK_MICHAEL: which pushbutton would that be?
	m_mediasize = new QLabel( dummy );
    m_mediasize->setWhatsThis(whatsThisPrintsizePosterPage);
	m_mediasize->setFrameStyle( QFrame::Panel|QFrame::Sunken );
	QLabel *posterlab = new QLabel( i18n( "Poste&r size:" ), dummy );
    posterlab->setWhatsThis(whatsThisPostersizePosterPage);
	QLabel *medialab = new QLabel( i18n( "Media size:" ), dummy );
    medialab->setWhatsThis(whatsThisPrintsizePosterPage);
	QLabel *printlab = new QLabel( i18n( "Pri&nt size:" ), dummy );
    printlab->setWhatsThis(whatsThisPrintsizePosterPage);
	posterlab->setBuddy( m_postersize );
	printlab->setBuddy( m_printsize );
	m_cutmargin = new KIntNumInput( 5, dummy );
    m_cutmargin->setWhatsThis(whatsThisCutmarginPosterPage);
	// xgettext:no-c-format
	m_cutmargin->setLabel( i18n( "C&ut margin (% of media):" ) );
    m_cutmargin->setRange( 0, 100, 2 );                     // step width was too big, changed from 10 to 2 (-kp-)
    m_cutmargin->setSliderEnabled(true);
	m_selection = new QLineEdit( dummy );
    m_selection->setWhatsThis(whatsThisTileOrderSelectionPosterPage);
	QLabel *selectionlab = new QLabel( i18n( "&Tile pages (to be printed):" ), dummy );
    selectionlab->setWhatsThis(whatsThisTileOrderSelectionPosterPage);
	selectionlab->setBuddy( m_selection );
    m_lockbtn->setCheckable( true );
    m_lockbtn->setIcon(QIcon::fromTheme("document-encrypt"));
    m_lockbtn->setChecked( true );
	m_lockbtn->setFixedSize( m_lockbtn->sizeHint() );
    m_lockbtn->setToolTip(i18n( "Link/unlink poster and print size" ));

    QList<QPrinter::PaperSize> paperSizeList = PaperSizeUtils::allPaperSizes();
    Q_FOREACH (QPrinter::PaperSize paperSize, paperSizeList)
	{
        m_postersize->addItem( PaperSizeUtils::paperSizeToString(paperSize), paperSize );
        m_printsize->addItem( PaperSizeUtils::paperSizeToString(paperSize), paperSize );
    }
Пример #14
0
JSPoliciesFrame::JSPoliciesFrame(JSPolicies *policies, const QString &title,
		QWidget* parent) :
	QGroupBox(title, parent),
	policies(policies) {

  bool is_per_domain = !policies->isGlobal();

  QGridLayout *this_layout = new QGridLayout();
  setLayout(this_layout);
  this_layout->setAlignment(Qt::AlignTop);

  QString wtstr;	// what's this description
  int colIdx;		// column index

  // === window.open ================================
  colIdx = 0;
  QLabel *label = new QLabel(i18n("Open new windows:"),this);
  this_layout->addWidget(label,0,colIdx++);

  js_popup = new QButtonGroup(this);
  js_popup->setExclusive(true);

  QRadioButton* policy_btn;
  if (is_per_domain) {
    policy_btn = new QRadioButton(i18n("Use global"), this);
    policy_btn->setWhatsThis(i18n("Use setting from global policy."));
    js_popup->addButton(policy_btn,INHERIT_POLICY);
    this_layout->addWidget(policy_btn,0,colIdx++);
    this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
  }/*end if*/

  policy_btn = new QRadioButton(i18n("Allow"), this);
  policy_btn->setWhatsThis(i18n("Accept all popup window requests."));
  js_popup->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowOpenAllow);
  this_layout->addWidget(policy_btn,0,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Ask"), this);
  policy_btn->setWhatsThis(i18n("Prompt every time a popup window is requested."));
  js_popup->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowOpenAsk);
  this_layout->addWidget(policy_btn,0,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Deny"), this);
  policy_btn->setWhatsThis(i18n("Reject all popup window requests."));
  js_popup->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowOpenDeny);
  this_layout->addWidget(policy_btn,0,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Smart"), this);
  policy_btn->setWhatsThis( i18n("Accept popup window requests only when "
                                   "links are activated through an explicit "
                                   "mouse click or keyboard operation."));
  js_popup->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowOpenSmart);
  this_layout->addWidget(policy_btn,0,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  wtstr = i18n("If you disable this, Konqueror will stop "
               "interpreting the <i>window.open()</i> "
               "JavaScript command. This is useful if you "
               "regularly visit sites that make extensive use "
               "of this command to pop up ad banners.<br />"
               "<br /><b>Note:</b> Disabling this option might "
               "also break certain sites that require <i>"
               "window.open()</i> for proper operation. Use "
               "this feature carefully.");
  label->setWhatsThis( wtstr);
  connect(js_popup, SIGNAL(buttonClicked(int)), SLOT(setWindowOpenPolicy(int)));

  // === window.resizeBy/resizeTo ================================
  colIdx = 0;
  label = new QLabel(i18n("Resize window:"),this);
  this_layout->addWidget(label,1,colIdx++);

  js_resize = new QButtonGroup(this);
  js_resize->setExclusive(true);

  if (is_per_domain) {
    policy_btn = new QRadioButton(i18n("Use global"), this);
    policy_btn->setWhatsThis(i18n("Use setting from global policy."));
    js_resize->addButton(policy_btn,INHERIT_POLICY);
    this_layout->addWidget(policy_btn,1,colIdx++);
    this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
  }/*end if*/

  policy_btn = new QRadioButton(i18n("Allow"), this);
  policy_btn->setWhatsThis(i18n("Allow scripts to change the window size."));
  js_resize->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowResizeAllow);
  this_layout->addWidget(policy_btn,1,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Ignore"), this);
  policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the window size. "
  				"The web page will <i>think</i> it changed the "
				"size but the actual window is not affected."));
  js_resize->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowResizeIgnore);
  this_layout->addWidget(policy_btn,1,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  wtstr = i18n("Some websites change the window size on their own by using "
  		"<i>window.resizeBy()</i> or <i>window.resizeTo()</i>. "
		"This option specifies the treatment of such "
		"attempts.");
  label->setWhatsThis( wtstr);
  connect(js_resize, SIGNAL(buttonClicked(int)), SLOT(setWindowResizePolicy(int)));

  // === window.moveBy/moveTo ================================
  colIdx = 0;
  label = new QLabel(i18n("Move window:"),this);
  this_layout->addWidget(label,2,colIdx++);

  js_move = new QButtonGroup(this);
  js_move->setExclusive(true);

  if (is_per_domain) {
    policy_btn = new QRadioButton(i18n("Use global"), this);
    policy_btn->setWhatsThis(i18n("Use setting from global policy."));
    js_move->addButton(policy_btn,INHERIT_POLICY);
    this_layout->addWidget(policy_btn,2,colIdx++);
    this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
  }/*end if*/

  policy_btn = new QRadioButton(i18n("Allow"), this);
  policy_btn->setWhatsThis(i18n("Allow scripts to change the window position."));
  js_move->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowMoveAllow);
  this_layout->addWidget(policy_btn,2,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Ignore"), this);
  policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the window position. "
  				"The web page will <i>think</i> it moved the "
				"window but the actual position is not affected."));
  js_move->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowMoveIgnore);
  this_layout->addWidget(policy_btn,2,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  wtstr = i18n("Some websites change the window position on their own by using "
  		"<i>window.moveBy()</i> or <i>window.moveTo()</i>. "
		"This option specifies the treatment of such "
		"attempts.");
  label->setWhatsThis( wtstr);
  connect(js_move, SIGNAL(buttonClicked(int)), SLOT(setWindowMovePolicy(int)));

  // === window.focus ================================
  colIdx = 0;
  label = new QLabel(i18n("Focus window:"),this);
  this_layout->addWidget(label,3,colIdx++);

  js_focus = new QButtonGroup(this);
  js_focus->setExclusive(true);

  if (is_per_domain) {
    policy_btn = new QRadioButton(i18n("Use global"), this);
    policy_btn->setWhatsThis(i18n("Use setting from global policy."));
    js_focus->addButton(policy_btn,INHERIT_POLICY);
    this_layout->addWidget(policy_btn,3,colIdx++);
    this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
  }/*end if*/

  policy_btn = new QRadioButton(i18n("Allow"), this);
  policy_btn->setWhatsThis(i18n("Allow scripts to focus the window.") );
  js_focus->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowFocusAllow);
  this_layout->addWidget(policy_btn,3,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Ignore"), this);
  policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to focus the window. "
  				"The web page will <i>think</i> it brought "
				"the focus to the window but the actual "
				"focus will remain unchanged.") );
  js_focus->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowFocusIgnore);
  this_layout->addWidget(policy_btn,3,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  wtstr = i18n("Some websites set the focus to their browser window on their "
  		"own by using <i>window.focus()</i>. This usually leads to "
		"the window being moved to the front interrupting whatever "
		"action the user was dedicated to at that time. "
		"This option specifies the treatment of such "
		"attempts.");
  label->setWhatsThis( wtstr);
  connect(js_focus, SIGNAL(buttonClicked(int)), SLOT(setWindowFocusPolicy(int)));

  // === window.status ================================
  colIdx = 0;
  label = new QLabel(i18n("Modify status bar text:"),this);
  this_layout->addWidget(label,4,colIdx++);

  js_statusbar = new QButtonGroup(this);
  js_statusbar->setExclusive(true);

  if (is_per_domain) {
    policy_btn = new QRadioButton(i18n("Use global"), this);
    policy_btn->setWhatsThis(i18n("Use setting from global policy."));
    js_statusbar->addButton(policy_btn,INHERIT_POLICY);
    this_layout->addWidget(policy_btn,4,colIdx++);
    this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);
  }/*end if*/

  policy_btn = new QRadioButton(i18n("Allow"), this);
  policy_btn->setWhatsThis(i18n("Allow scripts to change the text of the status bar."));
  js_statusbar->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowStatusAllow);
  this_layout->addWidget(policy_btn,4,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  policy_btn = new QRadioButton(i18n("Ignore"), this);
  policy_btn->setWhatsThis(i18n("Ignore attempts of scripts to change the status bar text. "
  				"The web page will <i>think</i> it changed "
				"the text but the actual text will remain "
				"unchanged.") );
  js_statusbar->addButton(policy_btn,KParts::HtmlSettingsInterface::JSWindowStatusIgnore);
  this_layout->addWidget(policy_btn,4,colIdx++);
  this_layout->addItem(new QSpacerItem(10,0),0,colIdx++);

  wtstr = i18n("Some websites change the status bar text by setting "
  		"<i>window.status</i> or <i>window.defaultStatus</i>, "
		"thus sometimes preventing displaying the real URLs of hyperlinks. "
		"This option specifies the treatment of such "
		"attempts.");
  label->setWhatsThis( wtstr);
  connect(js_statusbar, SIGNAL(buttonClicked(int)), SLOT(setWindowStatusPolicy(int)));
}
Пример #15
0
KfindTabWidget::KfindTabWidget(QWidget *parent)
  : KTabWidget( parent ), regExpDialog(0)
{
    // This validator will be used for all numeric edit fields
    //KDigitValidator *digitV = new KDigitValidator(this);

    // ************ Page One ************

    pages[0] = new QWidget;
    pages[0]->setObjectName( QLatin1String( "page1" ) );

    nameBox = new KComboBox(pages[0]);
    nameBox->setEditable( true );
    nameBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);  // allow smaller than widest entry
    QLabel * namedL = new QLabel(i18nc("this is the label for the name textfield","&Named:"), pages[0]);
    namedL->setBuddy( nameBox );
    namedL->setObjectName( QLatin1String( "named" ) );
    namedL->setToolTip( i18n("You can use wildcard matching and \";\" for separating multiple names") );
    dirBox  = new KUrlComboBox(KUrlComboBox::Directories, pages[0]);
    dirBox->setEditable( true );
    dirBox->setCompletionObject(new KUrlCompletion(KUrlCompletion::DirCompletion));
    dirBox->setAutoDeleteCompletionObject(true);
    dirBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);  // allow smaller than widest entry
    QLabel * lookinL = new QLabel(i18n("Look &in:"), pages[0]);
    lookinL->setBuddy( dirBox );
    lookinL->setObjectName( QLatin1String( "lookin" ) );
    subdirsCb  = new QCheckBox(i18n("Include &subfolders"), pages[0]);
    caseSensCb  = new QCheckBox(i18n("Case s&ensitive search"), pages[0]);
    browseB    = new QPushButton(i18n("&Browse..."), pages[0]);
    useLocateCb = new QCheckBox(i18n("&Use files index"), pages[0]);
    hiddenFilesCb = new QCheckBox(i18n("Show &hidden files"), pages[0]);
    // Setup

    subdirsCb->setChecked(true);
    caseSensCb->setChecked(false);
    useLocateCb->setChecked(false);
    hiddenFilesCb->setChecked(false);
    if(KStandardDirs::findExe(QLatin1String("locate")).isEmpty())
        useLocateCb->setEnabled(false);

    nameBox->setDuplicatesEnabled(false);
    nameBox->setFocus();
    dirBox->setDuplicatesEnabled(false);

    nameBox->setInsertPolicy(QComboBox::InsertAtTop);
    dirBox->setInsertPolicy(QComboBox::InsertAtTop);

    const QString nameWhatsThis
      = i18n("<qt>Enter the filename you are looking for. <br />"
	     "Alternatives may be separated by a semicolon \";\".<br />"
	     "<br />"
	     "The filename may contain the following special characters:"
	     "<ul>"
	     "<li><b>?</b> matches any single character</li>"
	     "<li><b>*</b> matches zero or more of any characters</li>"
	     "<li><b>[...]</b> matches any of the characters between the braces</li>"
	     "</ul>"
	     "<br />"
	     "Example searches:"
	     "<ul>"
	     "<li><b>*.kwd;*.txt</b> finds all files ending with .kwd or .txt</li>"
	     "<li><b>go[dt]</b> finds god and got</li>"
	     "<li><b>Hel?o</b> finds all files that start with \"Hel\" and end with \"o\", "
	     "having one character in between</li>"
	     "<li><b>My Document.kwd</b> finds a file of exactly that name</li>"
	     "</ul></qt>");
    nameBox->setWhatsThis(nameWhatsThis);
    namedL->setWhatsThis(nameWhatsThis);
    const QString whatsfileindex
        = i18n("<qt>This lets you use the files' index created by the <i>slocate</i> "
               "package to speed-up the search; remember to update the index from time to time "
               "(using <i>updatedb</i>)."
               "</qt>");
    useLocateCb->setWhatsThis(whatsfileindex);

    // Layout

    QGridLayout *grid = new QGridLayout( pages[0] );
    grid->setMargin( KDialog::marginHint() );
    grid->setSpacing( KDialog::spacingHint() );
    QVBoxLayout *subgrid = new QVBoxLayout();
    grid->addWidget( namedL, 0, 0 );
    grid->addWidget( nameBox, 0, 1, 1, 3 );
    grid->addWidget( lookinL, 1, 0 );
    grid->addWidget( dirBox, 1, 1 );
    grid->addWidget( browseB, 1, 2);
    grid->setColumnStretch(1,1);
    grid->addLayout( subgrid, 2, 1, 1, 2 );
    
    QHBoxLayout * layoutOne = new QHBoxLayout();
    layoutOne->addWidget( subdirsCb );
    layoutOne->addWidget( hiddenFilesCb );
    
    QHBoxLayout * layoutTwo = new QHBoxLayout();
    layoutTwo->addWidget( caseSensCb);
    layoutTwo->addWidget( useLocateCb );
    
    subgrid->addLayout( layoutOne );
    subgrid->addLayout( layoutTwo );
    
    subgrid->addStretch(1);

    // Signals

    connect(browseB, &QPushButton::clicked, this, &KfindTabWidget::getDirectory);

    connect(nameBox, static_cast<void (KComboBox::*)()>(&KComboBox::returnPressed), this, &KfindTabWidget::startSearch);

    connect(dirBox, static_cast<void (KUrlComboBox::*)()>(&KUrlComboBox::returnPressed), this, &KfindTabWidget::startSearch);
    
    // ************ Page Two

    pages[1] = new QWidget;
    pages[1]->setObjectName( QLatin1String( "page2" ) );

    findCreated =  new QCheckBox(i18n("Find all files created or &modified:"), pages[1]);
    bg  = new QButtonGroup();
    rb[0] = new QRadioButton(i18n("&between"), pages[1] );
    rb[1] = new QRadioButton(pages[1]); // text set in updateDateLabels
    andL = new QLabel(i18n("and"), pages[1]);
    andL->setObjectName( QLatin1String( "and" ) );
    betweenType = new KComboBox( pages[1] );
    betweenType->setObjectName( QLatin1String( "comboBetweenType" ) );
    betweenType->addItems(QVector<QString>(5).toList()); // texts set in updateDateLabels
    betweenType->setCurrentIndex(1);
    updateDateLabels(1, 1);

    QDate dt = KLocale::global()->calendar()->addYears(QDate::currentDate(), -1);

    fromDate = new KDateCombo(dt, pages[1] );
    fromDate->setObjectName( QLatin1String( "fromDate" ) );
    toDate = new KDateCombo(pages[1] );
    toDate->setObjectName( QLatin1String( "toDate" ) );
    timeBox = new KIntSpinBox( pages[1] );
    timeBox->setRange( 1, 60 );
    timeBox->setSingleStep( 1 );
    timeBox->setObjectName( QLatin1String( "timeBox" ) );

    sizeBox =new KComboBox( pages[1] );
    sizeBox->setObjectName( QLatin1String( "sizeBox" ) );
    QLabel * sizeL   =new QLabel(i18n("File &size is:"), pages[1]);
    sizeL->setBuddy( sizeBox );
    sizeEdit=new KIntSpinBox(pages[1] );
    sizeEdit->setRange( 0, INT_MAX );
    sizeEdit->setSingleStep( 1 );
    sizeEdit->setObjectName( QLatin1String( "sizeEdit" ) );
    sizeEdit->setValue(1);
    sizeUnitBox =new KComboBox( pages[1] );
    sizeUnitBox->setObjectName( QLatin1String( "sizeUnitBox" ) );

    m_usernameBox = new KComboBox( pages[1] );
    m_usernameBox->setEditable( true );
    m_usernameBox->setObjectName( QLatin1String( "m_combo1" ));
    QLabel *usernameLabel= new QLabel(i18n("Files owned by &user:"******"m_combo2" ) );
    QLabel *groupLabel= new QLabel(i18n("Owned by &group:"),pages[1]);
    groupLabel->setBuddy( m_groupBox );

    sizeBox ->addItem( i18nc("file size isn't considered in the search","(none)") );
    sizeBox ->addItem( i18n("At Least") );
    sizeBox ->addItem( i18n("At Most") );
    sizeBox ->addItem( i18n("Equal To") );

    sizeUnitBox ->addItem( i18np("Byte", "Bytes", 1) );
    sizeUnitBox ->addItem( i18n("KiB") );
    sizeUnitBox ->addItem( i18n("MiB") );
    sizeUnitBox ->addItem( i18n("GiB") );
    sizeUnitBox ->setCurrentIndex(1);

    int tmp = sizeEdit->fontMetrics().width(QLatin1String(" 000000000 "));
    sizeEdit->setMinimumSize(tmp, sizeEdit->sizeHint().height());

    m_usernameBox->setDuplicatesEnabled(false);
    m_groupBox->setDuplicatesEnabled(false);
    m_usernameBox->setInsertPolicy(QComboBox::InsertAtTop);
    m_groupBox->setInsertPolicy(QComboBox::InsertAtTop);


    // Setup
    rb[0]->setChecked(true);
    bg->addButton( rb[0] );
    bg->addButton( rb[1] );

    // Layout

    QGridLayout *grid1 = new QGridLayout( pages[1] );
    grid1->setMargin( KDialog::marginHint() );
    grid1->setSpacing( KDialog::spacingHint() );

    grid1->addWidget(findCreated, 0, 0, 1, 3 );
    grid1->addItem( new QSpacerItem(KDialog::spacingHint(), 0), 0, 0 );

    grid1->addWidget(rb[0], 1, 1 );
    grid1->addWidget(fromDate, 1, 2 );
    grid1->addWidget(andL, 1, 3, Qt::AlignHCenter );
    grid1->addWidget(toDate, 1, 4 );

    grid1->addWidget(rb[1], 2, 1 );
    grid1->addWidget(timeBox, 2, 2, 1, 2);
    grid1->addWidget(betweenType, 2, 4 );

    grid1->addWidget(sizeL,3,0,1,2);
    grid1->addWidget(sizeBox,3,2);
    grid1->addWidget(sizeEdit,3,3);
    grid1->addWidget(sizeUnitBox,3,4);

    grid1->addWidget(usernameLabel,4,0,1,2);
    grid1->addWidget(m_usernameBox,4,2);
    grid1->addWidget(groupLabel,4,3);
    grid1->addWidget(m_groupBox,4,4);

    for (int c=1; c<=4; c++)
       grid1->setColumnStretch(c,1);

    grid1->setRowStretch(6,1);

    // Connect
    connect(findCreated, &QCheckBox::toggled, this, &KfindTabWidget::fixLayout);
    connect(bg, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &KfindTabWidget::fixLayout);
    connect(sizeBox, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &KfindTabWidget::slotSizeBoxChanged);
    connect(timeBox, static_cast<void (KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &KfindTabWidget::slotUpdateDateLabelsForNumber);
    connect(betweenType, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &KfindTabWidget::slotUpdateDateLabelsForType);
    connect(sizeEdit, static_cast<void (KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged), this, &KfindTabWidget::slotUpdateByteComboBox);


    // ************ Page Three

    pages[2] = new QWidget;
    pages[2]->setObjectName( QLatin1String( "page3" ) );

    typeBox =new KComboBox( pages[2] );
    typeBox->setObjectName( QLatin1String( "typeBox" ) );
    typeBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);  // allow smaller than widest entry
    QLabel * typeL   =new QLabel( i18nc("label for the file type combobox","File &type:"), pages[2] );
    typeL->setBuddy( typeBox );
    textEdit=new KLineEdit(pages[2]);
    textEdit->setClearButtonShown(true);
    textEdit->setObjectName( QLatin1String( "textEdit" ) );
    QLabel * textL   =new QLabel(i18n("C&ontaining text:"), pages[2]);
    textL->setBuddy( textEdit );

    connect(textEdit, &KLineEdit::returnPressed, this, &KfindTabWidget::startSearch);

    const QString containingtext
      = i18n("<qt>If specified, only files that contain this text"
	      " are found. Note that not all file types from the list"
		  " above are supported. Please refer to the documentation"
		  " for a list of supported file types."
	      "</qt>");
    textEdit->setToolTip(containingtext);
    textL->setWhatsThis(containingtext);

    caseContextCb  =new QCheckBox(i18n("Case s&ensitive"), pages[2]);
    binaryContextCb  =new QCheckBox(i18n("Include &binary files"), pages[2]);
    regexpContentCb  =new QCheckBox(i18n("Regular e&xpression"), pages[2]);

    const QString binaryTooltip
      = i18n("<qt>This lets you search in any type of file, "
       "even those that usually do not contain text (for example "
	   "program files and images).</qt>");
    binaryContextCb->setToolTip(binaryTooltip);

    QPushButton* editRegExp = 0;
    if ( !KServiceTypeTrader::self()->query(QStringLiteral("KRegExpEditor/KRegExpEditor")).isEmpty() ) {
        // The editor is available, so lets use it.
        editRegExp = new QPushButton(i18n("&Edit..."), pages[2]);
        editRegExp->setObjectName( QLatin1String( "editRegExp" ) );
    }

    metainfokeyEdit=new KLineEdit(pages[2]);
    metainfoEdit=new KLineEdit(pages[2]);
    QLabel * textMetaInfo = new QLabel(i18nc("as in search for", "fo&r:"), pages[2]);
    textMetaInfo->setBuddy( metainfoEdit );
    QLabel * textMetaKey = new QLabel(i18n("Search &metainfo sections:"), pages[2]);
    textMetaKey->setBuddy( metainfokeyEdit );

    // Setup
    typeBox->addItem(i18n("All Files & Folders"));
    typeBox->addItem(i18n("Files"));
    typeBox->addItem(i18n("Folders"));
    typeBox->addItem(i18n("Symbolic Links"));
    typeBox->addItem(i18n("Special Files (Sockets, Device Files, ...)"));
    typeBox->addItem(i18n("Executable Files"));
    typeBox->addItem(i18n("SUID Executable Files"));
    typeBox->addItem(i18n("All Images"));
    typeBox->addItem(i18n("All Video"));
    typeBox->addItem(i18n("All Sounds"));

    initMimeTypes();
    initSpecialMimeTypes();

    for ( KMimeType::List::ConstIterator it = m_types.constBegin();
          it != m_types.constEnd(); ++it )
    {
      KMimeType::Ptr typ = *it;
// TODO: needs to move to thread (increases startup time to bizzare amount)
//       and replaced with a better concept 16x16 icons don't cut the cheese
//       typeBox->addItem(KIconLoader::global()->loadMimeTypeIcon( typ->iconName(), KIconLoader::Small ), typ->comment());
      typeBox->addItem(typ->comment());
    }

    if ( editRegExp ) {
      // The editor was available, so lets use it.
      connect(regexpContentCb, &QCheckBox::toggled, editRegExp, &QPushButton::setEnabled);
      editRegExp->setEnabled(false);
      connect(editRegExp, &QPushButton::clicked, this, &KfindTabWidget::slotEditRegExp);
    }
    else
        regexpContentCb->hide();

    // Layout
    tmp = sizeEdit->fontMetrics().width(QLatin1String(" 00000 "));
    sizeEdit->setMinimumSize(tmp, sizeEdit->sizeHint().height());

    QGridLayout *grid2 = new QGridLayout( pages[2] );
    grid2->setMargin( KDialog::marginHint() );
    grid2->setSpacing( KDialog::spacingHint() );
    grid2->addWidget( typeL, 0, 0 );
    grid2->addWidget( textL, 1, 0 );
    grid2->addWidget( typeBox, 0, 1, 1, 3 );
    grid2->addWidget( textEdit, 1, 1, 1, 3 );
    grid2->addWidget( regexpContentCb, 2, 2);
    grid2->addWidget( caseContextCb, 2, 1 );
    grid2->addWidget( binaryContextCb, 3, 1);

    grid2->addWidget( textMetaKey, 4, 0 );
    grid2->addWidget( metainfokeyEdit, 4, 1 );
    grid2->addWidget( textMetaInfo, 4, 2, Qt::AlignHCenter  );
    grid2->addWidget( metainfoEdit, 4, 3 );

    metainfokeyEdit->setText(QLatin1String("*"));

    if ( editRegExp ) {
      // The editor was available, so lets use it.
      grid2->addWidget( editRegExp, 2, 3 );
    }

    addTab( pages[0], i18n("Name/&Location") );
    addTab( pages[2], i18nc("tab name: search by contents","C&ontents") );
    addTab( pages[1], i18n("&Properties") );


    // Setup
    const QString whatsmetainfo
      = i18n("<qt>Search within files' specific comments/metainfo<br />"
	     "These are some examples:<br />"
	     "<ul>"
	     "<li><b>Audio files (mp3...)</b> Search in id3 tag for a title, an album</li>"
	     "<li><b>Images (png...)</b> Search images with a special resolution, comment...</li>"
	     "</ul>"
	     "</qt>");
    const QString whatsmetainfokey
      = i18n("<qt>If specified, search only in this field<br />"
	     "<ul>"
	     "<li><b>Audio files (mp3...)</b> This can be Title, Album...</li>"
	     "<li><b>Images (png...)</b> Search only in Resolution, Bitdepth...</li>"
	     "</ul>"
	     "</qt>");
    textMetaInfo->setWhatsThis(whatsmetainfo);
    metainfoEdit->setToolTip(whatsmetainfo);
    textMetaKey->setWhatsThis(whatsmetainfokey);
    metainfokeyEdit->setToolTip(whatsmetainfokey);


    fixLayout();
    loadHistory();
}
Пример #16
0
/**
 * Constructor of the class
 * @param parent
 * @param name
 * @return
 */
NMGModuleToolBoxItem::NMGModuleToolBoxItem( QWidget *parent, QString modName, const QColor & backgroundColor )
		: QWidget( parent )
{
	setObjectName( modName );
	setMouseTracking( true );

	QPalette palette;
	palette.setColor( backgroundRole(), backgroundColor );
	setPalette( palette );

	moduleName = modName;

	QVBoxLayout * layoutVertical = new QVBoxLayout( this );
	layoutVertical->setMargin( 0 );
	layoutVertical->setSpacing( 0 );
	layoutVertical->setObjectName( moduleName + "LayoutVertical" );

	QHBoxLayout * layoutHoritzontal = new QHBoxLayout( 0 );
	layoutHoritzontal->setMargin( 0 );
	layoutHoritzontal->setSpacing( 0 );
	layoutHoritzontal->setObjectName( moduleName + "LayoutHoritzontal" );

	QSpacerItem * leftSpacer = new QSpacerItem( 1, 21, QSizePolicy::Maximum, QSizePolicy::Minimum );
	layoutHoritzontal->addItem( leftSpacer );

	QString toolTip = (( NMGModuleParent * ) NMGModuleManager::self()->getModule( moduleName ) )->getModuleToolTip().c_str();

	QLabel * pixmapLabel1 = new QLabel( this );
	pixmapLabel1->setMaximumSize( QSize( 64, 64 ) );
	pixmapLabel1->setAlignment( Qt::AlignHCenter );
	pixmapLabel1->setObjectName( moduleName + "Label" );

	if ( !toolTip.isEmpty() )
	{
		pixmapLabel1->setToolTip( toolTip );
		pixmapLabel1->setWhatsThis( toolTip );
	}

	QString iconFile = (( NMGModuleParent * ) NMGModuleManager::self()->getModule( moduleName ) )->getModuleIcon().c_str();
	if ( iconFile.isEmpty() ) iconFile = DEFAULT_ICON_NAME;
	pixmapLabel1->setPixmap( * ( NMGImageManager::loadPixmap( iconFile ) ) );
	pixmapLabel1->setScaledContents( TRUE );
	layoutHoritzontal->addWidget( pixmapLabel1 );
	pixmapLabel1->setMouseTracking( true );

	QSpacerItem * rightSpacer = new QSpacerItem( 1, 21, QSizePolicy::Maximum, QSizePolicy::Minimum );
	layoutHoritzontal->addItem( rightSpacer );
	layoutVertical->addLayout( layoutHoritzontal );


	QLabel * txtModuleLabel = new QLabel( "<p align=\"center\">" + moduleName + "</p>", this );
	txtModuleLabel->setObjectName( moduleName + "Label" );
	if ( !toolTip.isEmpty() )
	{
		txtModuleLabel->setToolTip( toolTip );
		txtModuleLabel->setWhatsThis( toolTip );
	}

	QSizePolicy policy1( QSizePolicy::Preferred, QSizePolicy::Preferred );
	policy1.setHorizontalStretch( 0 );
	policy1.setVerticalStretch( 0 );
	policy1.setHeightForWidth( txtModuleLabel->sizePolicy().hasHeightForWidth() );
	txtModuleLabel->setSizePolicy( policy1 );

	/** Size of the label for the plugin's name at toolbar **/
	txtModuleLabel->adjustSize(); //setMaximumSize( QSize( 100, 150 ) );
	QPalette palettelabel;
	palettelabel.setColor( txtModuleLabel->backgroundRole(), backgroundColor );
	txtModuleLabel->setPalette( palettelabel );
	txtModuleLabel->setAlignment( Qt::AlignVCenter ); //how to 'or' with Qt::TextWordWrap ??
	layoutVertical->addWidget( txtModuleLabel );
}
Пример #17
0
Dim4TriSkelCompUI::Dim4TriSkelCompUI(regina::Dim4Triangulation* packet,
        PacketTabbedViewerTab* useParentUI) : PacketViewerTab(useParentUI),
        tri(packet) {
    ui = new QWidget();
    QBoxLayout* layout = new QVBoxLayout(ui);
    layout->addStretch(1);

    QGridLayout* grid = new QGridLayout();
    layout->addLayout(grid);
    grid->setColumnStretch(0, 1);
    grid->setColumnMinimumWidth(2, 5);
    grid->setColumnMinimumWidth(4, 10);
    grid->setColumnMinimumWidth(6, 10);
    grid->setColumnMinimumWidth(8, 5);
    grid->setColumnMinimumWidth(10, 10);
    grid->setColumnStretch(12, 1);

    QLabel* label;
    QPushButton* btn;
    QString msg;

    label = new QLabel(tr("Vertices:"), ui);
    grid->addWidget(label, 0, 1);
    nVertices = new QLabel(ui);
    nVertices->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nVertices, 0, 3);
    msg = tr("The total number of vertices in this triangulation.");
    label->setWhatsThis(msg);
    nVertices->setWhatsThis(msg);

    label = new QLabel(tr("Edges:"), ui);
    grid->addWidget(label, 1, 1);
    nEdges = new QLabel(ui);
    nEdges ->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nEdges, 1, 3);
    msg = tr("The total number of edges in this triangulation.");
    label->setWhatsThis(msg);
    nEdges->setWhatsThis(msg);

    label = new QLabel(tr("Triangles:"), ui);
    grid->addWidget(label, 2, 1);
    nTriangles = new QLabel(ui);
    nTriangles->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nTriangles, 2, 3);
    msg = tr("The total number of triangles in this triangulation.");
    label->setWhatsThis(msg);
    nTriangles->setWhatsThis(msg);

    label = new QLabel(tr("Tetrahedra:"), ui);
    grid->addWidget(label, 3, 1);
    nTetrahedra = new QLabel(ui);
    nTetrahedra->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nTetrahedra, 3, 3);
    msg = tr("The total number of tetrahedra in this triangulation.");
    label->setWhatsThis(msg);
    nTetrahedra->setWhatsThis(msg);

    label = new QLabel(tr("Pentachora:"), ui);
    grid->addWidget(label, 4, 1);
    nPentachora = new QLabel(ui);
    nPentachora->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nPentachora, 4, 3);
    msg = tr("The total number of pentachora in this triangulation.");
    label->setWhatsThis(msg);
    nPentachora->setWhatsThis(msg);

    label = new QLabel(tr("Components:"), ui);
    grid->addWidget(label, 0, 7);
    nComps = new QLabel(ui);
    nComps->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nComps, 0, 9);
    msg = tr("The total number of connected components in this "
        "triangulation.");
    label->setWhatsThis(msg);
    nComps->setWhatsThis(msg);

    label = new QLabel(tr("Bdry Components:"), ui);
    grid->addWidget(label, 1, 7);
    nBdryComps = new QLabel(ui);
    nBdryComps->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(nBdryComps, 1, 9);
    msg = tr("The total number of boundary components in this triangulation.");
    label->setWhatsThis(msg);
    nBdryComps->setWhatsThis(msg);

    label = new QLabel(trUtf8("χ (Triangulation):"), ui);
    grid->addWidget(label, 2, 7);
    eulerTri = new QLabel(ui);
    eulerTri->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(eulerTri, 2, 9);
    msg = tr("The Euler characteristic of the triangulation.  "
        "This is computed precisely as "
        "(vertices - edges + triangles - tetrahedra + pentachora).");
    label->setWhatsThis(msg);
    eulerTri->setWhatsThis(msg);

    eulerManifoldLabel = new QLabel(trUtf8("χ (Manifold):"), ui);
    grid->addWidget(eulerManifoldLabel, 3, 7);
    eulerManifold = new QLabel(ui);
    eulerManifold->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    grid->addWidget(eulerManifold, 3, 9);
    msg = tr("The Euler characteristic of the underlying compact 3-manifold.  "
        "This is computed as though we had truncated all ideal vertices.");
    eulerManifoldLabel->setWhatsThis(msg);
    eulerManifold->setWhatsThis(msg);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    // btn->setFlat(true);
    btn->setToolTip(tr("View details of individual vertices"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual vertices in a separate window."));
    connect(btn, SIGNAL(clicked()), this, SLOT(viewVertices()));
    grid->addWidget(btn, 0, 5);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    btn->setToolTip(tr("View details of individual edges"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual edges in a separate window."));
    // btn->setFlat(true);
    connect(btn, SIGNAL(clicked()), this, SLOT(viewEdges()));
    grid->addWidget(btn, 1, 5);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    btn->setToolTip(tr("View details of individual triangles"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual triangles in a separate window."));
    // btn->setFlat(true);
    connect(btn, SIGNAL(clicked()), this, SLOT(viewTriangles()));
    grid->addWidget(btn, 2, 5);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    btn->setToolTip(tr("View details of individual tetrahedra"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual tetrahedra in a separate window."));
    // btn->setFlat(true);
    connect(btn, SIGNAL(clicked()), this, SLOT(viewTetrahedra()));
    grid->addWidget(btn, 3, 5);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    btn->setToolTip(tr("View details of individual components"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual connected components in a separate window."));
    // btn->setFlat(true);
    connect(btn, SIGNAL(clicked()), this, SLOT(viewComponents()));
    grid->addWidget(btn, 0, 11);

    btn = new QPushButton(ReginaSupport::regIcon("packet_view"),
        tr("View..."), ui);
    btn->setToolTip(tr("View details of individual boundary components"));
    btn->setWhatsThis(tr("View details of this triangulation's "
        "individual boundary components in a separate window."));
    // btn->setFlat(true);
    connect(btn, SIGNAL(clicked()), this, SLOT(viewBoundaryComponents()));
    grid->addWidget(btn, 1, 11);

    layout->addStretch(1);
}
Пример #18
0
GotoOffsetView::GotoOffsetView( GotoOffsetTool* tool, QWidget* parent )
  : AbstractToolWidget( parent ),
    mTool( tool )
{
    QHBoxLayout* baseLayout = new QHBoxLayout( this );
    baseLayout->setMargin( 0 );

    // offset
    QHBoxLayout* offsetLayout = new QHBoxLayout();
    offsetLayout->setMargin( 0 );

    QLabel* label = new QLabel( i18nc("@label:listbox","O&ffset:"), this );
    mAddressEdit = new Okteta::AddressComboBox( this );
    connect( mAddressEdit, &Okteta::AddressComboBox::addressChanged,
             mTool, &GotoOffsetTool::setTargetOffset );
    connect( mAddressEdit, &Okteta::AddressComboBox::formatChanged,
             this, &GotoOffsetView::onFormatChanged );
    connect( mAddressEdit, &Okteta::AddressComboBox::addressTypeChanged,
             this, &GotoOffsetView::onAddressTypeChanged );
    label->setBuddy( mAddressEdit );
    const QString inputWhatsThis =
        i18nc( "@info:whatsthis","Enter an offset to go to, or select a previous offset from the list." );
    label->setWhatsThis( inputWhatsThis );
    mAddressEdit->setWhatsThis( inputWhatsThis );

    offsetLayout->addWidget( label );
    offsetLayout->addWidget( mAddressEdit, 1 );

    baseLayout->addLayout( offsetLayout, 1 );
    baseLayout->setAlignment( offsetLayout, Qt::AlignTop );

    setFocusProxy( mAddressEdit ); // TODO: see how KDialog does it, e.g. see if there is already a focuswidget as child

    // options
    QVBoxLayout* optionsLayout = new QVBoxLayout();
    optionsLayout->setMargin( 0 );

    mAtCursorCheckBox = new QCheckBox( i18nc("@option:check","From c&ursor"), this );
    mAtCursorCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Go relative from the current cursor location and not absolute.") );
    connect( mAtCursorCheckBox, &QCheckBox::toggled,
             mTool, &GotoOffsetTool::setIsRelative );
    mExtendSelectionCheckBox = new QCheckBox( i18nc("@option:check","&Extend selection"), this );
    mExtendSelectionCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Extend the selection by the cursor move.") );
    connect( mExtendSelectionCheckBox, &QCheckBox::toggled,
             mTool, &GotoOffsetTool::setIsSelectionToExtent );
    mBackwardsCheckBox = new QCheckBox( i18nc("@option:check","&Backwards"), this );
    mBackwardsCheckBox->setWhatsThis(
        i18nc("@info:whatsthis","Go backwards from the end or the current cursor location.") );
    connect( mBackwardsCheckBox, &QCheckBox::toggled, mTool, &GotoOffsetTool::setIsBackwards );

    QHBoxLayout* upperOptionsLayout = new QHBoxLayout();
    upperOptionsLayout->setMargin( 0 );
    upperOptionsLayout->addWidget( mAtCursorCheckBox );
    upperOptionsLayout->addWidget( mBackwardsCheckBox );

    optionsLayout->addLayout( upperOptionsLayout );
    optionsLayout->addWidget( mExtendSelectionCheckBox );

    baseLayout->addLayout( optionsLayout );

    // Goto button
    const KGuiItem gotoGuiItem =
        KGuiItem( i18nc("@action:button","&Go"),
                  QStringLiteral("go-jump"),
                  i18nc("@info:tooltip",
                        "Go to the Offset"),
                  xi18nc("@info:whatsthis",
                         "If you press the <interface>Go</interface> "
                         "button, the cursor will be moved in the document to or, "
                         "on your option, by the offset you entered above.") );
    mGotoButton = new QPushButton( this );
    KGuiItem::assign( mGotoButton, gotoGuiItem );
    connect( mGotoButton, &QPushButton::clicked, this, &GotoOffsetView::onGotoButtonClicked );
    addButton( mGotoButton, AbstractToolWidget::Default );
    baseLayout->addWidget( mGotoButton );
    baseLayout->setAlignment( mGotoButton, Qt::AlignTop );

    setTabOrder( mAddressEdit, mAtCursorCheckBox );
    setTabOrder( mAtCursorCheckBox, mBackwardsCheckBox );
    setTabOrder( mBackwardsCheckBox, mExtendSelectionCheckBox );
    setTabOrder( mExtendSelectionCheckBox, mGotoButton );

    connect( mTool, &GotoOffsetTool::isApplyableChanged,
             this, &GotoOffsetView::onApplyableChanged );

    onApplyableChanged( mTool->isApplyable() );
}
Пример #19
0
KMMsgPartDialog::KMMsgPartDialog( const QString & caption,
                                  QWidget * parent )
  : KDialog( parent )
{
  setCaption( caption.isEmpty() ? i18n("Message Part Properties") : caption );
  setButtons( Ok|Cancel|Help );
  setDefaultButton( Ok );
  setModal( true );
  showButtonSeparator( true );

  // tmp vars:
  QGridLayout * glay;
  QLabel      * label;
  QString       msg;

  setHelp( QString::fromLatin1("attachments") );

  for ( int i = 0 ; i < numEncodingTypes ; ++i )
    mI18nizedEncodings << i18nc( "message encoding type", encodingTypes[i].displayName );
  QFrame *frame = new QFrame( this );
  setMainWidget( frame );
  glay = new QGridLayout(frame );
  glay->setSpacing( spacingHint() );
  glay->setColumnStretch( 1, 1 );
  glay->setRowStretch( 8, 1 );

  // mimetype icon:
  mIcon = new QLabel( frame );
  mIcon->setPixmap( DesktopIcon("unknown") );
  glay->addWidget( mIcon, 0, 0, 2, 1);

  // row 0: Type combobox:
  mMimeType = new KComboBox( true, frame );
  mMimeType->setInsertPolicy( KComboBox::NoInsert );
  mMimeType->setValidator( new KMimeTypeValidator( mMimeType ) );
  mMimeType->addItems( QStringList()
                               << QString::fromLatin1("text/html")
                               << QString::fromLatin1("text/plain")
                               << QString::fromLatin1("image/gif")
                               << QString::fromLatin1("image/jpeg")
                               << QString::fromLatin1("image/png")
                               << QString::fromLatin1("application/octet-stream")
                               << QString::fromLatin1("application/x-gunzip")
                               << QString::fromLatin1("application/zip") );
  connect( mMimeType, SIGNAL(editTextChanged(const QString&)),
           this, SLOT(slotMimeTypeChanged(const QString&)) );
  glay->addWidget( mMimeType, 0, 1 );

  msg = i18n("<qt><p>The <em>MIME type</em> of the file:</p>"
             "<p>normally, you do not need to touch this setting, since the "
             "type of the file is automatically checked; but, sometimes, %1 "
             "may not detect the type correctly -- here is where you can fix "
             "that.</p></qt>", KGlobal::mainComponent().aboutData()->programName() );
  mMimeType->setWhatsThis( msg );

  // row 1: Size label:
  mSize = new QLabel( frame );
  setSize( KIO::filesize_t(0) );
  glay->addWidget( mSize, 1, 1 );

  msg = i18n("<qt><p>The size of the part:</p>"
             "<p>sometimes, %1 will only give an estimated size here, "
             "because calculating the exact size would take too much time; "
             "when this is the case, it will be made visible by adding "
             "\"(est.)\" to the size displayed.</p></qt>",
      KGlobal::mainComponent().aboutData()->programName() );
  mSize->setWhatsThis( msg );

  // row 2: "Name" lineedit and label:
  mFileName = new KLineEdit( frame );
  mFileName->setClearButtonShown( true );
  label = new QLabel( i18nc("file name of the attachment.", "&Name:"), frame );
  label->setBuddy( mFileName );
  glay->addWidget( label, 2, 0 );
  glay->addWidget( mFileName, 2, 1 );

  msg = i18n("<qt><p>The file name of the part:</p>"
             "<p>although this defaults to the name of the attached file, "
             "it does not specify the file to be attached; rather, it "
             "suggests a file name to be used by the recipient's mail agent "
             "when saving the part to disk.</p></qt>");
  label->setWhatsThis( msg );
  mFileName->setWhatsThis( msg );

  // row 3: "Description" lineedit and label:
  mDescription = new KLineEdit( frame );
  mDescription->setClearButtonShown( true );
  label = new QLabel( i18n("&Description:"), frame );
  label->setBuddy( mDescription );
  glay->addWidget( label, 3, 0 );
  glay->addWidget( mDescription, 3, 1 );

  msg = i18n("<qt><p>A description of the part:</p>"
             "<p>this is just an informational description of the part, "
             "much like the Subject is for the whole message; most "
             "mail agents will show this information in their message "
             "previews alongside the attachment's icon.</p></qt>");
  label->setWhatsThis( msg );
  mDescription->setWhatsThis( msg );

  // row 4: "Encoding" combobox and label:
  mEncoding = new KComboBox( frame );
  mEncoding->setEditable( false );
  mEncoding->addItems( mI18nizedEncodings );
  label = new QLabel( i18n("&Encoding:"), frame );
  label->setBuddy( mEncoding );
  glay->addWidget( label, 4, 0 );
  glay->addWidget( mEncoding, 4, 1 );

  msg = i18n("<qt><p>The transport encoding of this part:</p>"
             "<p>normally, you do not need to change this, since %1 will use "
             "a decent default encoding, depending on the MIME type; yet, "
             "sometimes, you can significantly reduce the size of the "
             "resulting message, e.g. if a PostScript file does not contain "
             "binary data, but consists of pure text -- in this case, choosing "
             "\"quoted-printable\" over the default \"base64\" will save up "
             "to 25% in resulting message size.</p></qt>",
      KGlobal::mainComponent().aboutData()->programName() );
  label->setWhatsThis( msg );
  mEncoding->setWhatsThis( msg );

  // row 5: "Suggest automatic display..." checkbox:
  mInline = new QCheckBox( i18n("Suggest &automatic display"), frame );
  glay->addWidget( mInline, 5, 0, 1, 2 );

  msg = i18n("<qt><p>Check this option if you want to suggest to the "
             "recipient the automatic (inline) display of this part in the "
             "message preview, instead of the default icon view;</p>"
             "<p>technically, this is carried out by setting this part's "
             "<em>Content-Disposition</em> header field to \"inline\" "
             "instead of the default \"attachment\".</p></qt>");
  mInline->setWhatsThis( msg );

  // row 6: "Sign" checkbox:
  mSigned = new QCheckBox( i18n("&Sign this part"), frame );
  glay->addWidget( mSigned, 6, 0, 1, 2 );

  msg = i18n("<qt><p>Check this option if you want this message part to be "
             "signed;</p>"
             "<p>the signature will be made with the key that you associated "
             "with the currently-selected identity.</p></qt>");
  mSigned->setWhatsThis( msg );

  // row 7: "Encrypt" checkbox:
  mEncrypted = new QCheckBox( i18n("Encr&ypt this part"), frame );
  glay->addWidget( mEncrypted, 7, 0, 1, 2 );

  msg = i18n("<qt><p>Check this option if you want this message part to be "
             "encrypted;</p>"
             "<p>the part will be encrypted for the recipients of this "
             "message</p></qt>");
  mEncrypted->setWhatsThis( msg );
  // (row 8: spacer)
}
Пример #20
0
ExportDialog::ExportDialog(QWidget *parent, Qt::WFlags fl)
    : QDialog(parent, fl) {
  setWindowTitle(tr("Export ASCII"));
  setSizeGripEnabled(true);

  QGridLayout *gl1 = new QGridLayout();
  gl1->addWidget(new QLabel(tr("Table")), 0, 0);
  boxTable = new QComboBox();
  boxTable->setSizePolicy(
      QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
  gl1->addWidget(boxTable, 0, 1);

  boxAllTables = new QCheckBox(tr("&All"));
  boxAllTables->setChecked(false);
  gl1->addWidget(boxAllTables, 0, 2);

  QLabel *sepText = new QLabel(tr("Separator"));
  gl1->addWidget(sepText, 1, 0);

  boxSeparator = new QComboBox();
  boxSeparator->addItem(tr("TAB"));
  boxSeparator->addItem(tr("SPACE"));
  boxSeparator->addItem(";" + tr("TAB"));
  boxSeparator->addItem("," + tr("TAB"));
  boxSeparator->addItem(";" + tr("SPACE"));
  boxSeparator->addItem("," + tr("SPACE"));
  boxSeparator->addItem(";");
  boxSeparator->addItem(",");
  boxSeparator->setSizePolicy(
      QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
  boxSeparator->setEditable(true);
  gl1->addWidget(boxSeparator, 1, 1);

  QString help =
      tr("The column separator can be customized. The following special codes "
         "can be used:\n\\t for a TAB character \n\\s for a SPACE");
  help +=
      "\n" +
      tr("The separator must not contain the following characters: 0-9eE.+-");

  boxSeparator->setWhatsThis(help);
  sepText->setWhatsThis(help);
  boxSeparator->setToolTip(help);
  sepText->setToolTip(help);

  boxNames = new QCheckBox(tr("Include Column &Names"));
  boxNames->setChecked(true);

  boxSelection = new QCheckBox(tr("Export &Selection"));
  boxSelection->setChecked(false);

  QVBoxLayout *vl1 = new QVBoxLayout();
  vl1->addLayout(gl1);
  vl1->addWidget(boxNames);
  vl1->addWidget(boxSelection);

  QHBoxLayout *hbox3 = new QHBoxLayout();
  buttonOk = new QPushButton(tr("&OK"));
  buttonOk->setDefault(true);
  hbox3->addWidget(buttonOk);
  buttonCancel = new QPushButton(tr("&Cancel"));
  hbox3->addWidget(buttonCancel);
  buttonHelp = new QPushButton(tr("&Help"));
  hbox3->addWidget(buttonHelp);
  hbox3->addStretch();

  QVBoxLayout *vl = new QVBoxLayout(this);
  vl->addLayout(vl1);
  vl->addStretch();
  vl->addLayout(hbox3);

  // signals and slots connections
  connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
  connect(buttonHelp, SIGNAL(clicked()), this, SLOT(help()));
  connect(boxAllTables, SIGNAL(toggled(bool)), this,
          SLOT(enableTableName(bool)));
}
void KOAttendeeEditor::initEditWidgets( QWidget *parent, QBoxLayout *layout )
{
  QGridLayout *topLayout = new QGridLayout();
  layout->addLayout( topLayout );

  QString whatsThis =
    i18nc( "@info:whatsthis",
           "Edits the name of the attendee selected in the list above, "
           "or adds a new attendee if there are no attendees in the list." );
  QLabel *attendeeLabel = new QLabel( parent );
  attendeeLabel->setWhatsThis( whatsThis );
  attendeeLabel->setText( i18nc( "@label attendee's name", "Na&me:" ) );
  topLayout->addWidget( attendeeLabel, 0, 0 );

  mNameEdit = new KPIM::AddresseeLineEdit( parent );
  mNameEdit->setWhatsThis( whatsThis );
  mNameEdit->setClickMessage( i18nc( "@label", "Click to add a new attendee" ) );
  attendeeLabel->setBuddy( mNameEdit );
  mNameEdit->installEventFilter( this );
  connect( mNameEdit, SIGNAL(textChanged(const QString &)), SLOT(updateAttendee()) );
  topLayout->addWidget( mNameEdit, 0, 1, 1, 2 );

  whatsThis =
    i18nc( "@info:whatsthis",
           "Edits the role of the attendee selected in the list above." );
  QLabel *attendeeRoleLabel = new QLabel( parent );
  attendeeRoleLabel->setWhatsThis( whatsThis );
  attendeeRoleLabel->setText( i18nc( "@label", "Ro&le:" ) );
  topLayout->addWidget( attendeeRoleLabel, 1, 0 );

  mRoleCombo = new KComboBox( parent );
  mRoleCombo->setToolTip(
    i18nc( "@info:tooltip", "Select the attendee participation role" ) );
  mRoleCombo->setWhatsThis( whatsThis );
  mRoleCombo->addItems( Attendee::roleList() );
  attendeeRoleLabel->setBuddy( mRoleCombo );
  connect( mRoleCombo, SIGNAL(activated(int)), SLOT(updateAttendee()) );
  topLayout->addWidget( mRoleCombo, 1, 1 );

  mDelegateLabel = new QLabel( parent );
  topLayout->addWidget( mDelegateLabel, 1, 2 );

  whatsThis = i18nc( "@info:whatsthis",
                     "Edits the current attendance status of the attendee "
                     "selected in the list above." );
  QLabel *statusLabel = new QLabel( parent );
  statusLabel->setWhatsThis( whatsThis );
  statusLabel->setText( i18nc( "@label", "Stat&us:" ) );
  topLayout->addWidget( statusLabel, 2, 0 );

  mStatusCombo = new KComboBox( parent );
  mStatusCombo->setToolTip(
    i18nc( "@info:tooltip", "Select the attendee participation status" ) );
  mStatusCombo->setWhatsThis( whatsThis );
  //TODO: the icons below aren't exactly correct
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "help-about" ),
                         Attendee::statusName( Attendee::NeedsAction ) );
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "dialog-ok-apply" ),
                         Attendee::statusName( Attendee::Accepted ) );
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "dialog-cancel" ),
                         Attendee::statusName( Attendee::Declined ) );
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "dialog-ok" ),
                         Attendee::statusName( Attendee::Tentative ) );
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "mail-forward" ),
                         Attendee::statusName( Attendee::Delegated ) );
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "mail-mark-read" ),
                         Attendee::statusName( Attendee::Completed ) ),
  mStatusCombo->addItem( KOGlobals::self()->smallIcon( "help-about" ),
                         Attendee::statusName( Attendee::InProcess ) );

  statusLabel->setBuddy( mStatusCombo );
  connect( mStatusCombo, SIGNAL(activated(int)), SLOT(updateAttendee()) );
  topLayout->addWidget( mStatusCombo, 2, 1 );

  topLayout->setColumnStretch( 2, 1 );

  mRsvpButton = new QCheckBox( parent );
  mRsvpButton->setToolTip(
    i18nc( "@info:tooltip", "Request a response from the attendee" ) );
  mRsvpButton->setWhatsThis(
    i18nc( "@info:whatsthis",
           "Edits whether to send an email to the "
           "attendee selected in the list above to "
           "request a response concerning attendance." ) );
  mRsvpButton->setText( i18nc( "@option:check", "Re&quest response" ) );
  connect( mRsvpButton, SIGNAL(clicked()), SLOT(updateAttendee()) );
  topLayout->addWidget( mRsvpButton, 2, 2 );

  QWidget *buttonBox = new QWidget( parent );
  QVBoxLayout *buttonLayout = new QVBoxLayout( buttonBox );

  mAddButton = new QPushButton( i18nc( "@action:button new attendee", "&New" ), buttonBox );
  mAddButton->setToolTip(
    i18nc( "@info:tooltip", "Add an attendee" ) );
  mAddButton->setWhatsThis(
    i18nc( "@info:whatsthis",
           "Adds a new attendee to the list. Once the "
           "attendee is added, you will be able to "
           "edit the attendee's name, role, attendance "
           "status, and whether or not the attendee is "
           "required to respond to the invitation. To "
           "select an attendee from your address book, "
           "click the 'Select Addressee' button instead." ) );
  buttonLayout->addWidget( mAddButton );
  connect( mAddButton, SIGNAL(clicked()), SLOT(addNewAttendee()) );

  mRemoveButton = new QPushButton( i18nc( "@action:button", "&Remove" ), buttonBox );
  mRemoveButton->setToolTip(
    i18nc( "@info:tooltip", "Remove the selected attendee" ) );
  mRemoveButton->setWhatsThis(
    i18nc( "@info:whatsthis",
           "Removes the attendee selected in the list above." ) );
  buttonLayout->addWidget( mRemoveButton );

  mAddressBookButton =
    new QPushButton( i18nc( "@action:button", "Select Addressee..." ), buttonBox );
  mAddressBookButton->setToolTip(
    i18nc( "@info:tooltip",
           "Open your address book" ) );
  mAddressBookButton->setWhatsThis(
    i18nc( "@info:whatsthis",
           "Opens your address book, allowing you to select new attendees from it." ) );
  buttonLayout->addWidget( mAddressBookButton );
  connect( mAddressBookButton, SIGNAL(clicked()), SLOT(openAddressBook()) );

  topLayout->addWidget( buttonBox, 0, 4, 3, 1 );
}
Пример #22
0
mosaicPage::mosaicPage (QWidget *parent, OPTIONS *op):
  QWizardPage (parent)
{
  options = op;


  setTitle (tr ("Mosaic/Camera parameters"));

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


  QHBoxLayout *hbox = new QHBoxLayout (this);
  hbox->setMargin (5);
  hbox->setSpacing (5);


  QGroupBox *pBox = new QGroupBox (tr ("Parameter Settings"), this);
  QVBoxLayout *pBoxLayout = new QVBoxLayout;
  pBox->setLayout (pBoxLayout);
  pBoxLayout->setSpacing (10);


  QHBoxLayout *cellBoxLayout = new QHBoxLayout;

  QLabel *cellLabel = new QLabel (tr ("Output Cell Size (m)"), this);
  cellLabel->setToolTip (tr ("Change the output cell size (0.2 - 10.0)"));
  cellLabel->setWhatsThis (cellText);
  cellBoxLayout->addWidget (cellLabel);

  cellSpin = new QDoubleSpinBox (this);
  cellSpin->setDecimals (2);
  cellSpin->setRange (0.2, 10.0);
  cellSpin->setSingleStep (1.0);
  cellSpin->setValue (options->cell_size);
  cellSpin->setWrapping (TRUE);
  cellSpin->setToolTip (tr ("Change the output cell size (0.2 - 10.0)"));
  cellSpin->setWhatsThis (cellText);
  cellBoxLayout->addWidget (cellSpin);

  pBoxLayout->addLayout (cellBoxLayout);


  QHBoxLayout *txt_file_box = new QHBoxLayout (0);
  txt_file_box->setSpacing (8);

  QLabel *txt_file_label = new QLabel (tr ("Mission Parameters File"), this);
  txt_file_box->addWidget (txt_file_label, 1);

  txt_file_edit = new QLineEdit (this);
  txt_file_edit->setReadOnly (TRUE);
  txt_file_box->addWidget (txt_file_edit, 10);

  QPushButton *txt_file_browse = new QPushButton (tr ("Browse..."), this);
  txt_file_box->addWidget (txt_file_browse, 1);

  txt_file_label->setWhatsThis (txt_fileText);
  txt_file_edit->setWhatsThis (txt_fileText);
  txt_file_browse->setWhatsThis (txt_fileBrowseText);

  connect (txt_file_browse, SIGNAL (clicked ()), this, SLOT (slotTxtFileBrowse ()));


  pBoxLayout->addLayout (txt_file_box);


  QHBoxLayout *timeBoxLayout = new QHBoxLayout;

  QLabel *timeLabel = new QLabel (tr ("Time Offset (s)"), this);
  timeLabel->setToolTip (tr ("Set a time offset to be added to the image time"));
  timeLabel->setWhatsThis (timeText);
  timeBoxLayout->addWidget (timeLabel);

  timeSpin = new QDoubleSpinBox (this);
  timeSpin->setDecimals (2);
  timeSpin->setRange (0.0, 1.0);
  timeSpin->setSingleStep (0.05);
  timeSpin->setValue (options->time_offset);
  timeSpin->setWrapping (TRUE);
  timeSpin->setToolTip (tr ("Set a time offset to be added to the image time"));
  timeSpin->setWhatsThis (timeText);
  timeBoxLayout->addWidget (timeSpin);

  pBoxLayout->addLayout (timeBoxLayout);


  QHBoxLayout *rollBoxLayout = new QHBoxLayout;

  QLabel *rollLabel = new QLabel (tr ("Roll Bias"), this);
  rollLabel->setToolTip (tr ("Change the camera boresight roll bias (-30.0 - 30.0)"));
  rollLabel->setWhatsThis (rollText);
  rollBoxLayout->addWidget (rollLabel);

  rollSpin = new QDoubleSpinBox (this);
  rollSpin->setDecimals (4);
  rollSpin->setRange (-30.0, 30.0);
  rollSpin->setSingleStep (1.0);
  rollSpin->setValue (options->roll_bias);
  rollSpin->setWrapping (TRUE);
  rollSpin->setToolTip (tr ("Change the camera boresight roll bias (-30.0 - 30.0)"));
  rollSpin->setWhatsThis (rollText);
  rollBoxLayout->addWidget (rollSpin);

  pBoxLayout->addLayout (rollBoxLayout);


  QHBoxLayout *pitchBoxLayout = new QHBoxLayout;

  QLabel *pitchLabel = new QLabel (tr ("Pitch Bias"), this);
  pitchLabel->setToolTip (tr ("Change the camera boresight pitch bias (-30.0 - 30.0)"));
  pitchLabel->setWhatsThis (pitchText);
  pitchBoxLayout->addWidget (pitchLabel);

  pitchSpin = new QDoubleSpinBox (this);
  pitchSpin->setDecimals (4);
  pitchSpin->setRange (-30.0, 30.0);
  pitchSpin->setSingleStep (1.0);
  pitchSpin->setValue (options->pitch_bias);
  pitchSpin->setWrapping (TRUE);
  pitchSpin->setToolTip (tr ("Change the camera boresight pitch bias (-30.0 - 30.0)"));
  pitchSpin->setWhatsThis (pitchText);
  pitchBoxLayout->addWidget (pitchSpin);

  pBoxLayout->addLayout (pitchBoxLayout);



  QHBoxLayout *headingBoxLayout = new QHBoxLayout;

  QLabel *headingLabel = new QLabel (tr ("Heading Bias"), this);
  headingLabel->setToolTip (tr ("Change the camera boresight heading bias (-30.0 - 30.0)"));
  headingLabel->setWhatsThis (headingText);
  headingBoxLayout->addWidget (headingLabel);

  headingSpin = new QDoubleSpinBox (this);
  headingSpin->setDecimals (4);
  headingSpin->setRange (-30.0, 30.0);
  headingSpin->setSingleStep (1.0);
  headingSpin->setValue (options->heading_bias);
  headingSpin->setWrapping (TRUE);
  headingSpin->setToolTip (tr ("Change the camera boresight heading bias (-30.0 - 30.0)"));
  headingSpin->setWhatsThis (headingText);
  headingBoxLayout->addWidget (headingSpin);

  pBoxLayout->addLayout (headingBoxLayout);



  QHBoxLayout *focalBoxLayout = new QHBoxLayout;

  QLabel *focalLabel = new QLabel (tr ("Camera Focal Length"), this);
  focalLabel->setToolTip (tr ("Change the camera focal length (mm)"));
  focalLabel->setWhatsThis (focalText);
  focalBoxLayout->addWidget (focalLabel);

  focalSpin = new QDoubleSpinBox (this);
  focalSpin->setDecimals (3);
  focalSpin->setRange (0.0, 200.0);
  focalSpin->setSingleStep (10.0);
  focalSpin->setValue (options->focal_length);
  focalSpin->setWrapping (TRUE);
  focalSpin->setToolTip (tr ("Change the camera focal length (mm)"));
  focalSpin->setWhatsThis (focalText);
  focalBoxLayout->addWidget (focalSpin);

  pBoxLayout->addLayout (focalBoxLayout);



  QHBoxLayout *pixelBoxLayout = new QHBoxLayout;

  QLabel *pixelLabel = new QLabel (tr ("Camera Pixel Size (u)"), this);
  pixelLabel->setToolTip (tr ("Change the camera pixel size"));
  pixelLabel->setWhatsThis (pixelText);
  pixelBoxLayout->addWidget (pixelLabel);

  pixelSpin = new QDoubleSpinBox (this);
  pixelSpin->setDecimals (2);
  pixelSpin->setRange (1.0, 100.0);
  pixelSpin->setSingleStep (10.0);
  pixelSpin->setValue (options->pixel_size);
  pixelSpin->setWrapping (TRUE);
  pixelSpin->setToolTip (tr ("Change the camera pixel size"));
  pixelSpin->setWhatsThis (pixelText);
  pixelBoxLayout->addWidget (pixelSpin);

  pBoxLayout->addLayout (pixelBoxLayout);



  QHBoxLayout *colBoxLayout = new QHBoxLayout;

  QLabel *colLabel = new QLabel (tr ("Camera Column Offset"), this);
  colLabel->setToolTip (tr ("Change the camera column offset"));
  colLabel->setWhatsThis (colText);
  colBoxLayout->addWidget (colLabel);

  colSpin = new QDoubleSpinBox (this);
  colSpin->setDecimals (2);
  colSpin->setRange (-500.0, 500.0);
  colSpin->setSingleStep (10.0);
  colSpin->setValue (options->column_offset);
  colSpin->setWrapping (TRUE);
  colSpin->setToolTip (tr ("Change the camera column offset"));
  colSpin->setWhatsThis (colText);
  colBoxLayout->addWidget (colSpin);

  pBoxLayout->addLayout (colBoxLayout);


  QHBoxLayout *rowBoxLayout = new QHBoxLayout;

  QLabel *rowLabel = new QLabel (tr ("Camera Row Offset"), this);
  rowLabel->setToolTip (tr ("Change the camera row offset"));
  rowLabel->setWhatsThis (rowText);
  rowBoxLayout->addWidget (rowLabel);

  rowSpin = new QDoubleSpinBox (this);
  rowSpin->setDecimals (2);
  rowSpin->setRange (-500.0, 500.0);
  rowSpin->setSingleStep (10.0);
  rowSpin->setValue (options->row_offset);
  rowSpin->setWrapping (TRUE);
  rowSpin->setToolTip (tr ("Change the camera row offset"));
  rowSpin->setWhatsThis (rowText);
  rowBoxLayout->addWidget (rowSpin);

  pBoxLayout->addLayout (rowBoxLayout);


  hbox->addWidget (pBox);


  registerField ("cellSpin", cellSpin, "value");
  registerField ("timeSpin", timeSpin, "value");
  registerField ("rollSpin", rollSpin, "value");
  registerField ("pitchSpin", pitchSpin, "value");
  registerField ("headingSpin", headingSpin, "value");
  registerField ("focalSpin", focalSpin, "value");
  registerField ("pixelSpin", pixelSpin, "value");
  registerField ("colSpin", colSpin, "value");
  registerField ("rowSpin", rowSpin, "value");
}
Пример #23
0
FilterView::FilterView( FilterTool *tool, QWidget* parent )
  : AbstractToolWidget( parent ),
    mTool( tool )
{
    QVBoxLayout *baseLayout = new QVBoxLayout( this );
    baseLayout->setMargin( 0 );

    // filter
    QHBoxLayout *operationLayout = new QHBoxLayout();
    QLabel *label = new QLabel( i18nc("@label:listbox operation to use by the filter","Operation:"), this );
    mOperationComboBox = new KComboBox( this );
    connect( mOperationComboBox, SIGNAL(activated(int)),
             SLOT(onOperationChange(int)) );

    label->setBuddy( mOperationComboBox );
    const QString operationToolTip =
        i18nc("@info:tooltip","The operation to use for the filter.");
    label->setToolTip( operationToolTip );
    mOperationComboBox->setToolTip( operationToolTip );
    const QString operationWhatsThis =
        i18nc("@info:whatsthis","Select the operation to use for the filter.");
    label->setWhatsThis( operationWhatsThis );
    mOperationComboBox->setWhatsThis( operationWhatsThis );

    operationLayout->addWidget( label );
    operationLayout->addWidget( mOperationComboBox, 10 );
    baseLayout->addLayout( operationLayout );

    QGroupBox *parameterSetBox = new QGroupBox( i18nc("@title:group","Parameters"), this );
    baseLayout->addWidget( parameterSetBox );

    QVBoxLayout *parameterSetLayout = new QVBoxLayout;

    parameterSetBox->setLayout( parameterSetLayout );

    mParameterSetEditStack = new QStackedWidget( parameterSetBox );

    parameterSetLayout->addWidget( mParameterSetEditStack );

    // filter button
    QHBoxLayout *buttonLayout = new QHBoxLayout();
    buttonLayout->addStretch( 10 );
    mFilterButton = new KPushButton( KGuiItem(i18nc("@action:button","&Filter"),
                      QLatin1String("run-build"),
                      i18nc("@info:tooltip","Executes the filter for the bytes in the selected range."),
                      i18nc("@info:whatsthis",
                            "If you press the <interface>Filter</interface> button, the operation you selected "
                            "above is executed for the bytes in the selected range with the given options.")), this );
    mFilterButton->setEnabled( mTool->hasWriteable() );
    connect( mTool, SIGNAL(hasWriteableChanged(bool)), SLOT(onHasWriteableChanged(bool)) );
    connect( mTool, SIGNAL(charCodecChanged(QString)), SLOT(onCharCodecChanged(QString)) );
    connect( mFilterButton, SIGNAL(clicked(bool)), SLOT(onFilterClicked()) );
    addButton( mFilterButton, AbstractToolWidget::Default );
    buttonLayout->addWidget( mFilterButton );
    baseLayout->addLayout( buttonLayout );
    baseLayout->addStretch( 10 );

    // automatically set focus to the parameters if a operation has been selected
    QAbstractItemView* operationComboBoxListView = mOperationComboBox->view();
    QObject::connect( operationComboBoxListView, SIGNAL(activated(QModelIndex)),
             mParameterSetEditStack, SLOT(setFocus()) );
    // TODO: is a workaround for Qt 4.5.1 which doesn't emit activated() for mouse clicks
    QObject::connect( operationComboBoxListView, SIGNAL(pressed(QModelIndex)),
             mParameterSetEditStack, SLOT(setFocus()) );
    // TODO: goto filter button if there are no parameters

    addFilters();
}
Пример #24
0
KDMDialogWidget::KDMDialogWidget(QWidget *parent)
    : QWidget(parent)
{
    QString wtstr;

    QGridLayout *grid = new QGridLayout(this);
    grid->setMargin(KDialog::marginHint());
    grid->setSpacing(KDialog::spacingHint());
    grid->setColumnStretch(1, 1);

    QHBoxLayout *hlay = new QHBoxLayout();
    hlay->setSpacing(KDialog::spacingHint());
    grid->addLayout(hlay, 0, 0, 1, 2);
    greetstr_lined = new KLineEdit(this);
    QLabel *label = new QLabel(i18n("&Greeting:"), this);
    label->setBuddy(greetstr_lined);
    hlay->addWidget(label);
    connect(greetstr_lined, SIGNAL(textChanged(QString)),
            SIGNAL(changed()));
    hlay->addWidget(greetstr_lined);
    wtstr = i18n(
        "<p>This is the \"headline\" for KDM's login window. You may want to "
        "put some nice greeting or information about the operating system here.</p>"
        "<p>KDM will substitute the following character pairs with the "
        "respective contents:</p>"
        "<ul>"
        "<li>%d -> current display</li>"
        "<li>%h -> host name, possibly with domain name</li>"
        "<li>%n -> node name, most probably the host name without domain name</li>"
        "<li>%s -> the operating system</li>"
        "<li>%r -> the operating system's version</li>"
        "<li>%m -> the machine (hardware) type</li>"
        "<li>%% -> a single %</li>"
        "</ul>");
    label->setWhatsThis(wtstr);
    greetstr_lined->setWhatsThis(wtstr);


    QGridLayout *hglay = new QGridLayout();
    hglay->setSpacing(KDialog::spacingHint());
    grid->addLayout(hglay, 1, 0);

    label = new QLabel(i18n("Logo area:"), this);
    hglay->addWidget(label, 0, 0);
    QVBoxLayout *vlay = new QVBoxLayout();
    vlay->setSpacing(KDialog::spacingHint());
    hglay->addLayout(vlay, 0, 1, 1, 2);
    noneRadio = new QRadioButton(i18nc("logo area", "&None"), this);
    clockRadio = new QRadioButton(i18n("Show cloc&k"), this);
    logoRadio = new QRadioButton(i18n("Sho&w logo"), this);
    QButtonGroup *buttonGroup = new QButtonGroup(this);
    connect(buttonGroup, SIGNAL(buttonClicked(int)),
            SLOT(slotAreaRadioClicked(int)));
    connect(buttonGroup, SIGNAL(buttonClicked(int)), SIGNAL(changed()));
    buttonGroup->addButton(noneRadio, KdmNone);
    buttonGroup->addButton(clockRadio, KdmClock);
    buttonGroup->addButton(logoRadio, KdmLogo);
    vlay->addWidget(noneRadio);
    vlay->addWidget(clockRadio);
    vlay->addWidget(logoRadio);
    wtstr = i18n("You can choose to display a custom logo (see below), a clock or no logo at all.");
    label->setWhatsThis(wtstr);
    noneRadio->setWhatsThis(wtstr);
    logoRadio->setWhatsThis(wtstr);
    clockRadio->setWhatsThis(wtstr);

    logoLabel = new QLabel(i18n("&Logo:"), this);
    logobutton = new QPushButton(this);
    logoLabel->setBuddy(logobutton);
    logobutton->setAutoDefault(false);
    logobutton->setAcceptDrops(true);
    logobutton->installEventFilter(this); // for drag and drop
    connect(logobutton, SIGNAL(clicked()), SLOT(slotLogoButtonClicked()));
    hglay->addWidget(logoLabel, 1, 0, Qt::AlignVCenter);
    hglay->addWidget(logobutton, 1, 1, Qt::AlignCenter);
    hglay->setRowMinimumHeight(1, 110);
    wtstr = i18n(
        "Click here to choose an image that KDM will display. "
        "You can also drag and drop an image onto this button "
        "(e.g. from Konqueror).");
    logoLabel->setWhatsThis(wtstr);
    logobutton->setWhatsThis(wtstr);


    vlay = new QVBoxLayout();
    grid->addLayout(vlay, 1, 1, 2, 1);
    vlay->setParent(grid);

    label = new QLabel(i18n("Dialog &position:"), this);
    vlay->addWidget(label);
    positioner = new Positioner(this);
    label->setBuddy(positioner);
    connect(positioner, SIGNAL(positionChanged()), SIGNAL(changed()));
    vlay->addWidget(positioner);

    grid->setRowStretch(3, 1);

}
void KIconDialog::KIconDialogPrivate::init()
{
    mGroupOrSize = KIconLoader::Desktop;
    mContext = KIconLoader::Any;
    mFileList = KGlobal::dirs()->findAllResources("appicon", QLatin1String("*.png"));

    QWidget *main = new QWidget(q);
    q->setMainWidget(main);

    QVBoxLayout *top = new QVBoxLayout(main);
    top->setMargin(0);

    QGroupBox *bgroup = new QGroupBox(main);
    bgroup->setTitle(i18n("Icon Source"));

    QVBoxLayout *vbox = new QVBoxLayout;
    bgroup->setLayout( vbox );
    top->addWidget(bgroup);

    QGridLayout *grid = new QGridLayout();
    grid->setSpacing(KDialog::spacingHint());
    bgroup->layout()->addItem(grid);

    mpSystemIcons = new QRadioButton(i18n("S&ystem icons:"), bgroup);
    connect(mpSystemIcons, SIGNAL(clicked()), q, SLOT(_k_slotSystemIconClicked()));
    grid->addWidget(mpSystemIcons, 1, 0);
    mpCombo = new QComboBox(bgroup);
    connect(mpCombo, SIGNAL(activated(int)), q, SLOT(_k_slotContext(int)));
    grid->addWidget(mpCombo, 1, 1);
    mpOtherIcons = new QRadioButton(i18n("O&ther icons:"), bgroup);
    connect(mpOtherIcons, SIGNAL(clicked()), q, SLOT(_k_slotOtherIconClicked()));
    grid->addWidget(mpOtherIcons, 2, 0);
    mpBrowseBut = new QPushButton(i18n("&Browse..."), bgroup);
    connect(mpBrowseBut, SIGNAL(clicked()), q, SLOT(_k_slotBrowse()));
    grid->addWidget(mpBrowseBut, 2, 1);

    //
    // ADD SEARCHLINE
    //
    QHBoxLayout *searchLayout = new QHBoxLayout();
    searchLayout->setMargin(0);
    searchLayout->setSpacing(KDialog::spacingHint());
    top->addLayout(searchLayout);

    QLabel *searchLabel = new QLabel(i18n("&Search:"), main);
    searchLayout->addWidget(searchLabel);

    searchLine = new KListWidgetSearchLine(main);
    searchLayout->addWidget(searchLine);
    searchLabel->setBuddy(searchLine);

    QString wtstr = i18n("Search interactively for icon names (e.g. folder).");
    searchLabel->setWhatsThis(wtstr);
    searchLine->setWhatsThis(wtstr);


    mpCanvas = new KIconCanvas(main);
    connect(mpCanvas, SIGNAL(itemActivated(QListWidgetItem *)), q, SLOT(_k_slotAcceptIcons()));
    mpCanvas->setMinimumSize(400, 125);
    top->addWidget(mpCanvas);
    searchLine->setListWidget(mpCanvas);

    mpProgress = new QProgressBar(main);
    top->addWidget(mpProgress);
    connect(mpCanvas, SIGNAL(startLoading(int)), q, SLOT(_k_slotStartLoading(int)));
    connect(mpCanvas, SIGNAL(progress(int)), q, SLOT(_k_slotProgress(int)));
    connect(mpCanvas, SIGNAL(finished()), q, SLOT(_k_slotFinished()));

    // When pressing Ok or Cancel, stop loading icons
    connect(q, SIGNAL(hidden()), mpCanvas, SLOT(stopLoading()));

    static const char* const context_text[] = {
        I18N_NOOP( "Actions" ),
        I18N_NOOP( "Animations" ),
        I18N_NOOP( "Applications" ),
        I18N_NOOP( "Categories" ),
        I18N_NOOP( "Devices" ),
        I18N_NOOP( "Emblems" ),
        I18N_NOOP( "Emotes" ),
        I18N_NOOP( "Filesystems" ),
        I18N_NOOP( "International" ),
        I18N_NOOP( "Mimetypes" ),
        I18N_NOOP( "Places" ),
        I18N_NOOP( "Status" ) };
    static const KIconLoader::Context context_id[] = {
        KIconLoader::Action,
        KIconLoader::Animation,
        KIconLoader::Application,
        KIconLoader::Category,
        KIconLoader::Device,
        KIconLoader::Emblem,
        KIconLoader::Emote,
        KIconLoader::FileSystem,
        KIconLoader::International,
        KIconLoader::MimeType,
        KIconLoader::Place,
        KIconLoader::StatusIcon };
    mNumContext = 0;
    int cnt = sizeof( context_text ) / sizeof( context_text[ 0 ] );
    // check all 3 arrays have same sizes
    Q_ASSERT( cnt == sizeof( context_id ) / sizeof( context_id[ 0 ] )
            && cnt == sizeof( mContextMap ) / sizeof( mContextMap[ 0 ] ));
    for( int i = 0;
         i < cnt;
         ++i )
    {
        if( mpLoader->hasContext( context_id[ i ] ))
        {
            mpCombo->addItem(i18n( context_text[ i ] ));
            mContextMap[ mNumContext++ ] = context_id[ i ];
        }
    }
    mpCombo->setFixedSize(mpCombo->sizeHint());

    mpBrowseBut->setFixedWidth(mpCombo->width());

    // Make the dialog a little taller
    q->incrementInitialSize(QSize(0,100));
    connect(q, SIGNAL(okClicked()), q, SLOT(slotOk()));
}
Пример #26
0
KDMGeneralWidget::KDMGeneralWidget( QWidget *parent )
	: QWidget( parent )
{
	QString wtstr;

	QBoxLayout *ml = new QVBoxLayout( this );
	ml->setSpacing( KDialog::spacingHint() );
	ml->setMargin( KDialog::marginHint() );

	QGroupBox *box = new QGroupBox( "Appearance", this );
	ml->addWidget( box );
	QGridLayout *grid = new QGridLayout( box );
	grid->setSpacing( KDialog::spacingHint() );
	grid->setMargin( KDialog::marginHint() );
	grid->setColStretch( 2, 1 );

	useThemeCheck = new QCheckBox( i18n("&Use themed greeter"), box );
	connect( useThemeCheck, SIGNAL(toggled( bool )), SLOT(slotUseThemeChanged()) );
	useThemeCheck->setWhatsThis( i18n("Enable this if you would like to use a themed Login Manager.") );
	grid->addWidget( useThemeCheck, 0, 0, 1, 2 );

	guicombo = new KBackedComboBox( box );
	guicombo->insertItem( "", i18n("<placeholder>default</placeholder>") );
	loadGuiStyles( guicombo );
	QLabel *label = new QLabel( i18n("GUI s&tyle:"), box );
	label->setBuddy( guicombo );
	connect( guicombo, SIGNAL(activated( int )), SIGNAL(changed()) );
	grid->addWidget( label, 1, 0 );
	grid->addWidget( guicombo, 1, 1 );
	wtstr = i18n("You can choose a basic GUI style here that will be "
	             "used by KDM only.");
	label->setWhatsThis( wtstr );
	guicombo->setWhatsThis( wtstr );

	colcombo = new KBackedComboBox( box );
	colcombo->insertItem( "", i18n("<placeholder>default</placeholder>") );
	loadColorSchemes( colcombo );
	label = new QLabel( i18n("Color sche&me:"), box );
	label->setBuddy( colcombo );
	connect( colcombo, SIGNAL(activated( int )), SIGNAL(changed()) );
	grid->addWidget( label, 2, 0 );
	grid->addWidget( colcombo, 2, 1 );
	wtstr = i18n("You can choose a basic Color Scheme here that will be "
	             "used by KDM only.");
	label->setWhatsThis( wtstr );
	colcombo->setWhatsThis( wtstr );

	box = new QGroupBox( "Locale", this );
	ml->addWidget( box );
	grid = new QGridLayout( box );
	grid->setSpacing( KDialog::spacingHint() );
	grid->setMargin( KDialog::marginHint() );
	grid->setColStretch( 2, 1 );

	// The Language group box
	langcombo = new KLanguageButton( box );
	langcombo->showLanguageCodes(true);
	langcombo->loadAllLanguages();
	connect( langcombo, SIGNAL(activated( const QString & )), SIGNAL(changed()) );
	label = new QLabel( i18n("&Language:"), this );
	label->setBuddy( langcombo );
	grid->addWidget( label, 0, 0 );
	grid->addWidget( langcombo, 0, 1 );
	wtstr = i18n("Here you can choose the language used by KDM. This setting does not affect"
	             " a user's personal settings; that will take effect after login.");
	label->setWhatsThis( wtstr );
	langcombo->setWhatsThis( wtstr );

	box = new QGroupBox( "Fonts", this );
	ml->addWidget( box );
	grid = new QGridLayout( box );
	grid->setSpacing( KDialog::spacingHint() );
	grid->setMargin( KDialog::marginHint() );

	label = new QLabel( i18n("&General:"), box );
	stdFontChooser = new KFontRequester( box );
	label->setBuddy( stdFontChooser );
	stdFontChooser->setWhatsThis( i18n("This changes the font which is used for all the text in the login manager except for the greeting and failure messages.") );
	connect( stdFontChooser, SIGNAL(fontSelected( const QFont& )), SIGNAL(changed()) );
	grid->addWidget( label, 0, 0 );
	grid->addWidget( stdFontChooser, 0, 1 );

	label = new QLabel( i18n("&Failure font:"), box );
	failFontChooser = new KFontRequester( box );
	label->setBuddy( failFontChooser );
	failFontChooser->setWhatsThis( i18n("This changes the font which is used for failure messages in the login manager.") );
	connect( failFontChooser, SIGNAL(fontSelected( const QFont& )), SIGNAL(changed()) );
	grid->addWidget( label, 1, 0 );
	grid->addWidget( failFontChooser, 1, 1 );

	label = new QLabel( i18n("Gree&ting:"), box );
	greetingFontChooser = new KFontRequester( box );
	label->setBuddy( greetingFontChooser );
	greetingFontChooser->setWhatsThis( i18n("This changes the font which is used for the login manager's greeting.") );
	connect( greetingFontChooser, SIGNAL(fontSelected( const QFont& )), SIGNAL(changed()) );
	grid->addWidget( label, 2, 0 );
	grid->addWidget( greetingFontChooser, 2, 1 );

	aacb = new QCheckBox( i18n("Use anti-aliasing for fonts"), box );
	aacb->setWhatsThis( i18n("If you check this box and your X-Server has the Xft extension, "
	                         "fonts will be antialiased (smoothed) in the login dialog.") );
	connect( aacb, SIGNAL(toggled( bool )), SIGNAL(changed()) );
	grid->addWidget( aacb, 3, 0, 1, 2 );

	ml->addStretch( 1 );
}