void AlignDistributePalette::setDoc( ScribusDoc* newDoc ) { currDoc=newDoc; if (currDoc!=NULL) alignObjects=&(currDoc->AObjects); else alignObjects=NULL; unitChange(); }
void Prefs_Printer::restoreDefaults(struct ApplicationPrefs *prefsData) { int docUnitIndex = prefsData->docSetupPrefs.docUnitIndex; unitChange(docUnitIndex); double unitRatio = unitGetRatioFromIndex(docUnitIndex); QString Pcap; QString printerName; QStringList printerNames = PrinterUtil::getPrinterNames(); int numPrinters = printerNames.count(); for( int i = 0; i < numPrinters; i++) { printerName = printerNames[i]; destinationComboBox->addItem(printerName); } destinationComboBox->addItem( tr("File")); PrefsContext* prefs = PrefsManager::instance()->prefsFile->getContext("print_options"); QString selectedDest = prefs->get("CurrentPrn", ""); int prnIndex = destinationComboBox->findText(selectedDest); if ((prnIndex > -1) && (prnIndex < destinationComboBox->count())) destinationComboBox->setCurrentIndex(prnIndex); useAltPrinterCmdCheckBox->setChecked(prefs->getBool("OtherCom", false)); selOtherComm(); altPrinterCmdLineEdit->setText(prefs->get("Command", "")); bool iccInUse = prefs->getBool("ICCinUse", false); bool psPrinter = PrinterUtil::isPostscriptPrinter(destinationComboBox->currentText()); applyICCProfilesCheckBox->setChecked( psPrinter ? iccInUse : false ); applyICCProfilesCheckBox->setEnabled( psPrinter ); outputComboBox->setCurrentIndex(prefs->getInt("Separations", 0)); postscriptPrintToColorComboBox->setCurrentIndex(prefs->getInt("PrintColor", 0)); postscriptLevelComboBox->setCurrentIndex(prefs->getInt("PSLevel", 3)-1); pageMirrorHorizontallyCheckBox->setChecked(prefs->getBool("MirrorH", false)); pageMirrorVerticallyCheckBox->setChecked(prefs->getBool("MirrorV", false)); setMediaSizeCheckBox->setChecked(prefs->getBool("doDev", false)); applyUnderColorRemovalCheckBox->setChecked(prefs->getBool("DoGCR", false)); clipToPrinterMarginsCheckBox->setChecked(prefs->getBool("Clip", false)); convertSpotsToProcessCheckBox->setChecked(!prefs->getBool("doSpot", true)); MarginStruct bleeds; bleeds.set(prefs->getDouble("BleedTop",0.0), prefs->getDouble("BleedBottom", 0.0), prefs->getDouble("BleedRight", 0.0), prefs->getDouble("BleedLeft", 0.0)); bleedsWidget->setup(bleeds, 0, docUnitIndex, false, false); bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth); bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight); markLengthSpinBox->setValue(prefs->getDouble("markLength", 20.0) * unitRatio); markOffsetSpinBox->setValue(prefs->getDouble("markOffset", 0.0) * unitRatio); cropMarksCheckBox->setChecked(prefs->getBool("cropMarks", false)); bleedMarksCheckBox->setChecked(prefs->getBool("bleedMarks", false)); registrationMarksCheckBox->setChecked(prefs->getBool("registrationMarks", false)); colorBarsCheckBox->setChecked(prefs->getBool("colorMarks", false)); includePDFAnnotationsCheckBox->setChecked(prefs->getBool("includePDFMarks", true)); }
QTabWidget* SMLineStyle::widget() { if (!m_twidget) { m_twidget = new QTabWidget(); m_widget = new SMLineStyleWidget(); m_twidget->addTab(m_widget, tr("Properties")); unitChange(); // connect(m_widget->lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotCurrentLineChanged(int))); connect(m_widget->lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotCurrentLineChanged(int))); }
QTabWidget* SMLineStyle::widget() { if (!twidget_) { twidget_ = new QTabWidget(); widget_ = new SMLineStyleWidget(); twidget_->addTab(widget_, tr("Properties")); unitChange(); // connect(widget_->lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotCurrentLineChanged(int))); connect(widget_->lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotCurrentLineChanged(int))); }
void GuideManager::setupPage(bool storeValues) { if (!m_Doc) return; m_drawGuides = false; setEnabled(true); // store old values for current page (=page to leave) if (currentPage && storeValues) storePageValues(currentPage); currentPage = m_Doc->currentPage(); unitChange(); setupGui(); }
Vruler::Vruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa) { prefsManager=PrefsManager::instance(); setBackgroundRole(QPalette::Window); setAutoFillBackground(true); QPalette palette; palette.setBrush(QPalette::Window, QColor(255, 255, 255)); setPalette(palette); currDoc = doc; currView = pa; offs = 0; oldMark = 0; Mpressed = false; drawMark = false; setMouseTracking(true); rulerGesture = new RulerGesture(currView, RulerGesture::VERTICAL); unitChange(); }
void NodePalette::setDoc(ScribusDoc *dc, ScribusView *vi) { doc = dc; view = vi; unitChange(); disconnect(EditCont, SIGNAL(clicked()), this, SLOT(ToggleConMode())); disconnect(AbsMode, SIGNAL(clicked()), this, SLOT(ToggleAbsMode())); if (doc!=0) { YSpin->setNewUnit(doc->unitIndex()); XSpin->setNewUnit(doc->unitIndex()); } AbsMode->setChecked(false); EditCont->setChecked(false); if (doc==0) disconnectSignals(); else connectSignals(); }
Hruler::Hruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa) { prefsManager=PrefsManager::instance(); setBackgroundRole(QPalette::Window); setAutoFillBackground(true); QPalette palette; palette.setBrush(QPalette::Window, QColor(240, 240, 240)); setPalette(palette); m_doc = doc; m_view = pa; offs = 0; oldMark = 0; ActCol = 1; Mpressed = false; textEditMode = false; drawMark = false; RulerCode = rc_none; itemScale = 1.0; setMouseTracking(true); rulerGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL); unitChange(); }
void Prefs_DocumentSetup::restoreDefaults(struct ApplicationPrefs *prefsData) { pageWidthSpinBox->blockSignals(true); pageHeightSpinBox->blockSignals(true); pageOrientationComboBox->blockSignals(true); pageSizeComboBox->blockSignals(true); unitRatio = unitGetRatioFromIndex(prefsData->docSetupPrefs.docUnitIndex); setupPageSizes(prefsData); pageOrientationComboBox->setCurrentIndex(prefsData->docSetupPrefs.pageOrientation); pageUnitsComboBox->setCurrentIndex(prefsData->docSetupPrefs.docUnitIndex); pageW = prefsData->docSetupPrefs.pageWidth; pageH = prefsData->docSetupPrefs.pageHeight; pageWidthSpinBox->setValue(pageW * unitRatio); pageHeightSpinBox->setValue(pageH * unitRatio); pageSets=prefsData->pageSets; if (prefsData->docSetupPrefs.pagePositioning < 2) { threeFoldRadioButton->hide(); fourFoldRadioButton->hide(); } switch (prefsData->docSetupPrefs.pagePositioning) { case 0: singlePageRadioButton->setChecked(true); break; case 1: doublePageRadioButton->setChecked(true); break; case 2: threeFoldRadioButton->setChecked(true); break; case 3: fourFoldRadioButton->setChecked(true); break; } setupPageSets(); layoutFirstPageIsComboBox->setCurrentIndex(prefsData->pageSets[prefsData->docSetupPrefs.pagePositioning].FirstPage); pageWidthSpinBox->blockSignals(false); pageHeightSpinBox->blockSignals(false); pageOrientationComboBox->blockSignals(false); pageSizeComboBox->blockSignals(false); marginsWidget->setup(prefsData->docSetupPrefs.margins, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, true, true); marginsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth); marginsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight); // marginsWidget->setPageSize(prefsPageSizeName); marginsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset); bleedsWidget->setup(prefsData->docSetupPrefs.bleeds, prefsData->docSetupPrefs.pagePositioning, prefsData->docSetupPrefs.docUnitIndex, false, false); bleedsWidget->setPageWidth(prefsData->docSetupPrefs.pageWidth); bleedsWidget->setPageHeight(prefsData->docSetupPrefs.pageHeight); // bleedsWidget->setPageSize(prefsPageSizeName); bleedsWidget->setMarginPreset(prefsData->docSetupPrefs.marginPreset); saveCompressedCheckBox->setChecked(prefsData->docSetupPrefs.saveCompressed); autosaveCheckBox->setChecked( prefsData->docSetupPrefs.AutoSave ); autosaveIntervalSpinBox->setValue(prefsData->docSetupPrefs.AutoSaveTime / 1000 / 60); undoCheckBox->setChecked(PrefsManager::instance()->prefsFile->getContext("undo")->getBool("enabled", true)); int undoLength = UndoManager::instance()->getHistoryLength(); if (undoLength == -1) undoLengthSpinBox->setEnabled(false); else undoLengthSpinBox->setValue(undoLength); unitChange(); }
void Prefs_ItemTools::restoreDefaults(struct ApplicationPrefs *prefsData) { enableSignals(false); int docUnitIndex = prefsData->docSetupPrefs.docUnitIndex; double unitRatio = unitGetRatioFromIndex(docUnitIndex); unitChange(docUnitIndex); PrefsManager* prefsManager=PrefsManager::instance(); ColorList* colorList = (m_doc != NULL) ? (&m_doc->PageColors) : prefsManager->colorSetPtr(); //Text Tool for (int i=0; i<textFontComboBox->count(); ++i) { if (textFontComboBox->itemText(i) == prefsData->itemToolPrefs.textFont) { textFontComboBox->setCurrentIndex(i); break; } } textSizeSpinBox->setValue(prefsData->itemToolPrefs.textSize / 10); textColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.textColor); textColorShadingSpinBox->setValue(prefsData->itemToolPrefs.textShade); textStrokeColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.textStrokeColor); textStrokeShadingSpinBox->setValue(prefsData->itemToolPrefs.textStrokeShade); textFrameFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.textFillColor); textFrameFillShadingSpinBox->setValue(prefsData->itemToolPrefs.textFillColorShade); textFrameLineColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.textLineColor); textFrameLineShadingSpinBox->setValue(prefsData->itemToolPrefs.textLineColorShade); textTabFillCharComboBox->clear(); textTabFillCharComboBox->addItem( tr("None", "tab fill" )); textTabFillCharComboBox->addItem( tr("Dot")); textTabFillCharComboBox->addItem( tr("Hyphen")); textTabFillCharComboBox->addItem( tr("Underscore")); textTabFillCharComboBox->addItem( tr("Custom")); if (prefsData->itemToolPrefs.textTabFillChar.isEmpty()) { textTabFillCharComboBox->setCurrentIndex(0); } else if (prefsData->itemToolPrefs.textTabFillChar == ".") { textTabFillCharComboBox->setCurrentIndex(1); } else if (prefsData->itemToolPrefs.textTabFillChar == "-") { textTabFillCharComboBox->setCurrentIndex(2); } else if (prefsData->itemToolPrefs.textTabFillChar == "_") { textTabFillCharComboBox->setCurrentIndex(3); } else { textTabFillCharComboBox->setCurrentIndex(4); textTabFillCharComboBox->setEditable(true); textTabFillCharComboBox->setItemText(textTabFillCharComboBox->currentIndex(), CommonStrings::trCustomTabFill + prefsData->itemToolPrefs.textTabFillChar); } textTabWidthSpinBox->setValue(prefsData->itemToolPrefs.textTabWidth * unitRatio); textColumnsSpinBox->setValue(prefsData->itemToolPrefs.textColumns); textColumnGapSpinBox->setValue(prefsData->itemToolPrefs.textColumnGap * unitRatio); topTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.top() * unitRatio); bottomTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.bottom() * unitRatio); leftTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.left() * unitRatio); rightTextDistanceSpinBox->setValue(prefsData->itemToolPrefs.textDistances.right() * unitRatio); //Image Tool imageFreeScalingRadioButton->setChecked( prefsData->itemToolPrefs.imageScaleType ); imageFrameScalingRadioButton->setChecked( !prefsData->itemToolPrefs.imageScaleType ); imageHorizontalScalingSpinBox->setValue(qRound(prefsData->itemToolPrefs.imageScaleX * 100)); imageVerticalScalingSpinBox->setValue(qRound(prefsData->itemToolPrefs.imageScaleY * 100)); imageKeepAspectRatioCheckBox->setChecked(prefsData->itemToolPrefs.imageAspectRatio); scalingLockToolButton->setChecked(prefsData->itemToolPrefs.imageAspectRatio); imageFrameFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.imageFillColor); imageFrameFillShadingSpinBox->setValue(prefsData->itemToolPrefs.imageFillColorShade ); imageFrameLineColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.imageStrokeColor); imageFrameLineShadingSpinBox->setValue(prefsData->itemToolPrefs.imageStrokeColorShade ); imageUseEmbeddedClippingPathCheckBox->setChecked(prefsData->itemToolPrefs.imageUseEmbeddedPath); switch (prefsData->itemToolPrefs.imageLowResType) { case 0: onscreenResolutionFullRadioButton->setChecked(true); break; case 1: onscreenResolutionNormalRadioButton->setChecked(true); break; case 2: onscreenResolutionLowRadioButton->setChecked(true); break; } //Shape Tool shapeFrameLineColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.shapeLineColor); shapeFrameLineShadingSpinBox->setValue(prefsData->itemToolPrefs.shapeLineColorShade); shapeFrameFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.shapeFillColor); shapeFrameFillShadingSpinBox->setValue(prefsData->itemToolPrefs.shapeFillColorShade); shapeFrameLineStyleComboBox->setCurrentIndex(static_cast<int>(prefsData->itemToolPrefs.shapeLineStyle) - 1); shapeLineWidthSpinBox->setValue(prefsData->itemToolPrefs.shapeLineWidth); //Polygon Tool polygonWidget->restoreDefaults(&prefsData->itemToolPrefs); //Line Tool lineFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.lineColor); lineFillColorShadingSpinBox->setValue(prefsData->itemToolPrefs.lineColorShade); lineStyleComboBox->setCurrentIndex(static_cast<int>(prefsData->itemToolPrefs.lineStyle) - 1); if (m_doc != 0) { lineStartArrowComboBox->rebuildList(&m_doc->arrowStyles()); lineEndArrowComboBox->rebuildList(&m_doc->arrowStyles()); } else { lineStartArrowComboBox->rebuildList(&prefsData->arrowStyles); lineEndArrowComboBox->rebuildList(&prefsData->arrowStyles); } lineStartArrowComboBox->setCurrentIndex(prefsData->itemToolPrefs.lineStartArrow); lineEndArrowComboBox->setCurrentIndex(prefsData->itemToolPrefs.lineEndArrow); lineWidthSpinBox->setValue(prefsData->itemToolPrefs.lineWidth); // //Calligraphic Pen Tool calPenFillColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligraphicPenFillColor); calPenFillShadingSpinBox->setValue(prefsData->itemToolPrefs.calligraphicPenFillColorShade); calPenColorComboBox->initColorList(colorList, m_doc, prefsData->itemToolPrefs.calligraphicPenLineColor); calPenLineShadingSpinBox->setValue(prefsData->itemToolPrefs.calligraphicPenLineColorShade); calPenStyleComboBox->setCurrentIndex(static_cast<int>(prefsData->itemToolPrefs.calligraphicPenStyle) - 1); calPenLineWidthSpinBox->setValue(prefsData->itemToolPrefs.calligraphicPenLineWidth); calPenAngleSpinBox->setValue(prefsData->itemToolPrefs.calligraphicPenAngle); calPenWidthSpinBox->setValue(prefsData->itemToolPrefs.calligraphicPenWidth); // Arc Tool arcDisplay->restoreDefaults(&prefsData->itemToolPrefs); // Spiral Tool spiralDisplay->restoreDefaults(&prefsData->itemToolPrefs); enableSignals(true); }