major rewrite
[wifi-assistant] / package / src / wifi_assistant / daemon / launcher.py
diff --git a/package/src/wifi_assistant/daemon/launcher.py b/package/src/wifi_assistant/daemon/launcher.py
new file mode 100644 (file)
index 0000000..721c33a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/python2.5
+from gnome import gconf
+import osso
+
+class Launcher():
+    
+    """Opens a URL in a browser."""
+    
+    def __init__(self):
+        pass
+    
+    # ---- public API __________________________________________________________
+    
+    def launchBrowser(self, browser_name, browser_options):
+        """Uses the specified browser and makes the calls specified in the browser_options"""
+        # TODO: 
+        
+        url = browser_options['url']
+        self.openUrl(url)
+
+    
+    def openUrl(self, url):
+        """Uses the default browser to open the specified url."""
+        
+        osso_context = osso.Context("org.maemo.touchsearch", "1.1", False)
+        osso_rpc = osso.Rpc(osso_context)
+        osso_rpc.rpc_run_with_defaults("osso_browser", "open_new_window", (url,))
+        
\ No newline at end of file