@@ -14,8 +14,8 @@ const CMD_VBOX = "virtualbox"
1414const CMD_VBOXMANAGE = "vboxmanage"
1515
1616const CMD_VBOX_VM = CMD_VBOXMANAGE + " startvm "
17- const CMD_VBOX_LIST = CMD_VBOXMANAGE + " list vms"
18- const CMD_VBOX_LIST_RUN = CMD_VBOXMANAGE + " list runningvms"
17+ const CMD_VBOX_LIST = CMD_VBOXMANAGE + " list --sorted vms"
18+ const CMD_VBOX_LIST_RUN = CMD_VBOXMANAGE + " list --sorted runningvms"
1919const CMD_VBOX_VERSION = CMD_VBOXMANAGE + " -v"
2020var VBOX_ISRUNNING = "0"
2121
@@ -71,12 +71,12 @@ const stringFromUTF8Array = function(data) {
7171}
7272
7373
74- function MyApplet ( metadata , orientation , panelHeight , instanceId ) {
74+ function VBoxLauncher ( metadata , orientation , panelHeight , instanceId ) {
7575 this . settings = new Settings . AppletSettings ( this , UUID , instanceId )
7676 this . _init ( orientation , panelHeight , instanceId )
7777}
7878
79- MyApplet . prototype = {
79+ VBoxLauncher . prototype = {
8080 __proto__ : Applet . IconApplet . prototype
8181
8282, _init : function ( orientation , panelHeight , instanceId ) {
@@ -325,9 +325,14 @@ MyApplet.prototype = {
325325, onSwitchShowHeadless : function ( ) {
326326 this . updateMenu ( ) // Whether or not to show headless modes
327327 }
328+ , on_applet_removed_from_panel : function ( event ) {
329+ if ( this . menu . isOpen )
330+ this . menu . close ( ) ;
331+ this . menu . removeAll ( ) ;
332+ }
328333
329334}
330335
331336function main ( metadata , orientation , panelHeight , instanceId ) {
332- return new MyApplet ( metadata , orientation , panelHeight , instanceId )
337+ return new VBoxLauncher ( metadata , orientation , panelHeight , instanceId )
333338}
0 commit comments