int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage, const QString prefsUserFile) { CommonStrings::languageChange(); iconManager = IconManager::instance(); if (!iconManager->setup()) return EXIT_FAILURE; // FIXME: Splash needs the prefs loaded by initDefaults() to know if it must force the image to grayscale initSplash(showSplash); LocaleManager::instance(); prefsManager = PrefsManager::instance(); prefsManager->setup(); //CB #4428 Get fonts before prefs are set to default bool haveFonts=false; haveFonts=ScCore->initFonts(showFontInfo); if (!haveFonts) return EXIT_FAILURE; prefsManager->initDefaults(); prefsManager->initDefaultGUIFont(qApp->font()); prefsManager->initArrowStyles(); undoManager = UndoManager::instance(); fileWatcher = new FileWatcher(this); pluginManager = new PluginManager(); setSplashStatus( tr("Initializing Keyboard Shortcuts") ); prefsManager->initDefaultActionKeys(); setSplashStatus( tr("Reading Preferences") ); if (prefsUserFile.isNull()) prefsManager->ReadPrefs(); else prefsManager->ReadPrefs(prefsUserFile); prefsManager->appPrefs.uiPrefs.showSplashOnStartup=showSplash; if (!iconManager->setActiveFromPrefs(prefsManager->appPrefs.uiPrefs.iconSet)) { //reset prefs name to chosen name based on version, when prefs is empty or not found prefsManager->appPrefs.uiPrefs.iconSet=iconManager->activeSetBasename(); } m_HaveGS = testGSAvailability(); m_HavePngAlpha = testGSDeviceAvailability("pngalpha"); m_HaveTiffSep = testGSDeviceAvailability("tiffsep"); setSplashStatus( tr("Initializing Plugins") ); pluginManager->initPlugs(); ScCore->setSplashStatus( tr("Reading Color Profiles") ); m_HaveCMS = false; getCMSProfiles(showProfileInfo); initCMS(); setSplashStatus( tr("Initializing Image Cache") ); ScImageCacheManager & icm = ScImageCacheManager::instance(); icm.setEnabled(prefsManager->appPrefs.imageCachePrefs.cacheEnabled); icm.setMaxCacheSizeMiB(prefsManager->appPrefs.imageCachePrefs.maxCacheSizeMiB); icm.setMaxCacheEntries(prefsManager->appPrefs.imageCachePrefs.maxCacheEntries); icm.setCompressionLevel(prefsManager->appPrefs.imageCachePrefs.compressionLevel); icm.initialize(); return 0; }
//Returns false when there are no fonts bool ScribusCore::initFonts(bool showFontInfo) { setSplashStatus( tr("Searching for Fonts") ); bool haveFonts=prefsManager->GetAllFonts(showFontInfo); if (!haveFonts) { closeSplash(); QString mess = tr("There are no fonts found on your system."); mess += "\n" + tr("Exiting now."); QMessageBox::critical(0, tr("Fatal Error"), mess, 1, 0, 0); } else setSplashStatus( tr("Font System Initialized") ); return haveFonts; }
void ScribusCore::initSplash(bool showSplash) { m_SplashScreen = NULL; if (!showSplash) return; QPixmap pix = IconManager::instance()->loadPixmap("scribus_splash.png", true); m_SplashScreen = new ScSplashScreen(pix, Qt::WindowStaysOnTopHint); if (m_SplashScreen != NULL) m_SplashScreen->show(); if (m_SplashScreen != NULL && m_SplashScreen->isVisible()) setSplashStatus(QObject::tr("Initializing...")); }
void ScribusCore::initSplash(bool showSplash) { if (showSplash) { QPixmap pix = loadIcon("Splash.png", true); m_SplashScreen = new SplashScreen(pix, Qt::WindowStaysOnTopHint); if (m_SplashScreen != NULL) m_SplashScreen->show(); if (m_SplashScreen != NULL && m_SplashScreen->isVisible()) setSplashStatus(QObject::tr("Initializing...")); } else m_SplashScreen = NULL; }
int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage, const QString prefsUserFile) { CommonStrings::languageChange(); int retVal=0; //FIXME ExternalApp = 0; initSplash(showSplash); prefsManager = PrefsManager::instance(); prefsManager->setup(); //CB #4428 Get fonts before prefs are set to default bool haveFonts=false; #ifdef Q_OS_MAC haveFonts=ScCore->initFonts(true); #else haveFonts=ScCore->initFonts(showFontInfo); #endif if (!haveFonts) return 1; prefsManager->initDefaults(); prefsManager->initDefaultGUIFont(qApp->font()); prefsManager->initArrowStyles(); undoManager = UndoManager::instance(); fileWatcher = new FileWatcher(this); pluginManager = new PluginManager(); setSplashStatus( tr("Initializing Plugins") ); pluginManager->initPlugs(); /* #4428, remove block later if ok bool haveFonts=false; #ifdef Q_OS_MAC haveFonts=ScCore->initFonts(true); #else haveFonts=ScCore->initFonts(showFontInfo); #endif if (!haveFonts) return 1; */ setSplashStatus( tr("Initializing Keyboard Shortcuts") ); prefsManager->initDefaultActionKeys(); setSplashStatus( tr("Reading Preferences") ); if (prefsUserFile.isNull()) prefsManager->ReadPrefs(); else prefsManager->ReadPrefs(prefsUserFile); prefsManager->appPrefs.uiPrefs.showSplashOnStartup=showSplash; // setSplashStatus( tr("Applying User Shortcuts") ); // prefsManager->applyLoadedShortCuts(); m_HaveGS = testGSAvailability(); m_HavePngAlpha = testGSDeviceAvailability("pngalpha"); m_HaveTiffSep = testGSDeviceAvailability("tiffsep"); ScCore->setSplashStatus( tr("Reading Color Profiles") ); m_HaveCMS = false; getCMSProfiles(showProfileInfo); initCMS(); setSplashStatus( tr("Initializing Image Cache") ); ScImageCacheManager & icm = ScImageCacheManager::instance(); icm.setEnabled(prefsManager->appPrefs.imageCachePrefs.cacheEnabled); icm.setMaxCacheSizeMiB(prefsManager->appPrefs.imageCachePrefs.maxCacheSizeMiB); icm.setMaxCacheEntries(prefsManager->appPrefs.imageCachePrefs.maxCacheEntries); icm.setCompressionLevel(prefsManager->appPrefs.imageCachePrefs.compressionLevel); icm.initialize(); return retVal; }