void Geometryval::setupParam(const QDomElement par, int minFrame, int maxFrame) { QString val = par.attribute("value"); if (par.attribute("fixed") == "1") { m_fixedMode = true; buttonPrevious->setHidden(true); buttonNext->setHidden(true); buttonDelete->setHidden(true); buttonAdd->setHidden(true); spinTransp->setMaximum(500); label_pos->setHidden(true); m_helper->setHidden(true); m_timePos.setHidden(true); } if (par.attribute("opacity") == "false") { label_opacity->setHidden(true); spinTransp->setHidden(true); } if (m_geom) m_geom->parse(val.toUtf8().data(), maxFrame - minFrame, m_profile->width(), m_profile->height()); else m_geom = new Mlt::Geometry(val.toUtf8().data(), maxFrame - minFrame, m_profile->width(), m_profile->height()); ////qDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise(); //read param her and set rect if (!m_fixedMode) { m_helper->setKeyGeometry(m_geom, maxFrame - minFrame - 1); m_helper->update(); /*QDomDocument doc; doc.appendChild(doc.importNode(par, true)); //qDebug() << "IMPORTED TRANS: " << doc.toString();*/ if (m_path == NULL) { m_path = new QGraphicsPathItem(); m_path->setPen(QPen(Qt::red)); m_scene->addItem(m_path); } updateTransitionPath(); } Mlt::GeometryItem item; m_geom->fetch(&item, 0); delete m_paramRect; m_paramRect = new QGraphicsRectItem(QRectF(0, 0, item.w() * m_dar, item.h())); m_paramRect->setPos(item.x() * m_dar, item.y()); m_paramRect->setZValue(0); m_paramRect->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); m_paramRect->setPen(QPen(QBrush(QColor(255, 0, 0, 255)), 1.0)); m_scene->addItem(m_paramRect); slotPositionChanged(0, false); slotUpdateGeometry(); if (!m_fixedMode) { m_timePos.setRange(0, maxFrame - minFrame - 1); connect(&m_timePos, SIGNAL(timeCodeEditingFinished()), this , SLOT(slotPositionChanged())); } connect(spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int))); }
void Geometryval::slotDeleteFrame(int pos) { // check there is more than one keyframe Mlt::GeometryItem item; int frame = m_timePos.getValue(); if (pos == -1) pos = frame; int error = m_geom->next_key(&item, pos + 1); if (error) { error = m_geom->prev_key(&item, pos - 1); if (error || item.frame() == pos) return; } m_geom->remove(frame); buttonAdd->setEnabled(true); buttonDelete->setEnabled(false); widget->setEnabled(false); spinTransp->setEnabled(false); frameOptions->setEnabled(false); m_reset->setEnabled(false); m_helper->update(); slotPositionChanged(pos, false); updateTransitionPath(); emit parameterChanged(); }
void Geometryval::slotSyncPosition(int relTimelinePos) { if (m_timePos.maximum() > 0 && KdenliveSettings::transitionfollowcursor()) { relTimelinePos = qMax(0, relTimelinePos); relTimelinePos = qMin(relTimelinePos, m_timePos.maximum()); if (relTimelinePos != m_timePos.getValue()) slotPositionChanged(relTimelinePos, false); } }
void Geometryval::slotPreviousFrame() { Mlt::GeometryItem item; int error = m_geom->prev_key(&item, m_helper->value() - 1); //qDebug() << "// SEEK TO NEXT KFR: " << error; if (error) return; int pos = item.frame(); m_timePos.setValue(pos); slotPositionChanged(); }
void Geometryval::slotNextFrame() { Mlt::GeometryItem item; int error = m_geom->next_key(&item, m_helper->value() + 1); int pos; //qDebug() << "// SEEK TO NEXT KFR: " << error; if (error) { // Go to end pos = m_helper->frameLength; } else pos = item.frame(); m_timePos.setValue(pos); slotPositionChanged(); }
void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame) { m_param = par; QString val = par.attribute("value"); if (par.attribute("fixed") == "1") { m_fixedMode = true; m_ui.buttonPrevious->setHidden(true); m_ui.buttonNext->setHidden(true); m_ui.buttonDelete->setHidden(true); m_ui.buttonAdd->setHidden(true); m_ui.spinTransp->setMaximum(500); m_ui.label_pos->setHidden(true); m_helper->setHidden(true); m_ui.spinPos->setHidden(true); } char *tmp = (char *) qstrdup(val.toUtf8().data()); if (m_geom) m_geom->parse(tmp, maxFrame - minFrame, m_profile.width, m_profile.height); else m_geom = new Mlt::Geometry(tmp, maxFrame - minFrame, m_profile.width, m_profile.height); delete[] tmp; //kDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise(); //read param her and set rect if (!m_fixedMode) { m_helper->setKeyGeometry(m_geom, maxFrame - minFrame - 1); m_helper->update(); /*QDomDocument doc; doc.appendChild(doc.importNode(par, true)); kDebug() << "IMPORTED TRANS: " << doc.toString();*/ m_ui.spinPos->setMaximum(maxFrame - minFrame - 1); if (m_path == NULL) { m_path = new QGraphicsPathItem(); m_path->setPen(QPen(Qt::red)); m_scene->addItem(m_path); } updateTransitionPath(); } Mlt::GeometryItem item; m_geom->fetch(&item, 0); delete m_paramRect; m_paramRect = new QGraphicsRectItem(QRectF(0, 0, item.w(), item.h())); m_paramRect->setPos(item.x(), item.y()); m_paramRect->setZValue(0); m_paramRect->setPen(QPen(QBrush(QColor(255, 0, 0, 255)), 1.0)); m_scene->addItem(m_paramRect); slotPositionChanged(0, false); if (!m_fixedMode) { connect(m_ui.spinPos, SIGNAL(valueChanged(int)), this , SLOT(slotPositionChanged(int))); }
void Geometryval::slotDeleteFrame() { // check there is more than one keyframe Mlt::GeometryItem item; const int pos = m_ui.spinPos->value(); int error = m_geom->next_key(&item, pos + 1); if (error) { error = m_geom->prev_key(&item, pos - 1); if (error || item.frame() == pos) return; } m_geom->remove(m_ui.spinPos->value()); m_ui.buttonAdd->setEnabled(true); m_ui.buttonDelete->setEnabled(false); m_ui.widget->setEnabled(false); m_ui.spinTransp->setEnabled(false); m_scaleMenu->setEnabled(false); m_alignMenu->setEnabled(false); m_helper->update(); slotPositionChanged(pos, false); updateTransitionPath(); emit parameterChanged(); }
GeometryWidget::GeometryWidget(EffectMetaInfo *info, int clipPos, bool showRotation, bool useOffset, QWidget* parent): QWidget(parent), m_monitor(info->monitor), m_timePos(new TimecodeDisplay(info->monitor->timecode())), m_clipPos(clipPos), m_inPoint(0), m_outPoint(1), m_previous(NULL), m_geometry(NULL), m_frameSize(info->frameSize), m_fixedGeom(false), m_singleKeyframe(false), m_useOffset(useOffset) { m_ui.setupUi(this); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); connect(m_monitor, &Monitor::effectChanged, this, &GeometryWidget::slotUpdateGeometryRect); connect(m_monitor, &Monitor::effectPointsChanged, this, &GeometryWidget::slotUpdateCenters, Qt::UniqueConnection); /* Setup of timeline and keyframe controls */ ((QGridLayout *)(m_ui.widgetTimeWrapper->layout()))->addWidget(m_timePos, 1, 5); QVBoxLayout *layout = new QVBoxLayout(m_ui.frameTimeline); m_timeline = new KeyframeHelper(m_ui.frameTimeline); layout->addWidget(m_timeline); layout->setContentsMargins(0, 0, 0, 0); int size = style()->pixelMetric(QStyle::PM_SmallIconSize); QSize iconSize(size, size); m_ui.buttonPrevious->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-backward"))); m_ui.buttonPrevious->setToolTip(i18n("Go to previous keyframe")); m_ui.buttonPrevious->setIconSize(iconSize); m_ui.buttonNext->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-forward"))); m_ui.buttonNext->setToolTip(i18n("Go to next keyframe")); m_ui.buttonNext->setIconSize(iconSize); m_ui.buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add"))); m_ui.buttonAddDelete->setToolTip(i18n("Add keyframe")); m_ui.buttonAddDelete->setIconSize(iconSize); connect(m_timeline, SIGNAL(requestSeek(int)), this, SLOT(slotRequestSeek(int))); connect(m_timeline, SIGNAL(keyframeMoved(int)), this, SLOT(slotKeyframeMoved(int))); connect(m_timeline, SIGNAL(addKeyframe(int)), this, SLOT(slotAddKeyframe(int))); connect(m_timeline, SIGNAL(removeKeyframe(int)), this, SLOT(slotDeleteKeyframe(int))); connect(m_timePos, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotPositionChanged())); connect(m_ui.buttonPrevious, SIGNAL(clicked()), this, SLOT(slotPreviousKeyframe())); connect(m_ui.buttonNext, SIGNAL(clicked()), this, SLOT(slotNextKeyframe())); connect(m_ui.buttonAddDelete, SIGNAL(clicked()), this, SLOT(slotAddDeleteKeyframe())); m_spinX = new DragValue(i18nc("x axis position", "X"), 0, 0, -99000, 99000, -1, QString(), false, this); m_ui.horizontalLayout->addWidget(m_spinX, 0, 0); m_spinY = new DragValue(i18nc("y axis position", "Y"), 0, 0, -99000, 99000, -1, QString(), false, this); m_ui.horizontalLayout->addWidget(m_spinY, 0, 1); m_spinWidth = new DragValue(i18nc("Frame width", "W"), m_monitor->render->frameRenderWidth(), 0, 1, 99000, -1, QString(), false, this); m_ui.horizontalLayout->addWidget(m_spinWidth, 0, 2); m_spinHeight = new DragValue(i18nc("Frame height", "H"), m_monitor->render->renderHeight(), 0, 1, 99000, -1, QString(), false, this); m_ui.horizontalLayout->addWidget(m_spinHeight, 0, 3); m_ui.horizontalLayout->setColumnStretch(4, 10); QMenu *menu = new QMenu(this); QAction *originalSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-original")), i18n("Adjust to original size"), this); connect(originalSize, SIGNAL(triggered()), this, SLOT(slotAdjustToSource())); QAction *adjustSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-best")), i18n("Adjust and center in frame"), this); connect(adjustSize, SIGNAL(triggered()), this, SLOT(slotAdjustToFrameSize())); QAction *fitToWidth = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-width")), i18n("Fit to width"), this); connect(fitToWidth, SIGNAL(triggered()), this, SLOT(slotFitToWidth())); QAction *fitToHeight = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-height")), i18n("Fit to height"), this); connect(fitToHeight, SIGNAL(triggered()), this, SLOT(slotFitToHeight())); QAction *importKeyframes = new QAction(i18n("Import keyframes from clip"), this); connect(importKeyframes, SIGNAL(triggered()), this, SIGNAL(importClipKeyframes())); menu->addAction(importKeyframes); QAction *resetKeyframes = new QAction(i18n("Reset all keyframes"), this); connect(resetKeyframes, SIGNAL(triggered()), this, SLOT(slotResetKeyframes())); menu->addAction(resetKeyframes); QAction *resetNextKeyframes = new QAction(i18n("Reset keyframes after cursor"), this); connect(resetNextKeyframes, SIGNAL(triggered()), this, SLOT(slotResetNextKeyframes())); menu->addAction(resetNextKeyframes); QAction *resetPreviousKeyframes = new QAction(i18n("Reset keyframes before cursor"), this); connect(resetPreviousKeyframes, SIGNAL(triggered()), this, SLOT(slotResetPreviousKeyframes())); menu->addAction(resetPreviousKeyframes); menu->addSeparator(); QAction *syncTimeline = new QAction(KoIconUtils::themedIcon(QStringLiteral("edit-link")), i18n("Synchronize with timeline cursor"), this); syncTimeline->setCheckable(true); syncTimeline->setChecked(KdenliveSettings::transitionfollowcursor()); connect(syncTimeline, SIGNAL(toggled(bool)), this, SLOT(slotSetSynchronize(bool))); menu->addAction(syncTimeline); QAction *alignleft = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-left")), i18n("Align left"), this); connect(alignleft, SIGNAL(triggered()), this, SLOT(slotMoveLeft())); QAction *alignhcenter = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-hor")), i18n("Center horizontally"), this); connect(alignhcenter, SIGNAL(triggered()), this, SLOT(slotCenterH())); QAction *alignright = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-right")), i18n("Align right"), this); connect(alignright, SIGNAL(triggered()), this, SLOT(slotMoveRight())); QAction *aligntop = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-top")), i18n("Align top"), this); connect(aligntop, SIGNAL(triggered()), this, SLOT(slotMoveTop())); QAction *alignvcenter = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-vert")), i18n("Center vertically"), this); connect(alignvcenter, SIGNAL(triggered()), this, SLOT(slotCenterV())); QAction *alignbottom = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-align-bottom")), i18n("Align bottom"), this); connect(alignbottom, SIGNAL(triggered()), this, SLOT(slotMoveBottom())); m_ui.buttonOptions->setMenu(menu); m_ui.buttonOptions->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure"))); m_ui.buttonOptions->setToolTip(i18n("Options")); m_ui.buttonOptions->setIconSize(iconSize); QHBoxLayout *alignLayout = new QHBoxLayout; alignLayout->setSpacing(0); QToolButton *alignButton = new QToolButton; alignButton->setDefaultAction(alignleft); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(alignhcenter); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(alignright); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(aligntop); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(alignvcenter); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(alignbottom); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(originalSize); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(adjustSize); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(fitToWidth); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignButton = new QToolButton; alignButton->setDefaultAction(fitToHeight); alignButton->setAutoRaise(true); alignLayout->addWidget(alignButton); alignLayout->addStretch(10); m_ui.horizontalLayout->addLayout(alignLayout, 1, 0, 1, 4); //m_ui.horizontalLayout->addStretch(10); m_spinSize = new DragValue(i18n("Size"), 100, 2, 1, 99000, -1, i18n("%"), false, this); m_ui.horizontalLayout2->addWidget(m_spinSize); m_opacity = new DragValue(i18n("Opacity"), 100, 0, 0, 100, -1, i18n("%"), true, this); m_ui.horizontalLayout2->addWidget(m_opacity); if (showRotation) { m_rotateX = new DragValue(i18n("Rotate X"), 0, 0, -1800, 1800, -1, QString(), true, this); m_rotateX->setObjectName(QStringLiteral("rotate_x")); m_ui.horizontalLayout3->addWidget(m_rotateX); m_rotateY = new DragValue(i18n("Rotate Y"), 0, 0, -1800, 1800, -1, QString(), true, this); m_rotateY->setObjectName(QStringLiteral("rotate_y")); m_ui.horizontalLayout3->addWidget(m_rotateY); m_rotateZ = new DragValue(i18n("Rotate Z"), 0, 0, -1800, 1800, -1, QString(), true, this); m_rotateZ->setObjectName(QStringLiteral("rotate_z")); m_ui.horizontalLayout3->addWidget(m_rotateZ); connect(m_rotateX, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateGeometry())); connect(m_rotateY, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateGeometry())); connect(m_rotateZ, SIGNAL(valueChanged(double)), this, SLOT(slotUpdateGeometry())); } /* Setup of geometry controls */ connect(m_spinX, SIGNAL(valueChanged(double)), this, SLOT(slotSetX(double))); connect(m_spinY, SIGNAL(valueChanged(double)), this, SLOT(slotSetY(double))); connect(m_spinWidth, SIGNAL(valueChanged(double)), this, SLOT(slotSetWidth(double))); connect(m_spinHeight, SIGNAL(valueChanged(double)), this, SLOT(slotSetHeight(double))); connect(m_spinSize, SIGNAL(valueChanged(double)), this, SLOT(slotResize(double))); connect(m_opacity, SIGNAL(valueChanged(double)), this, SLOT(slotSetOpacity(double))); /*connect(m_ui.buttonMoveLeft, SIGNAL(clicked()), this, SLOT(slotMoveLeft())); connect(m_ui.buttonCenterH, SIGNAL(clicked()), this, SLOT(slotCenterH())); connect(m_ui.buttonMoveRight, SIGNAL(clicked()), this, SLOT(slotMoveRight())); connect(m_ui.buttonMoveTop, SIGNAL(clicked()), this, SLOT(slotMoveTop())); connect(m_ui.buttonCenterV, SIGNAL(clicked()), this, SLOT(slotCenterV())); connect(m_ui.buttonMoveBottom, SIGNAL(clicked()), this, SLOT(slotMoveBottom()));*/ /* Setup of configuration controls */ connect(m_monitor, SIGNAL(addKeyframe()), this, SLOT(slotAddKeyframe())); connect(m_monitor, SIGNAL(seekToKeyframe(int)), this, SLOT(slotSeekToKeyframe(int))); connect(this, SIGNAL(parameterChanged()), this, SLOT(slotUpdateProperties())); }
void GeometryWidget::slotShowPath(bool show) { KdenliveSettings::setOnmonitoreffects_geometryshowpath(show); slotPositionChanged(-1, false); }
void GeometryWidget::slotShowPreviousKeyFrame(bool show) { KdenliveSettings::setOnmonitoreffects_geometryshowprevious(show); slotPositionChanged(-1, false); }
KPImagePage::KPImagePage(DrMain *driver, QWidget *parent, const char *name) : KPrintDialogPage(parent, name) { // WhatsThis strings.... (added by [email protected]) QString whatsThisBrightnessImagePage = i18n( " <qt> " " <p><b>Brightness:</b> Slider to control the brightness value of all colors used.</p>" " <p> The brightness value can range from 0 to 200. Values greater than 100 will " " lighten the print. Values less than 100 will darken the print. </p> " " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o brightness=... # use range from \"0\" to \"200\" " " </pre> " " </p> " " </qt>"); QString whatsThisHueImagePage = i18n( " <qt> " " <p><b>Hue (Tint):</b> Slider to control the hue value for color rotation.</p>" " <p> The hue value is a number from -360 to 360 and represents the color hue rotation. " " The following table summarizes the change you will see for the base colors: " " <center> " " <table border=\"1\" width=\"70%\"> " " <tr><th><b>Original</b></th> <th><b>hue=-45</b></th> <th><b>hue=45</b></th> </tr> " " <tr><td>Red</td> <td>Purple</td> <td>Yellow-orange</td> </tr> " " <tr><td>Green</td> <td>Yellow-green</td> <td>Blue-green</td> </tr> " " <tr><td>Yellow</td> <td>Orange</td> <td>Green-yellow</td> </tr> " " <tr><td>Blue</td> <td>Sky-blue</td> <td>Purple</td> </tr> " " <tr><td>Magenta</td> <td>Indigo</td> <td>Crimson</td> </tr> " " <tr><td>Cyan</td> <td>Blue-green</td> <td>Light-navy-blue</td> </tr> " " </table> " " </center> " " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o hue=... # use range from \"-360\" to \"360\" " " </pre>" " </p> " " </qt>"); QString whatsThisSaturationImagePage = i18n( " <qt> " " <p><b>Saturation:</b> Slider to control the saturation value for all colors used.</p>" " <p> The saturation value adjusts the saturation of the colors in an image, similar to " " the color knob on your television. The color saturation value.can range from 0 to 200." " On inkjet printers, a higher saturation value uses more ink. On laserjet printers, a " " higher saturation uses more toner. " " A color saturation of 0 produces a black-and-white print, while a value of 200 will " " make the colors extremely intense. </p>" " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o saturation=... # use range from \"0\" to \"200\" " " </pre>" " </p> " " </qt>"); QString whatsThisGammaImagePage = i18n( " <qt> " " <p><b>Gamma:</b> Slider to control the gamma value for color correction.</p>" " <p> The gamma value can range from 1 to 3000. " " A gamma values greater than 1000 lightens the print. A gamma value less than 1000 " " darken the print. The default gamma is 1000. </p>" " <p><b>Note:</b></p> the gamma value adjustment is not visible in the thumbnail " " preview. </p> " " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o gamma=... # use range from \"1\" to \"3000\" " " </pre>" " </p> " " </qt>"); QString whatsThisImagePage = i18n( " <qt> " " <p><b>Image Printing Options</b></p> " " <p>All options controlled on this page only apply to printing images. " " Most image file formats are supported. To name a few: JPEG, TIFF, PNG, GIF, " " PNM (PBM/PGM/PNM/PPM), Sun Raster, SGI RGB, Windows BMP." " Options to influence color output of image printouts are: " " <ul> " " <li> Brightness </li>" " <li> Hue </li>" " <li> Saturation </li>" " <li> Gamma </li>" " </ul> " " <p>For a more detailed explanation about Brightness, Hue, Saturation and Gamma settings, please " " look at the 'WhatsThis' items provided for these controls. " " </p> " " </p> " " </qt>"); QString whatsThisColorationPreviewImagePage = i18n( " <qt> " " <p><b>Coloration Preview Thumbnail</b></p> " " <p>The coloration preview thumbnail indicates change of image coloration by different settings. " " Options to influence output are: " " <ul> " " <li> Brightness </li>" " <li> Hue (Tint) </li>" " <li> Saturation </li>" " <li> Gamma </li>" " </ul> " " </p> " " <p>For a more detailed explanation about Brightness, Hue, Saturation and Gamma settings, please " " look at the 'WhatsThis' items provided for these controls. " " </p> " " </qt>"); QString whatsThisSizeImagePage = i18n( " <qt> " " <p><b>Image Size:</b> Dropdown menu to control the image size on the printed paper. Dropdown " " works in conjunction with slider below. Dropdown options are:.</p>" " <ul> " " <li> <b>Natural Image Size:</b> Image prints in its natural image size. If it does not fit onto " " one sheet, the printout will be spread across multiple sheets. Note, that the slider is disabled " " when selecting 'natural image size' in the dropdown menu. </li>" " <li> <b>Resolution (ppi):</b> The resolution value slider covers a number range from 1 to 1200. " " It specifies the resolution of the image in Pixels Per Inch (PPI). An image that is 3000x2400 pixels " " will print 10x8 inches at 300 pixels per inch, for example, but 5x4 inches at 600 pixels per inch." " If the specified resolution makes the image larger than the page, multiple pages will be printed. " " Resolution defaults to 72 ppi. " " </li>" " <li> <b>% of Page Size:</b> The percent value slider covers numbers from 1 to 800. It specifies the size " " in relation to the page (not the image). A scaling of 100 percent will fill the page as completely " " as the image aspect ratio allows (doing auto-rotation of the image as needed). " " A scaling of more than 100 will print the image across multiple " " sheets. A scaling of 200 percent will print on up to 4 pages. </li>" " Scaling in % of page size defaults to 100 %. " " <li> <b>% of Natural Image Size:</b> The percent value slider moves from 1 to 800. It specifies " " the printout size in relation " " to the natural image size. A scaling of 100 percent will print the image at its natural size, while a " " scaling of 50 percent will print the image at half its natural size. If the specified scaling makes " " the image larger than the page, multiple pages will be printed. " " Scaling in % of natural image size defaults to 100 %. " " </ul> " " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o natural-scaling=... # range in % is 1....800 " " <br> " " -o scaling=... # range in % is 1....800 " " <br> " " -o ppi=... # range in ppi is 1...1200 " " </pre>" " </p> " " </qt>"); QString whatsThisPreviewPositionImagePage = i18n( " <qt> " " <p><b>Position Preview Thumbnail</b></p> " " <p>This position preview thumbnail indicates the position of the image on the paper sheet. " " <p>Click on horizontal and vertical radio buttons to move image alignment on paper around. Options are: " " <ul> " " <li> center </li>" " <li> top </li>" " <li> top-left </li>" " <li> left </li>" " <li> bottom-left </li>" " <li> bottom </li>" " <li> bottom-right</li>" " <li> right </li>" " <li> top-right </li>" " </ul> " " </p> " " </qt>"); QString whatsThisResetButtonImagePage = i18n( " <qt> " " <p><b>Reset to Default Values</b> </p> " " <p> Reset all coloration settings to default values. Default values are: " " <ul> " " <li> Brightness: 100 </li>" " <li> Hue (Tint). 0 </li>" " <li> Saturation: 100 </li>" " <li> Gamma: 1000 </li>" " </ul> " " </p> " " </qt>"); QString whatsThisPositionImagePage = i18n( " <qt> " " <p><b>Image Positioning:</b></p> " " <p>Select a pair of radiobuttons to " " move image to the position you want on the paper printout. Default " " is 'center'. </p> " " <br> " " <hr> " " <p><em><b>Additional hint for power users:</b> This KDEPrint GUI element matches " " with the CUPS commandline job option parameter:</em> " " <pre>" " -o position=... # examples: \"top-left\" or \"bottom\" " " </pre>" " </p> " " </qt>"); setTitle(i18n("Image")); QGroupBox *colorbox = new QGroupBox(0, Qt::Vertical, i18n("Color Settings"), this); QWhatsThis::add(this, whatsThisImagePage); QGroupBox *sizebox = new QGroupBox(0, Qt::Vertical, i18n("Image Size"), this); QWhatsThis::add(sizebox, whatsThisSizeImagePage); QGroupBox *positionbox = new QGroupBox(0, Qt::Vertical, i18n("Image Position"), this); QWhatsThis::add(positionbox, whatsThisPositionImagePage); m_brightness = new KIntNumInput(100, colorbox); m_brightness->setLabel(i18n("&Brightness:")); m_brightness->setRange(0, 200, 20, true); QWhatsThis::add(m_brightness, whatsThisBrightnessImagePage); m_hue = new KIntNumInput(m_brightness, 0, colorbox); m_hue->setLabel(i18n("&Hue (Color rotation):")); m_hue->setRange(-360, 360, 36, true); QWhatsThis::add(m_hue, whatsThisHueImagePage); m_saturation = new KIntNumInput(m_brightness, 100, colorbox); m_saturation->setLabel(i18n("&Saturation:")); m_saturation->setRange(0, 200, 20, true); QWhatsThis::add(m_saturation, whatsThisSaturationImagePage); m_gamma = new KIntNumInput(m_saturation, 1000, colorbox); m_gamma->setLabel(i18n("&Gamma (Color correction):")); m_gamma->setRange(1, 3000, 100, true); QWhatsThis::add(m_gamma, whatsThisGammaImagePage); connect(m_brightness, SIGNAL(valueChanged(int)), SLOT(slotImageSettingsChanged())); connect(m_hue, SIGNAL(valueChanged(int)), SLOT(slotImageSettingsChanged())); connect(m_saturation, SIGNAL(valueChanged(int)), SLOT(slotImageSettingsChanged())); // connect(m_gamma, SIGNAL(valueChanged(int)), SLOT(slotImageSettingsChanged())); m_preview = new ImagePreview(colorbox); bool useColor = (driver ? driver->get("colordevice") == "1" : true); m_preview->setBlackAndWhite(!useColor); QWhatsThis::add(m_preview, whatsThisColorationPreviewImagePage); m_hue->setEnabled(useColor); m_saturation->setEnabled(useColor); QImage img(locate("data", "kdeprint/preview.png")); m_preview->setImage(img); KSeparator *sep = new KSeparator(Qt::Horizontal, colorbox); QPushButton *defbtn = new QPushButton(i18n("&Default Settings"), colorbox); QWhatsThis::add(defbtn, whatsThisResetButtonImagePage); connect(defbtn, SIGNAL(clicked()), SLOT(slotDefaultClicked())); slotDefaultClicked(); m_sizetype = new QComboBox(sizebox); m_sizetype->insertItem(i18n("Natural Image Size")); m_sizetype->insertItem(i18n("Resolution (ppi)")); // xgettext:no-c-format m_sizetype->insertItem(i18n("% of Page")); // xgettext:no-c-format m_sizetype->insertItem(i18n("% of Natural Image Size")); m_size = new KIntNumInput(sizebox); m_size->setRange(1, 1200, 20, true); m_size->setValue(72); connect(m_sizetype, SIGNAL(activated(int)), SLOT(slotSizeTypeChanged(int))); m_sizetype->setCurrentItem(0); slotSizeTypeChanged(0); QLabel *lab = new QLabel(i18n("&Image size type:"), sizebox); lab->setBuddy(m_sizetype); m_position = new ImagePosition(positionbox); QWhatsThis::add(m_position, whatsThisPreviewPositionImagePage); QRadioButton *bottom = new QRadioButton(positionbox); QRadioButton *top = new QRadioButton(positionbox); QRadioButton *vcenter = new QRadioButton(positionbox); QRadioButton *left = new QRadioButton(positionbox); QRadioButton *right = new QRadioButton(positionbox); QRadioButton *hcenter = new QRadioButton(positionbox); QSize sz = bottom->sizeHint(); bottom->setFixedSize(sz); vcenter->setFixedSize(sz); top->setFixedSize(sz); left->setFixedSize(sz); hcenter->setFixedSize(sz); right->setFixedSize(sz); m_vertgrp = new QButtonGroup(positionbox); m_vertgrp->hide(); m_horizgrp = new QButtonGroup(positionbox); m_horizgrp->hide(); m_vertgrp->insert(top, 0); m_vertgrp->insert(vcenter, 1); m_vertgrp->insert(bottom, 2); if(QApplication::reverseLayout()) { m_horizgrp->insert(left, 2); m_horizgrp->insert(hcenter, 1); m_horizgrp->insert(right, 0); } else { m_horizgrp->insert(left, 0); m_horizgrp->insert(hcenter, 1); m_horizgrp->insert(right, 2); } connect(m_vertgrp, SIGNAL(clicked(int)), SLOT(slotPositionChanged())); connect(m_horizgrp, SIGNAL(clicked(int)), SLOT(slotPositionChanged())); m_vertgrp->setButton(1); m_horizgrp->setButton(1); slotPositionChanged(); QGridLayout *l0 = new QGridLayout(this, 2, 2, 0, 10); l0->addMultiCellWidget(colorbox, 0, 0, 0, 1); l0->addWidget(sizebox, 1, 0); l0->addWidget(positionbox, 1, 1); l0->setColStretch(0, 1); QGridLayout *l1 = new QGridLayout(colorbox->layout(), 5, 2, 10); l1->addWidget(m_brightness, 0, 0); l1->addWidget(m_hue, 1, 0); l1->addWidget(m_saturation, 2, 0); l1->addWidget(sep, 3, 0); l1->addWidget(m_gamma, 4, 0); l1->addMultiCellWidget(m_preview, 0, 3, 1, 1); l1->addWidget(defbtn, 4, 1); QVBoxLayout *l2 = new QVBoxLayout(sizebox->layout(), 3); l2->addStretch(1); l2->addWidget(lab); l2->addWidget(m_sizetype); l2->addSpacing(10); l2->addWidget(m_size); l2->addStretch(1); QGridLayout *l3 = new QGridLayout(positionbox->layout(), 2, 2, 10); QHBoxLayout *l4 = new QHBoxLayout(0, 0, 10); QVBoxLayout *l5 = new QVBoxLayout(0, 0, 10); l3->addLayout(l4, 0, 1); l3->addLayout(l5, 1, 0); l3->addWidget(m_position, 1, 1); l4->addWidget(left, Qt::AlignLeft); l4->addWidget(hcenter, Qt::AlignCenter); l4->addWidget(right, Qt::AlignRight); l5->addWidget(top, Qt::AlignTop); l5->addWidget(vcenter, Qt::AlignVCenter); l5->addWidget(bottom, Qt::AlignBottom); }
void Geometryval::slotKeyframeMoved(int pos) { slotPositionChanged(pos); slotUpdateTransitionProperties(); QTimer::singleShot(100, this, SIGNAL(parameterChanged())); }
NotificationsConfig::NotificationsConfig( QWidget* parent ) : ConfigDialogBase( parent ) , m_oldAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) ) , m_oldYOffset( AmarokConfig::osdYOffset() ) { setupUi( this ); connect( this, SIGNAL(changed()), parent, SLOT(updateButtons()) ); m_osdPreview = new OSDPreviewWidget( this ); //must be child!!! m_osdPreview->setAlignment( static_cast<OSDWidget::Alignment>( AmarokConfig::osdAlignment() ) ); m_osdPreview->setYOffset( AmarokConfig::osdYOffset() ); m_osdPreview->setFontScale( AmarokConfig::osdFontScaling() ); m_osdPreview->setTranslucent( AmarokConfig::osdUseTranslucency() ); #ifdef Q_WS_MAC QCheckBox* growl = new QCheckBox( i18n( "Use Growl for notifications" ), this ); growl->setChecked( AmarokConfig::growlEnabled() ); gridLayout_5->addWidget( growl, 2, 0, 1, 1 ); connect( growl, SIGNAL(toggled(bool)), this, SLOT(setGrowlEnabled(bool)) ); #endif // Enable/disable the translucency option depending on availablity of desktop compositing kcfg_OsdUseTranslucency->setEnabled( KWindowSystem::compositingActive() ); connect( m_osdPreview, SIGNAL(positionChanged()), SLOT(slotPositionChanged()) ); const int numScreens = QApplication::desktop()->numScreens(); for( int i = 0; i < numScreens; i++ ) kcfg_OsdScreen->addItem( QString::number( i ) ); connect( kcfg_OsdTextColor, SIGNAL(changed(QColor)), m_osdPreview, SLOT(setTextColor(QColor)) ); connect( kcfg_OsdUseCustomColors, SIGNAL(toggled(bool)), this, SLOT(useCustomColorsToggled(bool)) ); connect( kcfg_OsdScreen, SIGNAL(activated(int)), m_osdPreview, SLOT(setScreen(int)) ); connect( kcfg_OsdEnabled, SIGNAL(toggled(bool)), m_osdPreview, SLOT(setVisible(bool)) ); connect( kcfg_OsdUseTranslucency, SIGNAL(toggled(bool)), m_osdPreview, SLOT(setTranslucent(bool)) ); connect( kcfg_OsdFontScaling, SIGNAL(valueChanged(int)), m_osdPreview, SLOT(setFontScale(int)) ); /* Amarok::QStringx text = i18n( "<h3>Tags Displayed in OSD</h3>" "You can use the following tokens:" "<ul>" "<li>Title - %1" "<li>Album - %2" "<li>Artist - %3" "<li>Genre - %4" "<li>Bitrate - %5" "<li>Year - %6" "<li>Track Length - %7" "<li>Track Number - %8" "<li>Filename - %9" "<li>Directory - %10" "<li>Type - %11" "<li>Comment - %12" "<li>Score - %13" "<li>Playcount - %14" "<li>Disc Number - %15" "<li>Rating - %16" "<li>Elapsed Time - %17" "</ul>" "If you surround sections of text that contain a token with curly-braces, that section will be hidden if the token is empty, for example:" "<pre>%18</pre>" "Will not show <b>Score: <i>%score</i></b> if the track has no score." ); */ }