[meld] meldapp: Show web help if running uninstalled



commit 7958c5077840ac8dbb346c22ab2d7fbed69bb71e
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Mar 5 07:46:19 2014 +1000

    meldapp: Show web help if running uninstalled

 meld/conf.py    |    4 +++-
 meld/meldapp.py |    6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/meld/conf.py b/meld/conf.py
index f5199dc..ffeb90c 100644
--- a/meld/conf.py
+++ b/meld/conf.py
@@ -7,15 +7,17 @@ __version__ = "3.11.1"
 
 DATADIR = os.path.join(sys.prefix, "share", "meld")
 LOCALEDIR = os.path.join(sys.prefix, "share", "locale")
+UNINSTALLED = False
 
 
 def uninstalled():
-    global DATADIR, LOCALEDIR
+    global DATADIR, LOCALEDIR, UNINSTALLED
     melddir = os.path.abspath(os.path.join(
         os.path.dirname(os.path.realpath(__file__)), ".."))
 
     DATADIR = os.path.join(melddir, "data")
     LOCALEDIR = os.path.join(melddir, "build", "mo")
+    UNINSTALLED = True
 
     # This first bit should be unnecessary, but some things (GTK icon theme
     # location, GSettings schema location) don't fall back correctly.
diff --git a/meld/meldapp.py b/meld/meldapp.py
index cf8efd3..adb0b8f 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -100,7 +100,11 @@ class MeldApp(Gtk.Application):
         meld.preferences.PreferencesDialog(self.get_active_window())
 
     def help_callback(self, action, parameter):
-        Gtk.show_uri(Gdk.Screen.get_default(), "help:meld",
+        if meld.conf.UNINSTALLED:
+            uri = "http://meldmerge.org/help/";
+        else:
+            uri = "help:meld"
+        Gtk.show_uri(Gdk.Screen.get_default(), uri,
                      Gtk.get_current_event_time())
 
     def about_callback(self, action, parameter):


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