Commit b72b6d3c authored by Cédric Bellegarde's avatar Cédric Bellegarde

Remove profiles feature until https://bugs.webkit.org/show_bug.cgi?id=186338 is fixed

parent 3c79d84c
......@@ -36,6 +36,7 @@ from eolie.database_exceptions import DatabaseExceptions
from eolie.database_settings import DatabaseSettings
from eolie.database_phishing import DatabasePhishing
from eolie.sqlcursor import SqlCursor
from eolie.context import Context
from eolie.search import Search
from eolie.download_manager import DownloadManager
from eolie.menu_pages import PagesMenu
......@@ -59,6 +60,7 @@ class Application(Gtk.Application):
"""
self.__version = version
self.__state_cache = []
self.__ephemeral_context = None
signal(SIGINT, lambda a, b: self.quit())
signal(SIGTERM, lambda a, b: self.quit())
# Set main thread name
......@@ -257,6 +259,17 @@ class Application(Gtk.Application):
value = self.search.uri
return value
@property
def ephemeral_context(self):
"""
Return ephemeral context
@return WebKit2.WebContext
"""
if self.__ephemeral_context is None:
self.__ephemeral_context = WebKit2.WebContext.new_ephemeral()
Context(self.__ephemeral_context)
return self.__ephemeral_context
@property
def default_style_sheet(self):
"""
......@@ -367,6 +380,8 @@ class Application(Gtk.Application):
# Init profiles
self.set_profiles()
# Init default context
Context(WebKit2.WebContext().get_default())
shortcut_action = Gio.SimpleAction.new('shortcut',
GLib.VariantType.new('s'))
......
......@@ -13,7 +13,7 @@
from gi.repository import Gio, GLib, Gtk
from gettext import gettext as _
from urllib.parse import urlparse
# from urllib.parse import urlparse
from eolie.define import App
from eolie.logger import Logger
......@@ -61,15 +61,15 @@ class SitesMenu(Gtk.Grid):
separator.show()
self.add(separator)
# Profiles switcher
webview = views[0].webview
if not webview.ephemeral:
parsed = urlparse(webview.uri)
if parsed.scheme in ["http", "https"]:
item = Gtk.ModelButton.new()
item.set_property("text", _("Profiles"))
item.set_property("menu-name", "profiles")
item.show()
self.add(item)
# webview = views[0].webview
# if not webview.ephemeral:
# parsed = urlparse(webview.uri)
# if parsed.scheme in ["http", "https"]:
# item = Gtk.ModelButton.new()
# item.set_property("text", _("Profiles"))
# item.set_property("menu-name", "profiles")
# item.show()
# self.add(item)
# Move to
item = Gtk.ModelButton.new()
item.set_property("text", _("Move to"))
......
......@@ -348,21 +348,21 @@ class SitesManagerChild(Gtk.ListBoxRow):
return True
elif event.button == 3:
from eolie.menu_sites import SitesMenu
from eolie.menu_profiles import ProfilesMenu
# from eolie.menu_profiles import ProfilesMenu
from eolie.menu_move_to import MoveToMenu
sites_menu = SitesMenu(self.__views, self.__window)
sites_menu.show()
webview = self.__views[0].webview
profiles_menu = ProfilesMenu(webview, self.__window)
profiles_menu.show()
# webview = self.__views[0].webview
# profiles_menu = ProfilesMenu(webview, self.__window)
# profiles_menu.show()
moveto_menu = MoveToMenu(self.__views, self.__window)
moveto_menu.show()
popover = Gtk.PopoverMenu.new()
popover.add(sites_menu)
popover.add(profiles_menu)
# popover.add(profiles_menu)
popover.add(moveto_menu)
popover.child_set_property(profiles_menu,
"submenu", "profiles")
# popover.child_set_property(profiles_menu,
# "submenu", "profiles")
popover.child_set_property(moveto_menu,
"submenu", "moveto")
popover.set_relative_to(eventbox)
......
......@@ -20,7 +20,6 @@ from eolie.webview_errors import WebViewErrors
from eolie.webview_navigation import WebViewNavigation
from eolie.webview_signals import WebViewSignals
from eolie.webview_artwork import WebViewArtwork
from eolie.context import Context
from eolie.list import LinkedList
from eolie.logger import Logger
......@@ -36,8 +35,9 @@ class WebView(WebKit2.WebView):
@param window as Window
@param view as View
"""
context = WebKit2.WebContext.new()
Context(context)
# context = WebKit2.WebContext.new()
# Context(context)
context = WebKit2.WebContext.get_default()
webview = WebKit2.WebView.new_with_context(context)
content_manager = webview.get_property("user-content-manager")
webview.__class__ = WebViewMeta
......@@ -50,8 +50,9 @@ class WebView(WebKit2.WebView):
@param window as Window
@param view as View
"""
context = WebKit2.WebContext.new_ephemeral()
Context(context)
# context = WebKit2.WebContext.new_ephemeral()
# Context(context)
context = App().ephemeral_context
webview = WebKit2.WebView.new_with_context(context)
webview.__class__ = WebViewMeta
content_manager = webview.get_property("user-content-manager")
......
......@@ -220,6 +220,7 @@ class WebViewNavigation:
Handle cookies manager
@param uri as str
"""
return
if self.ephemeral or self.__related_view is not None:
return
profile = App().websettings.get_profile(uri)
......
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