Kaydet (Commit) ca6eb8d2 authored tarafından Your Name's avatar Your Name

remove all webkit based components

üst 171aee23

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -16,8 +16,7 @@ import cairo
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('WebKit2', '4.0')
from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, WebKit2, Pango, GLib
from gi.repository import Gtk, Gdk, GdkPixbuf, GObject, Pango, GLib
gettext.install("live-installer", "/usr/share/locale")
......@@ -220,28 +219,11 @@ class InstallerWindow:
# make sure we're on the right page (no pun.)
self.activate_page(0)
# initiate the slide show
# We have no significant browsing interface, so there isn't much point
# in WebKit creating a memory-hungry cache.
context = WebKit2.WebContext.get_default()
context.set_cache_model(WebKit2.CacheModel.DOCUMENT_VIEWER)
self.partitions_browser = WebKit2.WebView()
s = self.partitions_browser.get_settings()
s.set_allow_file_access_from_file_urls(True)
self.partitions_browser.show()
self.partitions_browser.set_size_request(-1, 80)
self.builder.get_object("scrolled_partitions").add(self.partitions_browser)
self.window.show_all()
def fullscreen(self):
self.window.fullscreen()
def on_context_menu(self, unused_web_view, unused_context_menu,
unused_event, unused_hit_test_result):
# True will not show the menu
return True
def i18n(self):
......@@ -970,17 +952,9 @@ class InstallerWindow:
self.builder.get_object("button_back").set_sensitive(False)
self.builder.get_object("button_quit").set_sensitive(False)
self.do_install()
self.slideshow_browser = WebKit2.WebView()
s = self.slideshow_browser.get_settings()
s.set_allow_file_access_from_file_urls(True)
s.set_property('enable-caret-browsing', False)
self.slideshow_browser.load_uri("file:////usr/share/live-installer/slideshow/index.html#locale=%s" % self.setup.language)
self.builder.get_object("scrolled_slideshow").add(self.slideshow_browser)
self.builder.get_object("scrolled_slideshow").show_all()
self.slideshow_browser.connect('context-menu', self.on_context_menu)
self.builder.get_object("title_eventbox").hide()
self.builder.get_object("button_eventbox").hide()
self.window.resize(100, 100)
#self.window.resize(100, 100)
elif(sel == self.PAGE_CUSTOMPAUSED):
self.activate_page(self.PAGE_INSTALL)
self.builder.get_object("button_next").set_sensitive(False)
......
......@@ -80,12 +80,15 @@ class InstallerEngine:
"{src}* {dst}".format(src=SOURCE, dst=DEST, rsync_filter=rsync_filter),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
while rsync.poll() is None:
line = rsync.stdout.readline()
line = str(rsync.stdout.readline())
line = line.replace("b'","'")
line = line.replace("'","")
line = line.replace("\\n","")
if not line: # still copying the previous file, just wait
time.sleep(0.1)
else:
our_current = min(our_current + 1, our_total)
self.update_progress(our_current, our_total, False, False, _("Copying /%s" % line))
self.update_progress(our_current, our_total, False, False, _("Copying /%s") % line)
print("rsync exited with returncode: " + str(rsync.poll()))
# Steps:
......
......@@ -54,16 +54,6 @@ EFI_MOUNT_POINT = '/boot/efi'
SWAP_MOUNT_POINT = 'swap'
with open(RESOURCE_DIR + 'disk-partitions.html') as f:
DISK_TEMPLATE = f.read()
# cut out the single partition (skeleton) block
PARTITION_TEMPLATE = re.search('CUT_HERE([\s\S]+?)CUT_HERE', DISK_TEMPLATE, re.MULTILINE).group(1)
# delete the skeleton from original
DISK_TEMPLATE = DISK_TEMPLATE.replace(PARTITION_TEMPLATE, '')
# duplicate all { or } in original CSS so they don't get interpreted as part of string formatting
DISK_TEMPLATE = re.sub('<style>[\s\S]+?</style>', lambda match: match.group().replace('{', '{{').replace('}', '}}'), DISK_TEMPLATE)
def get_disks():
disks = []
exclude_devices = ['/dev/sr0', '/dev/sr1', '/dev/cdrom', '/dev/dvd', '/dev/fd0']
......@@ -110,10 +100,7 @@ def build_partitions(_installer):
print("Finished PartitionSetup()")
if partition_setup.disks:
installer._selected_disk = partition_setup.disks[0][0]
print("Loading HTML string")
installer.partitions_browser.load_html(partition_setup.get_html(installer._selected_disk), 'file:///')
print("Showing the partition screen")
installer.builder.get_object("scrolled_partitions").show_all()
installer.builder.get_object("treeview_disks").set_model(partition_setup)
installer.builder.get_object("treeview_disks").expand_all()
installer.window.get_window().set_cursor(None)
......@@ -125,7 +112,6 @@ def update_html_preview(selection):
except TypeError as IndexError: return # no disk is selected or no disk available
if disk != installer._selected_disk:
installer._selected_disk = disk
installer.partitions_browser.load_html(model.get_html(disk), 'file:///')
def edit_partition_dialog(widget, path, viewcol):
''' assign the partition ... '''
......@@ -226,7 +212,7 @@ class PartitionSetup(Gtk.TreeStore):
str) # disk device path
installer.setup.partitions = []
installer.setup.partition_setup = self
self.html_disks, self.html_chunks = {}, defaultdict(list)
self.html_chunks = {}, defaultdict(list)
os.popen('mkdir -p ' + TMP_MOUNTPOINT)
installer.setup.gptonefi = is_efi_supported()
......@@ -315,14 +301,9 @@ class PartitionSetup(Gtk.TreeStore):
partition,
disk_path))
print(" - Loading HTML view...")
self.html_disks[disk_path] = DISK_TEMPLATE.format(PARTITIONS_HTML=''.join(PARTITION_TEMPLATE.format(p) for p in partitions))
def get_html(self, disk):
if disk in self.html_disks:
return self.html_disks[disk]
else:
return ""
return ""
@idle
def show_error(message):
......@@ -564,7 +545,7 @@ class PartitionDialog(object):
filesystems = ['', 'swap']
for path in ["/bin", "/sbin"]:
for fs in getoutput('echo %s/mkfs.*' % path).split():
filesystems.append(fs.split("mkfs.")[1])
filesystems.append(str(fs).split("mkfs.")[1].replace("'",""))
filesystems = sorted(filesystems)
filesystems = sorted(filesystems, key=lambda x: 0 if x in ('', 'ext4') else 1 if x == 'swap' else 2)
model = Gtk.ListStore(str)
......
<html>
<head>
<style>
body {
background-color:#f0f0f0;
}
.partition {
position:relative;
width:100%;
float: left;
background: white;
border-radius: 3px;
}
.partition-cell {
position:relative;
margin: 2px 5px 2px 0;
padding: 1px;
float: left;
background: #9c9c9c;
border-radius: 3px;
}
.partition-text {
position:absolute;
top:10;
text-align: center;
width=100px;
white-space: nowrap;
text-overflow: ellipsis;
left: 0;
right: 0;
margin: 0 auto;
font-size:12px;
font-weight: bold;
color:#ffffff;
text-shadow: 1px 1px 1px #000;
}
.partition-os {
position:absolute;
top:30;
text-align: center;
width=100px;
white-space: nowrap;
text-overflow: ellipsis;
left: 0;
right: 0;
margin: 0 auto;
font-size:10px;
color:#ffffff;
text-shadow: 1px 1px 1px #000;
}
.fat, .fat16, .fat32, .exfat {
background-color: #b4d59b;
background-image: -webkit-gradient(linear, left top, left bottom, from(#b4d59b), to(#47872a));
background-image: -webkit-linear-gradient(top, #b4d59b, #47872a);
background-image: -moz-linear-gradient(top, #b4d59b, #47872a);
}
.ntfs {
background-color: #c9e3e4;
background-image: -webkit-gradient(linear, left top, left bottom, from(#c9e3e4), to(#66a6a8));
background-image: -webkit-linear-gradient(top,#c9e3e4, #66a6a8);
background-image: -moz-linear-gradient(top, #c9e3e4, #66a6a8);}
.ext, .ext2, .ext3 {
background-color: #98d4e0;
background-image: -webkit-gradient(linear, left top, left bottom, from(#98d4e0), to(#2582a0));
background-image: -webkit-linear-gradient(top, #98d4e0, #2582a0);
background-image: -moz-linear-gradient(top, #98d4e0, #2582a0);}
.ext4 {
background-color: #95c4de;
background-image: -webkit-gradient(linear, left top, left bottom, from(#95c4de), to(#21619e));
background-image: -webkit-linear-gradient(top, #95c4de, #21619e);
background-image: -moz-linear-gradient(top, #95c4de, #21619e);}
.swap {
background-color: #eaaca9;
background-image: -webkit-gradient(linear, left top, left bottom, from(#eaaca9), to(#be3a37));
background-image: -webkit-linear-gradient(top, #eaaca9, #be3a37);
background-image: -moz-linear-gradient(top, #eaaca9, #be3a37);}
.unknown, .btrfs, .hfs, .jfs, .reiserfs, .ufs, .xfs, .zfs {