r16036 by jghali - merge trunk revisions up to r16035
scribus-commit
scribus-commit at lists.scribus.net
Tue Nov 30 00:00:10 CET 2010
Author: jghali
Date: Mon Nov 29 23:00:10 2010
New Revision: 16036
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16036
Log:
merge trunk revisions up to r16035
Modified:
branches/ScribusOIF/scribus/scribus.cpp
branches/ScribusOIF/scribus/scribusdoc.cpp
branches/ScribusOIF/scribus/ui/cpalette.cpp
branches/ScribusOIF/scribus/ui/cpalette.h
branches/ScribusOIF/scribus/ui/paintmanager.cpp
branches/ScribusOIF/scribus/ui/scmenu.cpp
branches/ScribusOIF/scribus/ui/symbolpalette.cpp
branches/ScribusOIF/scribus/ui/symbolpalette.h
branches/ScribusOIF/scribus/ui/transparencypalette.cpp
branches/ScribusOIF/scribus/ui/transparencypalette.h
Modified: branches/ScribusOIF/scribus/scribus.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/scribus.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribus.cpp (original)
+++ branches/ScribusOIF/scribus/scribus.cpp Mon Nov 29 23:00:10 2010
@@ -217,6 +217,7 @@
#include "tocgenerator.h"
//#include "ui/tocindexprefs.h"
#include "ui/transformdialog.h"
+#include "ui/transparencypalette.h"
#include "ui/copypagetomasterpagedialog.h"
#include "ui/edittoolbar.h"
#include "ui/filetoolbar.h"
@@ -8499,7 +8500,22 @@
scrActions["toolsPDFAnnot3D"]->setEnabled(false);
#endif
pagePalette->enablePalette(false);
- symbolPalette->editingStart(temp);
+ QStringList patterns2Del;
+ QStringList mainPatterns = doc->docPatterns.keys();
+ for (int a = 0; a < mainPatterns.count(); a++)
+ {
+ if (mainPatterns[a] != temp)
+ {
+ QStringList subPatterns;
+ subPatterns = doc->getUsedPatternsHelper(mainPatterns[a], subPatterns);
+ if (subPatterns.contains(temp))
+ patterns2Del.append(mainPatterns[a]);
+ }
+ }
+ patterns2Del.append(temp);
+ symbolPalette->editingStart(patterns2Del);
+ propertiesPalette->Cpal->hideEditedPatterns(patterns2Del);
+ propertiesPalette->Tpal->hideEditedPatterns(patterns2Del);
updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp));
}
}
Modified: branches/ScribusOIF/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/scribusdoc.cpp
==============================================================================
--- branches/ScribusOIF/scribus/scribusdoc.cpp (original)
+++ branches/ScribusOIF/scribus/scribusdoc.cpp Mon Nov 29 23:00:10 2010
@@ -2890,19 +2890,20 @@
}
const QString& pat2 = pat->items.at(c)->strokePattern();
if (!pat2.isEmpty() && !results.contains(pat2))
- results.append(pat->items.at(c)->strokePattern());
+ pats.append(pat->items.at(c)->strokePattern());
const QString& pat3 = pat->items.at(c)->patternMask();
if (!pat3.isEmpty() && !results.contains(pat3))
- results.append(pat->items.at(c)->patternMask());
+ pats.append(pat->items.at(c)->patternMask());
}
if (!pats.isEmpty())
{
+ results = pats;
for (int c = 0; c < pats.count(); ++c)
{
getUsedPatternsHelper(pats[c], results);
}
}
- return pats;
+ return results;
}
QStringList ScribusDoc::getUsedSymbols()
Modified: branches/ScribusOIF/scribus/ui/cpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/cpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.cpp Mon Nov 29 23:00:10 2010
@@ -688,6 +688,19 @@
connect(patternBox, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(selectPattern(QListWidgetItem*)));
}
+void Cpalette::hideEditedPatterns(QStringList names)
+{
+ for (int a = 0; a < names.count(); a++)
+ {
+ QList<QListWidgetItem*> items = patternBox->findItems(names[a], Qt::MatchExactly);
+ if (items.count() > 0)
+ items[0]->setHidden(true);
+ items = patternBoxStroke->findItems(names[a], Qt::MatchExactly);
+ if (items.count() > 0)
+ items[0]->setHidden(true);
+ }
+}
+
void Cpalette::setPatterns(QMap<QString, ScPattern> *docPatterns)
{
patternList = docPatterns;
Modified: branches/ScribusOIF/scribus/ui/cpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/cpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/cpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/cpalette.h Mon Nov 29 23:00:10 2010
@@ -93,6 +93,7 @@
void setNamedGradientStroke(const QString &name);
void selectPattern(QListWidgetItem *c);
void selectPatternS(QListWidgetItem *c);
+ void hideEditedPatterns(QStringList names);
void updatePatternList();
void updateGradientList();
void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
Modified: branches/ScribusOIF/scribus/ui/paintmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/paintmanager.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/paintmanager.cpp (original)
+++ branches/ScribusOIF/scribus/ui/paintmanager.cpp Mon Nov 29 23:00:10 2010
@@ -917,17 +917,43 @@
pats.clear();
for (int c = 0; c < pat->items.count(); ++c)
{
+ if ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol))
+ {
+ const QString& patName = pat->items.at(c)->pattern();
+ if (!patName.isEmpty() && !results.contains(patName))
+ pats.append(patName);
+ }
+ const QString& pat2 = pat->items.at(c)->strokePattern();
+ if (!pat2.isEmpty() && !results.contains(pat2))
+ pats.append(pat->items.at(c)->strokePattern());
+ const QString& pat3 = pat->items.at(c)->patternMask();
+ if (!pat3.isEmpty() && !results.contains(pat3))
+ pats.append(pat->items.at(c)->patternMask());
+ }
+ if (!pats.isEmpty())
+ {
+ results = pats;
+ for (int c = 0; c < pats.count(); ++c)
+ {
+ getUsedPatternsHelper(pats[c], results);
+ }
+ }
+/* QStringList pats;
+ pats.clear();
+ for (int c = 0; c < pat->items.count(); ++c)
+ {
if ((!results.contains(pat->items.at(c)->pattern())) && ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol)))
pats.append(pat->items.at(c)->pattern());
}
if (!pats.isEmpty())
{
+ results = pats;
for (int c = 0; c < pats.count(); ++c)
{
getUsedPatternsHelper(pats[c], results);
}
- }
- return pats;
+ } */
+ return results;
}
void PaintManagerDialog::removeUnusedColorItem()
Modified: branches/ScribusOIF/scribus/ui/scmenu.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/scmenu.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/scmenu.cpp (original)
+++ branches/ScribusOIF/scribus/ui/scmenu.cpp Mon Nov 29 23:00:10 2010
@@ -197,8 +197,9 @@
// return false;
#ifdef Q_WS_MAC
- if (newMenuAction->icon().isNull() && ! (afterMenuAction->icon().isNull()))
- newMenuAction->setIcon(loadIcon("noicon.xpm"));
+ if (newMenuAction && afterMenuAction)
+ if (newMenuAction->icon().isNull() && ! (afterMenuAction->icon().isNull()))
+ newMenuAction->setIcon(loadIcon("noicon.xpm"));
#endif
int pos=menuItemList.indexOf(QPointer<QObject>(afterMenuAction));
Modified: branches/ScribusOIF/scribus/ui/symbolpalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/symbolpalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/symbolpalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/symbolpalette.cpp Mon Nov 29 23:00:10 2010
@@ -96,8 +96,7 @@
unsetDoc();
m_scMW = NULL;
- editItemName = "";
- editItem = NULL;
+ editItemNames.clear();
languageChange();
connect(SymbolViewWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(handleDoubleClick(QListWidgetItem *)));
}
@@ -108,41 +107,21 @@
emit startEdit(item->text());
}
-void SymbolPalette::editingStart(QString name)
+void SymbolPalette::editingStart(QStringList names)
{
- editItemName = name;
- QList<QListWidgetItem *> items = SymbolViewWidget->findItems(name, Qt::MatchExactly);
- if (items.count() > 0)
+ editItemNames = names;
+ for (int a = 0; a < editItemNames.count(); a++)
{
- editItem = items[0];
- editItem->setFlags(0);
+ QList<QListWidgetItem*> items = SymbolViewWidget->findItems(names[a], Qt::MatchExactly);
+ if (items.count() > 0)
+ items[0]->setFlags(0);
}
}
void SymbolPalette::editingFinished()
{
- if (!editItemName.isEmpty())
- {
- QPixmap pm;
- ScPattern pa = currDoc->docPatterns[editItemName];
- if (pa.getPattern()->width() >= pa.getPattern()->height())
- pm = QPixmap::fromImage(pa.getPattern()->scaledToWidth(48, Qt::SmoothTransformation));
- else
- pm = QPixmap::fromImage(pa.getPattern()->scaledToHeight(48, Qt::SmoothTransformation));
- QPixmap pm2(48, 48);
- pm2.fill(palette().color(QPalette::Base));
- QPainter p;
- p.begin(&pm2);
- p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
- p.end();
- if (editItem != NULL)
- {
- editItem->setIcon(pm2);
- editItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
- }
- }
- editItemName = "";
- editItem = NULL;
+ editItemNames.clear();
+ updateSymbolList();
}
void SymbolPalette::setMainWindow(ScribusMainWindow *mw)
@@ -188,11 +167,8 @@
p.drawPixmap(24 - pm.width() / 2, 24 - pm.height() / 2, pm);
p.end();
QListWidgetItem *item = new QListWidgetItem(pm2, it.key(), SymbolViewWidget);
- if (it.key() == editItemName)
- {
+ if (editItemNames.contains(it.key()))
item->setFlags(0);
- editItem = item;
- }
else
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
}
Modified: branches/ScribusOIF/scribus/ui/symbolpalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/symbolpalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/symbolpalette.h (original)
+++ branches/ScribusOIF/scribus/ui/symbolpalette.h Mon Nov 29 23:00:10 2010
@@ -67,7 +67,7 @@
void setMainWindow(ScribusMainWindow *mw);
void setDoc(ScribusDoc *);
void unsetDoc();
- void editingStart(QString name);
+ void editingStart(QStringList names);
void editingFinished();
void updateSymbolList();
@@ -86,8 +86,7 @@
QVBoxLayout* PaletteLayout;
ScribusDoc *currDoc;
ScribusMainWindow *m_scMW;
- QListWidgetItem *editItem;
- QString editItemName;
+ QStringList editItemNames;
};
#endif
Modified: branches/ScribusOIF/scribus/ui/transparencypalette.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/transparencypalette.cpp
==============================================================================
--- branches/ScribusOIF/scribus/ui/transparencypalette.cpp (original)
+++ branches/ScribusOIF/scribus/ui/transparencypalette.cpp Mon Nov 29 23:00:10 2010
@@ -364,6 +364,16 @@
{
if (TGradDia)
TGradDia->setValues(x1, y1, x2, y2, fx, fy, sg, sk, 0, 0);
+}
+
+void Tpalette::hideEditedPatterns(QStringList names)
+{
+ for (int a = 0; a < names.count(); a++)
+ {
+ QList<QListWidgetItem*> items = patternBox->findItems(names[a], Qt::MatchExactly);
+ if (items.count() > 0)
+ items[0]->setHidden(true);
+ }
}
void Tpalette::updatePatternList()
Modified: branches/ScribusOIF/scribus/ui/transparencypalette.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16036&path=/branches/ScribusOIF/scribus/ui/transparencypalette.h
==============================================================================
--- branches/ScribusOIF/scribus/ui/transparencypalette.h (original)
+++ branches/ScribusOIF/scribus/ui/transparencypalette.h Mon Nov 29 23:00:10 2010
@@ -84,6 +84,7 @@
void switchPatternMode();
void editGradientVector();
void setActiveGradDia(bool active);
+ void hideEditedPatterns(QStringList names);
void updatePatternList();
void selectPattern(QListWidgetItem *c);
void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
More information about the scribus-commit
mailing list