use local ctl
This commit is contained in:
parent
a40c38248d
commit
3119f2b5a9
1 changed files with 16 additions and 10 deletions
|
@ -1,26 +1,32 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
import os
|
||||||
|
from os.path import dirname, abspath
|
||||||
|
import subprocess
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('WebKit2', '4.0')
|
gi.require_version('WebKit2', '4.0')
|
||||||
from gi.repository import WebKit2, Gtk
|
from gi.repository import WebKit2, Gtk
|
||||||
import os
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
icon = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../static/png/oml.png')
|
|
||||||
|
base = dirname(dirname(dirname(abspath(__file__))))
|
||||||
|
icon = os.path.join(base, 'openmedialibrary/static/png/oml.png')
|
||||||
title = "Open Media Library"
|
title = "Open Media Library"
|
||||||
base = os.path.expanduser('~/.local/share/openmedialibrary')
|
|
||||||
|
|
||||||
|
def drop_cb(wid, context, x, y, time):
|
||||||
|
print([str(t) for t in context.targets])
|
||||||
|
context.finish(True, False, time)
|
||||||
|
return True
|
||||||
|
|
||||||
wnd = Gtk.Window()
|
wnd = Gtk.Window()
|
||||||
wnd.set_icon_from_file(icon)
|
wnd.set_icon_from_file(icon)
|
||||||
|
|
||||||
ctx = WebKit2.WebContext.get_default()
|
|
||||||
web = WebKit2.WebView.new_with_context(ctx)
|
|
||||||
|
|
||||||
wnd.connect("destroy", Gtk.main_quit)
|
|
||||||
wnd.add(web)
|
|
||||||
wnd.set_wmclass(title, title)
|
wnd.set_wmclass(title, title)
|
||||||
wnd.set_title(title)
|
wnd.set_title(title)
|
||||||
wnd.set_default_size(1366, 768)
|
wnd.set_default_size(1366, 768)
|
||||||
|
|
||||||
|
ctx = WebKit2.WebContext.get_default()
|
||||||
|
web = WebKit2.WebView.new_with_context(ctx)
|
||||||
|
wnd.connect("destroy", Gtk.main_quit)
|
||||||
|
wnd.add(web)
|
||||||
wnd.show_all()
|
wnd.show_all()
|
||||||
|
|
||||||
url = 'file://' + base + '/openmedialibrary/static/html/load.html'
|
url = 'file://' + base + '/openmedialibrary/static/html/load.html'
|
||||||
|
|
Loading…
Reference in a new issue