~ubuntu-branches/ubuntu/jaunty/gnome-do-plugins/jaunty-proposed

« back to all changes in this revision

Viewing changes to VirtualBox/src/VMItem.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Daniel T Chen, Iain Lane
  • Date: 2009-03-18 00:40:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090318004051-ujn1ja3kiu3ky7ru
Tags: 0.8.1.3+dfsg-0ubuntu1
[ Daniel T Chen ]
* New upstream release (LP: #344578)
  + Banshee plugin goes crazy if banshee isn't loaded first
    (LP: #289802)
  + gnome-do gCalculate plugin fails to display "times" symbol
    (LP: #274252)
  + Banshee-1 fails to build in Mono 2.0 (LP: #309188)
  + Pidgin 2.5.4 has incompatible dbus interface. s/uint/int/
    (LP: #314927)
  + Pidgin plugin hangs opening a chat if pidgin is unresponsive
    (LP: #315565)
  + twitter plugin still reports friend updates even when
    deactivated (LP: #317674)
  + Misspelling in microblogging plugin confirmation message
    (LP: #319433)
  + make install uses mdtool, but configure doesn't check for it
    (LP: #322951)
  + Virtualbox Icon in 2.10 are broken because of a new
    specification (LP: #323902)
  + Google Maps Plugin shouldn't always use route (LP: #324271)
  + Fix for Google Maps when using newlines and other special
    characters (LP: #324667)
  + VirtualBox failed to load icon (LP: #325712)
  + 'Read Man Pages' plugin makes Gnome-Do unresponsive
    (LP: #325935)
  + Search returns broken URLs (LP: #327855)
  + Default action for SSH hosts is "open" (LP: #328236)
  + Files and Folders Configuration doesn't use standard buttons
    (LP: #328236)
  + Window manager maximize action should focus if window is not
    currently focused (LP: #258893)
  + Locate plugin has no error message (LP: #262360)
  + Wishlist: Let user specify files and folders to ignore
    (LP: #263177)
  + ts-client plugin doesn't index subdirectories (LP: #322352)
  + Max 3000 items in Files and Folders plugin (LP: #324105)
  + putty cannot find host when running from gnome do
    (LP: #324282)
  + locate plugin with globbing (LP: #334798)
  + Twitter plugin encountered an error in UpdateFriends
    (LP: #317575)
  + gnome-terminal profiles no longer work (LP: #321977)
  + Creating a task using Remember the Milk plugin can fail if
    no task list is specified (LP: #324066)
  + bundled libraries makefile needs destdir (LP: #324704)
  + Typographical error in del.icio.us plugin (LP: #330525)
  + ImageShack fails to upload (LP: #337324)
* debian/copyright
  + Refresh for new upstream version; new plugins added.
* debian/patches/00_dfsg_autofoo.dpatch
  + Update for new upstream version
  + Don't build the YouTube plugin due to removal of shipped
    exes and dlls causing FTBFS
* debian/patches/02_ssh_respect_exec_arg.dpatch
  debian/patches/03_buildsystem_respect_mcs.dpatch
  debian/patches/04_fix_pidgin_dbus_ints.dpatch
  + Drop; fixed upstream

[ Iain Lane ]
* debian/rules: Update repackaging to not delete *.dll; upstream now ships
  source copies of google-gdata meaning we can now enable the Google and
  Youtube plugins.
* debian/patches/00_dfsg_autofoo: Drop, fixed by including and building
  these libs now. 
* debian/copyright: Update with information for google-gdata. 
* debian/patches/04_fix_pidgin_dbus_ints.dpatch: Add left out piece of patch
* debian/control: Bump gnome-do build-dep to require current version. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                public VMItem (XmlAttributeCollection MachineAttrs) 
52
52
                {
53
53
                        string home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
54
 
                
55
 
                        uuid = MachineAttrs["uuid"].Value.Replace("{", "").Replace("}", "");
 
54
                        
 
55
                        uuid = MachineAttrs["uuid"].Value.Replace ("{", "").Replace("}", "");
56
56
                        //find machine specific xml file
57
57
                        string MachineSource = MachineAttrs["src"].Value;
58
 
                        if (!File.Exists (MachineSource)) {
59
 
                                MachineSource = string.Format("{0}/.VirtualBox/{1}", home, MachineSource);
60
 
                        }
 
58
                        if (!File.Exists (MachineSource))
 
59
                                MachineSource = Path.Combine (Path.Combine (home, ".VirtualBox"), MachineSource);
61
60
                        //find the OS type of the machine
62
 
                        XmlDocument MachineDoc = new XmlDocument();
63
 
                        MachineDoc.Load(MachineSource);
 
61
                        XmlDocument MachineDoc = new XmlDocument ();
 
62
                        MachineDoc.Load (MachineSource);
64
63
                        XmlNodeList MachineInfo = MachineDoc.GetElementsByTagName("Machine");
65
64
                        name = MachineInfo[0].Attributes["name"].Value;
66
65
                        try
67
66
                        {
68
 
                                ico_file = string.Format("os_{0}.png@{1}", MachineInfo[0].Attributes["OSType"].Value, GetType().Assembly.FullName);
 
67
                                string icon = IconMap.LookUp (MachineInfo[0].Attributes["OSType"].Value);
 
68
                                ico_file = string.Format("os_{0}.png@{1}", icon, GetType ().Assembly.FullName);
69
69
                        }
70
 
                        catch //can't find icon, assign default VBox Icon
 
70
                        catch //something went bad trying to assign an icon
71
71
                        {
72
 
                                Log.Warn("Could not determine machine type for VM: {0}", name);
73
 
                                ico_file = string.Format("VirtualBox_64px.png@{0}", GetType().Assembly.FullName);
 
72
                                Log<VMItem>.Warn ("Could not determine machine type for VM: {0}", name);
 
73
                                ico_file = string.Format ("VirtualBox_64px.png@{0}", GetType().Assembly.FullName);
74
74
                        }
75
75
                        this.state = CurrentState;
76
 
                        Log.Info("VM: {0} indexed [State: {1} Uuid: {2}]", name, state, uuid);
 
76
                        Log<VMItem>.Info ("VM: {0} indexed [State: {1} Uuid: {2}]", name, state, uuid);
77
77
                }
78
78
                
79
79
                public VMState CurrentState
80
80
                {
81
81
                        get
82
82
                        {
83
 
                                VMState cur_state = default(VMState);
 
83
                                VMState cur_state = default (VMState);
84
84
                                //determine the state of thte VM
85
85
                                ProcessStartInfo ps = new ProcessStartInfo ("VBoxManage", "showvminfo " + uuid);
86
86
                                ps.UseShellExecute = false;
89
89
                                {
90
90
                                        p.WaitForExit ();
91
91
                                        string output = p.StandardOutput.ReadToEnd ();
92
 
                                        int s = output.IndexOf("State:");
93
 
                                        int e = output.IndexOf("\n", s);
 
92
                                        int s = output.IndexOf ("State:");
 
93
                                        int e = output.IndexOf ("\n", s);
94
94
                                        string outputState = output.Substring(s, e-s);
95
95
                                        //States: saved, running, paused, powered off
96
 
                                        if (outputState.Contains("saved"))
 
96
                                        if (outputState.Contains ("saved"))
97
97
                                                cur_state = VMState.saved;
98
 
                                        else if (outputState.Contains("running"))
 
98
                                        else if (outputState.Contains ("running"))
99
99
                                                cur_state = VMState.on;
100
 
                                        else if (outputState.Contains("paused"))
 
100
                                        else if (outputState.Contains ("paused"))
101
101
                                                cur_state = VMState.paused;
102
 
                                        else if (outputState.Contains("powered off"))
 
102
                                        else if (outputState.Contains ("powered off"))
103
103
                                                cur_state = VMState.off;
104
 
                                        if (output.Contains("Snapshots:"))
 
104
                                        if (output.Contains ("Snapshots:"))
105
105
                                            has_saved_states = true;
106
106
                                }
107
107
                                return cur_state;