-
Notifications
You must be signed in to change notification settings - Fork 0
/
image-load-responsiveness.patch
160 lines (156 loc) · 4.99 KB
/
image-load-responsiveness.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
Index: Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (Revision 26264)
+++ Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (Arbeitskopie)
@@ -277,6 +277,7 @@
m_mwProgressBar->setValue(reader.characterOffset());
progress = newProgress;
}
+ QApplication::processEvents();
}
if (firstElement)
Index: Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (Revision 26264)
+++ Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (Arbeitskopie)
@@ -1679,6 +1679,7 @@
m_mwProgressBar->setValue(reader.characterOffset());
progress = newProgress;
}
+ QApplication::processEvents();
}
if (firstElement)
Index: Scribus/scribus/scribus.cpp
===================================================================
--- Scribus/scribus/scribus.cpp (Revision 26264)
+++ Scribus/scribus/scribus.cpp (Arbeitskopie)
@@ -1552,7 +1552,43 @@
m_statusLabelText = newText;
}
+void ScribusMainWindow::setProgressBarMaxToImageCount()
+{
+ if (!doc)
+ {
+ mainWindowProgressBar->setMaximum(0);
+ return;
+ }
+ QList<PageItem*> items(doc->MasterItems);
+ items += doc->DocItems;
+ items += doc->FrameItems.values();
+ int docItemCount = items.count();
+ int docImageCount = 0;
+ QList<PageItem*> allItems;
+ PageItem* it;
+ for (int i=0; i < docItemCount; ++i)
+ {
+ it = items.at(i);
+ if (it->isGroup())
+ allItems = it->getAllChildren();
+ else
+ allItems.append(it);
+ for (int j = 0; j < allItems.count(); j++)
+ {
+ it = allItems.at(j);
+ if ((it->itemType() == PageItem::ImageFrame) && (it->imageIsAvailable))
+ {
+ docImageCount++;
+ break; // the inner for loop
+ }
+ }
+ allItems.clear();
+ }
+ mainWindowProgressBar->setMaximum(docImageCount);
+}
+
+
//AV to be replaced with Selection::update and listener in contentPalette
void ScribusMainWindow::setTBvals(PageItem *currItem)
{
@@ -3562,8 +3598,12 @@
}
if (doc->HasCMS)
{
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
recalcColors();
- doc->RecalcPictures(&ScCore->InputProfiles, &ScCore->InputProfilesCMYK);
+ setProgressBarMaxToImageCount();
+ mainWindowProgressBar->setValue(0);
+ doc->RecalcPictures(&ScCore->InputProfiles, &ScCore->InputProfilesCMYK, mainWindowProgressBar);
+ QApplication::restoreOverrideCursor();
}
}
else
Index: Scribus/scribus/scribus.h
===================================================================
--- Scribus/scribus/scribus.h (Revision 26264)
+++ Scribus/scribus/scribus.h (Arbeitskopie)
@@ -300,6 +300,7 @@
void setStatusBarTextSelectedItemInfo();
void setTempStatusBarText(const QString &text);
void setStatusBarInfoText(const QString& newText);
+ void setProgressBarMaxToImageCount();
bool DoFileClose();
void windowsMenuAboutToShow();
//! \brief Handle the Extras menu for its items availability.
Index: Scribus/scribus/scribusdoc.cpp
===================================================================
--- Scribus/scribus/scribusdoc.cpp (Revision 26264)
+++ Scribus/scribus/scribusdoc.cpp (Arbeitskopie)
@@ -963,8 +963,7 @@
{
m_ScMW->setStatusBarInfoText( tr("Adjusting Colors"));
m_ScMW->mainWindowProgressBar->reset();
- int progressBarCount = PageColors.count() + MasterItems.count() + DocItems.count() + FrameItems.count();
- m_ScMW->mainWindowProgressBar->setMaximum(progressBarCount);
+ m_ScMW->setProgressBarMaxToImageCount();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
bool oldCM = m_docPrefsData.colorPrefs.DCMSset.CMSinUse;
bool newCM = enable;
@@ -1002,7 +1001,6 @@
SetDefaultCMSParams();
HasCMS = false;
}
- m_ScMW->mainWindowProgressBar->setValue(progressBarCount);
QApplication::restoreOverrideCursor();
m_ScMW->setStatusBarInfoText("");
m_ScMW->mainWindowProgressBar->reset();
@@ -7327,6 +7325,7 @@
int docItemCount = items->count();
for (int i=0; i < docItemCount; ++i)
{
+ bool any = false;
it = items->at(i);
if (it->isGroup())
allItems = it->getAllChildren();
@@ -7348,14 +7347,19 @@
it->ImageProfile = m_docPrefsData.colorPrefs.DCMSset.DefaultImageRGBProfile;
}
loadPict(it->Pfile, it, true);
+ any = true;
}
}
allItems.clear();
if (usingGUI)
{
- ++counter;
- if (dia != nullptr)
- dia->setValue(counter);
+ if (any)
+ {
+ ++counter;
+ if (dia != nullptr)
+ dia->setValue(counter);
+ }
+ QApplication::processEvents();
}
}
}
@@ -16497,6 +16501,8 @@
if (updCol)
{
m_ScMW->recalcColors();
+ m_ScMW->setProgressBarMaxToImageCount();
+ m_ScMW->mainWindowProgressBar->setValue(0);
RecalcPictures(&ScCore->InputProfiles, &ScCore->InputProfilesCMYK, m_ScMW->mainWindowProgressBar);
}
m_ScMW->mainWindowProgressBar->setValue(cc);