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