mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 01:39:03 +08:00
CURA-4870 Modify printer menu visibility of the items. Show local or network submenu only when there is local or network printers respectively
This commit is contained in:
parent
dead2122dd
commit
6e35fc5035
@ -3,35 +3,58 @@
|
|||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
import Cura 1.0 as Cura
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
id: menu;
|
id: menu
|
||||||
|
// TODO Enable custom style to the menu
|
||||||
|
// style: MenuStyle
|
||||||
|
// {
|
||||||
|
// frame: Rectangle
|
||||||
|
// {
|
||||||
|
// color: "white"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label:category menu label", "Network printers")
|
text: catalog.i18nc("@label:category menu label", "Network enabled printers")
|
||||||
enabled: false
|
enabled: false
|
||||||
|
visible: networkPrinterMenu.count > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkPrinterMenu { }
|
NetworkPrinterMenu
|
||||||
|
{
|
||||||
|
id: networkPrinterMenu
|
||||||
|
}
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator
|
||||||
|
{
|
||||||
|
visible: networkPrinterMenu.count > 0
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||||
enabled: false
|
enabled: false
|
||||||
|
visible: localPrinterMenu.count > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalPrinterMenu { }
|
LocalPrinterMenu
|
||||||
|
{
|
||||||
|
id: localPrinterMenu
|
||||||
|
}
|
||||||
|
|
||||||
ExclusiveGroup { id: group; }
|
ExclusiveGroup { id: group; }
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator
|
||||||
|
{
|
||||||
|
visible: localPrinterMenu.count > 0
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem { action: Cura.Actions.addMachine; }
|
MenuItem { action: Cura.Actions.addMachine; }
|
||||||
MenuItem { action: Cura.Actions.configureMachines; }
|
MenuItem { action: Cura.Actions.configureMachines; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user