|
|
|
@ -281,12 +281,12 @@ int screen::checkScreenSaverStatus() {
|
|
|
|
|
if (check == 10) {
|
|
|
|
|
delete gnomeScreensaverCheck;
|
|
|
|
|
|
|
|
|
|
gnomeScreensaverCheck = new KProcess;
|
|
|
|
|
gnomeScreensaverCheck = new TDEProcess;
|
|
|
|
|
*gnomeScreensaverCheck << "gnome-screensaver-command" << "--query";
|
|
|
|
|
|
|
|
|
|
connect( gnomeScreensaverCheck , TQT_SIGNAL(processExited(KProcess *)),TQT_SLOT(getGSExited(KProcess *)));
|
|
|
|
|
connect( gnomeScreensaverCheck , TQT_SIGNAL(processExited(TDEProcess *)),TQT_SLOT(getGSExited(TDEProcess *)));
|
|
|
|
|
|
|
|
|
|
if(!gnomeScreensaverCheck->start(KProcess::NotifyOnExit))
|
|
|
|
|
if(!gnomeScreensaverCheck->start(TDEProcess::NotifyOnExit))
|
|
|
|
|
{
|
|
|
|
|
delete gnomeScreensaverCheck;
|
|
|
|
|
gnomeScreensaverCheck = NULL;
|
|
|
|
@ -302,7 +302,7 @@ int screen::checkScreenSaverStatus() {
|
|
|
|
|
* \b TQT_SLOT which called if the call of gnomescreensaver-command exited
|
|
|
|
|
* \param gnomecheckcommand the KPocess which called this SLOT
|
|
|
|
|
*/
|
|
|
|
|
void screen::getGSExited (KProcess *gnomecheckcommand) {
|
|
|
|
|
void screen::getGSExited (TDEProcess *gnomecheckcommand) {
|
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
|
|
|
|
|
|
if (gnomecheckcommand->normalExit()){
|
|
|
|
@ -449,12 +449,12 @@ bool screen::lockScreen(){
|
|
|
|
|
xscreensaver:
|
|
|
|
|
delete xscreensaver_lock;
|
|
|
|
|
|
|
|
|
|
xscreensaver_lock = new KProcess;
|
|
|
|
|
xscreensaver_lock = new TDEProcess;
|
|
|
|
|
*xscreensaver_lock << "xscreensaver-command" << "-lock";
|
|
|
|
|
connect(xscreensaver_lock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(xscreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
|
|
|
|
|
bool status = xscreensaver_lock->start(KProcess::DontCare);
|
|
|
|
|
bool status = xscreensaver_lock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete xscreensaver_lock;
|
|
|
|
@ -466,12 +466,12 @@ xscreensaver:
|
|
|
|
|
else if(SCREENSAVER_STATUS == 20){
|
|
|
|
|
delete gnomescreensaver_lock;
|
|
|
|
|
|
|
|
|
|
gnomescreensaver_lock = new KProcess;
|
|
|
|
|
gnomescreensaver_lock = new TDEProcess;
|
|
|
|
|
*gnomescreensaver_lock << "gnome-screensaver-command" << "--lock";
|
|
|
|
|
|
|
|
|
|
connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
bool status = gnomescreensaver_lock->start(KProcess::DontCare);
|
|
|
|
|
connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
bool status = gnomescreensaver_lock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete gnomescreensaver_lock;
|
|
|
|
@ -485,11 +485,11 @@ xscreensaver:
|
|
|
|
|
else if(SCREENSAVER_STATUS == 10 || SCREENSAVER_STATUS == 99){
|
|
|
|
|
delete xlock;
|
|
|
|
|
|
|
|
|
|
xlock = new KProcess;
|
|
|
|
|
xlock = new TDEProcess;
|
|
|
|
|
*xlock << "xlock"; //<< "-mode" << "blank";
|
|
|
|
|
connect(xlock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
bool status = xlock->start(KProcess::DontCare);
|
|
|
|
|
connect(xlock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
bool status = xlock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete xlock;
|
|
|
|
@ -519,12 +519,12 @@ bool screen::lockScreen( TQString lock_withMethod ) {
|
|
|
|
|
else if (lock_withMethod == "xlock") {
|
|
|
|
|
delete xlock;
|
|
|
|
|
|
|
|
|
|
xlock = new KProcess;
|
|
|
|
|
xlock = new TDEProcess;
|
|
|
|
|
*xlock << "xlock";
|
|
|
|
|
connect(xlock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(xlock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
|
|
|
|
|
bool status = xlock->start(KProcess::DontCare);
|
|
|
|
|
bool status = xlock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete xlock;
|
|
|
|
@ -534,12 +534,12 @@ bool screen::lockScreen( TQString lock_withMethod ) {
|
|
|
|
|
return status;
|
|
|
|
|
}
|
|
|
|
|
else if (lock_withMethod == "gnomescreensaver") {
|
|
|
|
|
gnomescreensaver_lock = new KProcess;
|
|
|
|
|
gnomescreensaver_lock = new TDEProcess;
|
|
|
|
|
*gnomescreensaver_lock << "gnome-screensaver-command" << "--lock";
|
|
|
|
|
connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(gnomescreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
|
|
|
|
|
bool status = gnomescreensaver_lock->start(KProcess::DontCare);
|
|
|
|
|
bool status = gnomescreensaver_lock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete gnomescreensaver_lock;
|
|
|
|
@ -569,12 +569,12 @@ bool screen::lockScreen( TQString lock_withMethod ) {
|
|
|
|
|
xscreensaver:
|
|
|
|
|
delete xscreensaver_lock;
|
|
|
|
|
|
|
|
|
|
xscreensaver_lock = new KProcess;
|
|
|
|
|
xscreensaver_lock = new TDEProcess;
|
|
|
|
|
*xscreensaver_lock << "xscreensaver-command" << "-lock";
|
|
|
|
|
connect(xscreensaver_lock, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(xscreensaver_lock, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
|
|
|
|
|
bool status = xscreensaver_lock->start(KProcess::DontCare);
|
|
|
|
|
bool status = xscreensaver_lock->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete xscreensaver_lock;
|
|
|
|
@ -652,12 +652,12 @@ bool screen::resetXScreensaver(){
|
|
|
|
|
|
|
|
|
|
delete xscreensaver_reset;
|
|
|
|
|
|
|
|
|
|
xscreensaver_reset = new KProcess;
|
|
|
|
|
xscreensaver_reset = new TDEProcess;
|
|
|
|
|
*xscreensaver_reset << "xscreensaver-command" << "-restart";
|
|
|
|
|
connect(xscreensaver_reset, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(xscreensaver_reset, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
|
|
|
|
|
bool status = xscreensaver_reset->start(KProcess::DontCare);
|
|
|
|
|
bool status = xscreensaver_reset->start(TDEProcess::DontCare);
|
|
|
|
|
if(!status)
|
|
|
|
|
{
|
|
|
|
|
delete xscreensaver_reset;
|
|
|
|
@ -677,10 +677,10 @@ bool screen::resetXScreensaver(){
|
|
|
|
|
void screen::forceDPMSOff() {
|
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
|
|
|
|
|
|
KProcess *xset = new KProcess;
|
|
|
|
|
TDEProcess *xset = new TDEProcess;
|
|
|
|
|
*xset << "xset" << "dpms" << "force" << "off";
|
|
|
|
|
connect(xset, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(KProcess*)));
|
|
|
|
|
connect(xset, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
|
this, TQT_SLOT(cleanProcess(TDEProcess*)));
|
|
|
|
|
if(!xset->start())
|
|
|
|
|
{
|
|
|
|
|
delete xset;
|
|
|
|
@ -690,9 +690,9 @@ void screen::forceDPMSOff() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* function to clean KProcess objects
|
|
|
|
|
* function to clean TDEProcess objects
|
|
|
|
|
*/
|
|
|
|
|
void screen::cleanProcess(KProcess* proc)
|
|
|
|
|
void screen::cleanProcess(TDEProcess* proc)
|
|
|
|
|
{
|
|
|
|
|
delete proc;
|
|
|
|
|
proc = NULL;
|
|
|
|
|