Commit 406ca33d authored by Cédric Bellegarde's avatar Cédric Bellegarde

Rename El() to App() like in Lollypop

parent c10d419b
......@@ -18,7 +18,7 @@ from eolie.view import View
from eolie.popover_webview import WebViewPopover
from eolie.pages_manager import PagesManager
from eolie.sites_manager import SitesManager
from eolie.define import El, LoadingType
from eolie.define import App, LoadingType
class DelayedStack(Gtk.Stack):
......@@ -89,7 +89,7 @@ class Container(Gtk.Overlay):
self.__preloaded = []
self.__pending_items = []
self.__preloaded_max = El().settings.get_value(
self.__preloaded_max = App().settings.get_value(
"preloaded-webviews").get_int32()
self.__stack = DelayedStack()
......@@ -109,14 +109,14 @@ class Container(Gtk.Overlay):
self.__pages_manager = PagesManager(self.__window)
self.__pages_manager.show()
self.__sites_manager = SitesManager(self.__window)
if El().settings.get_value("show-sidebar"):
if App().settings.get_value("show-sidebar"):
self.__sites_manager.show()
El().settings.connect("changed::show-sidebar",
self.__on_show_sidebar_changed)
App().settings.connect("changed::show-sidebar",
self.__on_show_sidebar_changed)
paned = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
paned.pack1(self.__sites_manager, False, False)
paned.add2(self.__expose_stack)
position = El().settings.get_value("sidebar-position").get_int32()
position = App().settings.get_value("sidebar-position").get_int32()
paned.set_position(position)
paned.connect("notify::position", self.__on_paned_notify_position)
paned.show()
......@@ -203,7 +203,7 @@ class Container(Gtk.Overlay):
# Reason: we do not remove/destroy view to let stack animation run
count = len(self.__pages_manager.children)
self.__window.toolbar.actions.count_label.set_text(str(count))
El().update_unity_badge()
App().update_unity_badge()
def add_view(self, view):
"""
......@@ -217,7 +217,7 @@ class Container(Gtk.Overlay):
self.__stack.set_visible_child(view)
count = len(self.__stack.get_children())
self.__window.toolbar.actions.count_label.set_text(str(count))
El().update_unity_badge()
App().update_unity_badge()
self.__pages_manager.update_visible_child()
self.__sites_manager.update_visible_child()
......@@ -234,11 +234,11 @@ class Container(Gtk.Overlay):
self.__current = self.__stack.get_visible_child()
count = len(children)
self.__window.toolbar.actions.count_label.set_text(str(count))
El().update_unity_badge()
App().update_unity_badge()
self.__pages_manager.update_visible_child()
self.__sites_manager.update_visible_child()
else:
for window in El().windows:
for window in App().windows:
window.mark(False)
self.__window.close()
......@@ -296,8 +296,8 @@ class Container(Gtk.Overlay):
@param view as View
"""
page_id = view.webview.get_page_id()
El().helper.call("FormsFilled", page_id, None,
self.__on_forms_filled, view)
App().helper.call("FormsFilled", page_id, None,
self.__on_forms_filled, view)
def close_view(self, view):
"""
......@@ -311,15 +311,15 @@ class Container(Gtk.Overlay):
return
views.remove(view)
views_count = len(views)
El().history.set_page_state(view.webview.uri)
App().history.set_page_state(view.webview.uri)
self.__window.close_popovers()
# Needed to unfocus titlebar
self.__window.set_focus(None)
was_current = view == self.__window.container.current
if not view.webview.ephemeral:
El().pages_menu.add_action(view.webview.title,
view.webview.uri,
view.webview.get_session_state())
App().pages_menu.add_action(view.webview.title,
view.webview.uri,
view.webview.get_session_state())
# Remove webview from parent
if view.webview.parent is not None:
......@@ -327,7 +327,7 @@ class Container(Gtk.Overlay):
view.destroy()
# Don't show 0 as we are going to open a new one
if views_count:
El().update_unity_badge()
App().update_unity_badge()
self.__window.toolbar.actions.count_label.set_text(
str(views_count))
# Nothing to do if was not current page
......@@ -366,7 +366,7 @@ class Container(Gtk.Overlay):
self.__window.container.set_current(next_view, True)
else:
# We are last row, add a new one
self.add_webview(El().start_page, LoadingType.FOREGROUND)
self.add_webview(App().start_page, LoadingType.FOREGROUND)
def stop_preloading(self):
"""
......@@ -550,12 +550,12 @@ class Container(Gtk.Overlay):
@param ignore as GParamInt
"""
position = paned.get_position()
saved_position = El().settings.get_value(
saved_position = App().settings.get_value(
"sidebar-position").get_int32()
# We do not want to keep minimal mode changes
if position >= 80 or saved_position > position:
El().settings.set_value("sidebar-position",
GLib.Variant("i", position))
App().settings.set_value("sidebar-position",
GLib.Variant("i", position))
self.__sites_manager.set_minimal(position < 80)
def __on_show_sidebar_changed(self, settings, value):
......@@ -564,7 +564,7 @@ class Container(Gtk.Overlay):
@param settings as Gio.Settings
@param value as bool
"""
if El().settings.get_value("show-sidebar"):
if App().settings.get_value("show-sidebar"):
self.__sites_manager.show()
else:
self.__sites_manager.hide()
......
......@@ -16,7 +16,7 @@ from urllib.parse import urlparse
from gettext import gettext as _
from datetime import datetime
from eolie.define import El
from eolie.define import App
class Context:
......@@ -32,15 +32,15 @@ class Context:
self.__context = context
if not context.is_ephemeral():
context.set_cache_model(WebKit2.CacheModel.WEB_BROWSER)
context.set_favicon_database_directory(El().favicons_path)
context.set_favicon_database_directory(App().favicons_path)
cookie_manager = context.get_cookie_manager()
cookie_manager.set_accept_policy(
El().settings.get_enum("cookie-storage"))
context.set_web_extensions_directory(El().extension_dir)
App().settings.get_enum("cookie-storage"))
context.set_web_extensions_directory(App().extension_dir)
context.set_process_model(
WebKit2.ProcessModel.MULTIPLE_SECONDARY_PROCESSES)
context.set_spell_checking_enabled(
El().settings.get_value("enable-spell-check"))
App().settings.get_value("enable-spell-check"))
locales = GLib.get_language_names()
try:
user_locale = locales[0].split(".")[0]
......@@ -67,16 +67,16 @@ class Context:
uri = request.get_uri()
parsed = urlparse(uri)
items = []
start_page = El().settings.get_value("start-page").get_string()
wanted = El().settings.get_value("max-popular-items").get_int32()
start_page = App().settings.get_value("start-page").get_string()
wanted = App().settings.get_value("max-popular-items").get_int32()
if start_page == "popular_book":
reset_function = "reset_bookmark"
for (item_id, uri, title) in El().bookmarks.get_populars(wanted):
for (item_id, uri, title) in App().bookmarks.get_populars(wanted):
items.append((title, uri, "", 1))
else:
reset_function = "reset_history"
for (item_id, uri,
netloc, title, count) in El().history.get_populars(
netloc, title, count) in App().history.get_populars(
parsed.netloc,
wanted):
items.append((title, uri, netloc, count))
......@@ -103,10 +103,10 @@ class Context:
idx += 1
if count == 1: # No navigation for one page
netloc = uri
path = El().art.get_path(uri, "start")
path = App().art.get_path(uri, "start")
if not GLib.file_test(path, GLib.FileTest.IS_REGULAR):
continue
favicon_path = El().art.get_favicon_path(netloc)
favicon_path = App().art.get_favicon_path(netloc)
if favicon_path is not None:
favicon_uri = "file://%s" % favicon_path
else:
......@@ -241,8 +241,8 @@ class Context:
request_uri = request.get_uri()
parsed = urlparse(request_uri)
uri = request_uri.replace("accept://", "https://")
if not El().websettings.get_accept_tls(uri):
El().websettings.set_accept_tls(uri, True)
if not App().websettings.get_accept_tls(uri):
App().websettings.set_accept_tls(uri, True)
self.__context.allow_tls_certificate_for_host(
view.bad_tls,
# Remove port
......@@ -255,4 +255,4 @@ class Context:
@param context as WebKit2.WebContext
@param download as WebKit2.Download
"""
El().download_manager.add(download)
App().download_manager.add(download)
......@@ -12,7 +12,7 @@
from gi.repository import Gio, GLib
El = Gio.Application.get_default
App = Gio.Application.get_default
PROXY_BUS = 'org.gnome.Eolie.Proxy.Page%s'
PROXY_PATH = '/org/gnome/EolieProxy'
......
......@@ -15,7 +15,7 @@ from gi.repository import Gtk, GLib, GObject, Gio, Gdk
import json
import sqlite3
from eolie.define import El, EOLIE_DATA_PATH, COOKIES_PATH
from eolie.define import App, EOLIE_DATA_PATH, COOKIES_PATH
class Profile(GObject.GObject):
......@@ -239,7 +239,7 @@ class CookiesDialog:
sql.commit()
except Exception as e:
print("CookiesDialog::_on_dialog_response():", e)
El().set_profiles()
App().set_profiles()
def _on_entry_changed(self, entry):
"""
......@@ -279,7 +279,7 @@ class CookiesDialog:
row = self.__profiles.get_selected_row()
if row is not None:
profile = row.item.get_property("profile")
El().websettings.remove_profile(profile)
App().websettings.remove_profile(profile)
try:
path = COOKIES_PATH % (EOLIE_DATA_PATH, profile)
f = Gio.File.new_for_path(path)
......@@ -386,7 +386,7 @@ class CookiesDialog:
"""
# Load user profiles
try:
self.__add_profiles(El().profiles)
self.__add_profiles(App().profiles)
except Exception as e:
print("DialogSearchEngine::__populate():", e)
......
......@@ -14,7 +14,7 @@ from gi.repository import Gtk
from gettext import gettext as _
from eolie.define import El
from eolie.define import App
class ImportBookmarksDialog:
......@@ -74,11 +74,11 @@ class ImportBookmarksDialog:
return
index = self.__listbox.get_selected_row().get_index()
if index == self.__Choice.FIREFOX:
El().bookmarks.import_firefox()
App().bookmarks.import_firefox()
elif index == self.__Choice.CHROME:
El().bookmarks.import_chromium(True)
App().bookmarks.import_chromium(True)
elif index == self.__Choice.CHROMIUM:
El().bookmarks.import_chromium(False)
App().bookmarks.import_chromium(False)
else:
dialog = Gtk.FileChooserDialog(
_("Import HTML bookmarks"), self.__window,
......@@ -101,4 +101,4 @@ class ImportBookmarksDialog:
"""
if response_id == Gtk.ResponseType.OK:
path = dialog.get_filename()
El().bookmarks.import_html(path)
App().bookmarks.import_html(path)
......@@ -12,7 +12,7 @@
from gi.repository import Gtk, Pango
from eolie.define import El
from eolie.define import App
class ModifyUADialog:
......@@ -47,7 +47,7 @@ class ModifyUADialog:
column.pack_start(renderer0, True)
column.add_attribute(renderer0, "text", 0)
view.append_column(column)
user_agent = El().websettings.get_user_agent(self.__uri)
user_agent = App().websettings.get_user_agent(self.__uri)
self.__select_matching(user_agent)
self.__entry.set_text(user_agent)
......@@ -84,7 +84,7 @@ class ModifyUADialog:
"""
if response_id != Gtk.ResponseType.DELETE_EVENT:
user_agent = self.__entry.get_text()
El().websettings.set_user_agent(user_agent, self.__uri)
App().websettings.set_user_agent(user_agent, self.__uri)
#######################
# PRIVATE #
......
......@@ -16,7 +16,7 @@ from gettext import gettext as _
from urllib.parse import urlparse
from eolie.search import Search
from eolie.define import El
from eolie.define import App
class Item(GObject.GObject):
......@@ -132,8 +132,8 @@ class SearchEngineDialog:
bang = child.item.get_property("bang")
if name and search:
engines[name] = [uri, search, keyword, encoding, bang]
El().search.save_engines(engines)
El().search.update_default_engine()
App().search.save_engines(engines)
App().search.update_default_engine()
self.__dialog.destroy()
#######################
......@@ -149,8 +149,8 @@ class SearchEngineDialog:
row = self.__listbox.get_selected_row()
if row is not None:
name = row.item.get_property("name")
El().settings.set_value("search-engine",
GLib.Variant("s", name))
App().settings.set_value("search-engine",
GLib.Variant("s", name))
def _on_add_button_clicked(self, button):
"""
......@@ -202,7 +202,7 @@ class SearchEngineDialog:
self.__uri_entry.set_text(row.item.get_property("uri"))
self.__search_entry.set_text(row.item.get_property("search"))
self.__bang_entry.set_text(row.item.get_property("bang"))
default_search_engine = El().settings.get_value(
default_search_engine = App().settings.get_value(
"search-engine").get_string()
self.__default_switch.set_active(default_search_engine ==
row.item.get_property("name"))
......@@ -218,9 +218,9 @@ class SearchEngineDialog:
return
# Update search engine if needed
name = row.item.get_property("name")
if name == El().settings.get_value("search-engine").get_string():
El().settings.set_value("search-engine",
GLib.Variant("s", new_name))
if name == App().settings.get_value("search-engine").get_string():
App().settings.set_value("search-engine",
GLib.Variant("s", new_name))
row.item.set_property("name", new_name)
row.set_name(new_name)
......
......@@ -14,7 +14,7 @@ from gi.repository import GObject, GLib, Gio, Gtk
from time import time
from eolie.define import El
from eolie.define import App
class DownloadManager(GObject.GObject):
......@@ -106,7 +106,7 @@ class DownloadManager(GObject.GObject):
if extension == filename:
extension = "avi"
filename = wanted_filename + "." + extension
directory_uri = El().settings.get_value('download-uri').get_string()
directory_uri = App().settings.get_value('download-uri').get_string()
if not directory_uri:
directory = GLib.get_user_special_dir(
GLib.UserDirectory.DIRECTORY_DOWNLOAD)
......@@ -143,7 +143,7 @@ class DownloadManager(GObject.GObject):
download.set_destination(webkit_uri)
self.emit('download-start', str(download))
# Notify user about download
window = El().active_window
window = App().active_window
if window is not None:
window.toolbar.end.show_download(download)
......@@ -154,7 +154,7 @@ class DownloadManager(GObject.GObject):
self.remove(download)
self.__finished.append(download)
self.emit('download-finish')
if El().settings.get_value('open-downloads'):
if App().settings.get_value('open-downloads'):
destination = download.get_destination()
f = Gio.File.new_for_uri(destination)
if f.query_exists():
......
......@@ -12,7 +12,7 @@
from urllib.parse import urlparse
from eolie.define import El
from eolie.define import App
from eolie.database_adblock import DatabaseAdblock
......@@ -55,7 +55,7 @@ class AdblockExtension:
if self.__settings.get_value("adblock") and\
uri not in self.__not_blocked and\
parsed.scheme in ["http", "https"] and\
not El().adblock_exceptions.find_parsed(parsed):
not App().adblock_exceptions.find_parsed(parsed):
if self.__adblock.is_netloc_blocked(parsed.netloc) or\
self.__adblock.is_uri_blocked(uri, parsed.netloc):
return True
......
......@@ -12,7 +12,7 @@
from urllib.parse import urlparse
from eolie.define import El
from eolie.define import App
class JSblockExtension:
......@@ -84,8 +84,8 @@ class JSblockExtension:
request_uri = request.get_uri()
parsed_request = urlparse(request_uri)
if parsed_request.scheme in ["http", "https"] and\
not El().js_exceptions.find(parsed_request.netloc,
parsed.netloc):
not App().js_exceptions.find(parsed_request.netloc,
parsed.netloc):
for i in range(0, self.__scripts.get_length()):
script = self.__scripts.item(i)
if script.get_src() == request_uri:
......
......@@ -12,7 +12,7 @@
from gi.repository import Gio
from eolie.define import PROXY_BUS, PROXY_PATH, PROXY_INTERFACE, El
from eolie.define import PROXY_BUS, PROXY_PATH, PROXY_INTERFACE, App
class DBusHelper:
......@@ -32,7 +32,7 @@ class DBusHelper:
@param callback as function
"""
try:
bus = El().get_dbus_connection()
bus = App().get_dbus_connection()
proxy_bus = PROXY_BUS % page_id
Gio.DBusProxy.new(bus, Gio.DBusProxyFlags.NONE, None,
proxy_bus,
......@@ -51,7 +51,7 @@ class DBusHelper:
@param page_id as int
"""
try:
bus = El().get_dbus_connection()
bus = App().get_dbus_connection()
proxy_bus = PROXY_BUS % page_id
subscribe_id = bus.signal_subscribe(None, proxy_bus, signal,
PROXY_PATH, None,
......
......@@ -15,7 +15,7 @@ from gi.repository import Gio, GLib
from hashlib import sha256
from gettext import gettext as _
from eolie.define import El
from eolie.define import App
class FormMenu(Gio.Menu):
......@@ -44,7 +44,7 @@ class FormMenu(Gio.Menu):
encoded = "FORM_" + sha256(
attributes["login"].encode("utf-8")).hexdigest()
action = Gio.SimpleAction(name=encoded)
El().add_action(action)
App().add_action(action)
self.__actions.append(encoded)
action.connect('activate',
self.__on_action_clicked,
......@@ -70,7 +70,7 @@ class FormMenu(Gio.Menu):
@param GVariant
@param attributes as {}
"""
El().helper.call("SetAuthForms", self.__page_id,
GLib.Variant("(ss)",
(attributes["userform"],
attributes["login"])))
App().helper.call("SetAuthForms", self.__page_id,
GLib.Variant("(ss)",
(attributes["userform"],
attributes["login"])))
......@@ -14,7 +14,7 @@ from gi.repository import Gio, GLib
from hashlib import sha256
from eolie.define import El
from eolie.define import App
class HistoryMenu(Gio.Menu):
......@@ -50,7 +50,7 @@ class HistoryMenu(Gio.Menu):
item.set_icon(Gio.ThemedIcon.new("emote-love-symbolic"))
else:
# Try to set icon
favicon_path = El().art.get_favicon_path(uri)
favicon_path = App().art.get_favicon_path(uri)
if favicon_path is not None:
f = Gio.File.new_for_path(favicon_path)
icon = Gio.FileIcon.new(f)
......@@ -77,5 +77,5 @@ class HistoryMenu(Gio.Menu):
@param GVariant
@param item as WebKit2.BackForwardListItem
"""
El().active_window.\
App().active_window.\
container.current.webview.go_to_back_forward_list_item(item)
......@@ -12,7 +12,7 @@
from gi.repository import Gtk, GLib, GtkSpell
from eolie.define import El
from eolie.define import App
class LanguageRow(Gtk.EventBox):
......@@ -45,7 +45,7 @@ class LanguageRow(Gtk.EventBox):
self.add(grid)
self.connect("button-press-event", self.__on_button_press_event, check)
user_code = ""
codes = El().websettings.get_languages(uri)
codes = App().websettings.get_languages(uri)
if codes is None:
codes = []
locales = GLib.get_language_names()
......@@ -76,10 +76,10 @@ class LanguageRow(Gtk.EventBox):
"""
active = check.get_active()
if active:
El().websettings.add_language(self.__code, self.__uri)
App().websettings.add_language(self.__code, self.__uri)
else:
El().websettings.remove_language(self.__code, self.__uri)
El().active_window.container.current.webview.update_spell_checking()
App().websettings.remove_language(self.__code, self.__uri)
App().active_window.container.current.webview.update_spell_checking()
class LanguagesMenu(Gtk.Bin):
......@@ -109,7 +109,8 @@ class LanguagesMenu(Gtk.Bin):
Populate languages
@param listbox as Gtk.ListBox
"""
self.__switch.set_active(El().settings.get_value("enable-spell-check"))
enable_spell_checking = App().settings.get_value("enable-spell-check")
self.__switch.set_active(enable_spell_checking)
if not listbox.get_children():
checker = GtkSpell.Checker()
for language in checker.get_language_list():
......@@ -124,10 +125,10 @@ class LanguagesMenu(Gtk.Bin):
@param listbox as Gtk.ListBox
@param state as bool
"""
El().settings.set_value("enable-spell-check",
GLib.Variant("b", state))
App().settings.set_value("enable-spell-check",
GLib.Variant("b", state))
listbox.set_sensitive(state)
for window in El().windows:
for window in App().windows:
for view in window.container.views:
context = view.webview.get_context()
context.set_spell_checking_enabled(state)
......@@ -14,7 +14,7 @@ from gi.repository import Gio, Gtk, GLib
from gettext import gettext as _
from eolie.define import El
from eolie.define import App
class MoveToMenu(Gtk.Grid):
......@@ -65,12 +65,12 @@ class MoveToMenu(Gtk.Grid):
item.set_action_target_value(GLib.Variant("s", "new_window"))
item.show()
self.add(item)
if len(El().windows) > 1:
if len(App().windows) > 1:
item = Gtk.Separator.new(Gtk.Orientation.HORIZONTAL)
item.show()
self.add(item)
for window in El().windows:
for window in App().windows:
if window == current_window:
continue
item = Gtk.ModelButton.new()
......@@ -127,9 +127,9 @@ class MoveToMenu(Gtk.Grid):
# Get wanted window
if window_str == "new_window":
window = El().get_new_window()
window = App().get_new_window()
else:
for window in El().windows:
for window in App().windows:
if window_str == str(window):
break
if window is None:
......
......@@ -15,7 +15,7 @@ from gi.repository import Gio, GLib
from gettext import gettext as _
from hashlib import sha256
from eolie.define import El, LoadingType
from eolie.define import App, LoadingType
from eolie.utils import wanted_loading_type
......@@ -32,12 +32,12 @@ class PagesMenu(Gio.Menu):
# Setup actions
action = Gio.SimpleAction(name="new-private")
El().add_action(action)
App().add_action(action)
action.connect('activate',
self.__on_private_clicked)
action = Gio.SimpleAction(name="openall")
action.set_enabled(False)
El().add_action(action)
App().add_action(action)
action.connect('activate',
self.__on_openall_clicked)
# Setup menu
......@@ -49,8 +49,8 @@ class PagesMenu(Gio.Menu):
item = Gio.MenuItem.new(_("Open all pages"), "app.openall")
item.set_icon(Gio.ThemedIcon.new("document-open-symbolic"))
self.append_item(item)
remember_session = El().settings.get_value("remember-session")
opened_pages = El().history.get_opened_pages()
remember_session = App().settings.get_value("remember-session")
opened_pages = App().history.get_opened_pages()
if not remember_session and opened_pages:
# Delayed to not slow down startup
GLib.timeout_add(1000, self.__append_opened_pages, opened_pages)
......@@ -62,7 +62,7 @@ class PagesMenu(Gio.Menu):
if self.__closed_section.get_n_items():
uri = self.__closed_section.get_item_attribute_value(0, "uri")
encoded = sha256(uri.get_string().encode("utf-8")).hexdigest()
action = El().lookup_action(encoded)
action = App().lookup_action(encoded)
if action is not None:
action.activate(None)
......@@ -81,7 +81,7 @@ class PagesMenu(Gio.Menu):
self.__clean_actions()
encoded = sha256(uri.encode("utf-8")).hexdigest()
action = Gio.SimpleAction(name=encoded)
El().add_action(action)
App().add_action(action)
action.connect('activate',
self.__on_action_clicked,
(uri, state))
......@@ -93,7 +93,7 @@ class PagesMenu(Gio.Menu):
item.set_icon(Gio.ThemedIcon.new("emote-love-symbolic"))
else:
# Try to set icon
favicon_path = El().art.get_favicon_path(uri)
favicon_path = App().art.get_favicon_path(uri)
if favicon_path is not None:
f = Gio.File.new_for_path(favicon_path)
icon = Gio.FileIcon.new(f)
......@@ -102,7 +102,7 @@ class PagesMenu(Gio.Menu):
else:
item.set_icon(Gio.ThemedIcon.new("applications-internet"))
self.__closed_section.insert_item(0, item)
action = El().lookup_action("openall")
action = App().lookup_action("openall")
if action is not None:
action.set_enabled(self.__closed_section.get_n_items() > 1)
......@@ -111,9 +111,9 @@ class PagesMenu(Gio.Menu):
Remove action from menu
"""
encoded = sha256(uri.encode("utf-8")).hexdigest()
action = El().lookup_action(encoded)
action = App().lookup_action(encoded)
if action is not None:
El().remove_action(encoded)
App().remove_action(encoded)
for i in range(0, self.__closed_section.get_n_items() - 1):
attribute = self.__closed_section.get_item_attribute_value(
i,
......@@ -124,7 +124,7 @@ class PagesMenu(Gio.Menu):
if uri == _uri:
self.__closed_section.remove(i)
break
action = El().lookup_action("openall")
action = App().lookup_action("openall")
if action is not None:
action.set_enabled(self.__closed_section.get_n_items() < 2)
......@@ -147,9 +147,9 @@ class PagesMenu(Gio.Menu):
uri = self.__closed_section.get_item_attribute_value(
0, "uri").get_string()
encoded = sha256(uri.encode("utf-8")).hexdigest()
action = El().lookup_action(encoded)
action = App().lookup_action(encoded)
if action is not None:
El().remove_action(encoded)
App().remove_action(encoded)