MCPcopy Index your code
hub / github.com/corecoding/Vitals / _initializeMenuGroup

Method _initializeMenuGroup

extension.js:438–454  ·  view source on GitHub ↗
(groupName, optionName, menuSuffix = '', position = -1)

Source from the content-addressed store, hash-verified

436 }
437
438 _initializeMenuGroup(groupName, optionName, menuSuffix = '', position = -1) {
439 this._groups[groupName] = new PopupMenu.PopupSubMenuMenuItem(_(this._ucFirst(groupName) + menuSuffix), true);
440 this._groups[groupName].icon.gicon = Gio.icon_new_for_string(this._sensorIconPath(groupName));
441
442 // hide menu items that user has requested to not include
443 if (!this._settings.get_boolean('show-' + optionName))
444 this._groups[groupName].actor.hide();
445
446 if (!this._groups[groupName].status) {
447 this._groups[groupName].status = this._defaultLabel();
448 this._groups[groupName].actor.insert_child_at_index(this._groups[groupName].status, 4);
449 this._groups[groupName].status.text = _('No Data');
450 }
451
452 if(position == -1) this.menu.addMenuItem(this._groups[groupName]);
453 else this.menu.addMenuItem(this._groups[groupName], position);
454 }
455
456 _createRoundButton(iconName) {
457 let button = new St.Button({

Callers 2

_initializeMenuMethod · 0.95
_querySensorsMethod · 0.95

Calls 3

_ucFirstMethod · 0.95
_sensorIconPathMethod · 0.95
_defaultLabelMethod · 0.95

Tested by

no test coverage detected