Пример #1
0
void PrintDialog::SelPrinter(const QString& prn)
{
	bool toFile = prn == tr("File") ? true : false;
	DateiT->setEnabled(toFile);
	LineEdit1->setEnabled(toFile);
	ToolButton1->setEnabled(toFile);
	OptButton->setEnabled(!toFile);
#if defined(_WIN32)
	if (!toFile)
	{
		if( !PrinterUtil::getDefaultSettings(PrintDest->currentText(), DevMode) )
			qWarning( tr("Failed to retrieve printer settings").toAscii().data() );
	}
#endif
	if (toFile && LineEdit1->text().isEmpty())
	{
		QFileInfo fi(m_doc->DocName);
		if (fi.isRelative()) // if (m_doc->DocName.startsWith( tr("Document")))
			LineEdit1->setText( QDir::toNativeSeparators(QDir::currentPath() + "/" + m_doc->DocName + ".ps") );
		else
		{
			QString completeBaseName = fi.completeBaseName();
			if (completeBaseName.endsWith(".sla", Qt::CaseInsensitive))
				if (completeBaseName.length() > 4) completeBaseName.chop(4);
			if (completeBaseName.endsWith(".gz", Qt::CaseInsensitive))
				if (completeBaseName.length() > 3) completeBaseName.chop(3);
			LineEdit1->setText( QDir::toNativeSeparators(fi.path() + "/" + completeBaseName + ".ps") );
		}
	}

	// Get page description language supported by the selected printer
	printEngineMap = PrinterUtil::getPrintEngineSupport(prn, toFile);
	refreshPrintEngineBox();

	prefs->set("CurrentPrn", prn);
	prefs->set("CurrentPrnEngine", printEngineMap[printEngines->currentText()]);
	
	bool ps1Supported = printEngineMap.contains(CommonStrings::trPostScript1);
	bool ps2Supported = printEngineMap.contains(CommonStrings::trPostScript2);
	bool ps3Supported = printEngineMap.contains(CommonStrings::trPostScript3);
	bool psSupported  = (ps1Supported || ps2Supported || ps3Supported);
	if (psSupported || toFile)
	{
		printEngines->setEnabled( true );
		PrintSep->setEnabled( true );
		UseICC->setEnabled( m_doc->HasCMS );
		usePDFMarks->setEnabled(true);
	}
	else
	{
		printEngines->setEnabled( false );
		setCurrentComboItem(PrintSep, tr("Print Normal"));
		PrintSep->setEnabled( false );
		setCurrentComboItem(SepArt, tr("All"));
		SepArt->setEnabled( false );
		UseICC->setEnabled( false );
		UseICC->setChecked( false );
		usePDFMarks->setEnabled(false);
	}
}
Пример #2
0
void Prefs_TableOfContents::selectToC( int numberSelected )
{
	numSelected=numberSelected;
	if (numSelected < 0)
		return;
	if (localToCSetupVector.isEmpty())
		return;
	if (localToCSetupVector.count()<numSelected)
		numSelected=0;
	disconnect( tocListBox, SIGNAL( currentRowChanged(int) ), this, SLOT( selectToC(int) ) );
	disconnect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
	disconnect( itemDestFrameComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemFrameSelected(const QString&) ) );
	disconnect( itemParagraphStyleComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemParagraphStyleSelected(const QString&) ) );
	disconnect( itemNumberPlacementComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemPageNumberPlacedSelected(const QString&) ) );
	disconnect( tocNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( setToCName(const QString&) ) );
	disconnect( itemListNonPrintingCheckBox, SIGNAL( toggled(bool) ), this, SLOT( nonPrintingFramesSelected(bool) ) );
	if (localToCSetupVector[numSelected].itemAttrName==CommonStrings::None)
		setCurrentComboItem(itemAttrComboBox, CommonStrings::tr_None);
	else
		setCurrentComboItem(itemAttrComboBox, localToCSetupVector[numSelected].itemAttrName);
	if (localToCSetupVector[numSelected].pageLocation==NotShown)
		setCurrentComboItem(itemNumberPlacementComboBox, trStrPNNotShown);
	else
		if (localToCSetupVector[numSelected].pageLocation==Beginning)
		setCurrentComboItem(itemNumberPlacementComboBox, trStrPNBeginning);
	else
		setCurrentComboItem(itemNumberPlacementComboBox, trStrPNEnd);

	itemListNonPrintingCheckBox->setChecked(localToCSetupVector[numSelected].listNonPrintingFrames);
	if (m_Doc!=NULL)
	{
		if (localToCSetupVector[numSelected].frameName==CommonStrings::None)
			setCurrentComboItem(itemDestFrameComboBox, CommonStrings::tr_None);
		else
			setCurrentComboItem(itemDestFrameComboBox, localToCSetupVector[numSelected].frameName);

		if (itemParagraphStyleComboBox->count()>0)
		{
			if (!paragraphStyleList.contains(localToCSetupVector[numSelected].textStyle) || localToCSetupVector[numSelected].textStyle==CommonStrings::None)
				setCurrentComboItem(itemParagraphStyleComboBox, CommonStrings::tr_None);
			else
				setCurrentComboItem(itemParagraphStyleComboBox, localToCSetupVector[numSelected].textStyle);
		}
	}

	if (tocListBox->currentItem())
		tocNameLineEdit->setText(tocListBox->currentItem()->text());

	connect( tocListBox, SIGNAL( currentRowChanged(int) ), this, SLOT( selectToC(int) ) );
	connect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
	connect( itemDestFrameComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemFrameSelected(const QString&) ) );
	connect( itemParagraphStyleComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemParagraphStyleSelected(const QString&) ) );
	connect( itemNumberPlacementComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemPageNumberPlacedSelected(const QString&) ) );
	connect( tocNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( setToCName(const QString&) ) );
	connect( itemListNonPrintingCheckBox, SIGNAL( toggled(bool) ), this, SLOT( nonPrintingFramesSelected(bool) ) );
}
Пример #3
0
void Prefs_TableOfContents::setupItemAttrs( QStringList newNames )
{
	disconnect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
	itemAttrComboBox->clear();
	itemAttrComboBox->addItem(CommonStrings::tr_None);
	itemAttrComboBox->addItems(newNames);
	if (numSelected!=999 && numSelected!=-1)
	{
		if (localToCSetupVector[numSelected].itemAttrName==CommonStrings::None)
			setCurrentComboItem(itemAttrComboBox, CommonStrings::tr_None);
		else
			setCurrentComboItem(itemAttrComboBox, localToCSetupVector[numSelected].itemAttrName);
	}
	connect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
}
Пример #4
0
void Tabruler::setFillChar()
{
	tabFillCombo->blockSignals(true);
	QChar ret;
	switch (tabFillCombo->currentIndex())
	{
		case 0:
			tabFillCombo->setEditable(false);
			ret = QChar();
			break;
		case 1:
			tabFillCombo->setEditable(false);
			ret = '.';
			break;
		case 2:
			tabFillCombo->setEditable(false);
			ret = '-';
			break;
		case 3:
			tabFillCombo->setEditable(false);
			ret = '_';
			break;
		case 4:
			tabFillCombo->setEditable(true);
			setCurrentComboItem(tabFillCombo, CommonStrings::trCustomTabFill);
			break;
	}
	if (tabFillCombo->currentIndex() != 4)
		ruler->changeTabChar(ret);
	tabFillCombo->blockSignals(false);
	emit tabrulerChanged();
	emit tabsChanged();
}
Пример #5
0
void Prefs_PreflightVerifier::restoreDefaults(struct ApplicationPrefs *prefsData)
{
	showPagesWithoutErrorsCheckBox->setChecked(prefsData->verifierPrefs.showPagesWithoutErrors);
	showNonPrintingLayerErrorsCheckBox->setChecked(prefsData->verifierPrefs.showNonPrintingLayerErrors);
	checkerProfile = prefsData->verifierPrefs.checkerPrefsList;
	currentProfileComboBox->clear();
	CheckerPrefsList::Iterator it;
	currentProfileComboBox->clear();
	for (it = checkerProfile.begin(); it != checkerProfile.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);
	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);
	minimumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].minResolution) );
	maximumResolutionSpinBox->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
	currentProfile = prefProfile;
	if (checkerProfile.count() == 1)
		removeProfilePushButton->setEnabled(false);
	addProfilePushButton->setEnabled(false);
	tempNewProfileName="";
}
Пример #6
0
void TabCheckDoc::restoreDefaults(CheckerPrefsList *prefsData, QString prefProfile)
{
	checkerProfile = *prefsData;
	curCheckProfile->clear();
	CheckerPrefsList::Iterator it;
	curCheckProfile->clear();
	for (it = checkerProfile.begin(); it != checkerProfile.end(); ++it)
		curCheckProfile->addItem(it.key());
	setCurrentComboItem(curCheckProfile, prefProfile);
	ignoreErrors->setChecked(checkerProfile[prefProfile].ignoreErrors);
	automaticCheck->setChecked(checkerProfile[prefProfile].autoCheck);
	missingGlyphs->setChecked(checkerProfile[prefProfile].checkGlyphs);
	checkOrphans->setChecked(checkerProfile[prefProfile].checkOrphans);
	textOverflow->setChecked(checkerProfile[prefProfile].checkOverflow);
	tranparentObjects->setChecked(checkerProfile[prefProfile].checkTransparency);
	missingPictures->setChecked(checkerProfile[prefProfile].checkPictures);
	pictResolution->setChecked(checkerProfile[prefProfile].checkResolution);
	useAnnotations->setChecked(checkerProfile[prefProfile].checkAnnotations);
	rasterPDF->setChecked(checkerProfile[prefProfile].checkRasterPDF);
	checkForGIF->setChecked(checkerProfile[prefProfile].checkForGIF);
	ignoreOffLayers->setChecked(checkerProfile[prefProfile].ignoreOffLayers);
	checkOffConflictLayers->setChecked(checkerProfile[prefProfile].checkOffConflictLayers);
	resolutionValue->setValue( qRound(checkerProfile[prefProfile].minResolution) );
	resolutionValueM->setValue( qRound(checkerProfile[prefProfile].maxResolution) );
	currentProfile = prefProfile;
	if (checkerProfile.count() == 1)
		removeProfile->setEnabled(false);
	addProfile->setEnabled(false);
	tempNewProfileName="";
}
Пример #7
0
void Tabruler::setTabFillChar(QChar t)
{
	if (t.isNull())
	{
		tabFillCombo->setEditable(false);
		tabFillCombo->setCurrentIndex(0);
	}
	else if (t == '.')
	{
		tabFillCombo->setEditable(false);
		tabFillCombo->setCurrentIndex(1);
	}
	else if (t == '-')
	{
		tabFillCombo->setEditable(false);
		tabFillCombo->setCurrentIndex(2);
	}
	else if (t == '_')
	{
		tabFillCombo->setEditable(false);
		tabFillCombo->setCurrentIndex(3);
	}
	else
	{
		tabFillCombo->setCurrentIndex(4);
		tabFillCombo->setEditable(true);
		setCurrentComboItem(tabFillCombo, CommonStrings::trCustomTabFill+QString(t));
	}
	emit tabrulerChanged();
	emit tabsChanged();
}
Пример #8
0
void TabGeneral::restoreDefaults(struct ApplicationPrefs *prefsData)
{
	selectedGUILang = prefsData->guiLanguage;
	setCurrentComboItem(guiLangCombo, LanguageManager::instance()->getLangFromAbbrev(selectedGUILang));
	setCurrentComboItem(GUICombo, prefsData->GUI);
	GFsize->setValue( prefsData->AppFontSize );
	GTFsize->setValue( prefsData->PaletteFontSize); // temp solution
	wheelJumpSpin->setValue( prefsData->Wheelval );
	spinTimeout->setValue(prefsData->moveTimeout);
	recentDocs->setValue( prefsData->RecentDCount );
	Docs->setText(QDir::toNativeSeparators(prefsData->DocDir));
	ProPfad->setText(QDir::toNativeSeparators(prefsData->ProfileDir));
	ScriptPfad->setText(QDir::toNativeSeparators(prefsData->ScriptDir));
	DocumentTemplateDir->setText(QDir::toNativeSeparators(prefsData->documentTemplatesDir));
	startUpDialog->setChecked(prefsData->showStartupDialog);
	showSplashCheckBox->setChecked( !ScQApp->neverSplashExists() );
	useSmallWidgetsCheck->setChecked(prefsData->useSmallWidgets);
}
Пример #9
0
void TabGeneral::restoreDefaults(struct ApplicationPrefs *prefsData)
{
	selectedGUILang = prefsData->uiPrefs.language;
	setCurrentComboItem(guiLangCombo, LanguageManager::instance()->getLangFromAbbrev(selectedGUILang));
	setCurrentComboItem(GUICombo, prefsData->uiPrefs.style);
	GFsize->setValue( prefsData->uiPrefs.applicationFontSize );
	GTFsize->setValue( prefsData->uiPrefs.paletteFontSize); // temp solution
	wheelJumpSpin->setValue( prefsData->uiPrefs.wheelJump );
	spinTimeout->setValue(prefsData->uiPrefs.mouseMoveTimeout);
	recentDocs->setValue( prefsData->uiPrefs.recentDocCount );
	Docs->setText(QDir::convertSeparators(prefsData->pathPrefs.documents));
	ProPfad->setText(QDir::convertSeparators(prefsData->pathPrefs.colorProfiles));
	ScriptPfad->setText(QDir::convertSeparators(prefsData->pathPrefs.scripts));
	DocumentTemplateDir->setText(QDir::convertSeparators(prefsData->pathPrefs.documentTemplates));
	startUpDialog->setChecked(prefsData->uiPrefs.showStartupDialog);
	showSplashCheckBox->setChecked( !ScQApp->neverSplashExists() );
	useSmallWidgetsCheck->setChecked(prefsData->uiPrefs.useSmallWidgets);
	useTabsForDocs->setChecked(prefsData->uiPrefs.useTabs);
}
void Tpalette::setCurrentItem(PageItem* item)
{
	currentItem = item;
	disconnectSignals();

	if (!currentItem || !currentDoc)
		return;

	setActTrans(currentItem->fillTransparency(), currentItem->lineTransparency());
	setActBlend(currentItem->fillBlendmode(), currentItem->lineBlendmode());
	gradEdit->setGradient(currentItem->mask_gradient);
	if (!currentItem->gradientMask().isEmpty())
	{
		setCurrentComboItem(namedGradient, currentItem->gradientMask());
		gradEdit->setGradientEditable(false);
	}
	else
	{
		namedGradient->setCurrentIndex(0);
		gradEdit->setGradientEditable(true);
	}
	if (currentItem->maskType() == 0)
		tabWidget->setCurrentIndex(0);
	else if ((currentItem->maskType() == 1) || (currentItem->maskType() == 2) || (currentItem->maskType() == 4) || (currentItem->maskType() == 5))
		tabWidget->setCurrentIndex(1);
	else
		tabWidget->setCurrentIndex(2);
	if (patternList->count() == 0)
		tabWidget->setTabEnabled(2, false);
	else
		tabWidget->setTabEnabled(2, true);
	transpCalcGradient->setChecked(false);
	transpCalcPattern->setChecked(false);
	usePatternInverted->setChecked(false);
	if ((currentItem->maskType() == 4) || (currentItem->maskType() == 5))
		transpCalcGradient->setChecked(true);
	if ((currentItem->maskType() == 6) || (currentItem->maskType() == 7))
		transpCalcPattern->setChecked(true);
	if ((currentItem->maskType() == 7) || (currentItem->maskType() == 8))
		usePatternInverted->setChecked(true);
	if ((currentItem->maskType() == 1) || (currentItem->maskType() == 4))
		gradientType->setCurrentIndex(0);
	else if ((currentItem->maskType() == 2) || (currentItem->maskType() == 5))
		gradientType->setCurrentIndex(1);
	if(TGradDia && gradEditButton->isChecked())
		TGradDia->setValues(currentItem->GrMaskStartX, currentItem->GrMaskStartY, currentItem->GrMaskEndX, currentItem->GrMaskEndY, currentItem->GrMaskFocalX, currentItem->GrMaskFocalY, currentItem->GrMaskScale, currentItem->GrMaskSkew, 0, 0);
	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
	bool mirrorX, mirrorY;
	currentItem->maskTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
	currentItem->maskFlip(mirrorX, mirrorY);
	setActPattern(currentItem->patternMask(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY, mirrorX, mirrorY);

	connectSignals();
}
Пример #11
0
MissingFont::MissingFont( QWidget* parent, QString fon, ScribusDoc* doc ) : QDialog( parent )
{
	QPixmap image0( ( const char** ) image100_data );
	setModal(true);
	setWindowTitle( tr("Missing Font"));
	setWindowIcon(QIcon(loadIcon("AppIcon.png")));
	missingFontLayout = new QHBoxLayout( this );
	missingFontLayout->setMargin(10);
	missingFontLayout->setSpacing(0);
	missingFontGridLayout = new QGridLayout;
	missingFontGridLayout->setSpacing( 10 );
	missingFontGridLayout->setMargin( 0 );
	notInstalledLabel = new QLabel( tr("The Font %1 is not installed.").arg(fon), this );
	missingFontGridLayout->addWidget( notInstalledLabel, 0, 0, 1, 4 );
	pixmapLabel = new QLabel( this );
	pixmapLabel->setPixmap( image0 );
	missingFontGridLayout->addWidget( pixmapLabel, 1, 0 );
	useLabel = new QLabel( tr( "Use" ), this );
	missingFontGridLayout->addWidget( useLabel, 1, 1 );
	replaceFontCombo = new FontCombo(this);
	if (doc != 0)
	{
		setCurrentComboItem(replaceFontCombo, doc->toolSettings.defFont);
		replacementFont = doc->toolSettings.defFont;
	}
	else
	{
		setCurrentComboItem(replaceFontCombo, PrefsManager::instance()->appPrefs.toolSettings.defFont);
		replacementFont = PrefsManager::instance()->appPrefs.toolSettings.defFont;
	}
	missingFontGridLayout->addWidget( replaceFontCombo, 1, 2 );
	insteadLabel = new QLabel( tr( "instead" ), this );
	missingFontGridLayout->addWidget( insteadLabel, 1, 3 );
	okButton = new QPushButton( CommonStrings::tr_OK, this );
	missingFontGridLayout->addWidget( okButton, 2, 2 );
	missingFontLayout->addLayout( missingFontGridLayout );

	// signals and slots connections
	connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
	connect( replaceFontCombo, SIGNAL( activated(const QString&) ), this, SLOT( newFont(const QString&) ) );
}
Пример #12
0
void Prefs_Hyphenator::restoreDefaults(struct ApplicationPrefs *prefsData)
{
	hyphSuggestionsCheckBox->setChecked(!prefsData->hyphPrefs.Automatic);
	hyphAutoCheckBox->setChecked(prefsData->hyphPrefs.AutoCheck);
	setCurrentComboItem(hyphLanguageComboBox, LanguageManager::instance()->getLangFromAbbrev(prefsData->hyphPrefs.Language, true));
	smallestWordSpinBox->setValue(prefsData->hyphPrefs.MinWordLen);
	maxConsecutiveCountSpinBox->setValue(prefsData->hyphPrefs.HyCount);
	ignoreListWidget->addItems(prefsData->hyphPrefs.ignoredWords.toList());
	ignoreListWidget->sortItems();
	exceptionListWidget->addItems(prefsData->hyphPrefs.specialWords.values());
	exceptionListWidget->sortItems();
}
Пример #13
0
void PageSelector::languageChange()
{
	Start->setToolTip(tr("Go to the first page"));
	Back->setToolTip(tr("Go to the previous page"));
	Forward->setToolTip(tr("Go to the next page"));
	Last->setToolTip(tr("Go to the last page"));
	PageCombo->setToolTip(tr("Select the current page"));
	PageCountString =  tr(" of %1", "number of pages in document");
	PageCount->setText(PageCountString.arg(LastPG));
	disconnect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
	setCurrentComboItem(PageCombo, QString::number(APage));
	connect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
}
Пример #14
0
void PropertiesPalette_Table::updateFillControls()
{
	if (m_item && m_item->isTable())
	{
		PageItem_Table* table = m_item->asTable();
		// Enable fill editing controls.
		fillColor->setEnabled(true);
		fillColorLabel->setEnabled(true);
		fillShade->setEnabled(true);
		fillShadeLabel->setEnabled(true);
		// Fill in values.
		if (m_doc->appMode != modeEditTable)
		{
			QString color = table->fillColor();
			if (color == CommonStrings::None)
				color = CommonStrings::tr_NoneColor;
			setCurrentComboItem(fillColor, color);
			fillShade->setValue(table->fillShade());
		}
		else
		{
			TableCell cell = table->activeCell();
			QString color = cell.fillColor();
			if (color == CommonStrings::None)
				color = CommonStrings::tr_NoneColor;
			setCurrentComboItem(fillColor, color);
			fillShade->setValue(cell.fillShade());
		}
	}
	else
	{
		// Disable fill editing controls.
		fillColor->setEnabled(false);
		fillColorLabel->setEnabled(false);
		fillShade->setEnabled(false);
		fillShadeLabel->setEnabled(false);
	}
}
Пример #15
0
void SMLineStyleWidget::slotEditNewLine(int i)
{
	lineStyles->setCurrentRow(i);
// 	lineStyles->setSelected(i, true);
	//currentLine_ = i;

	// JG #5876 protect against broken line styles 
	// JG #6099 no current item selected
	if (m_currentStyle.count() <= i || (i < 0))
		return;

	double unitRatio = lineWidth->unitRatio();

	lineWidth->setValue(m_currentStyle[i].Width * unitRatio);
	setCurrentComboItem(colorCombo, m_currentStyle[i].Color);
	shadeBox->setValue(m_currentStyle[i].Shade);
	
	dashCombo->setCurrentIndex(m_currentStyle[i].Dash - 1);
	switch (static_cast<Qt::PenCapStyle>(m_currentStyle[i].LineEnd))
	{
	case Qt::FlatCap:
		endCombo->setCurrentIndex(0);
		break;
	case Qt::SquareCap:
		endCombo->setCurrentIndex(1);
		break;
	case Qt::RoundCap:
		endCombo->setCurrentIndex(2);
		break;
	default:
		endCombo->setCurrentIndex(0);
		break;
	}

	switch (static_cast<Qt::PenJoinStyle>(m_currentStyle[i].LineJoin))
	{
	case Qt::MiterJoin:
		joinCombo->setCurrentIndex(0);
		break;
	case Qt::BevelJoin:
		joinCombo->setCurrentIndex(1);
		break;
	case Qt::RoundJoin:
		joinCombo->setCurrentIndex(2);
		break;
	default:
		joinCombo->setCurrentIndex(0);
		break;
	}
}
Пример #16
0
void SearchReplace::clear()
{
	SAlign->setChecked(false);
	SStroke->setChecked(false);
	SFill->setChecked(false);
	SStrokeS->setChecked(false);
	SFillS->setChecked(false);
	SSize->setChecked(false);
	SFont->setChecked(false);
	SStyle->setChecked(false);
	SText->setChecked(false);
	SEffect->setChecked(false);
	REffect->setChecked(false);
	STextVal->setText("");
	int currentParaStyle = findParagraphStyle(m_doc, m_doc->currentStyle);
	SStyleVal->setCurrentIndex(currentParaStyle);
	RAlignVal->setCurrentIndex(m_doc->currentStyle.alignment());
	setCurrentComboItem(SFontVal, m_doc->currentStyle.charStyle().font().scName());
	setCurrentComboItem(SFillVal, m_doc->currentStyle.charStyle().fillColor());
	setCurrentComboItem(SStrokeVal, m_doc->currentStyle.charStyle().strokeColor());
	SSizeVal->setValue(m_doc->currentStyle.charStyle().fontSize() / 10.0);
	RStroke->setChecked(false);
	RStrokeS->setChecked(false);
	RFill->setChecked(false);
	RFillS->setChecked(false);
	RSize->setChecked(false);
	RFont->setChecked(false);
	RStyle->setChecked(false);
	RText->setChecked(false);
	RTextVal->setText("");
	RStyleVal->setCurrentIndex(currentParaStyle);
	RAlignVal->setCurrentIndex(m_doc->currentStyle.alignment());
	setCurrentComboItem(RFontVal, m_doc->currentStyle.charStyle().font().scName());
	setCurrentComboItem(RFillVal, m_doc->currentStyle.charStyle().fillColor());
	setCurrentComboItem(RStrokeVal, m_doc->currentStyle.charStyle().strokeColor());
	RSizeVal->setValue(m_doc->currentStyle.charStyle().fontSize() / 10.0);
	Word->setChecked(false);
	CaseIgnore->setChecked(false);
	enableTxSearch();
	enableStyleSearch();
	enableFontSearch();
	enableSizeSearch();
	enableEffSearch();
	enableFillSearch();
	enableFillSSearch();
	enableStrokeSearch();
	enableStrokeSSearch();
	enableTxReplace();
	enableStyleReplace();
	enableFontReplace();
	enableSizeReplace();
	enableEffReplace();
	enableFillReplace();
	enableFillSReplace();
	enableStrokeReplace();
	enableStrokeSReplace();
}
Пример #17
0
void PageSelector::setMaximum(int a)
{
	disconnect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
	PageCombo->clear();
	LastPG = a;
//	v->setTop(LastPG);
	m_validator->setRange(1, LastPG);
	for (int b = 0; b < LastPG; ++b)
	{
		PageCombo->addItem(QString::number(b+1));
	}
	setCurrentComboItem(PageCombo, QString::number(APage));
	PageCount->setText(PageCountString.arg(LastPG));
	connect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
}
Пример #18
0
void PrintDialog::SelEngine(const QString& eng)
{
	prefs->set("CurrentPrnEngine", printEngineMap[printEngines->currentText()]);
	bool psSupported = outputToFile();
	psSupported |= (eng == CommonStrings::trPostScript1);
	psSupported |= (eng == CommonStrings::trPostScript2);
	psSupported |= (eng == CommonStrings::trPostScript3);
	if (psSupported)
	{
		PrintSep->setEnabled( true );
		UseICC->setEnabled( m_doc->HasCMS );
		usePDFMarks->setEnabled(true);
	}
	else
	{
		setCurrentComboItem(PrintSep, tr("Print Normal"));
		PrintSep->setEnabled( false );
		setCurrentComboItem(SepArt, tr("All"));
		SepArt->setEnabled( false );
		UseICC->setEnabled( false );
		UseICC->setChecked( false );
		usePDFMarks->setEnabled(false);
	}
}
Пример #19
0
void Prefs_UserInterface::restoreDefaults(struct ApplicationPrefs *prefsData)
{
	selectedGUILang = prefsData->uiPrefs.language;
	setCurrentComboItem(languageComboBox, LanguageManager::instance()->getLangFromAbbrev(selectedGUILang));
	setCurrentComboItem(themeComboBox, prefsData->uiPrefs.style);
	setCurrentComboItem(iconSetComboBox, prefsData->uiPrefs.iconSet);
	fontSizeMenuSpinBox->setValue( prefsData->uiPrefs.applicationFontSize );
	fontSizePaletteSpinBox->setValue( prefsData->uiPrefs.paletteFontSize);
	wheelJumpSpinBox->setValue( prefsData->uiPrefs.wheelJump );
	resizeMoveDelaySpinBox->setValue(prefsData->uiPrefs.mouseMoveTimeout);
	recentDocumentsSpinBox->setValue( prefsData->uiPrefs.recentDocCount );
	showStartupDialogCheckBox->setChecked(prefsData->uiPrefs.showStartupDialog);
	useTabsForDocumentsCheckBox->setChecked(prefsData->uiPrefs.useTabs);
	showSplashCheckBox->setChecked(prefsData->uiPrefs.showSplashOnStartup);
	useSmallWidgetsCheckBox->setChecked(prefsData->uiPrefs.useSmallWidgets);

	storyEditorUseSmartSelectionCheckBox->setChecked(prefsData->storyEditorPrefs.smartTextSelection);
	seFont.fromString(prefsData->storyEditorPrefs.guiFont);
	storyEditorFontPushButton->setText(seFont.family());
	QPixmap pm(100, 30);
	pm.fill(prefsData->storyEditorPrefs.guiFontColorBackground);
	seFontColor = prefsData->storyEditorPrefs.guiFontColorBackground;
	storyEditorFontColorPushButton->setIcon(pm);
}
Пример #20
0
void TabCheckDoc::delProf()
{
	disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	checkerProfile.remove(currentProfile);
	updateProfile(checkerProfile.begin().key());
	curCheckProfile->clear();
	CheckerPrefsList::Iterator it;
	CheckerPrefsList::Iterator itend=checkerProfile.end();
	for (it = checkerProfile.begin(); it != itend; ++it)
		curCheckProfile->addItem(it.key());
	setCurrentComboItem(curCheckProfile, currentProfile);
	connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	connect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	if (checkerProfile.count() == 1)
		removeProfile->setEnabled(false);
}
Пример #21
0
void Prefs_PreflightVerifier::delProf()
{
	disconnect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&)));
	disconnect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	checkerProfile.remove(currentProfile);
	updateProfile(checkerProfile.begin().key());
	currentProfileComboBox->clear();
	CheckerPrefsList::Iterator it;
	CheckerPrefsList::Iterator itend=checkerProfile.end();
	for (it = checkerProfile.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(textChanged(const QString&)), this, SLOT(setProfile(const QString&)));
	if (checkerProfile.count() == 1)
		removeProfilePushButton->setEnabled(false);
}
void PropertyWidget_ParEffect::openEnhanced()
{
	if (m_enhanced)
		return;

	QApplication::changeOverrideCursor(QCursor(Qt::WaitCursor));
	m_enhanced = new CharSelectEnhanced(this);
	m_enhanced->setModal(true);
	connect(m_enhanced, SIGNAL(insertSpecialChars(const QString &)), this, SLOT(insertSpecialChars(const QString &)));
	connect(m_enhanced, SIGNAL(paletteShown(bool)), bulletCharTableButton, SLOT(setChecked(bool)));
	m_enhanced->setDoc(m_doc);
	m_enhanced->setEnabled(true);
	QString styleName = peCharStyleCombo->currentText();
	setCurrentComboItem(m_enhanced->fontSelector, m_item->currentStyle().charStyle().font().scName());
	m_enhanced->newFont(m_enhanced->fontSelector->currentIndex());
	m_enhanced->show();
	QApplication::changeOverrideCursor(Qt::ArrowCursor);
}
Пример #23
0
void CharSelectEnhanced::setDoc(ScribusDoc* doc)
{
//     tDebug("CharSelectEnhanced setDoc start");
	if (m_doc != doc)
	{
		m_doc = doc;
		m_charTableModel->setDoc(m_doc);
		delEdit();
		setupRangeCombo();
		newCharClass(1);
	}

	QString oldFont(m_fontInUse);
	m_fontInUse = m_doc->currentStyle.charStyle().font().scName();
	if (oldFont != m_fontInUse && !m_fontInUse.isEmpty())
	{
		setCurrentComboItem(fontSelector, m_fontInUse);
		newFont(fontSelector->currentIndex());
	}
//     tDebug("CharSelectEnhanced setDoc end");
}
Пример #24
0
ExportForm::ExportForm(QWidget* parent, ScribusDoc* doc, int size, int quality, QString type)
	: QDialog(parent, 0), m_doc(doc), m_PageCount(doc->DocPages.count())
{
	setupUi(this);
	setModal(true);
	prefs = PrefsManager::instance()->prefsFile->getPluginContext("pixmapexport");

	QDirModel * dirModel = new QDirModel(this);
	dirModel->setFilter(QDir::AllDirs);
	outputDirectory->setCompleter(new QCompleter(dirModel, this));
	
	outputDirectory->setText( QDir::convertSeparators(prefs->get("wdir", QDir::currentPath())) );
	QList<QByteArray> imgs = QImageWriter::supportedImageFormats();
	for (int a = 0; a < imgs.count(); a++)
	{
		bitmapType->addItem(imgs[a]);
	}
	setCurrentComboItem(bitmapType, type.toLower());
	qualityBox->setValue(quality);
	qualityBox->setWrapping(true);
	
	DPIBox->setValue(size);
	enlargementBox->setValue(size);
	onePageRadio->setChecked( true );
 	pageNrButton->setIcon(loadIcon("ellipsis.png"));
	rangeVal->setEnabled(false);
	pageNrButton->setEnabled(false);

	languageChange();
	readConfig();
	computeSize();
	
	connect(outputDirectoryButton, SIGNAL(clicked()), this, SLOT(OutputDirectoryButton_pressed()));
	connect(intervalPagesRadio, SIGNAL(clicked()), this, SLOT(IntervalPagesRadio_stateChanged()));
	connect(allPagesRadio, SIGNAL(clicked()), this, SLOT(AllPagesRadio_stateChanged()));
	connect(onePageRadio, SIGNAL(clicked()), this, SLOT(OnePageRadio_stateChanged()));
	connect(enlargementBox, SIGNAL(valueChanged(int)), this, SLOT(computeSize()));
	connect(DPIBox, SIGNAL(valueChanged(int)), this, SLOT(computeSize()));
	connect(pageNrButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
}
Пример #25
0
void PageSelector::GotoPg(int a)
{
	disconnect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
	PageCombo->setCurrentIndex(a);
	setCurrentComboItem(PageCombo, QString::number(a+1));
	APage = a+1;
	Back->setEnabled(true);
	Start->setEnabled(true);
	Forward->setEnabled(true);
	Last->setEnabled(true);
	if (a == 0)
	{
		Back->setEnabled(false);
		Start->setEnabled(false);
	}
	if (a == LastPG-1)
	{
		Forward->setEnabled(false);
		Last->setEnabled(false);
	}
	connect( PageCombo, SIGNAL( activated(int) ), this, SLOT( GotoPgE(int) ) );
}
Пример #26
0
void SMCStyleWidget::showLanguage(const QList<CharStyle*> &cstyles, const QString &defLang)
{
	QString emptyString;
	QString s(cstyles[0]->language());
	for (int i = 0; i < cstyles.count(); ++i)
	{
		if (s != cstyles[i]->language())
		{
			s = emptyString;
			break;
		}
		else
			s = cstyles[i]->language();
	}
	if (s.isEmpty())
	{
		if (language_->itemText(language_->count() - 1) != "")
			language_->addItem("");
		language_->setCurrentIndex(language_->count() - 1);
	}
	else
		setCurrentComboItem(language_, LanguageManager::instance()->getLangFromAbbrev(s));
}
Пример #27
0
void PropertiesPalette_Table::on_borderLineList_currentRowChanged(int row)
{
	if (row == -1)
	{
		// No list item selected, so disable editing widgets.
		borderLineWidth->setEnabled(false);
		borderLineWidthLabel->setEnabled(false);
		borderLineColor->setEnabled(false);
		borderLineColorLabel->setEnabled(false);
		borderLineStyle->setEnabled(false);
		borderLineStyleLabel->setEnabled(false);
		borderLineShade->setEnabled(false);
		borderLineShadeLabel->setEnabled(false);
	}
	else
	{
		QList<TableBorderLine> borderLines = m_currentBorder.borderLines();
		Q_ASSERT(borderLineList->count() == borderLines.size());
		TableBorderLine line = borderLines.at(row);

		// Enable editing widgets.
		borderLineWidth->setEnabled(true);
		borderLineWidthLabel->setEnabled(true);
		borderLineColor->setEnabled(true);
		borderLineColorLabel->setEnabled(true);
		borderLineStyle->setEnabled(true);
		borderLineStyleLabel->setEnabled(true);
		borderLineShade->setEnabled(true);
		borderLineShadeLabel->setEnabled(true);

		// Fill in values.
		borderLineWidth->showValue(line.width());
		setCurrentComboItem(borderLineColor, line.color());
		borderLineStyle->setCurrentIndex(static_cast<int>(line.style()) - 1);
		borderLineShade->setValue(line.shade());
	}
}
void Prefs_DocumentSetup::setupPageSizes(struct ApplicationPrefs *prefsData)
{
	PageSize ps(prefsData->docSetupPrefs.pageSize);
	QStringList insertList(ps.activeSizeList());
	QStringList insertTrList(ps.activeSizeTRList());

	prefsPageSizeName = prefsData->docSetupPrefs.pageSize;
	if (insertList.indexOf(prefsPageSizeName) ==-1)
	{
		insertList << prefsPageSizeName;
		insertTrList << prefsPageSizeName;
	}

	QMap<QString, QString> insertMap;
	for (int i = 0; i < insertTrList.count(); ++i)
	{
		QString key = insertTrList.at(i);
		insertMap[key] = insertList.at(i);
	}
	insertTrList.sort();

	pageSizeComboBox->clear();
	for (int i = 0; i < insertList.count(); ++i)
	{
		QString key = insertTrList.at(i);
		pageSizeComboBox->addItem(key, insertMap[key]);
	}
	pageSizeComboBox->addItem(CommonStrings::trCustomPageSize, CommonStrings::customPageSize);

	QString pageSizeName = CommonStrings::trCustomPageSize;
	int index = pageSizeComboBox->findData(prefsPageSizeName);
	if (index >= 0)
		pageSizeName = pageSizeComboBox->itemText(index);
	setCurrentComboItem(pageSizeComboBox, pageSizeName);
	marginsWidget->setPageSize(prefsPageSizeName);
	bleedsWidget->setPageSize(prefsPageSizeName);
}
Пример #29
0
Prefs_TableOfContents::Prefs_TableOfContents(QWidget* parent, ScribusDoc* doc)
	: Prefs_Pane(parent),
	m_Doc(doc)
{
	setupUi(this);
	languageChange();
	itemDestFrameComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemAttrComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemNumberPlacementComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));
	itemParagraphStyleComboBox->setMaximumWidth(fontMetrics().width( "This is a very long Name" ));

	// signals and slots connections
	//do not connect( tocListBox, SIGNAL( currentRowChanged(int) ), this, SLOT( selectToC(int) ) );
	connect( tocAddButton, SIGNAL( clicked() ), this, SLOT( addToC() ) );
	connect( tocDeleteButton, SIGNAL( clicked() ), this, SLOT( deleteToC() ) );
	connect( itemAttrComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemAttributeSelected(const QString&) ) );
	connect( itemDestFrameComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemFrameSelected(const QString&) ) );
	connect( itemParagraphStyleComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemParagraphStyleSelected(const QString&) ) );
	connect( itemNumberPlacementComboBox, SIGNAL( activated(const QString&) ), this, SLOT( itemPageNumberPlacedSelected(const QString&) ) );
	connect( tocNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( setToCName(const QString&) ) );
	connect( itemListNonPrintingCheckBox, SIGNAL( toggled(bool) ), this, SLOT( nonPrintingFramesSelected(bool) ) );
	setCurrentComboItem(itemNumberPlacementComboBox, trStrPNEnd);
	numSelected=999;
}
Пример #30
0
FontReplaceDialog::FontReplaceDialog( QWidget* parent, QMap<QString, QString> *RList) : QDialog( parent )
{
	setModal(true);
	setWindowTitle( tr( "Font Substitution" ) );
	setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
	ReplaceList = RList;
	FontReplaceDialogLayout = new QVBoxLayout( this );
	FontReplaceDialogLayout->setMargin(10);
	FontReplaceDialogLayout->setSpacing(5);

	textLabel1 = new QLabel(this);
	textLabel1->setAlignment(Qt::AlignVCenter);
	textLabel1->setWordWrap(true);
	textLabel1->setText( "<qt>" + tr("This document contains some fonts that are not installed on your system, please choose a suitable replacement for them. Cancel will stop the document from loading.") + "</qt>" );
	FontReplaceDialogLayout->addWidget( textLabel1 );
	
	
	replacementTable = new QTableWidget(0, 2, this );
	replacementTable->setHorizontalHeaderItem(0, new QTableWidgetItem( tr("Original Font")));
	replacementTable->setHorizontalHeaderItem(1, new QTableWidgetItem( tr("Substitution Font")));
	replacementTable->setSortingEnabled(false);
	replacementTable->setSelectionBehavior( QAbstractItemView::SelectRows );
	QHeaderView *header = replacementTable->horizontalHeader();
	header->setSectionsClickable(false );
	header->setSectionsMovable( false );
	header->setSectionResizeMode(QHeaderView::Stretch);
	replacementTable->verticalHeader()->hide();
	replacementTable->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
	replacementTable->setRowCount(RList->count());
	int a = 0;
	QMap<QString,QString>::Iterator itfsu;
	for (itfsu = RList->begin(); itfsu != RList->end(); ++itfsu)
	{
		replacementTable->setItem(a, 0, new QTableWidgetItem(itfsu.key()));
		FontCombo* item = new FontCombo(this);
		setCurrentComboItem(item, itfsu.value());
		replacementTable->setCellWidget(a, 1, item);
		a++;
	}
	FontReplaceDialogLayout->addWidget( replacementTable );

	layout1 = new QHBoxLayout;
	layout1->setMargin(0);
	layout1->setSpacing(5);
	stickyReplacements = new QCheckBox( this );
	stickyReplacements->setText( tr( "Make these substitutions permanent" ) );
	layout1->addWidget( stickyReplacements );
	QSpacerItem* spacer1 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
	layout1->addItem( spacer1 );
	okButton = new QPushButton( CommonStrings::tr_OK, this );
	layout1->addWidget( okButton );
	cancelButton = new QPushButton( CommonStrings::tr_Cancel, this );
	layout1->addWidget( cancelButton );
	FontReplaceDialogLayout->addLayout( layout1 );
	resize( QSize(450, 250) );

	cancelButton->setToolTip( "<qt>" + tr( "Cancels these font substitutions and stops loading the document.") + "</qt>" );
	stickyReplacements->setToolTip( "<qt>" + tr( "Enabling this tells Scribus to use these replacements for missing fonts permanently in all future layouts. This can be reverted or changed in File > Preferences > Fonts.") + "</qt>" );
	okButton->setToolTip( "<qt>" + tr( "If you select OK, then save, these substitutions are made permanent in the document.") + "</qt>" );
	connect(okButton, SIGNAL(clicked()), this, SLOT(leaveOK()));
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}