Exemple #1
0
void EditorTool::setToolSettings(EditorToolSettings* const settings)
{
    d->settings = settings;
    d->settings->setToolIcon(toolIcon());
    d->settings->setToolName(toolName());

    connect(d->settings, SIGNAL(signalOkClicked()),
            this, SLOT(slotOk()));

    connect(d->settings, SIGNAL(signalCancelClicked()),
            this, SLOT(slotCancel()));

    connect(d->settings, SIGNAL(signalDefaultClicked()),
            this, SLOT(slotResetSettings()));

    connect(d->settings, SIGNAL(signalSaveAsClicked()),
            this, SLOT(slotSaveAsSettings()));

    connect(d->settings, SIGNAL(signalLoadClicked()),
            this, SLOT(slotLoadSettings()));

    connect(d->settings, SIGNAL(signalTryClicked()),
            this, SLOT(slotPreview()));

    connect(d->settings, SIGNAL(signalChannelChanged()),
            this, SLOT(slotChannelChanged()));

    connect(d->settings, SIGNAL(signalScaleChanged()),
            this, SLOT(slotScaleChanged()));

    // Will be unblocked in slotInit()
    // This will prevent signals emit during tool init.
    d->settings->blockSignals(true);
}
void TimelineSideBarWidget::doLoadState()
{

    KConfigGroup group = getConfigGroup();

    d->timeUnitCB->setCurrentIndex(group.readEntry(d->configHistogramTimeUnitEntry, (int)TimeLineWidget::Month));
    slotTimeUnitChanged(d->timeUnitCB->currentIndex());

    int id = group.readEntry(d->configHistogramScaleEntry, (int)TimeLineWidget::LinScale);

    if ( d->scaleBG->button( id ) )
    {
        d->scaleBG->button( id )->setChecked(true);
    }

    slotScaleChanged(d->scaleBG->checkedId());

    QDateTime now = QDateTime::currentDateTime();
    d->timeLineWidget->setCursorDateTime(group.readEntry(d->configCursorPositionEntry, now));
    d->timeLineWidget->setCurrentIndex(d->timeLineWidget->indexForCursorDateTime());

    d->timeLineFolderView->loadState();
}
Exemple #3
0
ImgPrintDialog::ImgPrintDialog(const KookaImage *img, QWidget *parent)
#ifndef KDE4
    : KPrintDialogPage( parent, name ),
#else
    : QWidget(parent),
#endif

      m_image(img),
      m_ignoreSignal(false)
{
#ifndef KDE4
    setTitle(i18n("Image Printing"));
#endif

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

    m_scaleRadios = new Q3ButtonGroup( 2, Qt::Vertical, i18n("Image Print Size"), this );
    m_scaleRadios->setRadioButtonExclusive(true);
    connect( m_scaleRadios, SIGNAL(clicked(int)), SLOT(slScaleChanged(int)));

    m_rbScreen = new QRadioButton( i18n("Scale to same size as on screen"),
                                       m_scaleRadios );
    m_rbScreen->setToolTip(i18n("Screen scaling. That prints according to the screen resolution."));

    m_scaleRadios->insert( m_rbScreen, ID_SCREEN );

    m_rbOrigSize = new QRadioButton( i18n("Original size (calculate from scan resolution)"),
                                     m_scaleRadios );
    m_rbOrigSize->setToolTip(i18n("Calculates the print size from the scan resolution. Enter the scan resolution in the dialog field below."));
    m_scaleRadios->insert( m_rbOrigSize, ID_ORIG );


    m_rbScale    = new QRadioButton( i18n("Scale image to custom dimension"), m_scaleRadios );
    m_rbScale->setToolTip(i18n("Set the print size yourself in the dialog below. The image is centered on the paper."));
    
    m_scaleRadios->insert( m_rbScale, ID_CUSTOM );

    m_rbFitPage = new QRadioButton( i18n("Scale image to fit to page"), m_scaleRadios );
    m_rbFitPage->setToolTip(i18n("Printout uses maximum space on the selected pager. Aspect ratio is maintained."));
    m_scaleRadios->insert( m_rbFitPage, ID_FIT_PAGE );

    layout->addWidget( m_scaleRadios );


    QHBoxLayout *hbox = new QHBoxLayout( this );
    layout->addLayout( hbox );

    /** Box for Image Resolutions **/
    Q3VGroupBox *group1 = new Q3VGroupBox( i18n("Resolutions"), this );
    hbox->addWidget( group1 );

    /* Postscript generation resolution  */
    m_psDraft = new QCheckBox(i18n("Generate low resolution PostScript (fast draft print)"), group1);
    m_psDraft->setChecked( false );


    /* Scan resolution of the image */
    m_dpi = new KIntNumInput( group1 );
    m_dpi->setLabel( i18n("Scan resolution (dpi):" ), Qt::AlignVCenter );
    m_dpi->setValue( 300 );
    m_dpi->setSuffix( i18n(" dpi"));

    /* Label for displaying the screen Resolution */
    m_screenRes = new QLabel( group1 );

    /** Box for Image Print Size **/
    Q3VGroupBox *group = new Q3VGroupBox( i18n("Image Print Size"), this );
    hbox->addWidget( group );

    m_sizeW = new KIntNumInput( group );
    m_sizeW->setLabel( i18n("Image width:"), Qt::AlignVCenter );
    m_sizeW->setSuffix( i18n(" mm"));
    connect( m_sizeW, SIGNAL(valueChanged(int)), SLOT(slCustomWidthChanged(int)));
    m_sizeH = new KIntNumInput( m_sizeW, Qt::AlignVCenter, group  );
    m_sizeH->setLabel( i18n("Image height:"), Qt::AlignVCenter);
    m_sizeH->setSuffix( i18n(" mm"));
    connect( m_sizeH, SIGNAL(valueChanged(int)), SLOT(slCustomHeightChanged(int)));

    m_ratio = new QCheckBox(i18n("Maintain aspect ratio"), group);
    m_ratio->setChecked(true);

    QWidget *spaceEater = new QWidget( this );
    spaceEater->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ));
    layout->addWidget( spaceEater );

    /* Set start values */
    m_rbScreen->setChecked(true);
    slotScaleChanged( ID_SCREEN );
}
Exemple #4
0
void HistogramBox::setScale(HistogramScale scale)
{
    d->scaleBG->button((int)scale)->setChecked(true);
    slotScaleChanged();
}