vmx-manager r85 - in trunk: . src
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: vmx-manager r85 - in trunk: . src
- Date: Sat, 24 Jan 2009 21:37:08 +0000 (UTC)
Author: abock
Date: Sat Jan 24 21:37:08 2009
New Revision: 85
URL: http://svn.gnome.org/viewvc/vmx-manager?rev=85&view=rev
Log:
2009-01-24 Aaron Bockover <abock gnome org>
* src/vmx-manager.in: Fix launcher to respect libdir
* src/VirtualMachineManager.cs: Use GIO to launch the VM desktop
files, falling back to legacy libgnome
Modified:
trunk/ChangeLog
trunk/src/VirtualMachineManager.cs
trunk/src/vmx-manager.in
Modified: trunk/src/VirtualMachineManager.cs
==============================================================================
--- trunk/src/VirtualMachineManager.cs (original)
+++ trunk/src/VirtualMachineManager.cs Sat Jan 24 21:37:08 2009
@@ -213,12 +213,34 @@
[DllImport ("libgnome-desktop-2.so.2")]
private static extern int gnome_desktop_item_launch (IntPtr item, IntPtr args, int flags, IntPtr error);
+ [DllImport ("libgio-2.0.so.0")]
+ private static extern IntPtr g_desktop_app_info_new_from_filename (string file);
+
+ [DllImport ("libgio-2.0.so.0")]
+ private static extern bool g_app_info_launch (IntPtr appinfo, IntPtr files, IntPtr launch_context, IntPtr error);
+
public void StartMachine (VirtualMachine machine) {
if (machine.Status == VirtualMachineStatus.Running) {
return;
}
+
+ string desktop_file = GetDesktopFileName (machine);
+
+ // Try to launch using GIO
+ try {
+ IntPtr appinfo = g_desktop_app_info_new_from_filename (desktop_file);
+ if (appinfo == IntPtr.Zero) {
+ throw new ApplicationException (Catalog.GetString ("Failed to load launcher"));
+ }
+
+ g_app_info_launch (appinfo, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+
+ return;
+ } catch (EntryPointNotFoundException) {
+ }
- IntPtr ditem = gnome_desktop_item_new_from_file (GetDesktopFileName (machine), 0, IntPtr.Zero);
+ // Use legacy libgnome to launch
+ IntPtr ditem = gnome_desktop_item_new_from_file (desktop_file, 0, IntPtr.Zero);
if (ditem == IntPtr.Zero) {
throw new ApplicationException (Catalog.GetString ("Failed to load launcher"));
}
Modified: trunk/src/vmx-manager.in
==============================================================================
--- trunk/src/vmx-manager.in (original)
+++ trunk/src/vmx-manager.in Sat Jan 24 21:37:08 2009
@@ -1,3 +1,3 @@
#!/bin/bash
-exec -a vmx-manager mono $VMX_MANAGER_MONO_ARGS @prefix@/lib/vmx-manager/vmx-manager.exe "$@"
+exec -a vmx-manager mono $VMX_MANAGER_MONO_ARGS @libdir@/vmx-manager/vmx-manager.exe "$@"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]