@ -71,11 +71,11 @@ void ContextMenu::restore(const KConfigGroup &config)
if ( c - > containmentType ( ) = = Plasma : : Types : : PanelContainment | |
if ( c - > containmentType ( ) = = Plasma : : Types : : PanelContainment | |
c - > containmentType ( ) = = Plasma : : Types : : CustomPanelContainment ) {
c - > containmentType ( ) = = Plasma : : Types : : CustomPanelContainment ) {
m_actionOrder < < QStringLiteral ( " add widgets " ) < < QStringLiteral ( " _add panel " ) < < QStringLiteral ( " lock widgets " ) < < QStringLiteral ( " _context " ) < < QStringLiteral ( " configure " ) < < QStringLiteral ( " remove " ) ;
m_actionOrder < < QStringLiteral ( " add widgets " ) < < QStringLiteral ( " _add panel " ) < < QStringLiteral ( " _context " ) < < QStringLiteral ( " configure " ) < < QStringLiteral ( " remove " ) ;
} else {
} else {
actions . insert ( QStringLiteral ( " configure shortcuts " ) , false ) ;
actions . insert ( QStringLiteral ( " configure shortcuts " ) , false ) ;
m_actionOrder < < QStringLiteral ( " _context " ) < < QStringLiteral ( " _run_command " ) < < QStringLiteral ( " add widgets " ) < < QStringLiteral ( " _add panel " )
m_actionOrder < < QStringLiteral ( " _context " ) < < QStringLiteral ( " _run_command " ) < < QStringLiteral ( " add widgets " ) < < QStringLiteral ( " _add panel " )
< < QStringLiteral ( " manage activities " ) < < QStringLiteral ( " remove " ) < < QStringLiteral ( " lock widgets " ) < < QStringLiteral ( " edit mode " ) < < QStringLiteral ( " _sep1 " )
< < QStringLiteral ( " manage activities " ) < < QStringLiteral ( " remove " ) < < QStringLiteral ( " edit mode " ) < < QStringLiteral ( " _sep1 " )
< < QStringLiteral ( " _lock_screen " ) < < QStringLiteral ( " _logout " ) < < QStringLiteral ( " _sep2 " ) < < QStringLiteral ( " run associated application " ) < < QStringLiteral ( " configure " )
< < QStringLiteral ( " _lock_screen " ) < < QStringLiteral ( " _logout " ) < < QStringLiteral ( " _sep2 " ) < < QStringLiteral ( " run associated application " ) < < QStringLiteral ( " configure " )
< < QStringLiteral ( " configure shortcuts " ) < < QStringLiteral ( " _sep3 " ) < < QStringLiteral ( " _wallpaper " ) ;
< < QStringLiteral ( " configure shortcuts " ) < < QStringLiteral ( " _sep3 " ) < < QStringLiteral ( " _wallpaper " ) ;
disabled . insert ( QStringLiteral ( " configure shortcuts " ) ) ;
disabled . insert ( QStringLiteral ( " configure shortcuts " ) ) ;
@ -140,11 +140,9 @@ QList<QAction*> ContextMenu::contextualActions()
// Bug 364292: show "Remove this Panel" option only when panelcontroller is opened
// Bug 364292: show "Remove this Panel" option only when panelcontroller is opened
if ( name ! = QLatin1String ( " remove " ) | | c - > isUserConfiguring ( ) | |
if ( name ! = QLatin1String ( " remove " ) | | c - > isUserConfiguring ( ) | |
( c - > containmentType ( ) ! = Plasma : : Types : : PanelContainment
( c - > containmentType ( ) ! = Plasma : : Types : : PanelContainment
& & c - > containmentType ( ) ! = Plasma : : Types : : CustomPanelContainment ) ) {
& & c - > containmentType ( ) ! = Plasma : : Types : : CustomPanelContainment
& & c - > corona ( ) - > immutability ( ) ! = Plasma : : Types : : Mutable ) ) {
if ( name ! = QLatin1String ( " lock widgets " ) | | c - > corona ( ) - > immutability ( ) ! = Plasma : : Types : : Mutable ) {
actions < < a ;
actions < < a ;
}
}
}
}
}
}
}
@ -178,10 +176,6 @@ QAction *ContextMenu::action(const QString &name)
if ( KAuthorized : : authorize ( QStringLiteral ( " logout " ) ) ) {
if ( KAuthorized : : authorize ( QStringLiteral ( " logout " ) ) ) {
return m_logoutAction ;
return m_logoutAction ;
}
}
} else if ( name = = QLatin1String ( " lock widgets " ) ) {
if ( c - > corona ( ) ) {
return c - > corona ( ) - > actions ( ) - > action ( QStringLiteral ( " lock widgets " ) ) ;
}
} else if ( name = = QLatin1String ( " edit mode " ) ) {
} else if ( name = = QLatin1String ( " edit mode " ) ) {
if ( c - > corona ( ) ) {
if ( c - > corona ( ) ) {
return c - > corona ( ) - > actions ( ) - > action ( QStringLiteral ( " edit mode " ) ) ;
return c - > corona ( ) - > actions ( ) - > action ( QStringLiteral ( " edit mode " ) ) ;