예제 #1
0
    def show_extended_settings_dialog(self):
        dlg = SettingsDialog(self)
        #self.eval('tk::PlaceWindow %s center' % dlg.winfo_pathname(dlg.winfo_id()))

        x = self.winfo_rootx()
        y = self.winfo_rooty()
        w = get_configuration_int('gui', 'settings-window-width', 550)
        h = get_configuration_int('gui', 'settings-window-height', 350)
        dlg.geometry('%sx%s+%d+%d' % (w, h, x+25, y+25))

        dlg.grab_set()
        self.wait_window(dlg)
예제 #2
0
    def __init__(self):
        has_configured_ssh_keyfile = not DEFAULT_SSH_KEYFILE is None

        configured_vnc_application = get_configuration('settings', 'vnc-application', default='')
        if configured_vnc_application is None:
            configured_vnc_application = ''
        elif len(configured_vnc_application.strip()) < 1:
            configured_vnc_application = ''

        self.host = Tkinter.StringVar(value=get_configuration('settings', 'host', default=''))
        self.port = Tkinter.IntVar(value=get_configuration_int('settings', 'port', default=5500))
        self.ssh_enabled = Tkinter.BooleanVar(value=get_configuration_boolean('settings', 'ssh-enabled', default=False))
        self.ssh_use_provided_key = Tkinter.BooleanVar(value=not PROVIDED_SSH_KEY is None)
        self.ssh_user = Tkinter.StringVar(value=get_configuration('settings', 'ssh-user', default=''))
        self.ssh_password = Tkinter.StringVar(value=get_configuration('settings', 'ssh-password', default=''))
        self.ssh_keyfile = Tkinter.StringVar(value=DEFAULT_SSH_KEYFILE if has_configured_ssh_keyfile else '')
        self.ssh_port = Tkinter.IntVar(value=get_configuration_int('settings', 'ssh-port', default=22))
        self.vnc_application = Tkinter.StringVar(value=configured_vnc_application)
        self.vnc_parameters = Tkinter.StringVar(value=get_configuration('settings', 'vnc-parameters', default=''))
예제 #3
0
    def initialize(self):

        self.title(TITLE)
        self.config(background=COLOR_BG)

        # HACK: set application icon
        # see http://stackoverflow.com/a/11180300
        icon = open_photoimage(resource_path('resources', 'icon.png'))
        self.tk.call('wm', 'iconphoto', self._w, icon)

        # create application frame
        self.frame = AppFrame(self)
        self.frame.pack(fill=Tkinter.BOTH, expand=1)

        # Specific modifications for Mac OS X systems
        if OS_DARWIN:

            # Add an empty main menu.
            menu = Tkinter.Menu(self)
            try:
                self.config(menu=menu)
            except AttributeError:
                # master is a toplevel window (Python 1.4/Tkinter 1.63)
                self.tk.call(self, 'config', '-menu', menu)

            # Register about dialog.
            self.createcommand('tkAboutDialog', self.show_about_dialog)

        # event on window close
        self.protocol('WM_DELETE_WINDOW', self.shutdown)

        # close window with ESC
        #self.bind('<Escape>', lambda e: self.on_close())

        # set window size
        #self.resizable(False,False)
        #self.resizable(width=False, height=False)
        w = get_configuration_int('gui', 'application-window-width', 500)
        h = get_configuration_int('gui', 'application-window-height', 300)
        self.geometry('%sx%s' % (w, h))