r19248 by craig - #12404: Propagate unit changes through prefs palettes
scribus-commit
scribus-commit at lists.scribus.net
Tue Jun 17 21:20:36 UTC 2014
Author: craig
Date: Tue Jun 17 21:20:36 2014
New Revision: 19248
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19248
Log:
#12404: Propagate unit changes through prefs palettes
Modified:
trunk/Scribus/scribus/ui/preferencesdialog.cpp
trunk/Scribus/scribus/ui/preferencesdialog.h
trunk/Scribus/scribus/ui/prefs_display.cpp
trunk/Scribus/scribus/ui/prefs_display.h
trunk/Scribus/scribus/ui/prefs_documentsections.cpp
trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
trunk/Scribus/scribus/ui/prefs_documentsetup.h
trunk/Scribus/scribus/ui/prefs_fonts.cpp
trunk/Scribus/scribus/ui/prefs_fonts.h
trunk/Scribus/scribus/ui/prefs_operatortools.cpp
trunk/Scribus/scribus/ui/prefs_operatortools.h
Modified: trunk/Scribus/scribus/ui/preferencesdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/preferencesdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/preferencesdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/preferencesdialog.cpp Tue Jun 17 21:20:36 2014
@@ -156,6 +156,7 @@
}
connect(prefs_DocumentSetup, SIGNAL(changeToOtherSection(const QString&)), this, SLOT(setNewItemSelected(const QString&)));
+ connect(prefs_DocumentSetup, SIGNAL(prefsChangeUnits(int)), this, SLOT(changeUnits(int)));
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(applyButton, SIGNAL(clicked()), this, SLOT(applyButtonClicked()));
@@ -330,6 +331,16 @@
}
}
+void PreferencesDialog::changeUnits(int u)
+{
+ prefs_Display->unitChange(u);
+ prefs_Guides->unitChange(u);
+ prefs_ItemTools->unitChange(u);
+ prefs_OperatorTools->unitChange(u);
+ prefs_PDFExport->unitChange(u);
+ prefs_Printer->unitChange(u);
+}
+
void PreferencesDialog::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange)
Modified: trunk/Scribus/scribus/ui/preferencesdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/preferencesdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/preferencesdialog.h (original)
+++ trunk/Scribus/scribus/ui/preferencesdialog.h Tue Jun 17 21:20:36 2014
@@ -72,6 +72,7 @@
void setupGui();
void saveGuiToPrefs();
void setNewItemSelected(const QString &s);
+ void changeUnits(int u);
protected slots:
virtual void languageChange();
Modified: trunk/Scribus/scribus/ui/prefs_display.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_display.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_display.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_display.cpp Tue Jun 17 21:20:36 2014
@@ -84,6 +84,22 @@
adjustDisplaySlider->setToolTip( "<qt>" + tr( "Place a ruler against your screen and drag the slider to set the zoom level so Scribus will display your pages and objects on them at the correct size" ) + "</qt>" );
}
+void Prefs_Display::unitChange(int unitIndex)
+{
+ scratchSpaceLeftSpinBox->setMaximum(1000);
+ scratchSpaceRightSpinBox->setMaximum(1000);
+ scratchSpaceTopSpinBox->setMaximum(1000);
+ scratchSpaceBottomSpinBox->setMaximum(1000);
+ pageGapHorizontalSpinBox->setMaximum(1000);
+ pageGapVerticalSpinBox->setMaximum(1000);
+ scratchSpaceLeftSpinBox->setNewUnit(unitIndex);
+ scratchSpaceRightSpinBox->setNewUnit(unitIndex);
+ scratchSpaceTopSpinBox->setNewUnit(unitIndex);
+ scratchSpaceBottomSpinBox->setNewUnit(unitIndex);
+ pageGapHorizontalSpinBox->setNewUnit(unitIndex);
+ pageGapVerticalSpinBox->setNewUnit(unitIndex);
+}
+
void Prefs_Display::restoreDefaults(struct ApplicationPrefs *prefsData)
{
docUnitIndex = prefsData->docSetupPrefs.docUnitIndex;
@@ -103,18 +119,7 @@
showVerifierWarningsOnCanvasCheckBox->setChecked(prefsData->displayPrefs.showVerifierWarningsOnCanvas);
showAutosaveClockOnCanvasCheckBox->setChecked(prefsData->displayPrefs.showAutosaveClockOnCanvas);
- scratchSpaceLeftSpinBox->setMaximum(1000);
- scratchSpaceRightSpinBox->setMaximum(1000);
- scratchSpaceTopSpinBox->setMaximum(1000);
- scratchSpaceBottomSpinBox->setMaximum(1000);
- pageGapHorizontalSpinBox->setMaximum(1000);
- pageGapVerticalSpinBox->setMaximum(1000);
- scratchSpaceLeftSpinBox->setNewUnit(docUnitIndex);
- scratchSpaceRightSpinBox->setNewUnit(docUnitIndex);
- scratchSpaceTopSpinBox->setNewUnit(docUnitIndex);
- scratchSpaceBottomSpinBox->setNewUnit(docUnitIndex);
- pageGapHorizontalSpinBox->setNewUnit(docUnitIndex);
- pageGapVerticalSpinBox->setNewUnit(docUnitIndex);
+ unitChange(docUnitIndex);
scratchSpaceLeftSpinBox->setValue(prefsData->displayPrefs.scratch.Left * unitRatio);
scratchSpaceRightSpinBox->setValue(prefsData->displayPrefs.scratch.Right * unitRatio);
Modified: trunk/Scribus/scribus/ui/prefs_display.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_display.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_display.h (original)
+++ trunk/Scribus/scribus/ui/prefs_display.h Tue Jun 17 21:20:36 2014
@@ -26,7 +26,7 @@
public slots:
void languageChange();
-
+ void unitChange(int unitIndex);
protected slots:
/*!
Modified: trunk/Scribus/scribus/ui/prefs_documentsections.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_documentsections.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsections.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_documentsections.cpp Tue Jun 17 21:20:36 2014
@@ -47,7 +47,6 @@
{
prefsData->docSectionMap=localSections;
}
-
void Prefs_DocumentSections::updateTable()
{
Modified: trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsetup.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_documentsetup.cpp Tue Jun 17 21:20:36 2014
@@ -84,6 +84,8 @@
pageWidthSpinBox->blockSignals(false);
pageHeightSpinBox->blockSignals(false);
+
+ emit prefsChangeUnits(docUnitIndex);
}
void Prefs_DocumentSetup::languageChange()
Modified: trunk/Scribus/scribus/ui/prefs_documentsetup.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_documentsetup.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsetup.h (original)
+++ trunk/Scribus/scribus/ui/prefs_documentsetup.h Tue Jun 17 21:20:36 2014
@@ -69,6 +69,7 @@
signals:
void changeToOtherSection(const QString&);
+ void prefsChangeUnits(int unit);
};
#endif // PREFS_DOCUMENTSETUP_H
Modified: trunk/Scribus/scribus/ui/prefs_fonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_fonts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_fonts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_fonts.cpp Tue Jun 17 21:20:36 2014
@@ -219,6 +219,11 @@
}
+void Prefs_Fonts::changeUnit(ApplicationPrefs *prefsData) const
+{
+ //Blank, no units on this tab, yet
+}
+
void Prefs_Fonts::ReplaceSel()
{
int selCount = fontSubstitutionsTableWidget->selectedItems().count();
Modified: trunk/Scribus/scribus/ui/prefs_fonts.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_fonts.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_fonts.h (original)
+++ trunk/Scribus/scribus/ui/prefs_fonts.h Tue Jun 17 21:20:36 2014
@@ -27,6 +27,7 @@
~Prefs_Fonts();
virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
+ virtual void changeUnit(struct ApplicationPrefs *prefsData) const;
public slots:
void languageChange();
Modified: trunk/Scribus/scribus/ui/prefs_operatortools.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_operatortools.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_operatortools.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_operatortools.cpp Tue Jun 17 21:20:36 2014
@@ -41,14 +41,20 @@
rotationConstraintSpinBox->setToolTip( tr( "Constrain value for the rotation tool when the Control key is pressed" ) );
}
+void Prefs_OperatorTools::unitChange(int unitIndex)
+{
+ itemDuplicateXDispSpinBox->setNewUnit(unitIndex);
+ itemDuplicateYDispSpinBox->setNewUnit(unitIndex);
+}
+
void Prefs_OperatorTools::restoreDefaults(struct ApplicationPrefs *prefsData)
{
zoomMinimumSpinBox->setValue(prefsData->opToolPrefs.magMin);
zoomMaximumSpinBox->setValue(prefsData->opToolPrefs.magMax);
zoomSteppingSpinBox->setValue(prefsData->opToolPrefs.magStep);
+ int docUnitIndex = prefsData->docSetupPrefs.docUnitIndex;
+ unitChange(docUnitIndex);
double unitRatio = unitGetRatioFromIndex(prefsData->docSetupPrefs.docUnitIndex);
- itemDuplicateXDispSpinBox->setNewUnit(prefsData->docSetupPrefs.docUnitIndex);
- itemDuplicateYDispSpinBox->setNewUnit(prefsData->docSetupPrefs.docUnitIndex);
itemDuplicateXDispSpinBox->setValue(prefsData->opToolPrefs.dispX * unitRatio);
itemDuplicateYDispSpinBox->setValue(prefsData->opToolPrefs.dispY * unitRatio);
rotationConstraintSpinBox->setValue(prefsData->opToolPrefs.constrain);
Modified: trunk/Scribus/scribus/ui/prefs_operatortools.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19248&path=/trunk/Scribus/scribus/ui/prefs_operatortools.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_operatortools.h (original)
+++ trunk/Scribus/scribus/ui/prefs_operatortools.h Tue Jun 17 21:20:36 2014
@@ -26,6 +26,7 @@
public slots:
void languageChange();
+ void unitChange(int);
};
#endif // PREFS_OPERATORTOOLS_H
More information about the scribus-commit
mailing list