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