create_appmenus() on standalone VM -> only register existing apps in menu

Needed for example on backup-restore
This commit is contained in:
Marek Marczykowski 2011-03-24 21:41:10 -04:00
parent 9aa5638dcf
commit 24b5c24c25
2 changed files with 10 additions and 4 deletions

View File

@ -31,10 +31,12 @@ if [ $# != 2 ]; then
fi
mkdir -p $APPSDIR
echo "--> Converting Appmenu Templates..."
find $SRCDIR -name "*.desktop" -exec /usr/lib/qubes/convert_apptemplate2vm.sh {} $APPSDIR $VMNAME $VMDIR \;
if [ "$SRCDIR" != "none" ]; then
echo "--> Converting Appmenu Templates..."
find $SRCDIR -name "*.desktop" -exec /usr/lib/qubes/convert_apptemplate2vm.sh {} $APPSDIR $VMNAME $VMDIR \;
/usr/lib/qubes/convert_dirtemplate2vm.sh $SRCDIR/qubes-vm.directory.template $APPSDIR/$VMNAME-vm.directory $VMNAME $VMDIR
/usr/lib/qubes/convert_dirtemplate2vm.sh $SRCDIR/qubes-vm.directory.template $APPSDIR/$VMNAME-vm.directory $VMNAME $VMDIR
fi
echo "--> Adding Apps to the Menu..."
xdg-desktop-menu install $APPSDIR/*.directory $APPSDIR/*.desktop

View File

@ -1500,7 +1500,11 @@ class QubesAppVm(QubesCowVm):
self.create_appmenus (verbose)
def create_appmenus(self, verbose):
subprocess.check_call ([qubes_appmenu_create_cmd, self.template_vm.appmenus_templates_dir, self.name])
if self.template_vm is not None:
subprocess.check_call ([qubes_appmenu_create_cmd, self.template_vm.appmenus_templates_dir, self.name])
else:
# Only add apps to menu
subprocess.check_call ([qubes_appmenu_create_cmd, "none", self.name])
def write_firewall_conf(self, conf):
root = xml.etree.ElementTree.Element(