Kaydet (Commit) 6176c379 authored tarafından Ali Rıza KESKİN's avatar Ali Rıza KESKİN

python3 converted

üst e93a28cb
......@@ -17,9 +17,9 @@ if is_hidpi:
#U+ , or +U+ ... to string
def fromUnicodeString(raw):
if raw[0:2] == "U+":
return unichr(int(raw[2:], 16))
return chr(int(raw[2:], 16))
elif raw[0:2] == "+U":
return unichr(int(raw[3:], 16))
return chr(int(raw[3:], 16))
return ""
......
# -*- coding: utf-8 -*-
import subprocess
import sys
import PyQt5
from PyQt5.QtCore import Qt, QRectF
from PyQt5.QtWidgets import QWidget, QApplication, QVBoxLayout
from PyQt5.QtGui import QFont, QPainter, QPen, QPainterPath, QColor, QPixmap
is_hidpi = sys.argv[4] == "hidpi"
if is_hidpi:
print("Keyboard layout being generated for hidpi")
PyQt5.QtWidgets.QApplication.setAttribute(PyQt5.QtCore.Qt.AA_EnableHighDpiScaling, True)
PyQt5.QtWidgets.QApplication.setAttribute(PyQt5.QtCore.Qt.AA_UseHighDpiPixmaps, True)
#U+ , or +U+ ... to string
def fromUnicodeString(raw):
if raw[0:2] == "U+":
return unichr(int(raw[2:], 16))
elif raw[0:2] == "+U":
return unichr(int(raw[3:], 16))
return ""
class Keyboard(QWidget):
kb_104 = {
"extended_return": False,
"keys": [
(0x29, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd),
(0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x2b),
(0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28),
(0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35),
()]
}
kb_105 = {
"extended_return": True,
"keys": [
(0x29, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd),
(0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b),
(0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2b),
(0x54, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35),
()]
}
kb_106 = {
"extended_return": True,
"keys": [
(0x29, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe),
(0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b),
(0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29),
(0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36),
()]
}
lowerFont = QFont("Ubuntu", 10, QFont.DemiBold)
upperFont = QFont("Ubuntu", 8)
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.codes = []
self.layout = "us"
self.variant = ""
self.kb = None
def setLayout(self, layout):
self.layout = layout
def setVariant(self, variant):
self.variant = variant
self.loadCodes()
self.loadInfo()
self.repaint()
def loadInfo(self):
kbl_104 = ["us", "th"]
kbl_106 = ["jp"]
# most keyboards are 105 key so default to that
if self.layout in kbl_104:
self.kb = self.kb_104
elif self.layout in kbl_106:
self.kb = self.kb_106
elif self.kb != self.kb_105:
self.kb = self.kb_105
def resizeEvent(self, re):
self.space = 6
self.usable_width = self.width()-6
self.key_w = (self.usable_width - 14 * self.space)/15
self.setMaximumHeight(self.key_w*4 + self.space*5)
def paintEvent(self, pe):
p = QPainter(self)
p.setRenderHint(QPainter.Antialiasing)
# p.setBrush(QColor(0xf0, 0xf0, 0xf0)) # color of the border
# p.drawRect(-1, -1, 800, 800)
pen = QPen()
pen.setWidth(1)
pen.setColor(QColor(0x58, 0x58, 0x58)) # color of the borders of the keys
p.setPen(pen)
p.setBrush(QColor(0x58, 0x58, 0x58)) # color of the keys
p.setBackgroundMode(Qt.TransparentMode)
rx = 3
space = self.space
w = self.usable_width
kw = self.key_w
def drawRow(row, sx, sy, last_end=False):
x=sx
y=sy
keys = row
rw=w-sx
i=0
for k in keys:
rect = QRectF(x, y, kw, kw)
if i == len(keys)-1 and last_end:
rect.setWidth(rw)
p.drawRoundedRect(rect, rx, rx)
rect.adjust(5,1, 0, 0)
p.setPen(QColor(0xff, 0xff, 0xff))
p.setFont(self.lowerFont)
p.drawText(rect, Qt.AlignLeft | Qt.AlignBottom, self.regular_text(k))
p.setPen(QColor(0x9e, 0xde, 0x00))
p.setFont(self.upperFont)
p.drawText(rect, Qt.AlignLeft | Qt.AlignTop, self.shift_text(k))
rw = rw - space - kw
x = x + space + kw
i = i+1
p.setPen(pen)
return (x,rw)
x=6
y=6
keys = self.kb["keys"]
ext_return = self.kb["extended_return"]
first_key_w = 0
rows = 4
remaining_x = [0,0,0,0]
remaining_widths = [0,0,0,0]
for i in range(0, rows):
if first_key_w > 0:
first_key_w = first_key_w*1.375
if self.kb == self.kb_105 and i==3:
first_key_w = kw * 1.275
rect = QRectF(6, y, first_key_w, kw)
p.drawRoundedRect(rect, rx, rx)
x = 6 + first_key_w + space
else:
first_key_w = kw
x,rw = drawRow(keys[i], x, y, i==1 and not ext_return)
remaining_x[i] = x
remaining_widths[i] = rw
if i!=1 and i!=2:
rect = QRectF(x, y, rw, kw)
p.drawRoundedRect(rect, rx, rx)
x=.5
y = y + space + kw
if ext_return:
rx=rx*2
x1 = remaining_x[1]
y1 = 6 + kw*1 + space*1
w1 = remaining_widths[1]
x2 = remaining_x[2]
y2 = 6 + kw*2 + space*2
# this is some serious crap... but it has to be so
# maybe one day keyboards won't look like this...
# one can only hope
pp = QPainterPath()
pp.moveTo(x1, y1+rx)
pp.arcTo(x1, y1, rx, rx, 180, -90)
pp.lineTo(x1+w1-rx, y1)
pp.arcTo(x1+w1-rx, y1, rx, rx, 90, -90)
pp.lineTo(x1+w1, y2+kw-rx)
pp.arcTo(x1+w1-rx, y2+kw-rx, rx, rx, 0, -90)
pp.lineTo(x2+rx, y2+kw)
pp.arcTo(x2, y2+kw-rx, rx, rx, -90, -90)
pp.lineTo(x2, y1+kw)
pp.lineTo(x1+rx, y1+kw)
pp.arcTo(x1, y1+kw-rx, rx, rx, -90, -90)
pp.closeSubpath()
p.drawPath(pp)
else:
x= remaining_x[2]
y = .5 + kw*2 + space*2
rect = QRectF(x, y, remaining_widths[2], kw)
p.drawRoundedRect(rect, rx, rx)
QWidget.paintEvent(self, pe)
def regular_text(self, index):
return self.codes[index - 1][0]
def shift_text(self, index):
return self.codes[index - 1][1]
def ctrl_text(self, index):
return self.codes[index - 1][2]
def alt_text(self, index):
return self.codes[index - 1][3]
def loadCodes(self):
if self.layout is None:
return
variantParam = ""
if self.variant is not None and self.variant != "None":
variantParam = "-variant %s" % self.variant
cmd="ckbcomp -model pc106 -layout %s %s -compact" % (self.layout, variantParam)
#print cmd
pipe = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=None)
cfile = pipe.communicate()[0]
#clear the current codes
del self.codes[:]
for l in cfile.split('\n'):
if l[:7] != "keycode":
continue
codes = l.split('=')[1].strip().split(' ')
plain = fromUnicodeString(codes[0])
shift = fromUnicodeString(codes[1])
ctrl = fromUnicodeString(codes[2])
alt = fromUnicodeString(codes[3])
if ctrl == plain:
ctrl = ""
if alt == plain:
alt = ""
self.codes.append((plain, shift, ctrl, alt))
## testing
if __name__ == "__main__":
app = QApplication(sys.argv)
layout=sys.argv[1]
variant = sys.argv[2]
filename = sys.argv[3]
kb1 = Keyboard()
kb1.setLayout(layout)
kb1.setVariant(variant)
snapshot = kb1.grab()
#snapshot = snapshot.scaled(600, 200, Qt.IgnoreAspectRatio, Qt.FastTransformation)
snapshot.save(filename, "PNG")
......@@ -7,7 +7,7 @@ import partitioning
import gettext
import os
import re
import commands
import subprocess
import sys
import threading
import time
......@@ -90,7 +90,7 @@ class InstallerWindow:
self.PAGE_OVERVIEW,
self.PAGE_CUSTOMWARNING,
self.PAGE_CUSTOMPAUSED,
self.PAGE_INSTALL) = range(12)
self.PAGE_INSTALL) = list(range(12))
# set the button events (wizard_cb)
self.builder.get_object("button_next").connect("clicked", self.wizard_cb, False)
......@@ -267,7 +267,7 @@ class InstallerWindow:
self.window.set_title(window_title)
# Header
self.wizard_pages = range(12)
self.wizard_pages = list(range(12))
self.wizard_pages[self.PAGE_WELCOME] = WizardPage(_("Welcome"), "mark-location-symbolic", "")
self.wizard_pages[self.PAGE_LANGUAGE] = WizardPage(_("Language"), "preferences-desktop-locale-symbolic", _("What language would you like to use?"))
self.wizard_pages[self.PAGE_TIMEZONE] = WizardPage(_("Timezone"), "mark-location-symbolic", _("Where are you?"))
......@@ -498,7 +498,7 @@ class InstallerWindow:
# Try to find out where we're located...
try:
from urllib import urlopen
from urllib.request import urlopen
except ImportError: # py3
from urllib.request import urlopen
try:
......@@ -515,7 +515,7 @@ class InstallerWindow:
iso_standard = "3166"
if os.path.exists("/usr/share/xml/iso-codes/iso_3166-1.xml"):
iso_standard = "3166-1"
for line in commands.getoutput("isoquery --iso %s | cut -f1,4-" % iso_standard).split('\n'):
for line in subprocess.getoutput("isoquery --iso %s | cut -f1,4-" % iso_standard).split('\n'):
ccode, cname = line.split(None, 1)
countries[ccode] = cname
......@@ -524,15 +524,15 @@ class InstallerWindow:
iso_standard = "639"
if os.path.exists("/usr/share/xml/iso-codes/iso_639-2.xml"):
iso_standard = "639-2"
for line in commands.getoutput("isoquery --iso %s | cut -f3,4-" % iso_standard).split('\n'):
for line in subprocess.getoutput("isoquery --iso %s | cut -f3,4-" % iso_standard).split('\n'):
cols = line.split(None, 1)
if len(cols) > 1:
name = cols[1].replace(";", ",")
languages[cols[0]] = name
for line in commands.getoutput("isoquery --iso %s | cut -f1,4-" % iso_standard).split('\n'):
for line in subprocess.getoutput("isoquery --iso %s | cut -f1,4-" % iso_standard).split('\n'):
cols = line.split(None, 1)
if len(cols) > 1:
if cols[0] not in languages.keys():
if cols[0] not in list(languages.keys()):
name = cols[1].replace(";", ",")
languages[cols[0]] = name
......@@ -542,7 +542,7 @@ class InstallerWindow:
flag_path = lambda ccode: self.resource_dir + '/flags/16/' + ccode.lower() + '.png'
from utils import memoize
flag = memoize(lambda ccode: GdkPixbuf.Pixbuf.new_from_file(flag_path(ccode)))
for locale in commands.getoutput("awk -F'[@ .]' '/UTF-8/{ print $1 }' /usr/share/i18n/SUPPORTED | uniq").split('\n'):
for locale in subprocess.getoutput("awk -F'[@ .]' '/UTF-8/{ print $1 }' /usr/share/i18n/SUPPORTED | uniq").split('\n'):
if '_' in locale:
lang, ccode = locale.split('_')
language = lang
......@@ -585,7 +585,7 @@ class InstallerWindow:
''' Do some xml kung-fu and load the keyboard stuffs '''
# Determine the layouts in use
(keyboard_geom,
self.setup.keyboard_layout) = commands.getoutput("setxkbmap -query | awk '/^(model|layout)/{print $2}'").split()
self.setup.keyboard_layout) = subprocess.getoutput("setxkbmap -query | awk '/^(model|layout)/{print $2}'").split()
# Build the models
from collections import defaultdict
def _ListStore_factory():
......@@ -641,18 +641,17 @@ class InstallerWindow:
''' Called whenever someone updates the language '''
model = treeview.get_model()
selection = treeview.get_selection()
if selection.count_selected_rows > 0:
(model, iter) = selection.get_selected()
if iter is not None:
self.setup.language = model.get_value(iter, 3)
self.setup.print_setup()
gettext.translation('live-installer', "/usr/share/locale",
languages=[self.setup.language, self.setup.language.split('_')[0]],
fallback=True).install() # Try e.g. zh_CN, zh, or fallback to hardcoded English
try:
self.i18n()
except:
pass # Best effort. Fails the first time as self.column1 doesn't exist yet.
(model, iter) = selection.get_selected()
if iter is not None:
self.setup.language = model.get_value(iter, 3)
self.setup.print_setup()
gettext.translation('live-installer', "/usr/share/locale",
languages=[self.setup.language, self.setup.language.split('_')[0]],
fallback=True).install() # Try e.g. zh_CN, zh, or fallback to hardcoded English
try:
self.i18n()
except:
pass # Best effort. Fails the first time as self.column1 doesn't exist yet.
def assign_login_options(self, checkbox, data=None):
if self.builder.get_object("radiobutton_passwordlogin").get_active():
......@@ -774,7 +773,7 @@ class InstallerWindow:
surface = Gdk.cairo_surface_create_from_pixbuf(pixbuf, widget.get_scale_factor(), widget.get_window())
widget.set_from_surface(surface)
except GLib.Error as e:
print("could not load keyboard layout: %s" % e.message)
print(("could not load keyboard layout: %s" % e.message))
return False
def activate_page(self, index):
......@@ -1105,11 +1104,11 @@ class InstallerWindow:
@asynchronous
def do_install(self):
print " ## INSTALLATION "
print(" ## INSTALLATION ")
''' Actually perform the installation .. '''
if __debug__:
print " ## DEBUG MODE - INSTALLATION PROCESS NOT LAUNCHED"
print(" ## DEBUG MODE - INSTALLATION PROCESS NOT LAUNCHED")
time.sleep(200)
Gtk.main_quit()
sys.exit(0)
......@@ -1125,8 +1124,8 @@ class InstallerWindow:
try:
self.installer.start_installation()
except Exception, detail1:
print detail1
except Exception as detail1:
print(detail1)
do_try_finish_install = False
self.show_error_dialog(_("Installation error"), str(detail1))
......@@ -1143,8 +1142,8 @@ class InstallerWindow:
try:
self.installer.finish_installation()
except Exception, detail1:
print detail1
except Exception as detail1:
print(detail1)
self.show_error_dialog(_("Installation error"), str(detail1))
# show a message dialog thingum
......@@ -1160,7 +1159,7 @@ class InstallerWindow:
while(self.showing_last_dialog):
time.sleep(0.1)
print " ## INSTALLATION COMPLETE "
print(" ## INSTALLATION COMPLETE ")
Gtk.main_quit()
sys.exit(0)
......
#!/usr/bin/env python
from installer import InstallerEngine, Setup, NON_LATIN_KB_LAYOUTS
from dialogs import MessageDialog, QuestionDialog, ErrorDialog, WarningDialog
import timezones
import partitioning
import gettext
import os
import re
import commands
import sys
import threading
import time
import parted
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
gettext.install("live-installer", "/usr/share/locale")
LOADING_ANIMATION = '/usr/share/live-installer/loading.gif'
# Used as a decorator to run things in the background
def asynchronous(func):
def wrapper(*args, **kwargs):
thread = threading.Thread(target=func, args=args, kwargs=kwargs)
thread.daemon = True
thread.start()
return thread
return wrapper
# Used as a decorator to run things in the main loop, from another thread
def idle(func):
def wrapper(*args, **kwargs):
GObject.idle_add(func, *args, **kwargs)
return wrapper
class WizardPage:
def __init__(self, help_text, icon, question):
self.help_text = help_text
self.icon = icon
self.question = question
class InstallerWindow:
# Cancelable timeout for keyboard preview generation, which is
# quite expensive, so avoid drawing it if only scrolling through
# the keyboard layout list
kbd_preview_generation = -1
def __init__(self, expert_mode=False):
self.expert_mode = expert_mode
# disable the screensaver
if not __debug__:
os.system("killall cinnamon-screen")
# build the setup object (where we put all our choices) and the installer
self.setup = Setup()
self.installer = InstallerEngine(self.setup)
self.resource_dir = '/usr/share/live-installer/'
glade_file = os.path.join(self.resource_dir, 'interface.ui')
self.builder = Gtk.Builder()
self.builder.add_from_file(glade_file)
# should be set early
self.done = False
self.fail = False
self.paused = False
self.showing_last_dialog = False
# load the window object
self.window = self.builder.get_object("main_window")
self.window.connect("delete-event", self.quit_cb)
# wizard pages
(self.PAGE_WELCOME,
self.PAGE_LANGUAGE,
self.PAGE_TIMEZONE,
self.PAGE_KEYBOARD,
self.PAGE_USER,
self.PAGE_TYPE,
self.PAGE_PARTITIONS,
self.PAGE_ADVANCED,
self.PAGE_OVERVIEW,
self.PAGE_CUSTOMWARNING,
self.PAGE_CUSTOMPAUSED,
self.PAGE_INSTALL) = range(12)
# set the button events (wizard_cb)
self.builder.get_object("button_next").connect("clicked", self.wizard_cb, False)
self.builder.get_object("button_back").connect("clicked", self.wizard_cb, True)
self.builder.get_object("button_quit").connect("clicked", self.quit_cb)
col = Gtk.TreeViewColumn("", Gtk.CellRendererPixbuf(), pixbuf=2)
self.builder.get_object("treeview_language_list").append_column(col)
ren = Gtk.CellRendererText()
self.language_column = Gtk.TreeViewColumn(_("Language"), ren, text=0)
self.language_column.set_sort_column_id(0)
self.language_column.set_expand(True)
self.language_column.set_resizable(True)
ren.set_property("ellipsize", Pango.EllipsizeMode.MIDDLE)
self.builder.get_object("treeview_language_list").append_column(self.language_column)
ren = Gtk.CellRendererText()
self.country_column = Gtk.TreeViewColumn(_("Country"), ren, text=1)
self.country_column.set_sort_column_id(1)
self.country_column.set_expand(True)
self.country_column.set_resizable(True)
ren.set_property("ellipsize", Pango.EllipsizeMode.MIDDLE)
self.builder.get_object("treeview_language_list").append_column(self.country_column)
self.builder.get_object("treeview_language_list").connect("cursor-changed", self.assign_language)
# build the language list
self.build_lang_list()
# build timezones
timezones.build_timezones(self)
# type page
model = Gtk.ListStore(str, str)
model.set_sort_column_id(0, Gtk.SortType.ASCENDING)
for disk_path, disk_description in partitioning.get_disks():
iterator = model.append(("%s (%s)" % (disk_description, disk_path), disk_path))
self.builder.get_object("combo_disk").set_model(model)
renderer_text = Gtk.CellRendererText()
self.builder.get_object("combo_disk").pack_start(renderer_text, True)
self.builder.get_object("combo_disk").add_attribute(renderer_text, "text", 0)
self.builder.get_object("entry_passphrase").connect("changed", self.assign_passphrase)
self.builder.get_object("entry_passphrase2").connect("changed", self.assign_passphrase)
self.builder.get_object("radio_automated").connect("toggled", self.assign_type_options)
self.builder.get_object("radio_manual").connect("toggled", self.assign_type_options)
self.builder.get_object("check_badblocks").connect("toggled", self.assign_type_options)
self.builder.get_object("check_encrypt").connect("toggled", self.assign_type_options)
self.builder.get_object("check_lvm").connect("toggled", self.assign_type_options)
self.builder.get_object("combo_disk").connect("changed", self.assign_type_options)
# partitions
self.builder.get_object("button_expert").connect("clicked", self.show_customwarning)
self.builder.get_object("button_edit").connect("clicked", partitioning.manually_edit_partitions)
self.builder.get_object("button_refresh").connect("clicked", lambda _: partitioning.build_partitions(self))
self.builder.get_object("treeview_disks").get_selection().connect("changed", partitioning.update_html_preview)
self.builder.get_object("treeview_disks").connect("row_activated", partitioning.edit_partition_dialog)
self.builder.get_object("treeview_disks").connect("button-release-event", partitioning.partitions_popup_menu)
text = Gtk.CellRendererText()
for i in (partitioning.IDX_PART_PATH,
partitioning.IDX_PART_TYPE,
partitioning.IDX_PART_DESCRIPTION,
partitioning.IDX_PART_MOUNT_AS,
partitioning.IDX_PART_FORMAT_AS,
partitioning.IDX_PART_SIZE,
partitioning.IDX_PART_FREE_SPACE):
col = Gtk.TreeViewColumn("", text, markup=i) # real title is set in i18n()
self.builder.get_object("treeview_disks").append_column(col)
self.builder.get_object("entry_name").connect("notify::text", self.assign_realname)
self.builder.get_object("entry_username").connect("notify::text", self.assign_username)
self.builder.get_object("entry_hostname").connect("notify::text", self.assign_hostname)
# events for detecting password mismatch..
self.builder.get_object("entry_password").connect("changed", self.assign_password)
self.builder.get_object("entry_confirm").connect("changed", self.assign_password)
self.builder.get_object("radiobutton_passwordlogin").connect("toggled", self.assign_login_options)
self.builder.get_object("checkbutton_encrypt_home").connect("toggled", self.assign_login_options)
# link the checkbutton to the combobox
grub_check = self.builder.get_object("checkbutton_grub")
grub_box = self.builder.get_object("combobox_grub")
grub_check.connect("toggled", self.assign_grub_install, grub_box)
grub_box.connect("changed", self.assign_grub_device)
# install Grub by default
grub_check.set_active(True)
grub_box.set_sensitive(True)
# kb models
cell = Gtk.CellRendererText()
cell.set_property("ellipsize", Pango.EllipsizeMode.MIDDLE)
self.builder.get_object("combobox_kb_model").pack_start(cell, True)
self.builder.get_object("combobox_kb_model").add_attribute(cell, 'text', 0)
self.builder.get_object("combobox_kb_model").connect("changed", self.assign_keyboard_model)
# kb layouts
ren = Gtk.CellRendererText()
self.column10 = Gtk.TreeViewColumn(_("Layout"), ren)
self.column10.add_attribute(ren, "text", 0)
self.builder.get_object("treeview_layouts").append_column(self.column10)
self.builder.get_object("treeview_layouts").connect("cursor-changed", self.assign_keyboard_layout)
ren = Gtk.CellRendererText()
self.column11 = Gtk.TreeViewColumn(_("Variant"), ren)
self.column11.add_attribute(ren, "text", 0)
self.builder.get_object("treeview_variants").append_column(self.column11)
self.builder.get_object("treeview_variants").connect("cursor-changed", self.assign_keyboard_variant)
self.build_kb_lists()
# 'about to install' aka overview
ren = Gtk.CellRendererText()
self.column12 = Gtk.TreeViewColumn("", ren)
self.column12.add_attribute(ren, "markup", 0)
self.builder.get_object("treeview_overview").append_column(self.column12)
# install page
self.builder.get_object("label_install_progress").set_text(_("Calculating file indexes ..."))
# i18n
self.i18n()
# pre-fill user details in debug mode
if __debug__:
self.builder.get_object("entry_name").set_text("John Boone")
self.builder.get_object("entry_username").set_text("john")
self.builder.get_object("entry_hostname").set_text("mars")
self.builder.get_object("entry_password").set_text("dummy_password")
self.builder.get_object("entry_confirm").set_text("dummy_password")
# build partition list
self.should_pulse = False
# 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.