diff --git a/README.md b/README.md index 87df20fe..2e323fdb 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,7 @@ or edit the DemonEditor.spec file. To run the program, copy the **dist/DemonEditor.app** bundle to the **Application** directory. Perhaps in the security settings it will be necessary to allow the launch of this application! -Users of the **64-bit version of the OS** can download a ready-made package from [here](https://github.com/DYefremov/DemonEditor/raw/experimental-mac/dist/DemonEditor.app.zip). -Just unpack and copy to the **Application** directory. +Users of the **64-bit version of the OS** can download a ready-made package from [here](https://github.com/DYefremov/DemonEditor/raw/experimental-mac/dist/DemonEditor.app.zip). Just unpack and run. **Note. The package may not contain all the latest changes!** diff --git a/app/settings.py b/app/settings.py index a73cd704..da318f37 100644 --- a/app/settings.py +++ b/app/settings.py @@ -5,9 +5,10 @@ from textwrap import dedent from enum import Enum from pathlib import Path -CONFIG_PATH = str(Path.home()) + "/.config/demon-editor/" +HOME_PATH = str(Path.home()) +CONFIG_PATH = HOME_PATH + "/.config/demon-editor/" CONFIG_FILE = CONFIG_PATH + "config.json" -DATA_PATH = "data/" +DATA_PATH = HOME_PATH + "/data/" class Profile(Enum): diff --git a/app/ui/dialogs.py b/app/ui/dialogs.py index 596b89f6..97b54a0c 100644 --- a/app/ui/dialogs.py +++ b/app/ui/dialogs.py @@ -1,5 +1,5 @@ """ Common module for showing dialogs """ -import locale +import gettext from enum import Enum from functools import lru_cache @@ -163,7 +163,7 @@ def get_dialog_from_xml(dialog_type, transient, use_header=0, title=""): def get_message(message): """ returns translated message """ - return locale.dgettext(TEXT_DOMAIN, message) + return gettext.dgettext(TEXT_DOMAIN, message) @lru_cache(maxsize=5) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index f18a788b..97e6169c 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -1039,7 +1039,6 @@ class Application(Gtk.Application): GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW) def save_data(self): - self._save_header_button.set_sensitive(False) profile = self._profile path = self._settings.data_dir_path backup_path = self._settings.backup_dir_path diff --git a/app/ui/uicommons.py b/app/ui/uicommons.py index 39f8e4f6..c735e819 100644 --- a/app/ui/uicommons.py +++ b/app/ui/uicommons.py @@ -6,15 +6,19 @@ from enum import Enum, IntEnum gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk -# path to *.glade files +# For launching from the bundle. +if os.getcwd() == "/": + try: + os.chdir(os.environ["GTK_PATH"]) + except KeyError: + pass + + # path to *.glade files UI_RESOURCES_PATH = "app/ui/" if os.path.exists("app/ui/") else "ui/" IS_GNOME_SESSION = int(bool(os.environ.get("GNOME_DESKTOP_SESSION_ID"))) # translation TEXT_DOMAIN = "demon-editor" -if UI_RESOURCES_PATH == "app/ui/": - LANG_DIR = UI_RESOURCES_PATH + "lang" -# locale.bindtextdomain(TEXT_DOMAIN, UI_RESOURCES_PATH + "lang") theme = Gtk.IconTheme.get_default() _IMAGE_MISSING = theme.load_icon("image-missing", 16, 0) if theme.lookup_icon("image-missing", 16, 0) else None diff --git a/start.py b/start.py index ca9f522d..4b2bdf8c 100755 --- a/start.py +++ b/start.py @@ -1,9 +1,4 @@ #!/usr/bin/env python3 -import os - -# For launching from the bundle. -if os.getcwd() == "/": - os.chdir("/Applications/DemonEditor.app/Contents/MacOS/") try: from Cocoa import NSBundle