* Removed "Advanced Button" from screensaver kcm.
* Screensaver screen edges settings have been merged with kwin screen edges settings. * Removed screensaver priority configuration: we assume that users don't need to change screensaver priority. REVIEWBOARD: http://reviewboard.kde.org/r/3240/ svn path=/trunk/KDE/kdebase/workspace/; revision=1101792
This commit is contained in:
parent
5d0ab03a69
commit
45bcf3173a
4 changed files with 39 additions and 1 deletions
|
@ -185,6 +185,13 @@ void KWinScreenEdgesConfig::monitorInit()
|
||||||
monitorAddItem( i18n( "No Action" ));
|
monitorAddItem( i18n( "No Action" ));
|
||||||
monitorAddItem( i18n( "Show Dashboard" ));
|
monitorAddItem( i18n( "Show Dashboard" ));
|
||||||
monitorAddItem( i18n( "Show Desktop" ));
|
monitorAddItem( i18n( "Show Desktop" ));
|
||||||
|
monitorAddItem( i18n( "Lock Screen" ));
|
||||||
|
monitorAddItem( i18n( "Prevent Screen Locking" ));
|
||||||
|
//Prevent Screen Locking is not supported on some edges
|
||||||
|
m_ui->monitor->setEdgeItemEnabled( int( Monitor::Top ), 4, false );
|
||||||
|
m_ui->monitor->setEdgeItemEnabled( int( Monitor::Left ), 4, false );
|
||||||
|
m_ui->monitor->setEdgeItemEnabled( int( Monitor::Right ), 4, false );
|
||||||
|
m_ui->monitor->setEdgeItemEnabled( int( Monitor::Bottom ), 4, false );
|
||||||
|
|
||||||
// Search the effect names
|
// Search the effect names
|
||||||
KServiceTypeTrader* trader = KServiceTypeTrader::self();
|
KServiceTypeTrader* trader = KServiceTypeTrader::self();
|
||||||
|
@ -251,6 +258,8 @@ void KWinScreenEdgesConfig::monitorLoadAction( ElectricBorder edge, const QStrin
|
||||||
QString lowerName = config.readEntry( configName, "None" ).toLower();
|
QString lowerName = config.readEntry( configName, "None" ).toLower();
|
||||||
if( lowerName == "dashboard" ) monitorChangeEdge( edge, int( ElectricActionDashboard ));
|
if( lowerName == "dashboard" ) monitorChangeEdge( edge, int( ElectricActionDashboard ));
|
||||||
else if( lowerName == "showdesktop" ) monitorChangeEdge( edge, int( ElectricActionShowDesktop ));
|
else if( lowerName == "showdesktop" ) monitorChangeEdge( edge, int( ElectricActionShowDesktop ));
|
||||||
|
else if( lowerName == "lockscreen" ) monitorChangeEdge( edge, int( ElectricActionLockScreen ));
|
||||||
|
else if( lowerName == "preventscreenlocking" ) monitorChangeEdge( edge, int( ElectricActionPreventScreenLocking ));
|
||||||
}
|
}
|
||||||
|
|
||||||
void KWinScreenEdgesConfig::monitorLoad()
|
void KWinScreenEdgesConfig::monitorLoad()
|
||||||
|
@ -348,8 +357,23 @@ void KWinScreenEdgesConfig::monitorSaveAction( int edge, const QString& configNa
|
||||||
config.writeEntry( configName, "Dashboard" );
|
config.writeEntry( configName, "Dashboard" );
|
||||||
else if( item == 2 )
|
else if( item == 2 )
|
||||||
config.writeEntry( configName, "ShowDesktop" );
|
config.writeEntry( configName, "ShowDesktop" );
|
||||||
|
else if( item == 3)
|
||||||
|
config.writeEntry( configName, "LockScreen" );
|
||||||
|
else if ( item == 4)
|
||||||
|
config.writeEntry( configName, "PreventScreenLocking" );
|
||||||
else // Anything else
|
else // Anything else
|
||||||
config.writeEntry( configName, "None" );
|
config.writeEntry( configName, "None" );
|
||||||
|
|
||||||
|
if ((edge == int( Monitor::TopRight )) ||
|
||||||
|
(edge == int( Monitor::BottomRight )) ||
|
||||||
|
(edge == int( Monitor::BottomLeft )) ||
|
||||||
|
(edge == int( Monitor::TopLeft )))
|
||||||
|
{
|
||||||
|
KConfig scrnConfig("kscreensaverrc");
|
||||||
|
KConfigGroup scrnGroup = scrnConfig.group("ScreenSaver");
|
||||||
|
scrnGroup.writeEntry("Action" + configName, (item == 4) ? 2 /* Prevent Screen Locking */ : 0 /* None */);
|
||||||
|
scrnGroup.sync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KWinScreenEdgesConfig::monitorSave()
|
void KWinScreenEdgesConfig::monitorSave()
|
||||||
|
|
|
@ -95,6 +95,8 @@ enum ElectricBorderAction
|
||||||
ElectricActionNone, // No special action, not set, desktop switch or an effect
|
ElectricActionNone, // No special action, not set, desktop switch or an effect
|
||||||
ElectricActionDashboard, // Launch the Plasma dashboard
|
ElectricActionDashboard, // Launch the Plasma dashboard
|
||||||
ElectricActionShowDesktop, // Show desktop or restore
|
ElectricActionShowDesktop, // Show desktop or restore
|
||||||
|
ElectricActionLockScreen, // Lock screen
|
||||||
|
ElectricActionPreventScreenLocking,
|
||||||
ELECTRIC_ACTION_COUNT
|
ELECTRIC_ACTION_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -278,6 +278,8 @@ ElectricBorderAction Options::electricBorderAction( const QString& name )
|
||||||
QString lowerName = name.toLower();
|
QString lowerName = name.toLower();
|
||||||
if( lowerName == "dashboard" ) return ElectricActionDashboard;
|
if( lowerName == "dashboard" ) return ElectricActionDashboard;
|
||||||
else if( lowerName == "showdesktop" ) return ElectricActionShowDesktop;
|
else if( lowerName == "showdesktop" ) return ElectricActionShowDesktop;
|
||||||
|
else if( lowerName == "lockscreen" ) return ElectricActionLockScreen;
|
||||||
|
else if( lowerName == "preventscreenlocking" ) return ElectricActionLockScreen;
|
||||||
return ElectricActionNone;
|
return ElectricActionNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2242,6 +2242,16 @@ void Workspace::checkElectricBorder(const QPoint& pos, Time now)
|
||||||
setShowingDesktop( !showingDesktop() );
|
setShowingDesktop( !showingDesktop() );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ElectricActionLockScreen: // Lock the screen
|
||||||
|
{
|
||||||
|
QDBusInterface screenSaver( "org.kde.screensaver", "/ScreenSaver" );
|
||||||
|
screenSaver.call( "Lock" );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ElectricActionPreventScreenLocking:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ElectricActionNone: // Either desktop switching or an effect
|
case ElectricActionNone: // Either desktop switching or an effect
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue