Commit 5b1845d2 authored by Vasily Galkin's avatar Vasily Galkin Committed by Kai Willadsen

Use external help in frozen installation, like uninstalled (#197)

There were two different UNINSTALLED_* flags for
uninstalled/frozen installations. Every flag had a single use.

In #197 it turns out that showing offline help in frozen installation
can fail since frozen installation is quite "portable"
so it can be problematic to rely on system tool for showing help.
(actually I'm not completely sure how freezing is typically
used on non-windows, but non-windows freezing doesn't look popular)

So simple fix of #197 is to merge flags, because the single case
that was different (trying to sho help in frozen state) is the bug case.
So it looks that single flag indicating that meld can assume that
it's data is installed in "global" system prefixes is enough.
parent 56dc3c7f
......@@ -9,8 +9,9 @@ __version__ = "3.19.1"
DATADIR = os.path.join(sys.prefix, "share", "meld")
LOCALEDIR = os.path.join(sys.prefix, "share", "locale")
# END
UNINSTALLED = False
UNINSTALLED_SCHEMA = False
# Flag enabling some workarounds if data dir isn't installed in standard prefix
DATADIR_IS_UNINSTALLED = False
PYTHON_REQUIREMENT_TUPLE = (3, 3)
......@@ -24,13 +25,13 @@ ngettext = no_translation
def frozen():
global DATADIR, LOCALEDIR, UNINSTALLED_SCHEMA
global DATADIR, LOCALEDIR, DATADIR_IS_UNINSTALLED
melddir = os.path.dirname(sys.executable)
DATADIR = os.path.join(melddir, "share", "meld")
LOCALEDIR = os.path.join(melddir, "share", "mo")
UNINSTALLED_SCHEMA = True
DATADIR_IS_UNINSTALLED = True
# This first bit should be unnecessary, but some things (GTK icon theme
# location, GSettings schema location) don't fall back correctly.
......@@ -40,14 +41,13 @@ def frozen():
def uninstalled():
global DATADIR, LOCALEDIR, UNINSTALLED, UNINSTALLED_SCHEMA
global DATADIR, LOCALEDIR, DATADIR_IS_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
UNINSTALLED_SCHEMA = True
DATADIR_IS_UNINSTALLED = True
def ui_file(filename):
......
......@@ -111,7 +111,7 @@ class MeldApp(Gtk.Application):
meld.preferences.PreferencesDialog(self.get_active_window())
def help_callback(self, action, parameter):
if meld.conf.UNINSTALLED:
if meld.conf.DATADIR_IS_UNINSTALLED:
uri = "http://meldmerge.org/help/"
else:
uri = "help:meld"
......
......@@ -79,7 +79,7 @@ class MeldSettings(GObject.GObject):
def load_settings_schema(schema_id):
if meld.conf.UNINSTALLED_SCHEMA:
if meld.conf.DATADIR_IS_UNINSTALLED:
schema_source = Gio.SettingsSchemaSource.new_from_directory(
meld.conf.DATADIR,
Gio.SettingsSchemaSource.get_default(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment