capuchin r58 - in trunk: examples src/libcapuchin



Author: sebp
Date: Fri Mar  7 22:20:00 2008
New Revision: 58
URL: http://svn.gnome.org/viewvc/capuchin?rev=58&view=rev

Log:
Adjusted test class to name change

Modified:
   trunk/examples/testapp.cs
   trunk/src/libcapuchin/DownloadManager.cs

Modified: trunk/examples/testapp.cs
==============================================================================
--- trunk/examples/testapp.cs	(original)
+++ trunk/examples/testapp.cs	Fri Mar  7 22:20:00 2008
@@ -8,8 +8,8 @@
 	protected const string CAPUCHIN_SERVICE = "org.gnome.Capuchin";
 	protected const string APPOBJECTMANAGER_PATH = "/org/gnome/Capuchin/AppObjectManager";
 	
-	protected Capuchin.IAppObjectManager stuffmanager;
-	protected Capuchin.IAppObject newstuff;
+	protected Capuchin.IAppObjectManager manager;
+	protected Capuchin.IAppObject appobject;
 	
 	private static TestCapuchin test = new TestCapuchin();
 	
@@ -17,24 +17,24 @@
 	{
 		Bus bus = Bus.Session;
 		
-		this.stuffmanager = bus.GetObject<Capuchin.IAppObjectManager> (CAPUCHIN_SERVICE, new ObjectPath (APPOBJECTMANAGER_PATH)); 
+		this.manager = bus.GetObject<Capuchin.IAppObjectManager> (CAPUCHIN_SERVICE, new ObjectPath (APPOBJECTMANAGER_PATH)); 
 	}
 	
-	public void testGetNewStuff()
+	public void testGetAppObject()
 	{
-		ObjectPath path = this.stuffmanager.GetAppObject ("http://www.k-d-w.org/clipboard/deskbar/deskbar.xml";);
+		ObjectPath path = this.manager.GetAppObject ("http://www.k-d-w.org/clipboard/deskbar/deskbar.xml";);
 		
 		Bus bus = Bus.Session;
 		
-		this.newstuff = bus.GetObject<Capuchin.IAppObject> (CAPUCHIN_SERVICE, path);
-		this.newstuff.InstallFinished += new Capuchin.InstallFinishedHandler ( this.OnNewStuffUpdated );
-		this.newstuff.Status += new Capuchin.StatusHandler ( this.OnStatus );
-		this.newstuff.UpdateFinished += new Capuchin.UpdateFinishedHandler ( delegate () { ContinueMain(); } );
+		this.appobject = bus.GetObject<Capuchin.IAppObject> (CAPUCHIN_SERVICE, path);
+		this.appobject.InstallFinished += new Capuchin.InstallFinishedHandler ( this.OnInstallFinished );
+		this.appobject.Status += new Capuchin.StatusHandler ( this.OnStatus );
+		this.appobject.UpdateFinished += new Capuchin.UpdateFinishedHandler ( delegate () { ContinueMain(); } );
 	}
 	
-	protected void OnNewStuffUpdated(string plugin_id)
+	protected void OnInstallFinished(string plugin_id)
 	{
-		Console.WriteLine ("NewStuff updated: {0}", plugin_id);
+		Console.WriteLine ("appobject updated: {0}", plugin_id);
 	}
 	
 	protected void OnStatus(Capuchin.ActionType action, string plugin_id, double progress, int speed)
@@ -42,21 +42,21 @@
 		Console.WriteLine ("DOWNLOAD: {0} {1} {2} {3}", action, plugin_id, progress, speed);
 	}
 	
-	public void testRefresh()
+	public void testUpdate()
 	{
-		this.newstuff.Update(false);
+		this.appobject.Update(false);
 	}
 	
-	public void testGetAvailableNewStuff()
+	public void testGetAvailablePlugins()
 	{
-		string[] stuff = this.newstuff.GetAvailablePlugins();
+		string[] stuff = this.appobject.GetAvailablePlugins();
 		Console.WriteLine ("ALL:");
 		foreach (string s in stuff)
 		{
 			Console.WriteLine ("ID: " + s);
-            Console.WriteLine ("Name: " + this.newstuff.GetName(s));
-            Console.WriteLine ("Description: " + this.newstuff.GetDescription(s) );
-            string[] author = this.newstuff.GetAuthor(s);
+            Console.WriteLine ("Name: " + this.appobject.GetName(s));
+            Console.WriteLine ("Description: " + this.appobject.GetDescription(s) );
+            string[] author = this.appobject.GetAuthor(s);
             Console.WriteLine ("Author: {0} <{1}>", author[0], author[1]);
 		}
 	}
@@ -67,18 +67,18 @@
 		plugins[0] = new string[] {"leoorg.py", "0.2.0"};
 		plugins[1] = new string[] {"ssh.py", "0.0.9"};
 		
-		string[] updates = this.newstuff.GetAvailableUpdates (plugins);
+		string[] updates = this.appobject.GetAvailableUpdates (plugins);
 		Console.WriteLine ("UPDATES:");
 		foreach (string s in updates)
 		{
 			Console.WriteLine (s);
-            Console.WriteLine ("Changes: " + this.newstuff.GetChanges(s, "1.1.0.0"));
+            Console.WriteLine ("Changes: " + this.appobject.GetChanges(s, "1.1.0.0"));
 		}
 	}
 	
 	public void testGetTags()
 	{
-		string[] tags = this.newstuff.GetTags("leoorg.py");
+		string[] tags = this.appobject.GetTags("leoorg.py");
 		Console.WriteLine ("TAGS:");
 		foreach (string t in tags)
 		{
@@ -88,35 +88,40 @@
 	
 	public void testGetAuthor()
 	{
-		string[] author = this.newstuff.GetAuthor("leoorg.py");
+		string[] author = this.appobject.GetAuthor("leoorg.py");
 		Console.WriteLine ("AUTHOR: {0}, {1}", author[0], author[1]);
 	}
+    
+    public void testGetApplicationName () {
+        Console.WriteLine ("APPLICATION-NAME: {0}", this.appobject.GetApplicationName ());
+    }
 	
-	public void testUpdate()
+	public void testInstall()
 	{
-		this.newstuff.Install("leoorg.py");
+		this.appobject.Install("leoorg.py");
 	}
 	
 	public void testClose()
 	{
-		this.newstuff.Close();
+		this.appobject.Close();
 	}
 	
 	public static void ContinueMain()
 	{
-		test.testGetAvailableNewStuff();
+        test.testGetApplicationName();
+        test.testGetAvailablePlugins();
 		test.testGetAvailableUpdates();
 		test.testGetTags();
 		test.testGetAuthor();
-		test.testUpdate();
+		test.testInstall();
 		Thread.Sleep(5000); // Wait 5s for update to complete, because we have no mainloop
 		test.testClose();
 	}
 	
 	public static void Main (string[] args)
 	{
-		test.testGetNewStuff();
-		test.testRefresh();
+		test.testGetAppObject();
+        test.testUpdate();
 		Thread.Sleep(5000); // Wait 5s for update to complete, because we have no mainloop
 	}
 }

Modified: trunk/src/libcapuchin/DownloadManager.cs
==============================================================================
--- trunk/src/libcapuchin/DownloadManager.cs	(original)
+++ trunk/src/libcapuchin/DownloadManager.cs	Fri Mar  7 22:20:00 2008
@@ -24,7 +24,7 @@
         {
             this.Downloads = new Dictionary<int, Download>();
             this.downloadsIndex = 0;
-           }
+        }
         
         /// <summary>Download a file using the DownloadManager</summary>
         public virtual int DownloadFile(string download_url, string download_dest)
@@ -119,7 +119,8 @@
         }
         
         /// <summary>Emits the finished signal</summary>
-        protected void OnDownloadFinished(int id) {
+        protected void OnDownloadFinished(int id)
+        {
             if (DownloadFinished != null) {
                 DownloadFinished(id);
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]