Пример #1
0
gradientManagerDialog::gradientManagerDialog(QWidget* parent, QMap<QString, VGradient> *docGradients, ColorList doco, ScribusDoc *doc, ScribusMainWindow *scMW) : QDialog(parent)
{
	setupUi(this);
	setModal(true);
	m_doc = doc;
	m_colorList = doco;
	mainWin = scMW;
	gradientsList->clear();
	for (QMap<QString, VGradient>::Iterator it = docGradients->begin(); it != docGradients->end(); ++it)
	{
		dialogGradients.insert(it.key(), it.value());
		origNames.insert(it.key(), it.key());
	}
	origGradients = docGradients->keys();
	updateGradientList();
	replaceMap.clear();
	buttonRemove->setEnabled(false);
	buttonEdit->setEnabled(false);
	hasImportedColors = false;
	connect(buttonOK, SIGNAL(clicked()), this, SLOT(accept()));
	connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
	connect(buttonAdd, SIGNAL(clicked()), this, SLOT(addGradient()));
	connect(buttonRemove, SIGNAL(clicked()), this, SLOT(removeGradient()));
	connect(buttonRemoveAll, SIGNAL(clicked()), this, SLOT(removeAllGradients()));
	connect(buttonEdit, SIGNAL(clicked()), this, SLOT(editGradient()));
	connect(gradientsList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(gradientSelected(QListWidgetItem*)));
	connect(buttonLoad, SIGNAL(clicked()), this, SLOT(loadGradients()));
	connect(buttonSave, SIGNAL(clicked()), this, SLOT(saveGradients()));
}
PropertiesPalette_Group::PropertiesPalette_Group( QWidget* parent) : QWidget(parent)
{
	m_ScMW = 0;
	m_doc  = 0;
	m_item = 0;
	m_haveDoc   = false;
	m_haveItem  = false;
	m_unitIndex = 0;
	m_unitRatio = 1.0;
	m_userActionOn = false;

	m_tmpSelection = new Selection(this, false);
	m_tmpSelection->clear();

	setupUi(this);
	setSizePolicy( QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));

	textFlowDisabled->setIcon(IconManager::instance()->loadIcon("flow-none.png"));
	textFlowUsesFrameShape->setIcon(IconManager::instance()->loadIcon("flow-frame.png"));
	textFlowUsesBoundingBox->setIcon(IconManager::instance()->loadIcon("flow-bounding.png"));
	textFlowUsesContourLine->setIcon(IconManager::instance()->loadIcon("flow-contour.png"));
	textFlowUsesImageClipping->setIcon(IconManager::instance()->loadIcon("flow-contour.png"));

	textFlowDisabled->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
	textFlowUsesFrameShape->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
	textFlowUsesBoundingBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
	textFlowUsesContourLine->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
	textFlowUsesImageClipping->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));

	transPalWidget->hideSelectionButtons();

	languageChange();

	connect(textFlowBtnGroup, SIGNAL(buttonClicked(int)), this, SLOT(handleTextFlow()));

	connect(customShape  , SIGNAL(FormSel(int, int, qreal *)), this, SLOT(handleNewShape(int, int, qreal *)));
	connect(editShape    , SIGNAL(clicked())                 , this, SLOT(handleShapeEdit()));
	connect(evenOdd      , SIGNAL(clicked())                 , this, SLOT(handleFillRule()) );
	connect(nonZero      , SIGNAL(clicked())                 , this, SLOT(handleFillRule()) );
	connect(clipGroups   , SIGNAL(clicked())                 , this, SLOT(handleClipping()) );
	connect(transPalWidget , SIGNAL(editGradient())          , this, SLOT(handleGradientEdit()));
	connect(transPalWidget , SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SLOT(handleSpecialGradient(double, double, double, double, double, double, double, double )));
}