@ -82,8 +82,9 @@ PlasmaComponents.ContextMenu {
return tasksModel . data ( modelIndex , modelProp )
}
function show ( ) {
function show ( ) {
loadDynamicLaunchActions ( visualParent . m . LauncherUrlWithoutIcon ) ;
loadMyViewActions ( ) ;
/ / b a c k e n d . u n g r a b M o u s e ( v i s u a l P a r e n t ) ;
openRelative ( ) ;
@ -299,6 +300,23 @@ PlasmaComponents.ContextMenu {
}
}
function loadMyViewActions ( ) {
if ( ! appletAbilities . myView . isReady ) {
return ;
}
var actionsCount = appletAbilities . myView . containmentActions . length ;
for ( var i = 0 ; i < actionsCount ; ++ i ) {
var item = newMenuItem ( menu ) ;
item . action = appletAbilities . myView . containmentActions [ i ] ;
item . visible = Qt . binding ( function ( ) {
return this . action . visible ;
} ) ;
menu . addMenuItem ( item , myViewActions ) ;
}
}
/ / / R E M O V E
function updateOnAllActivitiesLauncher ( ) {
/ / i s O n A l l A c t i v i t i e s L a u n c h e r = A c t i v i t i e s T o o l s . i s O n A l l A c t i v i t i e s ( v i s u a l P a r e n t . m . L a u n c h e r U r l W i t h o u t I c o n ) ;
@ -321,7 +339,7 @@ PlasmaComponents.ContextMenu {
}
Component.onDestruction: {
Component.onDestruction: {
if ( ! changingLayout ) {
root . contextMenu = null ;
backend . ungrabMouse ( visualParent ) ;
@ -817,13 +835,8 @@ PlasmaComponents.ContextMenu {
/ / / / / / E N D O F N E W A R C H I T E C T U R E
/ * P l a s m a C o m p o n e n t s . M e n u I t e m {
separator: true
visible: root . inEditMode
} * /
PlasmaComponents . MenuItem {
id: addInternalSeparatorItem
id: addInternalSeparatorItem
enabled: ! visualParent . tailItemIsSeparator || ! visualParent . headItemIsSeparator
visible: visualParent . hasShownLauncher
icon: "add"
@ -879,100 +892,24 @@ PlasmaComponents.ContextMenu {
}
PlasmaComponents . MenuItem {
/ / t e x t : i 1 8 n ( " C o n f i g u r e " )
/ / s e c t i o n : t r u e
id: myViewActions
separator: true
visible: preferenceMenuItem . visible
}
/ * P l a s m a C o m p o n e n t s . M e n u I t e m {
separator: true
visible: root . inEditMode
} * /
PlasmaComponents . MenuItem {
text: "Latte"
section: true
visible: appletAbilities . myView . isReady
}
PlasmaComponents . MenuItem {
id: layoutsMenuItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "layouts" ) : plasmoid . action ( "configure" )
enabled: visible
}
PlasmaComponents . MenuItem {
id: preferenceMenuItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "preferences" ) : plasmoid . action ( "configure" )
visible: appletAbilities . myView . isReady
}
PlasmaComponents . MenuItem {
id: quitApplicationItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "quit latte" ) : plasmoid . action ( "configure" )
visible: appletAbilities . myView . isReady
visible: false
}
PlasmaComponents . MenuItem {
separator: true
visible: preferenceMenuItem . visible
visible: removePlasmoidInMyViewEditMode . visible
}
PlasmaComponents . MenuItem {
id: addWidgets
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "add latte widgets" ) : plasmoid . action ( "configure" ) ;
visible: appletAbilities . myView . isReady && action . visible
}
PlasmaComponents . MenuItem {
id: duplicateItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "duplicate view" ) : plasmoid . action ( "configure" )
visible: appletAbilities . myView . isReady && action . visible
}
PlasmaComponents . MenuItem {
id: exportItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "export view" ) : plasmoid . action ( "configure" )
visible: appletAbilities . myView . isReady && action . visible
}
PlasmaComponents . MenuItem {
id: configureItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "edit view" ) : plasmoid . action ( "configure" )
visible: appletAbilities . myView . isReady && action . visible
}
PlasmaComponents . MenuItem {
id: removeItem
action: appletAbilities . myView . isReady ? appletAbilities . myView . action ( "remove view" ) : plasmoid . action ( "remove" )
visible: appletAbilities . myView . isReady && action . visible
}
/ / ! B E G I N : P l a s m o i d a c t i o n s w h e n i t i s n t i n s i d e a L a t t e d o c k
PlasmaComponents . MenuItem {
id: configurePlasmoid
visible: ! appletAbilities . myView . isReady && ! plasmoid . immutable
text: plasmoid . action ( "configure" ) . text
icon: plasmoid . action ( "configure" ) . icon
onClicked: plasmoid . action ( "configure" ) . trigger ( ) ;
}
/ / ! E N D : P l a s m o i d a c t i o n s w h e n i t i s n t i n s i d e a L a t t e d o c k
PlasmaComponents . MenuItem {
separator: true
visible: removePlasmoid . visible
}
PlasmaComponents . MenuItem {
id: removePlasmoid
visible: ( appletAbilities . myView . isReady && appletAbilities . myView . inEditMode )
|| ( ! root . latteBridge && ! plasmoid . immutable /*normal plasmoid in the desktop*/ )
id: removePlasmoidInMyViewEditMode
/ / ! W o r k a r o u n d : t h i s i s p r e f e r r e d c o m p a r e d t o :
/ / ! a c t i o n : p l a s m o i d . a c t i o n ( " r e m o v e " )
/ / ! w h i c h s h o w s t h e a c t i o n a l w a y s a n d n o t d e p e n d e n t o f m y V i e w . i n E d i t M o d e f l a g
text: plasmoid . action ( "remove" ) . text
icon: plasmoid . action ( "remove" ) . icon
visible: appletAbilities . myView . isReady && appletAbilities . myView . inEditMode
onClicked: plasmoid . action ( "remove" ) . trigger ( ) ;
}