示例#1
0
void MainWindow::PathsConfig()
{
	PathDialog* paths = new PathDialog(this);
	connect(paths, &PathDialog::PathAdded, m_game_list, &GameList::DirectoryAdded);
	connect(paths, &PathDialog::PathRemoved, m_game_list, &GameList::DirectoryRemoved);
	paths->exec();
}
示例#2
0
bool PathAlongPathPlugin::run(ScribusDoc* doc, QString)
{
	firstUpdate = true;
	currDoc = doc;
	originalPathG.clear();
	originalRotG.clear();
	originalXPosG.clear();
	originalYPosG.clear();
	patternItemG.clear();
	if (currDoc == 0)
		currDoc = ScCore->primaryMainWindow()->doc;
	if (currDoc->m_Selection->count() > 1)
	{
		if ((currDoc->m_Selection->itemAt(0)->Groups.count() != 0) || (currDoc->m_Selection->itemAt(1)->Groups.count() != 0))
		{
			selOffs = 0;
			selCount = currDoc->m_Selection->count() - 1;
			if (currDoc->m_Selection->itemAt(0)->Groups.count() == 0)
			{
				pathItem = currDoc->m_Selection->itemAt(0);
				selOffs = 1;
			}
			else
				pathItem = currDoc->m_Selection->itemAt(selCount);
			effectPath = pathItem->PoLine.copy();
			QTransform mp;
			mp.rotate(pathItem->rotation());
			effectPath.map(mp);
			for (int bx = 0; bx < selCount; ++bx)
			{
				PageItem* bxi = currDoc->m_Selection->itemAt(bx + selOffs);
				originalPathG.append(bxi->PoLine.copy());
				originalXPosG.append(bxi->xPos());
				originalYPosG.append(bxi->yPos());
				originalRotG.append(bxi->rotation());
				patternItemG.append(bxi);
			}
			QPainterPath tmpPath = effectPath.toQPainterPath(false);
			PathDialog *dia = new PathDialog(currDoc->scMW(), currDoc->unitIndex(), tmpPath.length(), true);
			connect(dia, SIGNAL(updateValues(int, double, double, double, int)), this, SLOT(updateEffectG(int, double, double, double, int)));
			if (dia->exec())
			{
				updateEffectG(dia->effectType, dia->offset, dia->offsetY, dia->gap, dia->rotate);
				currDoc->changed();
			}
			else
			{
				updateEffectG(-1, dia->offset, dia->offsetY, dia->gap, dia->rotate);
				currDoc->view()->DrawNew();
			}
			delete dia;
		}
		else
		{
示例#3
0
bool PathAlongPathPlugin::run(ScribusDoc* doc, QString)
{
	firstUpdate = true;
	m_doc = doc;
	originalPathG.clear();
	originalRotG.clear();
	originalXPosG.clear();
	originalYPosG.clear();
	patternItemG.clear();
	if (m_doc == 0)
		m_doc = ScCore->primaryMainWindow()->doc;
	if (m_doc->m_Selection->count() > 1)
	{
		if ((m_doc->m_Selection->itemAt(0)->isGroup()) || (m_doc->m_Selection->itemAt(1)->isGroup()))
		{
			selOffs = 0;
			selCount = m_doc->m_Selection->count() - 1;
			if (!m_doc->m_Selection->itemAt(0)->isGroup())
			{
				pathItem = m_doc->m_Selection->itemAt(0);
				selOffs = 1;
			}
			else
				pathItem = m_doc->m_Selection->itemAt(selCount);
			effectPath = pathItem->PoLine.copy();
			QTransform mp;
			mp.rotate(pathItem->rotation());
			effectPath.map(mp);
			PageItem* bxi = m_doc->m_Selection->itemAt(selOffs);
			bxi->asGroupFrame()->adjustXYPosition();
			originalPathG.append(bxi->PoLine.copy());
			originalXPosG.append(bxi->xPos());
			originalYPosG.append(bxi->yPos());
			originalXPosGi.append(bxi->gXpos);
			originalYPosGi.append(bxi->gYpos);
			originalRotG.append(bxi->rotation());
			originalWidth.append(bxi->width());
			originalHeight.append(bxi->height());
			originalWidthG.append(bxi->groupWidth);
			originalHeightG.append(bxi->groupHeight);
			patternItemG.append(bxi);
			QList<PageItem*> bxiL = bxi->getItemList();
			for (int bx = 0; bx < bxiL.count(); ++bx)
			{
				PageItem* cIte = bxiL.at(bx);
				originalPathG.append(cIte->PoLine.copy());
				originalXPosG.append(cIte->xPos());
				originalYPosG.append(cIte->yPos());
				originalWidth.append(cIte->width());
				originalHeight.append(cIte->height());
				originalWidthG.append(cIte->groupWidth);
				originalHeightG.append(cIte->groupHeight);
				originalXPosGi.append(cIte->gXpos);
				originalYPosGi.append(cIte->gYpos);
				originalRotG.append(cIte->rotation());
				patternItemG.append(cIte);
			}
			QPainterPath tmpPath = effectPath.toQPainterPath(false);
			PathDialog *dia = new PathDialog(m_doc->scMW(), m_doc->unitIndex(), tmpPath.length(), true);
			connect(dia, SIGNAL(updateValues(int, double, double, double, int)), this, SLOT(updateEffectG(int, double, double, double, int)));
			if (dia->exec())
			{
				updateEffectG(dia->effectType, dia->offset, dia->offsetY, dia->gap, dia->rotate);
				m_doc->changed();
			}
			else
			{
				updateEffectG(-1, dia->offset, dia->offsetY, dia->gap, dia->rotate);
				m_doc->view()->DrawNew();
			}
			delete dia;
		}
		else
		{