示例#1
0
    def __init__(self):
        self.xml = get_gtk_builder("connect_server")

        self.dialog = self.xml.get_object("dialog")
        self.host = self.xml.get_object("host")
        self.connect_button = self.xml.get_object("connect_button")

        self.xml.connect_signals(self)
示例#2
0
 def __init__(self, main):
     
     xml = get_gtk_builder('login')
     
     self.login = xml.get_object('login')
     
     if osname == "nt": # Change type of login window
         c = self.login.get_children()
         if c:
             w = c[0]
             self.login.remove(w)
             self.login = gtk.Window(gtk.WINDOW_TOPLEVEL)
             self.login.set_decorated(False)
             self.login.set_position(gtk.WIN_POS_CENTER_ALWAYS)
             self.login.add(w)
     
     self.entry = xml.get_object('entry')
     self.image = xml.get_object('image')
     self.label = xml.get_object('label')
     self.title = xml.get_object('title')
     self.okbnt = xml.get_object('okbnt')
     self.againbnt = xml.get_object('againbnt')
     self.warn_msg = xml.get_object('warn_msg')
     self.imagealign = xml.get_object('imagealign')
     self.wm_title = xml.get_object('wm_title')
     self.register_bnt = xml.get_object('register')
     self.xml = xml
     self.err_box = self.xml.get_object("err_box")
     
     self.password = None
     self.username = None
     self.running = True
     self.main = main
     
     #Title
     self.xml.get_object("title_eventbox").set_state(gtk.STATE_SELECTED)
     
     #Clock
     self.clock_label = gtk.Label()
     self.clock_item = gtk.MenuItem()
     self.clock_item.add(self.clock_label)
     self.clock_item.set_right_justified(True)
     self.clock_item.show_all()
     self.xml.get_object("menubar").append(self.clock_item)
     self.clock_item.unset_flags(gtk.SENSITIVE)
     self.clock_update()
     self.xml.connect_signals(self)
示例#3
0
    def __init__(self):
        
        self.logger = logging.getLogger('client.main')
        self.conf_client = get_default_client()
        self.dbus_manager = DbusManager(self)
        self.script_manager = ScriptManager()
        self.proxy_setter = ProxySetter()

        if pynotify and not pynotify.is_initted():
            pynotify.init('telecentros')

        # Get operating system version
        o = get_os()
        if o[0]:
            self.os_name = o[0]
        if o[1]:
            self.os_version = o[1]
        
        self.mac_id = get_route_mac_address()
        self.server = self.conf_client.get_string('server')
        self.port = self.conf_client.get_int('port')
        
        if not self.port:
            self.port = 80
    
        self.json_requester = JSONRequester(self.server, self.port)
        self.json_requester.run()
        self.json_requester.request('POST', {'cmd': 'identify', 'mac': self.mac_id, 'os_name': self.os_name,
                                             'os_version': self.os_version},
                                    self.on_identify_response, None)
        
        #icons
        self.icons = icons.Icons()
        self.logo = self.icons.get_icon(CLIENT_ICON_NAME)
        
        #MainWindow
        self.xml = get_gtk_builder('main')
        self.main_window = self.xml.get_object('window')
        self.time_str = self.xml.get_object('time_str')
        self.elapsed_pb = self.xml.get_object('elapsed_pb')
        self.remaining_pb = self.xml.get_object('remaining_pb')
        self.full_name = self.xml.get_object('full_name')
        self.tray_menu = self.xml.get_object('tray_menu')
        self.show_window_menu = self.xml.get_object('show_window_menu')
        
        self.main_window.set_icon_name('telecentros')
        self.main_window.show()
        
        self.visible = True
        self.show_window_menu.set_active(True)
        
        self.xml.connect_signals(self)
        
        #Tray
        self.tray_icon = gtk.status_icon_new_from_icon_name("telecentros")
        self.tray_icon.set_tooltip(_("TeleCentros"))
        
        self.tray_icon.connect('popup-menu', self.on_tray_popup_menu)
        self.tray_icon.connect('activate', self.on_show_hide)
        
        #Login Window
        self.login_window = login.Login(self)
        self.login_window.run()
示例#4
0
    def __init__(self, server=None):
        self.xml = get_gtk_builder("prefs")
        self.dialog = self.xml.get_object("dialog")

        if server:
            self.xml.get_object("server_entry").set_text(server)