You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
2.5 KiB
108 lines
2.5 KiB
15 years ago
|
%{CPP_TEMPLATE}
|
||
|
|
||
|
#include <stdlib.h>
|
||
15 years ago
|
#include <tqcheckbox.h>
|
||
|
#include <tqcolor.h>
|
||
15 years ago
|
#include <kapplication.h>
|
||
|
#include <klocale.h>
|
||
|
#include <kpushbutton.h>
|
||
|
#include <kconfig.h>
|
||
|
#include <kglobal.h>
|
||
|
#include "%{APPNAMELC}.h"
|
||
|
#include "%{APPNAMELC}ui.h"
|
||
|
|
||
12 years ago
|
//! libtdescreensaver interface
|
||
15 years ago
|
extern "C"
|
||
|
{
|
||
|
const char *kss_applicationName = "%{APPNAMELC}.kss";
|
||
|
const char *kss_description = I18N_NOOP( "%{APPNAME}" );
|
||
|
const char *kss_version = "2.2.0";
|
||
|
|
||
|
%{APPNAME} *kss_create( WId id )
|
||
|
{
|
||
12 years ago
|
TDEGlobal::locale()->insertCatalogue("%{APPNAMELC}");
|
||
15 years ago
|
return new %{APPNAME}( id );
|
||
|
}
|
||
|
|
||
15 years ago
|
TQDialog *kss_setup()
|
||
15 years ago
|
{
|
||
12 years ago
|
TDEGlobal::locale()->insertCatalogue("%{APPNAMELC}");
|
||
15 years ago
|
return new %{APPNAME}Setup();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//-----------------------------------------------------------------------------
|
||
|
//! dialog to setup screen saver parameters
|
||
14 years ago
|
%{APPNAME}Setup::%{APPNAME}Setup( TQWidget *parent, const char *name )
|
||
|
: %{APPNAME}UI( parent, name, TRUE )
|
||
15 years ago
|
{
|
||
|
/// @todo
|
||
|
//Connect your signals and slots here to configure the screen saver.
|
||
15 years ago
|
connect( OkayPushButton, TQT_SIGNAL( released() ),
|
||
|
TQT_SLOT( slotOkPressed() ) );
|
||
|
connect( CancelPushButton, TQT_SIGNAL( released() ),
|
||
|
TQT_SLOT( slotCancelPressed() ) );
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
//! read settings from config file
|
||
|
void %{APPNAME}Setup::readSettings()
|
||
|
{
|
||
12 years ago
|
TDEConfig *config = TDEGlobal::config();
|
||
15 years ago
|
config->setGroup( "Settings" );
|
||
|
/// @todo
|
||
|
// Add your config options here...
|
||
|
CheckBox1->setChecked(config->readBoolEntry( "somesetting", false ));
|
||
|
}
|
||
|
|
||
|
|
||
|
//! Ok pressed - save settings and exit
|
||
|
void %{APPNAME}Setup::slotOkPressed()
|
||
|
{
|
||
12 years ago
|
TDEConfig *config = TDEGlobal::config();
|
||
15 years ago
|
config->setGroup( "Settings" );
|
||
|
/// @todo
|
||
|
// Add your config options here.
|
||
|
config->writeEntry( "somesetting", CheckBox1->isChecked() );
|
||
|
config->sync();
|
||
|
|
||
|
accept();
|
||
|
}
|
||
|
|
||
|
void %{APPNAME}Setup::slotCancelPressed()
|
||
|
{
|
||
|
reject();
|
||
|
}
|
||
|
//-----------------------------------------------------------------------------
|
||
|
|
||
|
|
||
|
%{APPNAME}::%{APPNAME}( WId id ) : KScreenSaver( id )
|
||
|
{
|
||
|
readSettings();
|
||
|
blank();
|
||
|
}
|
||
|
|
||
|
%{APPNAME}::~%{APPNAME}()
|
||
|
{}
|
||
|
|
||
|
|
||
|
//! read configuration settings from config file
|
||
|
void %{APPNAME}::readSettings()
|
||
|
{
|
||
12 years ago
|
TDEConfig *config = TDEGlobal::config();
|
||
15 years ago
|
config->setGroup( "Settings" );
|
||
|
/// @todo
|
||
|
// Add your config options here...
|
||
|
bool somesetting = config->readBoolEntry( "somesetting", false );
|
||
|
}
|
||
|
|
||
|
|
||
|
void %{APPNAME}::blank()
|
||
|
{
|
||
|
/// @todo
|
||
|
//Add your code to render the screen.
|
||
15 years ago
|
setBackgroundColor( TQColor(black) );
|
||
15 years ago
|
//
|
||
|
erase();
|
||
|
}
|