welcomewindow.py 1.32 KB
Newer Older
hark's avatar
hark committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'''
Created on 09/06/2015

@author: noid
'''
import tailsgroupinstaller
import os
from gi.repository import Gtk
from tailsgroupinstaller.userwindow import UserWindow
import config


class WelcomeWindow(object):
    '''
    Welcome and requirements
    '''


    def __init__(self, groupinstaller):
        '''
        Constructor
        '''
        self.groupinstaller = groupinstaller
        builder = Gtk.Builder()
        builder.add_from_file(os.path.join(tailsgroupinstaller.GLADE_DIR, "welcome.glade"))
        builder.connect_signals(self)
        self.window = builder.get_object("welcome")
        self.window.move(500,100)
        self.window.resize(500,500)
        self.window.btn_nusers = builder.get_object("btn_nusers")
        self.window.root_password_entry = builder.get_object("root_password_entry")
        
    def delete_event(self, *args):
        Gtk.main_quit(*args)
    
    def btn_start_clicked(self,*args):
        
        config.ROOT_PASSWORD = self.window.root_password_entry.get_text()
        self.groupinstaller.nusers = self.window.btn_nusers.get_value()
        self.groupinstaller.userwindow = UserWindow(self.groupinstaller)
        print "created UserWindow"
        print config.ROOT_PASSWORD
        self.groupinstaller.welcomewindow.window.hide()
        self.groupinstaller.userwindow.window.show()