Skip to content

Commit

Permalink
Sort the VM-list (#6717)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux authored Jan 8, 2025
1 parent b511323 commit 575ce1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 10 additions & 5 deletions vboxlauncher@mockturtl/files/vboxlauncher@mockturtl/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const CMD_VBOX = "virtualbox"
const CMD_VBOXMANAGE = "vboxmanage"

const CMD_VBOX_VM = CMD_VBOXMANAGE + " startvm "
const CMD_VBOX_LIST = CMD_VBOXMANAGE + " list vms"
const CMD_VBOX_LIST_RUN = CMD_VBOXMANAGE + " list runningvms"
const CMD_VBOX_LIST = CMD_VBOXMANAGE + " list --sorted vms"
const CMD_VBOX_LIST_RUN = CMD_VBOXMANAGE + " list --sorted runningvms"
const CMD_VBOX_VERSION = CMD_VBOXMANAGE + " -v"
var VBOX_ISRUNNING = "0"

Expand Down Expand Up @@ -71,12 +71,12 @@ const stringFromUTF8Array = function(data) {
}


function MyApplet(metadata, orientation, panelHeight, instanceId) {
function VBoxLauncher(metadata, orientation, panelHeight, instanceId) {
this.settings = new Settings.AppletSettings(this, UUID, instanceId)
this._init(orientation, panelHeight, instanceId)
}

MyApplet.prototype = {
VBoxLauncher.prototype = {
__proto__: Applet.IconApplet.prototype

, _init: function(orientation, panelHeight, instanceId) {
Expand Down Expand Up @@ -325,9 +325,14 @@ MyApplet.prototype = {
, onSwitchShowHeadless: function() {
this.updateMenu() // Whether or not to show headless modes
}
, on_applet_removed_from_panel: function(event) {
if (this.menu.isOpen)
this.menu.close();
this.menu.removeAll();
}

}

function main(metadata, orientation, panelHeight, instanceId) {
return new MyApplet(metadata, orientation, panelHeight, instanceId)
return new VBoxLauncher(metadata, orientation, panelHeight, instanceId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"uuid": "vboxlauncher@mockturtl",
"name": "Vbox Launcher",
"description": "An applet to launch virtual machines.",
"version": "0.4.1"
"version": "0.4.2",
"author": "mockturtl"
}

0 comments on commit 575ce1d

Please sign in to comment.