r21121 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Sat Mar 26 23:10:56 UTC 2016
Author: jghali
Date: Sat Mar 26 23:10:56 2016
New Revision: 21121
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21121
Log:
#13855: Style Manager does not update available colors after importing PDF/SVG files
Modified:
trunk/Scribus/scribus/ui/smcellstyle.cpp
trunk/Scribus/scribus/ui/smcellstylewidget.cpp
trunk/Scribus/scribus/ui/smcellstylewidget.h
trunk/Scribus/scribus/ui/smcstylewidget.cpp
trunk/Scribus/scribus/ui/smcstylewidget.h
trunk/Scribus/scribus/ui/smpstylewidget.cpp
trunk/Scribus/scribus/ui/smtablestyle.cpp
trunk/Scribus/scribus/ui/smtablestylewidget.cpp
trunk/Scribus/scribus/ui/smtablestylewidget.h
trunk/Scribus/scribus/ui/smtextstyles.cpp
Modified: trunk/Scribus/scribus/ui/smcellstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smcellstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smcellstyle.cpp Sat Mar 26 23:10:56 2016
@@ -58,21 +58,10 @@
{
m_doc = doc;
+ if (m_page)
+ m_page->setDoc(doc);
+
if (!m_doc)
- {
- removeConnections();
- m_selection.clear();
- m_cachedStyles.clear();
- }
-
- if (m_doc)
- {
- if (m_page)
- {
- m_page->fillFillColorCombo(m_doc->PageColors);
- }
- }
- else
{
removeConnections();
m_selection.clear();
Modified: trunk/Scribus/scribus/ui/smcellstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smcellstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.cpp Sat Mar 26 23:10:56 2016
@@ -10,7 +10,8 @@
#include "smcellstylewidget.h"
#include "iconmanager.h"
-SMCellStyleWidget::SMCellStyleWidget(QWidget *parent) : QWidget()
+SMCellStyleWidget::SMCellStyleWidget(QWidget *parent) : QWidget(),
+ m_Doc(0)
{
setupUi(this);
@@ -31,6 +32,26 @@
QWidget::changeEvent(e);
}
+void SMCellStyleWidget::handleUpdateRequest(int updateFlags)
+{
+ if (!m_Doc)
+ return;
+ if (updateFlags & reqColorsUpdate)
+ fillFillColorCombo(m_Doc->PageColors);
+}
+
+void SMCellStyleWidget::setDoc(ScribusDoc* doc)
+{
+ if (m_Doc)
+ disconnect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+
+ m_Doc = doc;
+ if (!m_Doc)
+ return;
+
+ fillFillColorCombo(m_Doc->PageColors);
+ connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+}
void SMCellStyleWidget::show(CellStyle *cellStyle, QList<CellStyle> &cellStyles, const QString &defLang, int unitIndex)
{
Modified: trunk/Scribus/scribus/ui/smcellstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smcellstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.h Sat Mar 26 23:10:56 2016
@@ -28,6 +28,8 @@
SMCellStyleWidget(QWidget *parent = 0);
/// Destructor.
~SMCellStyleWidget();
+
+ void setDoc(ScribusDoc* doc);
virtual void changeEvent(QEvent *e);
/**
@@ -64,6 +66,12 @@
*/
void fillFillColorCombo(ColorList &colors);
void showColors(const QList<CellStyle*> &cellStyles);
+
+private:
+ ScribusDoc * m_Doc;
+
+private slots:
+ void handleUpdateRequest(int);
};
#endif // SMCELLSTYLEWIDGET_H
Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Sat Mar 26 23:10:56 2016
@@ -7,14 +7,16 @@
#include <QEvent>
+#include "iconmanager.h"
#include "langmgr.h"
+#include "scribus.h"
#include "smcstylewidget.h"
-#include "iconmanager.h"
#include "util.h"
#include "units.h"
-SMCStyleWidget::SMCStyleWidget(QWidget *parent) : QWidget()
+SMCStyleWidget::SMCStyleWidget(QWidget *parent) : QWidget(),
+ m_Doc(0)
{
setupUi(this);
@@ -189,6 +191,32 @@
backColor_->view()->setMinimumWidth(backColor_->view()->maximumViewportSize().width()+24);
}
+void SMCStyleWidget::handleUpdateRequest(int updateFlags)
+{
+ if (!m_Doc)
+ return;
+ if (updateFlags & reqColorsUpdate)
+ fillColorCombo(m_Doc->PageColors);
+}
+
+void SMCStyleWidget::setDoc(ScribusDoc *doc)
+{
+ if (m_Doc)
+ disconnect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+
+ m_Doc = doc;
+ if (!m_Doc)
+ return;
+
+ QStringList languageList;
+ LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
+ fillLangComboFromList(languageList);
+ fillColorCombo(m_Doc->PageColors);
+ fontFace_->RebuildList(m_Doc);
+
+ connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+}
+
void SMCStyleWidget::show(CharStyle *cstyle, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex)
{
disconnect(effects_, SIGNAL(State(int)), this, SLOT(slotColorChange()));
Modified: trunk/Scribus/scribus/ui/smcstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smcstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.h Sat Mar 26 23:10:56 2016
@@ -24,6 +24,7 @@
virtual void changeEvent(QEvent *e);
+ void setDoc(ScribusDoc* doc);
void show(CharStyle *cstyle, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex);
void show(QList<CharStyle*> &cstyles, QList<CharStyle> &cstylesAll, const QString &defLang, int unitIndex);
//void fillLangCombo(QMap<QString,QString> langMap);
@@ -34,6 +35,7 @@
private:
//QMap<QString, QString> m_langMap;
+ ScribusDoc * m_Doc;
void showSizeAndPosition(const QList<CharStyle*> &cstyles);
void showEffects(const QList<CharStyle*> &cstyles);
@@ -46,6 +48,7 @@
private slots:
void slotColorChange();
+ void handleUpdateRequest(int);
};
#endif
Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Sat Mar 26 23:10:56 2016
@@ -262,6 +262,7 @@
{
if (m_Doc)
disconnect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+
m_Doc = doc;
if (m_Doc)
{
@@ -269,6 +270,8 @@
fillColorCombo(m_Doc->PageColors);
fillNumerationsCombo();
}
+
+ cpage->setDoc(m_Doc);
}
void SMPStyleWidget::fillColorCombo(ColorList &colors)
Modified: trunk/Scribus/scribus/ui/smtablestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smtablestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestyle.cpp (original)
+++ trunk/Scribus/scribus/ui/smtablestyle.cpp Sat Mar 26 23:10:56 2016
@@ -54,21 +54,10 @@
{
m_doc = doc;
+ if (m_page)
+ m_page->setDoc(doc);
+
if (!m_doc)
- {
- removeConnections();
- m_selection.clear();
- m_cachedStyles.clear();
- }
-
- if (m_doc)
- {
- if (m_page)
- {
- m_page->fillFillColorCombo(m_doc->PageColors);
- }
- }
- else
{
removeConnections();
m_selection.clear();
Modified: trunk/Scribus/scribus/ui/smtablestylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smtablestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smtablestylewidget.cpp Sat Mar 26 23:10:56 2016
@@ -10,7 +10,8 @@
#include "smtablestylewidget.h"
#include "iconmanager.h"
-SMTableStyleWidget::SMTableStyleWidget(QWidget *parent) : QWidget()
+SMTableStyleWidget::SMTableStyleWidget(QWidget *parent) : QWidget(),
+ m_Doc(0)
{
setupUi(this);
@@ -29,6 +30,27 @@
languageChange();
else
QWidget::changeEvent(e);
+}
+
+void SMTableStyleWidget::handleUpdateRequest(int updateFlags)
+{
+ if (!m_Doc)
+ return;
+ if (updateFlags & reqColorsUpdate)
+ fillFillColorCombo(m_Doc->PageColors);
+}
+
+void SMTableStyleWidget::setDoc(ScribusDoc* doc)
+{
+ if (m_Doc)
+ disconnect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
+
+ m_Doc = doc;
+ if (!m_Doc)
+ return;
+
+ fillFillColorCombo(m_Doc->PageColors);
+ connect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
}
void SMTableStyleWidget::show(TableStyle *tableStyle, QList<TableStyle> &tableStyles, const QString &defLang, int unitIndex)
Modified: trunk/Scribus/scribus/ui/smtablestylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smtablestylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smtablestylewidget.h Sat Mar 26 23:10:56 2016
@@ -28,6 +28,8 @@
SMTableStyleWidget(QWidget *parent = 0);
/// Destructor.
~SMTableStyleWidget();
+
+ void setDoc(ScribusDoc* doc);
virtual void changeEvent(QEvent *e);
/**
@@ -64,6 +66,12 @@
*/
void fillFillColorCombo(ColorList &colors);
void showColors(const QList<TableStyle*> &tableStyles);
+
+private:
+ ScribusDoc * m_Doc;
+
+private slots:
+ void handleUpdateRequest(int);
};
#endif // SMTABLESTYLEWIDGET_H
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21121&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Sat Mar 26 23:10:56 2016
@@ -71,25 +71,20 @@
{
if (m_pwidget)
{
- QStringList languageList;
- LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
- m_pwidget->cpage->fillLangComboFromList(languageList);
- m_pwidget->cpage->fillColorCombo(m_doc->PageColors);
- m_pwidget->cpage->fontFace_->RebuildList(m_doc);
- m_pwidget->fillColorCombo(m_doc->PageColors);
+ m_pwidget->setDoc(m_doc);
if (m_unitRatio != m_doc->unitRatio())
unitChange();
}
}
else
{
+ if (m_pwidget)
+ m_pwidget->setDoc(0);
removeConnections();
m_selection.clear();
m_tmpStyles.clear();
m_deleted.clear();
}
- if (m_pwidget)
- m_pwidget->setDoc(doc);
}
StyleSet<ParagraphStyle>* SMParagraphStyle::tmpStyles()
@@ -1936,24 +1931,15 @@
void SMCharacterStyle::setCurrentDoc(ScribusDoc *doc)
{
m_doc = doc;
- if (m_doc)
- {
- if (m_page)
- {
- QStringList languageList;
- LanguageManager::instance()->fillInstalledHyphStringList(&languageList);
- m_page->fillLangComboFromList(languageList);
- m_page->fillColorCombo(m_doc->PageColors);
- m_page->fontFace_->RebuildList(m_doc);
- }
- }
- else
+ if (m_page)
+ m_page->setDoc(doc);
+
+ if (!m_doc)
{
removeConnections();
m_selection.clear();
m_tmpStyles.clear();
}
-
}
StyleSet<CharStyle>* SMCharacterStyle::tmpStyles()
More information about the scribus-commit
mailing list