diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-14 20:11:45 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-14 20:11:45 +0000 |
commit | a382b3ab3160bc265983c538cb235eb51b87a4c5 (patch) | |
tree | 9805f2010c017b8376673c4f5f11aed8bcab310a /ksplashml/themeengine/unified | |
parent | 75ab9920ac2043f45a09dd50763e14f58de9cd65 (diff) | |
download | tdebase-a382b3ab3160bc265983c538cb235eb51b87a4c5.tar.gz tdebase-a382b3ab3160bc265983c538cb235eb51b87a4c5.zip |
Add new "Unified" splash screen
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253671 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksplashml/themeengine/unified')
-rw-r--r-- | ksplashml/themeengine/unified/CMakeLists.txt | 45 | ||||
-rw-r--r-- | ksplashml/themeengine/unified/Makefile.am | 17 | ||||
-rw-r--r-- | ksplashml/themeengine/unified/ksplashunified.desktop | 78 | ||||
-rw-r--r-- | ksplashml/themeengine/unified/main.cpp | 17 | ||||
-rw-r--r-- | ksplashml/themeengine/unified/themeunified.cpp | 118 | ||||
-rw-r--r-- | ksplashml/themeengine/unified/themeunified.h | 101 |
6 files changed, 376 insertions, 0 deletions
diff --git a/ksplashml/themeengine/unified/CMakeLists.txt b/ksplashml/themeengine/unified/CMakeLists.txt new file mode 100644 index 000000000..5200fb060 --- /dev/null +++ b/ksplashml/themeengine/unified/CMakeLists.txt @@ -0,0 +1,45 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + #${CMAKE_CURRENT_SOURCE_DIR} + #${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/ksplashml/themeengine + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES ksplashunified.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) + + +##### ksplashunified (module) ################### + +tde_add_kpart( ksplashunified AUTOMOC + SOURCES main.cpp + LINK themeunified-static ksplashthemes-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) + + +##### themeunified (static) ##################### + +tde_add_library( themeunified STATIC_PIC AUTOMOC + SOURCES themeunified.cpp + LINK ksplashthemes-shared +) diff --git a/ksplashml/themeengine/unified/Makefile.am b/ksplashml/themeengine/unified/Makefile.am new file mode 100644 index 000000000..e3f522751 --- /dev/null +++ b/ksplashml/themeengine/unified/Makefile.am @@ -0,0 +1,17 @@ + +INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../.. $(all_includes) + +noinst_LTLIBRARIES = libthemedefault.la +libthemedefault_la_SOURCES = themelegacy.cpp +libthemedefault_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) +libthemedefault_la_LIBADD = $(LIB_KDEUI) ../libksplashthemes.la + +kde_module_LTLIBRARIES = ksplashdefault.la + +ksplashdefault_la_SOURCES = main.cpp +ksplashdefault_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(KDE_PLUGIN) -module +ksplashdefault_la_LIBADD = $(LIB_KDEUI) ../libksplashthemes.la libthemedefault.la +METASOURCES = AUTO + +servicesdir = $(kde_servicesdir) +services_DATA = ksplashdefault.desktop diff --git a/ksplashml/themeengine/unified/ksplashunified.desktop b/ksplashml/themeengine/unified/ksplashunified.desktop new file mode 100644 index 000000000..408daab5f --- /dev/null +++ b/ksplashml/themeengine/unified/ksplashunified.desktop @@ -0,0 +1,78 @@ +[Desktop Entry] +Type=Service +Comment=KSplash Plugin +Comment[af]=KSplash Inprop module +Comment[ar]=ملحق للشاشة الافتتاحية +Comment[az]=KSplash Əlavəsi +Comment[be]=Утулка KSplash +Comment[bg]=Приставка KSplash +Comment[bn]=কে-স্প্ল্যাশ প্লাগ-ইন +Comment[br]=Lugent KSplash +Comment[bs]=KSplash dodatak +Comment[ca]=Connector per a KSplash +Comment[cs]=Modul aplikaci KSplash +Comment[csb]=Plugins KSplash +Comment[cy]=Ategyn KCroeso +Comment[da]=KSplash-plugin +Comment[de]=KSplash-Plugin +Comment[el]=Πρόσθετο KSplash +Comment[eo]=Ksalutŝilda kromaĵo +Comment[es]=Complemento KSplash +Comment[et]=KSplashi plugin +Comment[eu]=KSplash plugina +Comment[fa]=وصلۀ KSplash +Comment[fi]=KSplash-liitännäinen +Comment[fr]=Modules de KSplash +Comment[fy]=KSplash-plugin +Comment[ga]=Breiseán KSplash +Comment[gl]=Plugin de KSplash +Comment[he]=תוסף KSplash +Comment[hi]=के-स्प्लैश प्लगइन +Comment[hr]=KSplash dodatak +Comment[hu]=KSplash bővítőmodul +Comment[is]=KSplash íforrit +Comment[it]=Plugin KSplash +Comment[ja]=KSplash プラグイン +Comment[ka]=KSplash პლაგინი +Comment[kk]=KSplash модулі +Comment[km]=កម្មវិធីជំនួយខាងក្នុងរបស់ KSplash +Comment[lt]=KSplash įskiepis +Comment[lv]=KSplash spraudnis +Comment[mk]=Приклучок за KSplash +Comment[ms]=Plugin KSplash +Comment[mt]=Plugin ta' KSplash +Comment[nb]=Programtillegg Ksplash +Comment[ne]=के स्प्लयास प्लगइन +Comment[nl]=KSplash-plugin +Comment[nn]=KSplash-programtillegg +Comment[pa]=ਕੇ-ਸਪਲੇਸ ਪਲੱਗਇਨ +Comment[pl]=Wtyczka KSplash +Comment[pt]='Plugin' do KSplash +Comment[pt_BR]=Plug-in do KSplash +Comment[ro]=Modul KSplash +Comment[ru]=Модуль KSplash +Comment[rw]=Icomeka rya K-Gukwiza +Comment[se]=KSplash-lassemoduvla +Comment[sk]=Modul KSplash +Comment[sl]=Vstavek KSplash +Comment[sr]=KSplash прикључак +Comment[sr@Latn]=KSplash priključak +Comment[sv]=Insticksprogram för startskärm +Comment[ta]=Kஸ்ப்ளாஷ் செருகு பொருள் +Comment[tg]=Мутассалкунандаи KSplash +Comment[th]=ปลั๊กอิน KSplash +Comment[tr]=KSplash Eklentisi +Comment[tt]=KSplash atlı Östämä +Comment[uk]=Втулок KSplash +Comment[uz]=KSplash plagini +Comment[uz@cyrillic]=KSplash плагини +Comment[vi]=Trình bổ sung Chào mừng KDE +Comment[wa]=Tchôke-divins KSplash (waitroûle d' enondaedje) +Comment[zh_CN]=KSplash 插件 +Comment[zh_TW]=KSplash 外掛程式 +Name=KSplashUnified +ServiceTypes=KSplash/Plugin +X-KDE-Library=ksplashunified +X-KSplash-Default=true +X-KSplash-PluginName=Unified +X-KSplash-ObjectName=ThemeUnified diff --git a/ksplashml/themeengine/unified/main.cpp b/ksplashml/themeengine/unified/main.cpp new file mode 100644 index 000000000..a28cf5952 --- /dev/null +++ b/ksplashml/themeengine/unified/main.cpp @@ -0,0 +1,17 @@ +/*************************************************************************** + * Copyright Brian Ledbetter 2001-2003 <brian@shadowcom.net> * + * Copyright Ravikiran Rajagopal 2003 * + * ravi@ee.eng.ohio-state.edu * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License (version 2) as * + * published by the Free Software Foundation. (The original KSplash/ML * + * codebase (upto version 0.95.3) is BSD-licensed.) * + * * + ***************************************************************************/ + +#include <kgenericfactory.h> + +#include "themeunified.h" + +K_EXPORT_COMPONENT_FACTORY( ksplashunified, KGenericFactory<ThemeUnified>( "ksplash" ) ) diff --git a/ksplashml/themeengine/unified/themeunified.cpp b/ksplashml/themeengine/unified/themeunified.cpp new file mode 100644 index 000000000..e552e9909 --- /dev/null +++ b/ksplashml/themeengine/unified/themeunified.cpp @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright Brian Ledbetter 2001-2003 <brian@shadowcom.net> * + * Copyright Ravikiran Rajagopal 2003 <ravi@kde.org> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License (version 2) as * + * published by the Free Software Foundation. (The original KSplash/ML * + * codebase (upto version 0.95.3) is BSD-licensed.) * + * * + ***************************************************************************/ + +#include <kapplication.h> +#include <kconfig.h> +#include <kdebug.h> +#include <kgenericfactory.h> +#include <kglobalsettings.h> +#include <klocale.h> +#include <kstandarddirs.h> +#include <kprogress.h> + +#include <tqcheckbox.h> +#include <tqdesktopwidget.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqwidget.h> +#include <tqtimer.h> +#include <tqcursor.h> + +#include "objkstheme.h" +#include "themeengine.h" +#include "themeunified.h" +#include "themeunified.moc" + +UnifiedConfig::UnifiedConfig( TQWidget *parent, KConfig *config ) + :ThemeEngineConfig( parent, config ) +{ + mConfig->setGroup( TQString("KSplash Theme: Default") ); + TQVBox *hbox = new TQVBox( this ); + mAlwaysShow = new TQCheckBox( i18n("Always show progress bar"), hbox ); + mAlwaysShow->setChecked( mConfig->readBoolEntry("Always Show Progress",true) ); +} + +void UnifiedConfig::save() +{ + kdDebug() << "UnifiedConfig::save()" << endl; + mConfig->setGroup( TQString("KSplash Theme: Default") ); + mConfig->writeEntry( "Always Show Progress", mAlwaysShow->isChecked() ); + mConfig->sync(); +} + +ThemeUnified::ThemeUnified( TQWidget *parent, const char *name, const TQStringList &args ) + :ThemeEngine( parent, name, args ) +{ + + mState = 0; + + _readSettings(); + _initUi(); +} + +ThemeUnified::~ThemeUnified() +{ + if (mSysModalDialog) { + KSMModalDialog* temp = mSysModalDialog; + mSysModalDialog = NULL; + temp->closeSMDialog(); + } +} + +void ThemeUnified::_initUi() +{ + resize(10,10); + + mSysModalDialog = new KSMModalDialog(this); + mSysModalDialog->setStatusMessage(i18n("Trinity is starting up").append("...")); + mSysModalDialog->show(); + mSysModalDialog->setActiveWindow(); + + const TQRect rect = kapp->desktop()->screenGeometry( mTheme->xineramaScreen() ); + + // Center the dialog + TQSize sh = tqsizeHint(); + TQRect rect1 = KGlobalSettings::desktopGeometry(TQCursor::pos()); + move(rect1.x() + (rect1.width() - sh.width())/2, rect1.y() + (rect1.height() - sh.height())/2); +} + +// Attempt to find overrides elsewhere? +void ThemeUnified::_readSettings() +{ + if( !mTheme ) + return; + + KConfig *cfg = mTheme->themeConfig(); + if( !cfg ) + return; + + cfg->setGroup( TQString("KSplash Theme: %1").arg(mTheme->theme()) ); + + TQColor df(Qt::white); + mLabelForeground = cfg->readColorEntry( "Label Foreground", &df ); +} + +/* + * ThemeUnified::slotUpdateState(): IF in Default mode, THEN adjust the bar + * pixmap label. Whee, phun! + * + * A similar method exists in the old KSplash. + */ +void ThemeUnified::slotUpdateState() +{ + if( mState > 8 ) + mState = 8; + +// mBarLabel->setPixmap( updateBarPixmap( mState ) ); + + mState++; +} diff --git a/ksplashml/themeengine/unified/themeunified.h b/ksplashml/themeengine/unified/themeunified.h new file mode 100644 index 000000000..a8f9e12e2 --- /dev/null +++ b/ksplashml/themeengine/unified/themeunified.h @@ -0,0 +1,101 @@ +/*************************************************************************** + * Copyright Brian Ledbetter 2001-2003 <brian@shadowcom.net> * + * Copyright Ravikiran Rajagopal 2003 * + * ravi@ee.eng.ohio-state.edu * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License (version 2) as * + * published by the Free Software Foundation. (The original KSplash/ML * + * codebase (upto version 0.95.3) is BSD-licensed.) * + * * + ***************************************************************************/ + +#ifndef __THEMEUNIFIED_H__ +#define __THEMEUNIFIED_H__ + +#include <kprogress.h> + +#include <tqlabel.h> +#include <tqwidget.h> + +#include <kdialog.h> + +#include "themeengine.h" +class TQPixmap; +class TQTimer; + +class TQCheckBox; + +class UnifiedConfig: public ThemeEngineConfig +{ + Q_OBJECT +public: + UnifiedConfig( TQWidget *, KConfig * ); + void save(); +protected: + TQCheckBox *mAlwaysShow; +}; + +/** + * @short Traditional Trinity splash screen. + */ +class ObjKsTheme; +class KDE_EXPORT ThemeUnified : public ThemeEngine +{ + Q_OBJECT +public: + ThemeUnified( TQWidget *, const char *, const TQStringList& ); + virtual ~ThemeUnified(); + + inline const UnifiedConfig *config( TQWidget *p, KConfig *c ) + { + return new UnifiedConfig( p, c ); + }; + + static TQStringList names() + { + TQStringList Names; + Names << "Unified"; + return( Names ); + } + +public slots: + inline void slotSetText( const TQString& s ) + { + close(); + if (mSysModalDialog) mSysModalDialog->setStatusMessage(TQString(s).append("...")); + } + inline void slotSetTextIndex( const int i ) + { + if (i == 3) { + if (mSysModalDialog) { + KSMModalDialog* temp = mSysModalDialog; + mSysModalDialog = NULL; + temp->closeSMDialog(); + } + } + } + inline void slotUpdateSteps( int s ) + { + } + inline void slotUpdateProgress( int i ) + { + } + + +private slots: + void slotUpdateState(); + +private: + void _initUi(); + void _readSettings(); + + // Configurable Options + TQColor mLabelForeground; + + // Internals. + KSMModalDialog* mSysModalDialog; + int mState; +}; + +#endif |