@@ -53,6 +53,7 @@ Item {
5353
5454 "unity.widgets.systemsettings.tablet.wifisection" : wifiSection,
5555 "unity.widgets.systemsettings.tablet.accesspoint" : accessPoint,
56+ "com.canonical.indicator.network.modeminfoitem" : modeminfoitem,
5657 }
5758
5859 function getExtendedProperty(object, propertyName, defaultValue) {
@@ -363,6 +364,80 @@ Item {
363364 }
364365 }
365366
367+ Component {
368+ id: modeminfoitem;
369+ ModemInfoItem {
370+ objectName: "modemInfoItem"
371+ property QtObject menuData: null
372+ property var menuModel: menuFactory.menuModel
373+ property int menuIndex: -1
374+ property var extendedData: menuData && menuData.ext || undefined
375+
376+ property var statusLabelAction: QMenuModel.UnityMenuAction {
377+ model: menuModel
378+ index: menuIndex
379+ name: getExtendedProperty(extendedData, "xCanonicalModemStatusLabelAction", "")
380+ }
381+ statusText: statusLabelAction.valid ? statusLabelAction.state : ""
382+
383+ property var statusIconAction: QMenuModel.UnityMenuAction {
384+ model: menuModel
385+ index: menuIndex
386+ name: getExtendedProperty(extendedData, "xCanonicalModemStatusIconAction", "")
387+ }
388+ statusIcon: statusIconAction.valid ? statusIconAction.state : ""
389+
390+ property var connectivityIconAction: QMenuModel.UnityMenuAction {
391+ model: menuModel
392+ index: menuIndex
393+ name: getExtendedProperty(extendedData, "xCanonicalModemConnectivityIconAction", "")
394+ }
395+ connectivityIcon: connectivityIconAction.valid ? connectivityIconAction.state : ""
396+
397+ property var simIdentifierLabelAction: QMenuModel.UnityMenuAction {
398+ model: menuModel
399+ index: menuIndex
400+ name: getExtendedProperty(extendedData, "xCanonicalModemSimIdentifierLabelAction", "")
401+ }
402+ simIdentifierText: simIdentifierLabelAction.valid ? simIdentifierLabelAction.state : ""
403+
404+ property var roamingAction: QMenuModel.UnityMenuAction {
405+ model: menuModel
406+ index: menuIndex
407+ name: getExtendedProperty(extendedData, "xCanonicalModemRoamingAction", "")
408+ }
409+ roaming: roamingAction.valid ? roamingAction.state : false
410+
411+ property var unlockAction: QMenuModel.UnityMenuAction {
412+ model: menuModel
413+ index: menuIndex
414+ name: getExtendedProperty(extendedData, "xCanonicalModemLockedAction", "")
415+ }
416+ onUnlock: {
417+ unlockAction.activate();
418+ shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
419+ }
420+ locked: unlockAction.valid ? unlockAction.state : false
421+
422+ onMenuModelChanged: {
423+ loadAttributes();
424+ }
425+ onMenuIndexChanged: {
426+ loadAttributes();
427+ }
428+
429+ function loadAttributes() {
430+ if (!menuModel || menuIndex == -1) return;
431+ menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-modem-status-label-action': 'string',
432+ 'x-canonical-modem-status-icon-action': 'string',
433+ 'x-canonical-modem-connectivity-icon-action': 'string',
434+ 'x-canonical-modem-sim-identifier-label': 'string',
435+ 'x-canonical-modem-roaming-action': 'string',
436+ 'x-canonical-modem-locked-action': 'string'});
437+ }
438+ }
439+ }
440+
366441 Component {
367442 id: messageItem
368443 MessageMenuItemFactory {