|
|
@ -71,7 +71,7 @@ screen::~screen() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* To enable/disable the KScreensaver/Xscreensaver.
|
|
|
|
* To enable/disable the TDEScreensaver/Xscreensaver.
|
|
|
|
* \param enable true: activate/enable screensaver / false: deactivate/disable screensacer
|
|
|
|
* \param enable true: activate/enable screensaver / false: deactivate/disable screensacer
|
|
|
|
* \return the result of try to set the screensaver
|
|
|
|
* \return the result of try to set the screensaver
|
|
|
|
* \retval true if screensaver set correct
|
|
|
|
* \retval true if screensaver set correct
|
|
|
@ -236,8 +236,8 @@ void screen::xscreensaver_ping(){
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* Checks if KScreenSaver or XscreenSaver is activated
|
|
|
|
* Checks if KScreenSaver or XscreenSaver is activated
|
|
|
|
* \return The result of the check as an integer value.
|
|
|
|
* \return The result of the check as an integer value.
|
|
|
|
* \retval 0 KScreensaver is disabled
|
|
|
|
* \retval 0 TDEScreensaver is disabled
|
|
|
|
* \retval 1 KScreensaver is activated
|
|
|
|
* \retval 1 TDEScreensaver is activated
|
|
|
|
* \retval 10 Xscreensaver is not found or not running
|
|
|
|
* \retval 10 Xscreensaver is not found or not running
|
|
|
|
* \retval 11 Xscreensaver is activated
|
|
|
|
* \retval 11 Xscreensaver is activated
|
|
|
|
* \retval 99 gnome-screensaver check is running
|
|
|
|
* \retval 99 gnome-screensaver check is running
|
|
|
@ -269,9 +269,9 @@ int screen::checkScreenSaverStatus() {
|
|
|
|
if(windowid == 0) {
|
|
|
|
if(windowid == 0) {
|
|
|
|
//Xscreensaver not detected
|
|
|
|
//Xscreensaver not detected
|
|
|
|
check_xscreensaver_timer->stop();
|
|
|
|
check_xscreensaver_timer->stop();
|
|
|
|
// KScreensaver activ and no XScreensaver found
|
|
|
|
// TDEScreensaver active and no XScreensaver found
|
|
|
|
if(kScreenSaver_tmp_status == 0) return 0;
|
|
|
|
if(kScreenSaver_tmp_status == 0) return 0;
|
|
|
|
// no KScreensaver and no XScreensaver found
|
|
|
|
// no TDEScreensaver and no XScreensaver found
|
|
|
|
else check = 10;
|
|
|
|
else check = 10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else return 11;
|
|
|
|
else return 11;
|
|
|
@ -434,13 +434,13 @@ bool screen::lockScreen(){
|
|
|
|
// screensaver status known?
|
|
|
|
// screensaver status known?
|
|
|
|
if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus();
|
|
|
|
if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus();
|
|
|
|
|
|
|
|
|
|
|
|
// set lock for KScreensaver
|
|
|
|
// set lock for TDEScreensaver
|
|
|
|
if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){
|
|
|
|
if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){
|
|
|
|
DCOPReply reply = screen_save_dcop_ref.call("lock");
|
|
|
|
DCOPReply reply = screen_save_dcop_ref.call("lock");
|
|
|
|
if ( reply.isValid() ) {
|
|
|
|
if ( reply.isValid() ) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
kdWarning() << "Could not lock KScreensaver, try XScreensaver as fallback." << endl;
|
|
|
|
kdWarning() << "Could not lock TDEScreensaver, try XScreensaver as fallback." << endl;
|
|
|
|
goto xscreensaver;
|
|
|
|
goto xscreensaver;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -557,7 +557,7 @@ bool screen::lockScreen( TQString lock_withMethod ) {
|
|
|
|
if ( reply.isValid() ) {
|
|
|
|
if ( reply.isValid() ) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
kdWarning() << "Could not call lock for KScreensaver, try XScreensaver "
|
|
|
|
kdWarning() << "Could not call lock for TDEScreensaver, try XScreensaver "
|
|
|
|
<< "as fallback." << endl;
|
|
|
|
<< "as fallback." << endl;
|
|
|
|
goto xscreensaver;
|
|
|
|
goto xscreensaver;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -598,7 +598,7 @@ void screen::blankOnlyScreen( bool blankonly ){
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
|
|
|
|
|
|
|
|
if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus();
|
|
|
|
if(SCREENSAVER_STATUS == -1) SCREENSAVER_STATUS = checkScreenSaverStatus();
|
|
|
|
// set KScreensaver
|
|
|
|
// set TDEScreensaver
|
|
|
|
if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){
|
|
|
|
if((SCREENSAVER_STATUS == 1) || (SCREENSAVER_STATUS == 0)){
|
|
|
|
screen_save_dcop_ref.send("setBlankOnly", blankonly);
|
|
|
|
screen_save_dcop_ref.send("setBlankOnly", blankonly);
|
|
|
|
}
|
|
|
|
}
|
|
|
|