Author: jghali
Date: Tue Jul 10 11:27:27 2018
New Revision: 22597
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22597
Log:
refactoring for preflight verifier prefs
Modified:
trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
trunk/Scribus/scribus/ui/prefs_preflightverifier.h
Modified: trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22597&path=/trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_preflightverifier.cpp Tue Jul 10
11:27:27 2018
@@ -52,34 +52,37 @@
{
showPagesWithoutErrorsCheckBox->setChecked(prefsData->verifierPrefs.showPagesWithoutErrors);
showNonPrintingLayerErrorsCheckBox->setChecked(prefsData->verifierPrefs.showNonPrintingLayerErrors);
- checkerProfile = prefsData->verifierPrefs.checkerPrefsList;
+ checkerProfiles = prefsData->verifierPrefs.checkerPrefsList;
currentProfileComboBox->clear();
CheckerPrefsList::Iterator it;
currentProfileComboBox->clear();
- for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
+ for (it = checkerProfiles.begin(); it != checkerProfiles.end(); ++it)
currentProfileComboBox->addItem(it.key());
QString prefProfile(prefsData->verifierPrefs.curCheckProfile);
setCurrentComboItem(currentProfileComboBox, prefProfile);
-
ignoreAllErrorsCheckBox->setChecked(checkerProfile[prefProfile].ignoreErrors);
-
autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile[prefProfile].autoCheck);
-
checkMissingGlyphsCheckBox->setChecked(checkerProfile[prefProfile].checkGlyphs);
-
checkItemsNotOnAPageCheckBox->setChecked(checkerProfile[prefProfile].checkOrphans);
-
checkTextOverflowCheckBox->setChecked(checkerProfile[prefProfile].checkOverflow);
-
checkTransparenciesCheckBox->setChecked(checkerProfile[prefProfile].checkTransparency);
-
checkMissingImagesCheckBox->setChecked(checkerProfile[prefProfile].checkPictures);
-
checkPartFilledImageFramesCheckBox->setChecked(checkerProfile[prefProfile].checkPartFilledImageFrames);
-
checkImageResolutionCheckBox->setChecked(checkerProfile[prefProfile].checkResolution);
-
checkPDFAnnotFieldsCheckBox->setChecked(checkerProfile[prefProfile].checkAnnotations);
-
checkPlacedPDFCheckBox->setChecked(checkerProfile[prefProfile].checkRasterPDF);
- checkGIFsCheckBox->setChecked(checkerProfile[prefProfile].checkForGIF);
-
checkNonPrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].ignoreOffLayers);
-
checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile[prefProfile].checkOffConflictLayers);
-
checkAppliedMasterPageLocationCheckBox->setChecked(checkerProfile[prefProfile].checkAppliedMasterDifferentSide);
-
checkEmptyTextFramesCheckBox->setChecked(checkerProfile[prefProfile].checkEmptyTextFrames);
- minimumResolutionSpinBox->setValue(
qRound(checkerProfile[prefProfile].minResolution) );
- maximumResolutionSpinBox->setValue(
qRound(checkerProfile[prefProfile].maxResolution) );
+
+ CheckerPrefs& checkerProfile = checkerProfiles[prefProfile];
+ ignoreAllErrorsCheckBox->setChecked(checkerProfile.ignoreErrors);
+
autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile.autoCheck);
+ checkMissingGlyphsCheckBox->setChecked(checkerProfile.checkGlyphs);
+ checkItemsNotOnAPageCheckBox->setChecked(checkerProfile.checkOrphans);
+ checkTextOverflowCheckBox->setChecked(checkerProfile.checkOverflow);
+
checkTransparenciesCheckBox->setChecked(checkerProfile.checkTransparency);
+ checkMissingImagesCheckBox->setChecked(checkerProfile.checkPictures);
+
checkPartFilledImageFramesCheckBox->setChecked(checkerProfile.checkPartFilledImageFrames);
+
checkImageResolutionCheckBox->setChecked(checkerProfile.checkResolution);
+
checkPDFAnnotFieldsCheckBox->setChecked(checkerProfile.checkAnnotations);
+ checkPlacedPDFCheckBox->setChecked(checkerProfile.checkRasterPDF);
+ checkGIFsCheckBox->setChecked(checkerProfile.checkForGIF);
+
checkNonPrintableLayersCheckBox->setChecked(checkerProfile.ignoreOffLayers);
+
checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile.checkOffConflictLayers);
+
checkAppliedMasterPageLocationCheckBox->setChecked(checkerProfile.checkAppliedMasterDifferentSide);
+
checkEmptyTextFramesCheckBox->setChecked(checkerProfile.checkEmptyTextFrames);
+ minimumResolutionSpinBox->setValue(
qRound(checkerProfile.minResolution) );
+ maximumResolutionSpinBox->setValue(
qRound(checkerProfile.maxResolution) );
+
currentProfile = prefProfile;
- if (checkerProfile.count() == 1)
+ if (checkerProfiles.count() == 1)
removeProfilePushButton->setEnabled(false);
addProfilePushButton->setEnabled(false);
tempNewProfileName="";
@@ -89,38 +92,39 @@
{
prefsData->verifierPrefs.showPagesWithoutErrors=showPagesWithoutErrorsCheckBox->isChecked();
prefsData->verifierPrefs.showNonPrintingLayerErrors=showNonPrintingLayerErrorsCheckBox->isChecked();
- prefsData->verifierPrefs.checkerPrefsList = checkerProfile;
+ prefsData->verifierPrefs.checkerPrefsList = checkerProfiles;
prefsData->verifierPrefs.curCheckProfile =
currentProfileComboBox->currentText();
}
void Prefs_PreflightVerifier::putProfile()
{
- if (checkerProfile.contains(currentProfile))
- {
- checkerProfile[currentProfile].ignoreErrors =
ignoreAllErrorsCheckBox->isChecked();
- checkerProfile[currentProfile].autoCheck =
autoCheckBeforePrintExportCheckBox->isChecked();
- checkerProfile[currentProfile].checkGlyphs =
checkMissingGlyphsCheckBox->isChecked();
- checkerProfile[currentProfile].checkOrphans =
checkItemsNotOnAPageCheckBox->isChecked();
- checkerProfile[currentProfile].checkOverflow =
checkTextOverflowCheckBox->isChecked();
- checkerProfile[currentProfile].checkPictures =
checkMissingImagesCheckBox->isChecked();
- checkerProfile[currentProfile].checkPartFilledImageFrames =
checkPartFilledImageFramesCheckBox->isChecked();
- checkerProfile[currentProfile].checkResolution =
checkImageResolutionCheckBox->isChecked();
- checkerProfile[currentProfile].checkTransparency =
checkTransparenciesCheckBox->isChecked();
- checkerProfile[currentProfile].minResolution =
minimumResolutionSpinBox->value();
- checkerProfile[currentProfile].maxResolution =
maximumResolutionSpinBox->value();
- checkerProfile[currentProfile].checkAnnotations =
checkPDFAnnotFieldsCheckBox->isChecked();
- checkerProfile[currentProfile].checkRasterPDF =
checkPlacedPDFCheckBox->isChecked();
- checkerProfile[currentProfile].checkForGIF =
checkGIFsCheckBox->isChecked();
- checkerProfile[currentProfile].ignoreOffLayers =
checkNonPrintableLayersCheckBox->isChecked();
- checkerProfile[currentProfile].checkOffConflictLayers =
checkVisiblePrintableLayersCheckBox->isChecked();
- checkerProfile[currentProfile].checkAppliedMasterDifferentSide
= checkAppliedMasterPageLocationCheckBox->isChecked();
- checkerProfile[currentProfile].checkEmptyTextFrames =
checkEmptyTextFramesCheckBox->isChecked();
- }
+ if (!checkerProfiles.contains(currentProfile))
+ return;
+
+ CheckerPrefs& checkerProfile = checkerProfiles[currentProfile];
+ checkerProfile.ignoreErrors = ignoreAllErrorsCheckBox->isChecked();
+ checkerProfile.autoCheck =
autoCheckBeforePrintExportCheckBox->isChecked();
+ checkerProfile.checkGlyphs = checkMissingGlyphsCheckBox->isChecked();
+ checkerProfile.checkOrphans = checkItemsNotOnAPageCheckBox->isChecked();
+ checkerProfile.checkOverflow = checkTextOverflowCheckBox->isChecked();
+ checkerProfile.checkPictures = checkMissingImagesCheckBox->isChecked();
+ checkerProfile.checkPartFilledImageFrames =
checkPartFilledImageFramesCheckBox->isChecked();
+ checkerProfile.checkResolution =
checkImageResolutionCheckBox->isChecked();
+ checkerProfile.checkTransparency =
checkTransparenciesCheckBox->isChecked();
+ checkerProfile.minResolution = minimumResolutionSpinBox->value();
+ checkerProfile.maxResolution = maximumResolutionSpinBox->value();
+ checkerProfile.checkAnnotations =
checkPDFAnnotFieldsCheckBox->isChecked();
+ checkerProfile.checkRasterPDF = checkPlacedPDFCheckBox->isChecked();
+ checkerProfile.checkForGIF = checkGIFsCheckBox->isChecked();
+ checkerProfile.ignoreOffLayers =
checkNonPrintableLayersCheckBox->isChecked();
+ checkerProfile.checkOffConflictLayers =
checkVisiblePrintableLayersCheckBox->isChecked();
+ checkerProfile.checkAppliedMasterDifferentSide =
checkAppliedMasterPageLocationCheckBox->isChecked();
+ checkerProfile.checkEmptyTextFrames =
checkEmptyTextFramesCheckBox->isChecked();
}
void Prefs_PreflightVerifier::setProfile(const QString& name)
{
- if (checkerProfile.contains(name))
+ if (checkerProfiles.contains(name))
{
putProfile();
updateProfile(name);
@@ -154,24 +158,25 @@
disconnect(checkAppliedMasterPageLocationCheckBox, SIGNAL(clicked()),
this, SLOT(putProfile()));
disconnect(checkEmptyTextFramesCheckBox, SIGNAL(clicked()), this,
SLOT(putProfile()));
- ignoreAllErrorsCheckBox->setChecked(checkerProfile[name].ignoreErrors);
-
autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile[name].autoCheck);
-
checkMissingGlyphsCheckBox->setChecked(checkerProfile[name].checkGlyphs);
-
checkItemsNotOnAPageCheckBox->setChecked(checkerProfile[name].checkOrphans);
-
checkTextOverflowCheckBox->setChecked(checkerProfile[name].checkOverflow);
-
checkTransparenciesCheckBox->setChecked(checkerProfile[name].checkTransparency);
-
checkMissingImagesCheckBox->setChecked(checkerProfile[name].checkPictures);
-
checkPartFilledImageFramesCheckBox->setChecked(checkerProfile[name].checkPartFilledImageFrames);
-
checkImageResolutionCheckBox->setChecked(checkerProfile[name].checkResolution);
- minimumResolutionSpinBox->setValue(
qRound(checkerProfile[name].minResolution) );
- maximumResolutionSpinBox->setValue(
qRound(checkerProfile[name].maxResolution) );
-
checkPDFAnnotFieldsCheckBox->setChecked(checkerProfile[name].checkAnnotations);
- checkPlacedPDFCheckBox->setChecked(checkerProfile[name].checkRasterPDF);
- checkGIFsCheckBox->setChecked(checkerProfile[name].checkForGIF);
-
checkNonPrintableLayersCheckBox->setChecked(checkerProfile[name].ignoreOffLayers);
-
checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile[name].checkOffConflictLayers);
-
checkAppliedMasterPageLocationCheckBox->setChecked(checkerProfile[name].checkAppliedMasterDifferentSide);
-
checkEmptyTextFramesCheckBox->setChecked(checkerProfile[name].checkEmptyTextFrames);
+ CheckerPrefs& checkerProfile = checkerProfiles[name];
+ ignoreAllErrorsCheckBox->setChecked(checkerProfile.ignoreErrors);
+
autoCheckBeforePrintExportCheckBox->setChecked(checkerProfile.autoCheck);
+ checkMissingGlyphsCheckBox->setChecked(checkerProfile.checkGlyphs);
+ checkItemsNotOnAPageCheckBox->setChecked(checkerProfile.checkOrphans);
+ checkTextOverflowCheckBox->setChecked(checkerProfile.checkOverflow);
+
checkTransparenciesCheckBox->setChecked(checkerProfile.checkTransparency);
+ checkMissingImagesCheckBox->setChecked(checkerProfile.checkPictures);
+
checkPartFilledImageFramesCheckBox->setChecked(checkerProfile.checkPartFilledImageFrames);
+
checkImageResolutionCheckBox->setChecked(checkerProfile.checkResolution);
+ minimumResolutionSpinBox->setValue(
qRound(checkerProfile.minResolution) );
+ maximumResolutionSpinBox->setValue(
qRound(checkerProfile.maxResolution) );
+
checkPDFAnnotFieldsCheckBox->setChecked(checkerProfile.checkAnnotations);
+ checkPlacedPDFCheckBox->setChecked(checkerProfile.checkRasterPDF);
+ checkGIFsCheckBox->setChecked(checkerProfile.checkForGIF);
+
checkNonPrintableLayersCheckBox->setChecked(checkerProfile.ignoreOffLayers);
+
checkVisiblePrintableLayersCheckBox->setChecked(checkerProfile.checkOffConflictLayers);
+
checkAppliedMasterPageLocationCheckBox->setChecked(checkerProfile.checkAppliedMasterDifferentSide);
+
checkEmptyTextFramesCheckBox->setChecked(checkerProfile.checkEmptyTextFrames);
currentProfile = name;
connect(ignoreAllErrorsCheckBox, SIGNAL(clicked()), this,
SLOT(putProfile()));
@@ -214,9 +219,9 @@
checkerSettings.checkOffConflictLayers =
checkVisiblePrintableLayersCheckBox->isChecked();
checkerSettings.checkAppliedMasterDifferentSide =
checkAppliedMasterPageLocationCheckBox->isChecked();
checkerSettings.checkEmptyTextFrames =
checkEmptyTextFramesCheckBox->isChecked();
- checkerProfile.insert(tempNewProfileName, checkerSettings);
+ checkerProfiles.insert(tempNewProfileName, checkerSettings);
currentProfile = tempNewProfileName;
- if (checkerProfile.count() > 1)
+ if (checkerProfiles.count() > 1)
removeProfilePushButton->setEnabled(true);
addProfilePushButton->setEnabled(false);
currentProfileComboBox->clear();
@@ -225,7 +230,7 @@
disconnect(currentProfileComboBox, SIGNAL(editTextChanged(const
QString&)), this, SLOT(setProfile(const QString&)));
CheckerPrefsList::Iterator it;
int j,i=0;
- for (it = checkerProfile.begin(), j=0; it != checkerProfile.end();
++it, ++j)
+ for (it = checkerProfiles.begin(), j=0; it != checkerProfiles.end();
++it, ++j)
{
currentProfileComboBox->addItem(it.key());
if (it.key()==currentProfile)
@@ -241,16 +246,16 @@
{
disconnect(currentProfileComboBox, SIGNAL(activated(const QString&)),
this, SLOT(setProfile(const QString&)));
disconnect(currentProfileComboBox, SIGNAL(editTextChanged(const
QString&)), this, SLOT(setProfile(const QString&)));
- checkerProfile.remove(currentProfile);
- updateProfile(checkerProfile.begin().key());
+ checkerProfiles.remove(currentProfile);
+ updateProfile(checkerProfiles.begin().key());
currentProfileComboBox->clear();
CheckerPrefsList::Iterator it;
- CheckerPrefsList::Iterator itend=checkerProfile.end();
- for (it = checkerProfile.begin(); it != itend; ++it)
+ CheckerPrefsList::Iterator itend=checkerProfiles.end();
+ for (it = checkerProfiles.begin(); it != itend; ++it)
currentProfileComboBox->addItem(it.key());
setCurrentComboItem(currentProfileComboBox, currentProfile);
connect(currentProfileComboBox, SIGNAL(activated(const QString&)),
this, SLOT(setProfile(const QString&)));
connect(currentProfileComboBox, SIGNAL(editTextChanged(const
QString&)), this, SLOT(setProfile(const QString&)));
- if (checkerProfile.count() == 1)
+ if (checkerProfiles.count() == 1)
removeProfilePushButton->setEnabled(false);
}
Modified: trunk/Scribus/scribus/ui/prefs_preflightverifier.h
URL:
http://scribus.net/websvn/diff.php?repname=Scribus&rev=22597&path=/trunk/Scribus/scribus/ui/prefs_preflightverifier.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_preflightverifier.h (original)
+++ trunk/Scribus/scribus/ui/prefs_preflightverifier.h Tue Jul 10 11:27:27 2018
@@ -38,7 +38,7 @@
protected:
QString tempNewProfileName;
- CheckerPrefsList checkerProfile;
+ CheckerPrefsList checkerProfiles;
QString currentProfile;
void updateProfile(const QString& name);
};
_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit