From e43abc64ef016aabb9d1e5b1a1409ed79bf2d440 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Mon, 11 Feb 2019 01:52:41 +0100 Subject: [PATCH] ditch gdlib --- .gitlab-ci.yml | 1 - .gitmodules | 3 --- CONTRIBUTING.md | 14 +++++--------- data/ui/window.ui.in | 1 + meson.build | 15 +-------------- src/Authenticator/widgets/accounts/add.py | 4 +--- src/Authenticator/widgets/settings.py | 8 +++++--- src/Authenticator/widgets/window.py | 5 +---- src/authenticator-search-provider.py.in | 11 +---------- src/authenticator.py.in | 9 +-------- subprojects/libgd | 1 - 11 files changed, 16 insertions(+), 56 deletions(-) delete mode 100644 .gitmodules delete mode 160000 subprojects/libgd diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b03db55..1be2d0a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,6 @@ include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ variables: BUNDLE: "authenticator-dev.flatpak" - GIT_SUBMODULE_STRATEGY: recursive flatpak: image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master' diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fa13636..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "subprojects/libgd"] - path = subprojects/libgd - url = https://gitlab.gnome.org/GNOME/libgd.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f64414..e78e92e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,20 +1,16 @@ -Hey newcomer, welcome to Authenticator. +# Hey newcomer, welcome to Authenticator The application is built using Python3, Gtk 3, GLib and other GNOME technologies around it. It's built to run on GNOME & Librem 5 phone. - -## If you're a translator: +## If you're a translator You can translate Authenticator here: https://hosted.weblate.org/engage/authenticator/ +## If you're a developer -## If you're a developer: - -You want to work on fixing a bug, adding a new feature, please first join our Matrix Channel and ask if there's anyone working on that already. +You want to work on fixing a bug, adding a new feature, please first join our Matrix Channel and ask if there's anyone working on that already. The Matrix Channel: https://matrix.to/#/#authenticator:matrix.org - We suggest you to use [GNOME Builder](https://flathub.org/apps/details/org.gnome.Builder) as the IDE supports Flatpak and you can hack on Authenticator, click on run and voilĂ , you have got to test your modifications without having to think about installing the dependencies or how to build the application itself. - -Thanks and good hacking. \ No newline at end of file +Thanks and good hacking. diff --git a/data/ui/window.ui.in b/data/ui/window.ui.in index 71fe335..d9d6097 100644 --- a/data/ui/window.ui.in +++ b/data/ui/window.ui.in @@ -192,6 +192,7 @@ True True True + win.toggle-searchbar search_image diff --git a/meson.build b/meson.build index 2175696..cfe38b4 100644 --- a/meson.build +++ b/meson.build @@ -37,22 +37,10 @@ else message('Found python3 binary') endif -PKGLIB_DIR = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name()) LOCALE_DIR = join_paths(get_option('prefix'), get_option('localedir')) PKGDATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir')) -libgd_dep = dependency('gdlib', required: false) -if not libgd_dep.found() - libgd_proj = subproject('libgd', - default_options: [ - 'with-introspection=true', - 'with-notification=true', - 'static=false', - 'pkgdatadir=' + PKGDATA_DIR, - 'pkglibdir=' + PKGLIB_DIR - ] - ) -endif + # Configuration params conf = configuration_data() @@ -63,7 +51,6 @@ conf.set('LOCALE_DIR', LOCALE_DIR) conf.set('PYTHON_DIR', join_paths(get_option('prefix'), python.sysconfig_path('purelib'))) conf.set('PYTHON_EXEC_DIR', join_paths(get_option('prefix'), python.sysconfig_path('stdlib'))) conf.set('VERSION', meson.project_version()) -conf.set('PKGLIB_DIR', PKGLIB_DIR) conf.set('PROFILE', profile) conf.set('NAME_SUFFIX', name_suffix) conf.set('libexecdir', LIBEXEC_DIR) diff --git a/src/Authenticator/widgets/accounts/add.py b/src/Authenticator/widgets/accounts/add.py index 0871f13..ab69d8c 100644 --- a/src/Authenticator/widgets/accounts/add.py +++ b/src/Authenticator/widgets/accounts/add.py @@ -22,9 +22,8 @@ from gettext import gettext as _ from gi import require_version require_version("Gtk", "3.0") -require_version('Gd', '1.0') -from gi.repository import Gd, Gio, Gtk, GObject, Gdk, GLib +from gi.repository import Gio, Gtk, GObject, Gdk, GLib from ..headerbar import HeaderBarButton from ...models import OTP @@ -195,7 +194,6 @@ class AccountConfig(Gtk.Box, GObject.GObject): else: self.token_entry.get_style_context().remove_class("error") valid_token = True - self.emit("changed", all([valid_name, valid_provider, valid_token])) def scan_qr(self): diff --git a/src/Authenticator/widgets/settings.py b/src/Authenticator/widgets/settings.py index af86220..804b6bf 100644 --- a/src/Authenticator/widgets/settings.py +++ b/src/Authenticator/widgets/settings.py @@ -21,9 +21,8 @@ from gettext import gettext as _ from gi import require_version -require_version('Gd', '1.0') require_version("Gtk", "3.0") -from gi.repository import Gd, Gtk, GObject +from gi.repository import Gtk, GObject from .window import Window from ..models import Settings, Keyring @@ -252,7 +251,7 @@ class SettingsWindow(Gtk.Window): self.add(self.stack) def __on_app_can_be_locked_changed(self, __, state): - notification = Gd.Notification() + """notification = Gd.Notification() notification.set_timeout(5) notification_lbl = Gtk.Label() @@ -262,6 +261,7 @@ class SettingsWindow(Gtk.Window): notification_parent = self.stack.get_child_by_name("behaviour") notification_parent.add(notification) notification_parent.reorder_child(notification, 0) + """ self.show_all() if state and not Keyring.has_password(): @@ -279,6 +279,7 @@ class SettingsWindow(Gtk.Window): state) def __on_clear_database_clicked(self, *__): + """ notification = Gd.Notification() notification.set_timeout(5) notification.connect("dismissed", self.__clear_database) @@ -297,6 +298,7 @@ class SettingsWindow(Gtk.Window): notification_parent = self.stack.get_child_by_name("behaviour") notification_parent.add(notification) notification_parent.reorder_child(notification, 0) + """ self.show_all() @staticmethod diff --git a/src/Authenticator/widgets/window.py b/src/Authenticator/widgets/window.py index 944596d..24bc34a 100644 --- a/src/Authenticator/widgets/window.py +++ b/src/Authenticator/widgets/window.py @@ -19,13 +19,10 @@ from gettext import gettext as _ from gi import require_version -require_version('Gd', '1.0') require_version("Gtk", "3.0") -from gi.repository import Gd, Gtk, GObject, Gio, GLib +from gi.repository import Gtk, GObject, Gio, GLib from ..models import Logger, Settings, Database, AccountsManager -from .headerbar import HeaderBar, HeaderBarState from .accounts import AccountsWidget, AddAccountWindow -from .search_bar import SearchBar from . import LoginWidget class WindowState: diff --git a/src/authenticator-search-provider.py.in b/src/authenticator-search-provider.py.in index a026515..8b8cbb2 100755 --- a/src/authenticator-search-provider.py.in +++ b/src/authenticator-search-provider.py.in @@ -23,16 +23,7 @@ import sy sys.path.insert(1, '@PYTHON_EXEC_DIR@') sys.path.insert(1, '@PYTHON_DIR@') from os import path -import gi -gi.require_version('Gtk', '3.0') -gi.require_version('GIRepository', '2.0') - -from gi.repository import Gio, GIRepository, GLib - -GIRepository.Repository.prepend_search_path( - path.join('@PKGLIB_DIR@', 'girepository-1.0')) -GIRepository.Repository.prepend_library_path('@PKGLIB_DIR@') - +from gi.repository import Gio, GLib from Authenticator.models.database import Database from Authenticator.models.account import Account diff --git a/src/authenticator.py.in b/src/authenticator.py.in index d2c6595..2af5c6b 100755 --- a/src/authenticator.py.in +++ b/src/authenticator.py.in @@ -27,8 +27,7 @@ from os import path from gettext import gettext as _ from gi import require_version -require_version('GIRepository', '2.0') -from gi.repository import Gio, GIRepository +from gi.repository import Gio sys.path.insert(1, '@PYTHON_EXEC_DIR@') sys.path.insert(1, '@PYTHON_DIR@') @@ -40,14 +39,8 @@ def prepare_locale(): gettext.textdomain('@GETTEXT_PACKAGE@') -def prepare_gir(): - gir_repository_path = path.join('@PKGLIB_DIR@', 'girepository-1.0') - GIRepository.Repository.prepend_search_path(gir_repository_path) - GIRepository.Repository.prepend_library_path('@PKGLIB_DIR@') - if __name__ == "__main__": prepare_locale() - prepare_gir() parser = argparse.ArgumentParser(prog="Authenticator") parser.add_argument("--debug", "-d", action="store_true", diff --git a/subprojects/libgd b/subprojects/libgd deleted file mode 160000 index 7ae254b..0000000 --- a/subprojects/libgd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7ae254bfc5f641c60566614e08245176f7bc5aa8