git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1253671 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
parent
75ab9920ac
commit
a382b3ab31
@ -0,0 +1,14 @@
|
||||
#################################################
|
||||
#
|
||||
# (C) 2010-2011 Serghei Amelian
|
||||
# serghei (DOT) amelian (AT) gmail.com
|
||||
#
|
||||
# Improvements and feedback are welcome
|
||||
#
|
||||
# This file is released under GPL >= 2
|
||||
#
|
||||
#################################################
|
||||
|
||||
install( FILES
|
||||
Theme.rc
|
||||
DESTINATION ${DATA_INSTALL_DIR}/ksplash/Themes/Unified )
|
@ -0,0 +1,16 @@
|
||||
# Unified KSplash/ML Theme
|
||||
|
||||
[KSplash Theme: Unified]
|
||||
Name = Trinity Unified Splash Screen
|
||||
Description = Unified system startup screen
|
||||
Version = 1.0
|
||||
Author = Timothy Pearson <kb9vqf@pearsoncomputing.net>
|
||||
|
||||
# Theme behaviour settings.
|
||||
Engine = Unified
|
||||
|
||||
# Show progress bar?
|
||||
Always Show Progress = false
|
||||
|
||||
# Status text colour
|
||||
Label Foreground = #FFFFFF
|
@ -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
|
||||
)
|
@ -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
|
@ -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" ) )
|
@ -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++;
|
||||
}
|
@ -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
|
Loading…
Reference in new issue