Author: llipka
Date: Thu Feb 14 22:15:10 2008
New Revision: 4480
URL: http://svn.gnome.org/viewvc/beagle?rev=4480&view=rev

Log:
Expose a simple Hide/Show DBus interface for beagle-search. I'm done for the 
day, more hacking tomorrow.

Modified:
   trunk/beagle/search/Beagle.Search/Driver.cs
   trunk/beagle/search/Beagle.Search/ISearch.cs

Modified: trunk/beagle/search/Beagle.Search/Driver.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search/Driver.cs (original)
+++ trunk/beagle/search/Beagle.Search/Driver.cs Thu Feb 14 22:15:10 2008
@@ -7,6 +7,7 @@
 using System;
 
 using NDesk.DBus;
+using org.freedesktop.DBus;
 using Mono.Unix;
 
 using Beagle;
@@ -16,6 +17,9 @@
 
        public class Driver {
 
+               private const string INTERFACE_NAME = "org.gnome.Beagle.Search";
+               private const string PATH_NAME = "/org/gnome/Beagle/Search";
+
                private static string ParseArgs (String[] args)
                {
                        string query = String.Empty;
@@ -99,12 +103,19 @@
 
                        string query = ParseArgs (args);
 
+                       if (Bus.Session.RequestName (INTERFACE_NAME) != 
RequestNameReply.PrimaryOwner) {
+                               Console.WriteLine ("There is already an 
instance of beagle-search running!");
+                               return;
+                       }
+                       
                        // Init Gnome program
 
                        Gnome.Program program = new Gnome.Program ("search", 
"0.0", Gnome.Modules.UI, args);
 
                        Search window = new Search (query);
 
+                       Bus.Session.Register (INTERFACE_NAME, new ObjectPath 
(PATH_NAME), window);
+
                        //if (query != null && query != "" && !IconEnabled) {
                        //      window.entry.Text = query;
                        //      window.Search (true);

Modified: trunk/beagle/search/Beagle.Search/ISearch.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search/ISearch.cs        (original)
+++ trunk/beagle/search/Beagle.Search/ISearch.cs        Thu Feb 14 22:15:10 2008
@@ -10,7 +10,10 @@
 using org.freedesktop.DBus;
 
 namespace Beagle.Search {
-
+       
+       [Interface ("org.gnome.Beagle.Search")]
        public interface ISearch {
+               void Show ();
+               void Hide ();
        }
 }
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to