Rev 5781 | Rev 5880 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5244 | cbradney | 1 | /* |
2 | For general Scribus (>=1.3.2) copyright and licensing information please refer |
||
3 | to the COPYING file provided with the program. Following this notice may exist |
||
4 | a copyright and/or license notice that predates the release of Scribus 1.3.2 |
||
5 | for which a new license (GPL+exception) is in place. |
||
6 | */ |
||
7 | /*************************************************************************** |
||
8 | pageitem.h - description |
||
9 | ------------------- |
||
10 | copyright : Scribus Team |
||
11 | ***************************************************************************/ |
||
12 | |||
13 | /*************************************************************************** |
||
14 | * * |
||
15 | * This program is free software; you can redistribute it and/or modify * |
||
16 | * it under the terms of the GNU General Public License as published by * |
||
17 | * the Free Software Foundation; either version 2 of the License, or * |
||
18 | * (at your option) any later version. * |
||
19 | * * |
||
20 | ***************************************************************************/ |
||
21 | |||
5721 | avox | 22 | #include <cassert> |
23 | #include <iostream> |
||
24 | #include <qglobal.h> |
||
25 | |||
5244 | cbradney | 26 | #include "scribuscore.h" |
27 | #include "scribuscore.moc" |
||
28 | |||
29 | #include "commonstrings.h" |
||
30 | #include "filewatcher.h" |
||
31 | #include "gsutil.h" |
||
32 | #include "pluginmanager.h" |
||
33 | #include "prefsmanager.h" |
||
34 | #include "scpaths.h" |
||
35 | #include "splash.h" |
||
36 | #include "scribusapp.h" |
||
37 | #include "undomanager.h" |
||
38 | |||
39 | extern ScribusQApp* ScQApp; |
||
40 | |||
41 | #ifdef HAVE_CMS |
||
42 | #include "cmserrorhandling.h" |
||
43 | cmsHPROFILE CMSoutputProf; |
||
44 | cmsHPROFILE CMSprinterProf; |
||
5369 | mrdocs | 45 | cmsHTRANSFORM stdTransRGBMonG; |
46 | cmsHTRANSFORM stdTransCMYKMonG; |
||
5244 | cbradney | 47 | cmsHTRANSFORM stdProofG; |
48 | cmsHTRANSFORM stdTransImgG; |
||
49 | cmsHTRANSFORM stdProofImgG; |
||
50 | cmsHTRANSFORM stdTransCMYKG; |
||
51 | cmsHTRANSFORM stdProofCMYKG; |
||
52 | cmsHTRANSFORM stdTransRGBG; |
||
53 | cmsHTRANSFORM stdProofGCG; |
||
54 | cmsHTRANSFORM stdProofCMYKGCG; |
||
55 | bool BlackPoint; |
||
56 | bool SoftProofing; |
||
57 | bool Gamut; |
||
58 | bool SCRIBUS_API CMSuse; |
||
5345 | mrdocs | 59 | int IntentColors; |
60 | int IntentImages; |
||
5244 | cbradney | 61 | #endif |
62 | bool CMSavail; |
||
63 | |||
64 | |||
65 | ScribusCore::ScribusCore() : QObject() |
||
66 | { |
||
67 | m_ScribusInitialized=false; |
||
68 | m_SplashScreen=0; |
||
69 | m_UseGUI=false; |
||
5257 | cbradney | 70 | m_PaletteParent=0; |
5418 | cbradney | 71 | m_currScMW=0; |
5244 | cbradney | 72 | } |
73 | |||
74 | |||
75 | |||
76 | ScribusCore::~ScribusCore() |
||
5257 | cbradney | 77 | { |
78 | delete m_PaletteParent; |
||
79 | } |
||
5244 | cbradney | 80 | |
5721 | avox | 81 | #ifndef NDEBUG |
82 | static void abort_on_error(QtMsgType t, const char * m) |
||
83 | { |
||
84 | if(t==QtFatalMsg) assert(false); |
||
85 | std::cerr << m << "\n"; |
||
86 | } |
||
87 | #endif |
||
88 | |||
89 | |||
5244 | cbradney | 90 | int ScribusCore::init(bool useGUI, bool swapDialogButtonOrder, const QString fileToUse) |
91 | { |
||
92 | m_UseGUI=useGUI; |
||
93 | m_File=fileToUse; |
||
94 | m_SwapDialogButtonOrder=swapDialogButtonOrder; |
||
5721 | avox | 95 | #ifndef NDEBUG |
96 | qInstallMsgHandler( & abort_on_error ); |
||
97 | #endif |
||
98 | |||
5244 | cbradney | 99 | return 0; |
100 | } |
||
101 | |||
102 | int ScribusCore::startGUI(bool showSplash, bool showFontInfo, const QString newGuiLanguage, const QString prefsUserFile) |
||
103 | { |
||
5257 | cbradney | 104 | m_PaletteParent=new QWidget(0); |
105 | Q_CHECK_PTR(m_PaletteParent); |
||
5418 | cbradney | 106 | ScribusMainWindow* scribus = new ScribusMainWindow(); |
5257 | cbradney | 107 | Q_CHECK_PTR(scribus); |
108 | if (!scribus) |
||
109 | return(EXIT_FAILURE); |
||
5418 | cbradney | 110 | ScMWList.append(scribus); |
111 | m_currScMW=0; |
||
5781 | cbradney | 112 | // ScMW=scribus; |
5257 | cbradney | 113 | int retVal=initScribusCore(showSplash, showFontInfo, newGuiLanguage, prefsUserFile); |
114 | if (retVal == 1) |
||
115 | return(EXIT_FAILURE); |
||
116 | retVal = scribus->initScMW(true); |
||
117 | if (retVal == 1) |
||
118 | return(EXIT_FAILURE); |
||
119 | closeSplash(); |
||
120 | m_ScribusInitialized=true; |
||
121 | ScQApp->setMainWidget(scribus); |
||
122 | connect(ScQApp, SIGNAL(lastWindowClosed()), ScQApp, SLOT(quit())); |
||
5244 | cbradney | 123 | |
5257 | cbradney | 124 | scribus->show(); |
125 | scribus->ShowSubs(); |
||
5244 | cbradney | 126 | |
5257 | cbradney | 127 | if (!m_File.isEmpty()) |
128 | scribus->loadDoc(m_File); |
||
129 | else |
||
130 | { |
||
131 | if (PrefsManager::instance()->appPrefs.showStartupDialog) |
||
132 | scribus->startUpDialog(); |
||
5244 | cbradney | 133 | else |
5257 | cbradney | 134 | scribus->setFocus(); |
135 | } |
||
5244 | cbradney | 136 | |
5257 | cbradney | 137 | // A hook for plug-ins and scripts to trigger on. Some plugins and scripts |
138 | // require the app to be fully set up (in particular, the main window to be |
||
139 | // built and shown) before running their setup. |
||
140 | emit appStarted(); |
||
141 | return EXIT_SUCCESS; |
||
5244 | cbradney | 142 | } |
143 | |||
144 | int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, const QString newGuiLanguage, const QString prefsUserFile) |
||
145 | { |
||
146 | CommonStrings::languageChange(); |
||
147 | int retVal=0; |
||
148 | //FIXME ExternalApp = 0; |
||
149 | m_GuiLanguage = newGuiLanguage; |
||
150 | initSplash(showSplash); |
||
151 | prefsManager = PrefsManager::instance(); |
||
152 | prefsManager->setup(); |
||
153 | prefsManager->initDefaults(); |
||
154 | prefsManager->initDefaultGUIFont(qApp->font()); |
||
155 | prefsManager->initArrowStyles(); |
||
156 | undoManager = UndoManager::instance(); |
||
157 | fileWatcher = new FileWatcher(this); |
||
158 | pluginManager = new PluginManager(); |
||
159 | setSplashStatus( tr("Initializing Plugins") ); |
||
160 | pluginManager->initPlugs(); |
||
161 | bool haveFonts=false; |
||
162 | #ifdef QT_MAC |
||
163 | haveFonts=ScCore->initFonts(true); |
||
164 | #else |
||
165 | haveFonts=ScCore->initFonts(showFontInfo); |
||
166 | #endif |
||
167 | if (!haveFonts) |
||
168 | return 1; |
||
169 | setSplashStatus( tr("Initializing Keyboard Shortcuts") ); |
||
170 | prefsManager->initDefaultActionKeys(); |
||
171 | setSplashStatus( tr("Reading Preferences") ); |
||
172 | if (prefsUserFile.isNull()) |
||
173 | prefsManager->ReadPrefs(); |
||
174 | else |
||
175 | prefsManager->ReadPrefs(prefsUserFile); |
||
176 | |||
177 | m_HaveGS = testGSAvailability(); |
||
178 | m_HavePngAlpha = testGSDeviceAvailability("pngalpha"); |
||
179 | m_HaveTiffSep = testGSDeviceAvailability("tiffsep"); |
||
180 | |||
181 | ScCore->setSplashStatus( tr("Reading ICC Profiles") ); |
||
182 | CMSavail = false; |
||
183 | getCMSProfiles(); |
||
184 | initCMS(); |
||
185 | /* |
||
186 | |||
5257 | cbradney | 187 | buildFontMenu(); |
5244 | cbradney | 188 | |
189 | |||
190 | initPalettes(); |
||
191 | |||
192 | |||
193 | setSplashStatus( tr("Initializing Hyphenator") ); |
||
194 | QString preLang = prefsManager->appPrefs.Language; |
||
195 | initHyphenator(); |
||
196 | if (Sprachen.contains(preLang)) |
||
197 | prefsManager->appPrefs.Language = preLang; |
||
198 | setSplashStatus( tr("Reading Scrapbook") ); |
||
199 | initScrapbook(); |
||
200 | setSplashStatus( tr("Setting up Shortcuts") ); |
||
201 | SetShortCut(); |
||
202 | scrActions["helpTooltips"]->setOn(prefsManager->appPrefs.showToolTips); |
||
203 | ToggleTips(); |
||
204 | |||
205 | connect(fileWatcher, SIGNAL(fileDeleted(QString )), this, SLOT(removeRecent(QString))); |
||
206 | connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString))); |
||
207 | connect(this, SIGNAL(TextIFont(QString)), propertiesPalette, SLOT(setFontFace(QString))); |
||
208 | connect(this, SIGNAL(TextISize(int)), this, SLOT(setFSizeMenu(int))); |
||
209 | connect(this, SIGNAL(TextISize(int)), propertiesPalette, SLOT(setSize(int))); |
||
210 | connect(this, SIGNAL(TextUSval(int)), propertiesPalette, SLOT(setExtra(int))); |
||
211 | connect(this, SIGNAL(TextStil(int)), propertiesPalette, SLOT(setStil(int))); |
||
212 | connect(this, SIGNAL(TextScale(int)), propertiesPalette, SLOT(setTScale(int))); |
||
213 | connect(this, SIGNAL(TextScaleV(int)), propertiesPalette, SLOT(setTScaleV(int))); |
||
214 | connect(this, SIGNAL(TextBase(int)), propertiesPalette, SLOT(setTBase(int))); |
||
215 | connect(this, SIGNAL(TextShadow(int, int )), propertiesPalette, SLOT(setShadowOffs(int, int ))); |
||
216 | connect(this, SIGNAL(TextOutline(int)), propertiesPalette, SLOT(setOutlineW(int))); |
||
217 | connect(this, SIGNAL(TextUnderline(int, int)), propertiesPalette, SLOT(setUnderline(int, int))); |
||
218 | connect(this, SIGNAL(TextStrike(int, int)), propertiesPalette, SLOT(setStrike(int, int))); |
||
219 | connect(this, SIGNAL(TextFarben(QString, QString, int, int)), propertiesPalette, SLOT(setActFarben(QString, QString, int, int))); |
||
220 | }*/ |
||
5257 | cbradney | 221 | |
5244 | cbradney | 222 | return retVal; |
223 | } |
||
224 | |||
225 | |||
226 | void ScribusCore::initSplash(bool showSplash) |
||
227 | { |
||
228 | if (showSplash) |
||
229 | { |
||
230 | m_SplashScreen = new SplashScreen(); |
||
231 | if (m_SplashScreen != NULL && m_SplashScreen->isShown()) |
||
232 | setSplashStatus(QObject::tr("Initializing...")); |
||
233 | } |
||
234 | else |
||
235 | m_SplashScreen = NULL; |
||
236 | } |
||
237 | |||
238 | void ScribusCore::setSplashStatus(const QString& newText) |
||
239 | { |
||
240 | if (m_SplashScreen != NULL) |
||
241 | { |
||
242 | m_SplashScreen->setStatus( newText ); |
||
243 | qApp->processEvents(); |
||
244 | } |
||
245 | } |
||
246 | |||
247 | void ScribusCore::showSplash(bool shown) |
||
248 | { |
||
249 | if (m_SplashScreen!=NULL && shown!=m_SplashScreen->isShown()) |
||
250 | m_SplashScreen->setShown(shown); |
||
251 | } |
||
252 | |||
253 | bool ScribusCore::splashShowing() const |
||
254 | { |
||
255 | if (m_SplashScreen != NULL) |
||
256 | return m_SplashScreen->isShown(); |
||
257 | return false; |
||
258 | } |
||
259 | |||
260 | void ScribusCore::closeSplash() |
||
261 | { |
||
262 | if (m_SplashScreen!=NULL) |
||
263 | { |
||
264 | m_SplashScreen->close(); |
||
265 | delete m_SplashScreen; |
||
266 | m_SplashScreen = NULL; |
||
267 | } |
||
268 | } |
||
269 | |||
270 | bool ScribusCore::usingGUI() const |
||
271 | { |
||
272 | return m_UseGUI; |
||
273 | } |
||
274 | |||
275 | bool ScribusCore::isMacGUI() const |
||
276 | { |
||
277 | // Do it statically for now |
||
278 | #if defined(Q_WS_MAC) |
||
279 | return true; |
||
280 | #else |
||
281 | return false; |
||
282 | #endif |
||
283 | } |
||
284 | |||
285 | bool ScribusCore::isWinGUI() const |
||
286 | { |
||
287 | // Do it statically for now |
||
288 | #if defined(_WIN32) |
||
289 | return true; |
||
290 | #else |
||
291 | return false; |
||
292 | #endif |
||
293 | } |
||
294 | |||
295 | bool ScribusCore::reverseDialogButtons() const |
||
296 | { |
||
297 | if (m_SwapDialogButtonOrder) |
||
298 | return true; |
||
299 | //Win32 - dont switch |
||
300 | #if defined(_WIN32) |
||
301 | return false; |
||
302 | //Mac Aqua - switch |
||
303 | #elif defined(Q_WS_MAC) |
||
304 | return true; |
||
305 | #else |
||
306 | //Gnome - switch |
||
307 | QString gnomesession= ::getenv("GNOME_DESKTOP_SESSION_ID"); |
||
308 | if (!gnomesession.isEmpty()) |
||
309 | return true; |
||
310 | |||
311 | //KDE/KDE Aqua - dont switch |
||
312 | //Best guess for now if we are running under KDE |
||
313 | QString kdesession= ::getenv("KDE_FULL_SESSION"); |
||
314 | if (!kdesession.isEmpty()) |
||
315 | return false; |
||
316 | #endif |
||
317 | return false; |
||
318 | } |
||
319 | |||
320 | //Returns false when there are no fonts |
||
321 | bool ScribusCore::initFonts(bool showFontInfo) |
||
322 | { |
||
323 | setSplashStatus( tr("Searching for Fonts") ); |
||
324 | bool haveFonts=prefsManager->GetAllFonts(showFontInfo); |
||
325 | if (!haveFonts) |
||
326 | { |
||
327 | closeSplash(); |
||
328 | QString mess = tr("There are no fonts found on your system."); |
||
329 | mess += "\n" + tr("Exiting now."); |
||
330 | QMessageBox::critical(0, tr("Fatal Error"), mess, 1, 0, 0); |
||
331 | } |
||
332 | else |
||
333 | setSplashStatus( tr("Font System Initialized") ); |
||
334 | return haveFonts; |
||
335 | } |
||
336 | |||
337 | |||
338 | void ScribusCore::getCMSProfiles() |
||
339 | { |
||
340 | QString profDir; |
||
341 | QStringList profDirs; |
||
342 | MonitorProfiles.clear(); |
||
343 | PrinterProfiles.clear(); |
||
344 | InputProfiles.clear(); |
||
345 | InputProfilesCMYK.clear(); |
||
346 | QString pfad = ScPaths::instance().libDir(); |
||
347 | pfad += "profiles/"; |
||
348 | profDirs = ScPaths::getSystemProfilesDirs(); |
||
349 | profDirs.prepend( prefsManager->appPrefs.ProfileDir ); |
||
350 | profDirs.prepend( pfad ); |
||
351 | for(unsigned int i = 0; i < profDirs.count(); i++) |
||
352 | { |
||
353 | profDir = profDirs[i]; |
||
354 | if(!profDir.isEmpty()) |
||
355 | { |
||
356 | if(profDir.right(1) != "/") |
||
357 | profDir += "/"; |
||
358 | getCMSProfilesDir(profDir); |
||
359 | } |
||
360 | } |
||
361 | if ((!PrinterProfiles.isEmpty()) && (!InputProfiles.isEmpty()) && (!MonitorProfiles.isEmpty())) |
||
362 | CMSavail = true; |
||
363 | else |
||
364 | CMSavail = false; |
||
365 | } |
||
366 | |||
367 | void ScribusCore::getCMSProfilesDir(QString pfad) |
||
368 | { |
||
369 | #ifdef HAVE_CMS |
||
370 | QDir d(pfad, "*", QDir::Name, QDir::Files | QDir::Readable | QDir::Dirs | QDir::NoSymLinks); |
||
371 | if ((d.exists()) && (d.count() != 0)) |
||
372 | { |
||
373 | QString nam = ""; |
||
374 | const char *Descriptor; |
||
375 | cmsHPROFILE hIn = NULL; |
||
376 | |||
377 | for (uint dc = 0; dc < d.count(); ++dc) |
||
378 | { |
||
379 | QFileInfo fi(pfad + "/" + d[dc]); |
||
380 | if (fi.isDir() && d[dc][0] != '.') |
||
381 | { |
||
382 | getCMSProfilesDir(fi.filePath()+"/"); |
||
383 | continue; |
||
384 | } |
||
385 | |||
386 | #ifndef QT_MAC |
||
387 | QString ext = fi.extension(false).lower(); |
||
388 | if ((ext != "icm") && (ext != "icc")) |
||
389 | continue; |
||
390 | #endif |
||
391 | |||
392 | QFile f(fi.filePath()); |
||
393 | QByteArray bb(40); |
||
394 | if (!f.open(IO_ReadOnly)) { |
||
395 | qDebug("%s", QString("couldn't open %1 as ICC").arg(fi.filePath()).ascii()); |
||
396 | continue; |
||
397 | } |
||
398 | int len = f.readBlock(bb.data(), 40); |
||
399 | f.close(); |
||
400 | if (len == 40 && bb[36] == 'a' && bb[37] == 'c' && bb[38] == 's' && bb[39] == 'p') |
||
401 | { |
||
402 | const QCString profilePath( QString(pfad + d[dc]).local8Bit() ); |
||
403 | if (setjmp(cmsJumpBuffer)) |
||
404 | { |
||
405 | // Reset to the default handler otherwise may enter a loop |
||
406 | // if an error occur in cmsCloseProfile() |
||
407 | cmsSetErrorHandler(NULL); |
||
408 | if (hIn) |
||
409 | { |
||
410 | cmsCloseProfile(hIn); |
||
411 | hIn = NULL; |
||
412 | } |
||
413 | continue; |
||
414 | } |
||
415 | cmsSetErrorHandler(&cmsErrorHandler); |
||
416 | hIn = cmsOpenProfileFromFile(profilePath.data(), "r"); |
||
417 | if (hIn == NULL) |
||
418 | continue; |
||
419 | Descriptor = cmsTakeProductDesc(hIn); |
||
420 | nam = QString(Descriptor); |
||
421 | switch (static_cast<int>(cmsGetDeviceClass(hIn))) |
||
422 | { |
||
423 | case icSigInputClass: |
||
5838 | jghali | 424 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData) |
425 | InputProfiles[nam] = pfad + d[dc]; |
||
426 | break; |
||
5244 | cbradney | 427 | case icSigColorSpaceClass: |
428 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData) |
||
429 | InputProfiles[nam] = pfad + d[dc]; |
||
430 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData) |
||
431 | InputProfilesCMYK[nam] = pfad + d[dc]; |
||
432 | break; |
||
433 | case icSigDisplayClass: |
||
434 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigRgbData) |
||
435 | { |
||
436 | MonitorProfiles[nam] = pfad + d[dc]; |
||
437 | InputProfiles[nam] = pfad + d[dc]; |
||
438 | } |
||
439 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData) |
||
440 | InputProfilesCMYK[nam] = pfad + d[dc]; |
||
441 | break; |
||
442 | case icSigOutputClass: |
||
443 | PrinterProfiles[nam] = pfad + d[dc]; |
||
444 | if (static_cast<int>(cmsGetColorSpace(hIn)) == icSigCmykData) |
||
445 | { |
||
446 | PDFXProfiles[nam] = pfad + d[dc]; |
||
447 | InputProfilesCMYK[nam] = pfad + d[dc]; |
||
448 | } |
||
449 | break; |
||
450 | } |
||
451 | cmsCloseProfile(hIn); |
||
452 | hIn = NULL; |
||
453 | } |
||
454 | } |
||
455 | cmsSetErrorHandler(NULL); |
||
456 | } |
||
457 | #endif |
||
458 | } |
||
459 | |||
460 | void ScribusCore::initCMS() |
||
461 | { |
||
462 | if (CMSavail) |
||
463 | { |
||
464 | ProfilesL::Iterator ip; |
||
465 | if ((prefsManager->appPrefs.DCMSset.DefaultImageRGBProfile.isEmpty()) || (!InputProfiles.contains(prefsManager->appPrefs.DCMSset.DefaultImageRGBProfile))) |
||
466 | { |
||
467 | ip = InputProfiles.begin(); |
||
468 | prefsManager->appPrefs.DCMSset.DefaultImageRGBProfile = ip.key(); |
||
469 | } |
||
470 | if ((prefsManager->appPrefs.DCMSset.DefaultImageCMYKProfile.isEmpty()) || (!InputProfilesCMYK.contains(prefsManager->appPrefs.DCMSset.DefaultImageCMYKProfile))) |
||
471 | { |
||
472 | ip = InputProfilesCMYK.begin(); |
||
473 | prefsManager->appPrefs.DCMSset.DefaultImageCMYKProfile = ip.key(); |
||
474 | } |
||
5345 | mrdocs | 475 | if ((prefsManager->appPrefs.DCMSset.DefaultSolidColorRGBProfile.isEmpty()) || (!InputProfiles.contains(prefsManager->appPrefs.DCMSset.DefaultSolidColorRGBProfile))) |
5244 | cbradney | 476 | { |
477 | ip = InputProfiles.begin(); |
||
5345 | mrdocs | 478 | prefsManager->appPrefs.DCMSset.DefaultSolidColorRGBProfile = ip.key(); |
5244 | cbradney | 479 | } |
5345 | mrdocs | 480 | if ((prefsManager->appPrefs.DCMSset.DefaultSolidColorCMYKProfile.isEmpty()) || (!InputProfilesCMYK.contains(prefsManager->appPrefs.DCMSset.DefaultSolidColorCMYKProfile))) |
481 | { |
||
482 | ip = InputProfilesCMYK.begin(); |
||
483 | prefsManager->appPrefs.DCMSset.DefaultSolidColorCMYKProfile = ip.key(); |
||
484 | } |
||
5244 | cbradney | 485 | if ((prefsManager->appPrefs.DCMSset.DefaultMonitorProfile.isEmpty()) || (!MonitorProfiles.contains(prefsManager->appPrefs.DCMSset.DefaultMonitorProfile))) |
486 | { |
||
487 | ip = MonitorProfiles.begin(); |
||
488 | prefsManager->appPrefs.DCMSset.DefaultMonitorProfile = ip.key(); |
||
489 | } |
||
490 | if ((prefsManager->appPrefs.DCMSset.DefaultPrinterProfile.isEmpty()) || (!PrinterProfiles.contains(prefsManager->appPrefs.DCMSset.DefaultPrinterProfile))) |
||
491 | { |
||
492 | ip = PrinterProfiles.begin(); |
||
493 | prefsManager->appPrefs.DCMSset.DefaultPrinterProfile = ip.key(); |
||
494 | } |
||
495 | #ifdef HAVE_CMS |
||
496 | SoftProofing = prefsManager->appPrefs.DCMSset.SoftProofOn; |
||
497 | CMSuse = false; |
||
5345 | mrdocs | 498 | IntentColors = prefsManager->appPrefs.DCMSset.DefaultIntentColors; |
499 | IntentImages = prefsManager->appPrefs.DCMSset.DefaultIntentImages; |
||
5244 | cbradney | 500 | #endif |
501 | } |
||
502 | } |
||
5418 | cbradney | 503 | |
504 | ScribusMainWindow * ScribusCore::primaryMainWindow( ) |
||
505 | { |
||
506 | if (ScMWList.count()==0 || m_currScMW>ScMWList.count()) |
||
507 | return 0; |
||
508 | ScribusMainWindow* mw=ScMWList.at(m_currScMW); |
||
509 | if (!mw) |
||
510 | return 0; |
||
511 | return mw; |
||
512 | } |
||
5781 | cbradney | 513 | |
514 | |||
515 | bool ScribusCore::fileWatcherActive() const |
||
516 | { |
||
517 | if (fileWatcher!=NULL) |
||
518 | return fileWatcher->isActive(); |
||
519 | return false; |
||
520 | } |