* 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,7 +185,14 @@ void KWinScreenEdgesConfig::monitorInit()
|
|||
monitorAddItem( i18n( "No Action" ));
|
||||
monitorAddItem( i18n( "Show Dashboard" ));
|
||||
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
|
||||
KServiceTypeTrader* trader = KServiceTypeTrader::self();
|
||||
KService::List services;
|
||||
|
@ -251,6 +258,8 @@ void KWinScreenEdgesConfig::monitorLoadAction( ElectricBorder edge, const QStrin
|
|||
QString lowerName = config.readEntry( configName, "None" ).toLower();
|
||||
if( lowerName == "dashboard" ) monitorChangeEdge( edge, int( ElectricActionDashboard ));
|
||||
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()
|
||||
|
@ -348,8 +357,23 @@ void KWinScreenEdgesConfig::monitorSaveAction( int edge, const QString& configNa
|
|||
config.writeEntry( configName, "Dashboard" );
|
||||
else if( item == 2 )
|
||||
config.writeEntry( configName, "ShowDesktop" );
|
||||
else if( item == 3)
|
||||
config.writeEntry( configName, "LockScreen" );
|
||||
else if ( item == 4)
|
||||
config.writeEntry( configName, "PreventScreenLocking" );
|
||||
else // Anything else
|
||||
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()
|
||||
|
|
|
@ -95,6 +95,8 @@ enum ElectricBorderAction
|
|||
ElectricActionNone, // No special action, not set, desktop switch or an effect
|
||||
ElectricActionDashboard, // Launch the Plasma dashboard
|
||||
ElectricActionShowDesktop, // Show desktop or restore
|
||||
ElectricActionLockScreen, // Lock screen
|
||||
ElectricActionPreventScreenLocking,
|
||||
ELECTRIC_ACTION_COUNT
|
||||
};
|
||||
|
||||
|
|
|
@ -278,6 +278,8 @@ ElectricBorderAction Options::electricBorderAction( const QString& name )
|
|||
QString lowerName = name.toLower();
|
||||
if( lowerName == "dashboard" ) return ElectricActionDashboard;
|
||||
else if( lowerName == "showdesktop" ) return ElectricActionShowDesktop;
|
||||
else if( lowerName == "lockscreen" ) return ElectricActionLockScreen;
|
||||
else if( lowerName == "preventscreenlocking" ) return ElectricActionLockScreen;
|
||||
return ElectricActionNone;
|
||||
}
|
||||
|
||||
|
|
|
@ -2242,6 +2242,16 @@ void Workspace::checkElectricBorder(const QPoint& pos, Time now)
|
|||
setShowingDesktop( !showingDesktop() );
|
||||
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
|
||||
default:
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue