Beispiel #1
0
    def on_click_vnc_select(self):

        title = _('Select VNC application \'{0}\'.').format(VNC_LAUNCHER)
        defaultextension = '.exe' if OS_WINDOWS else ''

        # Mac OS X does not support filetype filters in file dialogs.
        # Therefore we need to provide an empty list. Otherwise the file dialog is not properly rendered.
        filetypes = []
        if not OS_DARWIN:
            if OS_WINDOWS: filetypes.append((_('executable files'), '.exe'))
            filetypes.append((_('all files'), '.*'))

        vnc = self.settings.get_vnc_application(default=None)
        if vnc is None:
            initialdir = os.path.expanduser('~')
            initialfile = None
        else:
            initialdir = os.path.dirname(vnc)
            initialfile = os.path.basename(vnc)

        path = tkFileDialog.askopenfilename(title=title, defaultextension=defaultextension, filetypes=filetypes,
                                            initialdir=initialdir, initialfile=initialfile)
        if path:
            #print 'selected vnc app: %s' % path
            self.settings.vnc_application.set(path)
Beispiel #2
0
    def initialize(self):
        self.title(_('Extended Settings'))
        self.config(background=COLOR_BG, padx=0, pady=0)

        self.sidebar = open_photoimage(resource_path('resources', 'sidebar_settings.png'), self.winfo_rgb(COLOR_BG))
        Tkinter.Label(self, image=self.sidebar, background=COLOR_BG, padx=0, pady=0, borderwidth=0)\
            .grid(row=0, column=0, rowspan=11, sticky='nw')

        # settings form
        self.form = SettingsDialogForm(self)
        self.form.grid(row=0, column=1, padx=5, pady=5, sticky='nwe')

        # growing separator
        Tkinter.Label(self, font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=1, column=1, sticky='we')

        # buttons
        buttons = Tkinter.Frame(self, background=COLOR_BG)
        Tkinter.Button(buttons, text=_('Submit'), command=self.on_click_submit, background=COLOR_BG, font=FONT_BUTTON)\
            .grid(row=0, column=1, padx=5, pady=5)
        Tkinter.Button(buttons, text=_('Cancel'), command=self.on_click_cancel, background=COLOR_BG, font=FONT_BUTTON)\
            .grid(row=0, column=2, padx=5, pady=5)
        buttons.grid(row=2, column=1, columnspan=2, sticky='e')

        # layout grid
        self.grid_columnconfigure(index=0, weight=0)
        self.grid_columnconfigure(index=1, weight=1)
        self.grid_rowconfigure(index=1, weight=1)

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

        # Fokus auf dem Textfeld anfordern
        self.form.focus_set()
Beispiel #3
0
    def run(self):
        self.error = False

        # start the process
        try:
            self.pid = self.process.start(self.settings)
        except:
            print traceback.format_exc()
            self.app.set_error(_('Can\'t establish the connection.'))
            self.error = True

        # check peridically, if the process is running
        if not self.error:
            time.sleep(5)
        if not self.error and self.pid > 0 and self.check():
            self.running = True
            self.app.set_connected()
            while self.running and self.check():
                time.sleep(.5)
            self.app.set_disconnected()

        # process did not start up
        else:
            self.app.set_error(_('Can\'t establish the connection.'))
            self.error = True

        self.kill()
Beispiel #4
0
    def initialize(self):

        # Feld für Adresse
        Tkinter.Label(self, text=_('Address'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=0, column=0, sticky='e')

        self.address = Tkinter.Entry(self, width=10, textvariable=self.parent.settings.host, font=FONT_BASE, background=COLOR_BG)
        self.address.grid(row=0, column=1, padx=5, sticky='we')
        self.address.focus_set()

        # Feld für Port-Nr
        Tkinter.Label(self, text=_('Port-Nr'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=0, column=2, sticky='e')
        self.port = Tkinter.Entry(self, width=5, textvariable=self.parent.settings.port, font=FONT_BASE, background=COLOR_BG)
        self.port.grid(row=0, column=3, padx=5, sticky='we')

        # SSL-Verschlüsselung aktivieren
        self.ssh = Tkinter.Checkbutton(self, text=_('Enable SSH encryption.'), borderwidth=0, highlightthickness=0, relief=Tkinter.FLAT, font=FONT_SMALL, background=COLOR_BG, variable=self.parent.settings.ssh_enabled, offvalue=False, onvalue=True, anchor='w')
        self.ssh.grid(row=1, column=0, columnspan=2, pady=(5,0), sticky='w')

        # Button für erweiterte Optionen
        self.button = Tkinter.Button(self, text=_('Extended...'), command=self.parent.on_click_settings, background=COLOR_BG, font=FONT_BUTTON, pady=0)
        self.button.grid(row=1, column=2, columnspan=2, padx=(0,5), pady=(5,0), sticky='e')

        self.grid_columnconfigure(index=0, weight=0)
        self.grid_columnconfigure(index=1, weight=1)
        self.grid_columnconfigure(index=2, weight=0)
        self.grid_columnconfigure(index=3, weight=0)
        self.config(background=COLOR_BG, padx=0, pady=0)
Beispiel #5
0
    def initialize(self):
        self.config(background=COLOR_BG)
        row = 0

        # title image
        self.sidebar = open_photoimage(resource_path('resources', 'sidebar.png'), self.winfo_rgb(COLOR_BG))
        Tkinter.Label(self, image=self.sidebar, background=COLOR_BG, padx=0, pady=0, borderwidth=0)\
            .grid(row=row, column=0, rowspan=4, sticky='nw')

        # title text
        Tkinter.Label(self, text='%s v%s' % (TITLE, VERSION), background=COLOR_BG, font=FONT_TITLE, anchor='w', padx=5)\
            .grid(row=row, column=1, pady=(3,0), sticky='nwe')

        # description
        row += 1
        description = _('Use this application in order to allow access on your desktop.')
        self.description = Tkinter.Label(self, text=description, background=COLOR_BG, font=FONT_SMALL, anchor='w', padx=5, justify=Tkinter.LEFT)
        self.description.grid(row=row, column=1, sticky='nwe')
        self.description.bind('<Configure>', self.on_resize_description)

        # form fields
        row += 1
        self.connection = AppFrameForm(self)
        self.connection.address.bind('<Return>', self.on_key_enter)
        self.connection.port.bind('<Return>', self.on_key_enter)
        self.connection.grid(row=row, column=1, sticky='we', pady=10, padx=5)

        # logo image
        row += 1
        logo = resource_path('resources', 'logo.png')
        if os.path.isfile(logo):
            self.logo = open_photoimage(logo, self.winfo_rgb(COLOR_BG))
            Tkinter.Label(self, image=self.logo, background=COLOR_BG, padx=0, pady=0, borderwidth=0)\
                .grid(row=row, column=1, sticky='nw')

        # some space for separation with dynamic height, if no logo is present
        else:
            Tkinter.Label(self, background=COLOR_BG).grid(row=row, column=1)

        # form buttons
        row += 1
        self.buttons = AppFrameButtons(self)
        self.buttons.grid(row=row, column=0, columnspan=2, sticky='we')

        # status bar
        row += 1
        self.status = AppFrameStatus(self)
        self.status.grid(row=row, column=0, columnspan=2, sticky='we')
        self.status.set_message(_('Welcome to remote maintenance.'))

        # layout grid
        self.grid_columnconfigure(index=1, weight=1)
        self.grid_rowconfigure(index=3, weight=1)
Beispiel #6
0
    def on_click_submit(self):

        messages = []
        self.form.validate(messages)
        if len(messages) > 0:
            txt = _('Incorrect settings!')
            txt += '\n- '
            txt += '\n- '.join(messages)
            tkMessageBox.showerror(title=_('Incorrect settings!'), message=txt, parent=self)
            return

        # copy values into application settings
        self.parent.settings.copy_from(self.settings)

        # unregister VNC application, if the default application is enabled
        if self.form.is_custom_vnc_app():
            self.parent.settings.vnc_application.set('')

        self.destroy()
Beispiel #7
0
    def start_thread(self):
        self.stop_thread(False)

        # validate hostname
        host = self.settings.get_host()
        if host is None:
            self.set_error(msg=_('The address in invalid.'))
            return

        # validate port number
        port = self.settings.get_port()
        if port is None:
            self.set_error(msg=_('The port number is invalid.'))
            return
        if port < 0 or port > 65535:
            self.set_error(_('The port number is not in the interval from {0} to {1}.').format(1, 65535))
            return

        #print 'connecting to %s:%s' % (host, port)
        self.set_connecting()
        self.thread = VNC(self, self.settings)
        self.thread.start()
Beispiel #8
0
    def initialize(self):

        self.quit = Tkinter.Button(self, text=_('Quit'), command=self.parent.on_click_quit, background=COLOR_BG, font=FONT_BUTTON)
        self.quit.grid(row=0, column=0, padx=5, pady=5)

        self.about = Tkinter.Button(self, text=_('About'), command=self.parent.on_click_about, background=COLOR_BG, font=FONT_BUTTON)
        self.about.grid(row=0, column=1, padx=5, pady=5)

        Tkinter.Label(self, background=COLOR_BG)\
            .grid(row=0, column=2, sticky='we')

        self.connect = Tkinter.Button(self, text=_('Connect'), command=self.parent.on_click_connect, background=COLOR_BG, font=FONT_BUTTON)
        self.connect.grid(row=0, column=3, padx=5, pady=5)

        self.disconnect = Tkinter.Button(self, text=_('Disconnect'), command=self.parent.on_click_disconnect, background=COLOR_BG, font=FONT_BUTTON)
        self.disconnect.grid(row=0, column=4, padx=5, pady=5)

        self.grid_columnconfigure(index=0, weight=0)
        self.grid_columnconfigure(index=1, weight=0)
        self.grid_columnconfigure(index=2, weight=1)
        self.grid_columnconfigure(index=3, weight=0)
        self.grid_columnconfigure(index=4, weight=0)
        self.config(background=COLOR_BG, padx=0, pady=0)
Beispiel #9
0
    def on_click_ssh_keyfile_select(self):

        title = _('Select SSH private key file.')
        defaultextension = ''

        # Mac OS X does not support filetype filters in file dialogs.
        # Therefore we need to provide an empty list. Otherwise the file dialog is not properly rendered.
        filetypes = []
        if not OS_DARWIN:
            filetypes = [(_('all files'), '.*')]

        vnc = self.settings.get_ssh_keyfile(default=None)
        if vnc is None:
            initialdir = os.path.expanduser('~')
            initialfile = None
        else:
            initialdir = os.path.dirname(vnc)
            initialfile = os.path.basename(vnc)

        path = tkFileDialog.askopenfilename(title=title, defaultextension=defaultextension, filetypes=filetypes,
                                            initialdir=initialdir, initialfile=initialfile)
        if path:
            #print 'selected ssh keyfile: %s' % path
            self.settings.ssh_keyfile.set(path)
Beispiel #10
0
    def validate(self, messages):
        count = len(messages)

        # validate VNC application
        if not self.is_custom_vnc_app():
            vnc = self.settings.get_vnc_application(default=None)
            if vnc is None or vnc == '':
                messages.append(_('No VNC application was specified.'))
            elif not os.path.isfile(vnc):
                messages.append(_('The VNC application does not point to a file.'))

        # validate SSH user
        user = self.settings.get_ssh_user(default=None)
        if user is None:
            messages.append(_('No SSH user name was specified.'))

        # validate SSH keyfile
        if not self.settings.is_ssh_use_provided_key():
            password = self.settings.get_ssh_password()
            keyfile = self.settings.get_ssh_keyfile(default=None)
            if not keyfile is None:
                if not os.path.isfile(keyfile):
                    messages.append(_('The private key file is invalid.'))
                else:
                    try:
                        read_private_key_from_file(keyfile, password=password)
                    except:
                        print traceback.format_exc()
                        messages.append(_('Can\'t open private key with the provided password.'))

        # validate SSH port
        port = self.settings.get_ssh_port(default=None)
        if port is None:
            messages.append(_('The SSH port number is invalid.'))
        elif port < 0 or port > 65535:
            messages.append(_('The SSH port number is not in the interval from {0} to {1}.').format(1, 65535))

        return len(messages) > count
Beispiel #11
0
    def initialize(self):
        from src import DEFAULT_VNC_APPLICATION
        from src import DEFAULT_VNC_APPLICATION_LICENSE
        from src import VERSION_GETTEXT_WINDOWS
        from src import VERSION_NUMPY
        from src import VERSION_PARAMIKO
        from src import VERSION_PILLOW
        from src import VERSION_PSUTIL
        from src import VERSION_PYCRYPTO
        from src import VERSION_PYTHON
        from src import VERSION_TCL
        from src import VERSION_TIGHTVNC
        from src import VERSION_VINESERVER
        from src import VERSION_X11VNC

        authors = get_configuration('about', 'authors', None)
        company_name = get_configuration('about', 'company-name', None)
        company_website = get_configuration('about', 'company-website', None)
        is_forked = True if company_name else False

        self.title(_('About this program'))
        self.config(background=COLOR_BG)

        # HACK: Programm-Icon setzen
        # siehe http://stackoverflow.com/a/11180300
        icon = open_photoimage(resource_path('resources', 'icon.png'))
        self.tk.call('wm', 'iconphoto', self._w, icon)

        self.sidebar = open_photoimage(resource_path('resources', 'sidebar_about.png'), self.winfo_rgb(COLOR_BG))
        Tkinter.Label(self, image=self.sidebar, background=COLOR_BG, padx=0, pady=0, borderwidth=0)\
            .grid(row=0, column=0, sticky='nw')

        vnc_linux = _('{0} for {1}').format('x11vnc %s (GPLv2)' % VERSION_X11VNC, 'Linux')
        vnc_darwin = _('{0} for {1}').format('VineServer / OSXvnc %s (GPLv2)' % VERSION_VINESERVER, 'Mac OS X')
        vnc_windows = _('{0} for {1}').format('TightVNC %s (GPLv2) ' % VERSION_TIGHTVNC, 'Windows')

        text = Tkinter.Text(self, height=20, width=50, background=COLOR_BG, padx=5, highlightthickness=0, relief=Tkinter.FLAT)
        scroll = Tkinter.Scrollbar(self, command=text.yview)
        text.configure(yscrollcommand=scroll.set)
        text.tag_configure('title', font=FONT_TITLE, wrap=Tkinter.WORD)
        text.tag_configure('subtitle', font=FONT_SUBTITLE, wrap=Tkinter.WORD)
        text.tag_configure('default', font=FONT_BASE, wrap=Tkinter.WORD)
        text.tag_configure('small', font=FONT_SMALL, wrap=Tkinter.WORD)
        text.tag_configure('tiny', font=(FONT_FAMILY, 4), wrap=Tkinter.WORD)
        #text.tag_configure('color', foreground='#476042', font=('Tempus Sans ITC', 12, 'bold'))
        #text.tag_bind('follow', '<1>', lambda e, t=text2: t.insert(Tkinter.END, "Not now, maybe later!"))

        text.insert(Tkinter.END, '%s v%s' % (TITLE, VERSION), 'title')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, _('This application provides access to your desktop for our support staff.'), 'default')
        text.insert(Tkinter.END, ' ', 'default')
        text.insert(Tkinter.END, _('We will tell you the required settings in order to build up a connection for remote maintenance.'), 'default')
        if is_forked:
            text.insert(Tkinter.END, '\n\n', 'tiny')
            text.insert(Tkinter.END, _('This software is based on the free and open Remote Support Tool and was modified for {0}.').format(company_name), 'default')
            text.insert(Tkinter.END, ' ', 'default')
            text.insert(Tkinter.END, _('Please contact {0} for any questions or problems.').format(company_name), 'default')
        text.insert(Tkinter.END, '\n\n\n', 'tiny')

        text.insert(Tkinter.END,_('Authors'), 'subtitle')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, '• Andreas Rudolph & Walter Wagner (OpenIndex.de)', 'default')
        if authors:
            text.insert(Tkinter.END, '\n• %s' % authors, 'default')
        text.insert(Tkinter.END, '\n\n\n', 'tiny')

        text.insert(Tkinter.END, _('Translators'), 'subtitle')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, _('There are currently no translations available besides the default languages (English and German).'), 'default')
        text.insert(Tkinter.END, '\n\n\n', 'tiny')

        text.insert(Tkinter.END, _('Internal components'), 'subtitle')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, _('The following third party components were integrated:'), 'default')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, '• Python %s (PSFL)\n' % VERSION_PYTHON, 'default')
        text.insert(Tkinter.END, '• Tcl/Tk %s (BSD)\n' % VERSION_TCL, 'default')
        text.insert(Tkinter.END, '• PyCrypto %s (Public Domain)\n' % VERSION_PYCRYPTO, 'default')
        text.insert(Tkinter.END, '• Paramiko %s (LGPL)\n' % VERSION_PARAMIKO, 'default')
        text.insert(Tkinter.END, '• Pillow %s (PIL)\n' % VERSION_PILLOW, 'default')
        text.insert(Tkinter.END, '• psutil %s (BSD)\n' % VERSION_PSUTIL, 'default')
        if not VERSION_NUMPY is None:
            text.insert(Tkinter.END, '• NumPy %s (BSD)\n' % VERSION_NUMPY, 'default')
        text.insert(Tkinter.END, '• gettext-py-windows %s (MIT)\n' % VERSION_GETTEXT_WINDOWS, 'default')
        text.insert(Tkinter.END, '• Crystal Clear Icons (LGPL)\n', 'default')
        text.insert(Tkinter.END, '\n\n', 'tiny')

        if DEFAULT_VNC_APPLICATION:
            vnc_app = '%s (%s)' % (VNC_NAME, DEFAULT_VNC_APPLICATION_LICENSE)
            text.insert(Tkinter.END, _('Embedded VNC application'), 'subtitle')
            text.insert(Tkinter.END, '\n\n', 'tiny')
            text.insert(Tkinter.END, _('The software {0} was embedded into this application in order to access your {1} system via VNC.').format(vnc_app, OS_NAME), 'default')
            text.insert(Tkinter.END, '\n\n', 'tiny')

        text.insert(Tkinter.END, _('Created with'), 'subtitle')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, _('The application was created with:'), 'default')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        text.insert(Tkinter.END, '• PyCharm Community Edition\n', 'default')
        text.insert(Tkinter.END, '• PyInstaller\n', 'default')
        text.insert(Tkinter.END, '\n\n', 'tiny')

        text.insert(Tkinter.END, _('License'), 'subtitle')
        text.insert(Tkinter.END, '\n\n', 'tiny')
        with open(resource_path('resources', 'LICENSE.txt'), 'r') as myfile:
            txt = myfile.read()\
                .replace('\n\n', '$$')\
                .replace('\n', '')\
                .replace('$$', '\n\n')
            text.insert(Tkinter.END, txt, 'default')
        text.insert(Tkinter.END, '\n', 'small')

        #text.insert(Tkinter.END, 'follow-up\n', 'follow')
        #text.pack(side=Tkinter.LEFT, expand=True)

        text.grid(row=0, column=1, rowspan=4, pady=(3,0), sticky='nwes')
        text.config(state=Tkinter.DISABLED)
        scroll.grid(row=0, column=2, rowspan=4, sticky='nes')

        button_row = 0

        if company_name and company_website:
            button_row += 1
            Tkinter.Button(self, text=company_name, command=self.on_click_company, background=COLOR_BG, font=FONT_BUTTON)\
                .grid(row=button_row, column=0, padx=6, pady=3, sticky='ews')

        button_row += 1
        Tkinter.Button(self, text=_('Project at GitHub'), command=self.on_click_github, background=COLOR_BG, font=FONT_BUTTON)\
            .grid(row=button_row, column=0, padx=6, pady=3, sticky='ews')

        button_row += 1
        Tkinter.Button(self, text=_('Close'), command=self.on_click_close, background=COLOR_BG, font=FONT_BUTTON)\
            .grid(row=button_row, column=0, padx=6, pady=3, sticky='ews')

        self.grid_columnconfigure(index=0, weight=0)
        self.grid_columnconfigure(index=1, weight=1)
        self.grid_columnconfigure(index=2, weight=0)
        self.grid_rowconfigure(index=0, weight=1)
        self.grid_rowconfigure(index=1, weight=0)
        self.grid_rowconfigure(index=2, weight=0)
        self.grid_rowconfigure(index=3, weight=0)

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

        # Fokus auf dem Textfeld anfordern
        text.focus_set()
Beispiel #12
0
    def initialize(self):
        self.config(background=COLOR_BG)
        row = -1

        # VNC settings title
        row += 1
        Tkinter.Label(self, text=_('Settings for VNC') + ' (%s)' % VNC_NAME, font=FONT_TITLE, background=COLOR_BG)\
            .grid(row=row, column=0, columnspan=3, sticky='w')

        # VNC application
        row += 1
        Tkinter.Label(self, text=_('Application file').format(VNC_LAUNCHER), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=row, column=0, padx=5, sticky='e')
        self.vnc_app = Tkinter.Entry(self, width=10, textvariable=self.settings.vnc_application, font=FONT_BASE, background=COLOR_BG)
        self.vnc_app.grid(row=row, column=1, sticky='we')
        self.vnc_button = Tkinter.Button(self, text=_('Select'), command=self.on_click_vnc_select, background=COLOR_BG, font=FONT_BUTTON, pady=0)
        self.vnc_button.grid(row=row, column=2, sticky='nwes')
        row += 1
        Tkinter.Checkbutton(self, text=_('Use provided program.'), borderwidth=0, highlightthickness=0, relief=Tkinter.FLAT, font=FONT_SMALL, background=COLOR_BG, variable=self.custom_vnc_app, offvalue=False, onvalue=True, command=self.update_form)\
            .grid(row=row, column=1, columnspan=2, sticky='w')

        # VNC options (x11vnc only)
        if not OS_WINDOWS:
            row += 1
            Tkinter.Label(self, text=_('Parameters'), font=FONT_SMALL, background=COLOR_BG)\
                .grid(row=row, column=0, padx=5, pady=1, sticky='e')
            Tkinter.Entry(self, width=10, textvariable=self.settings.vnc_parameters, font=FONT_BASE, background=COLOR_BG)\
                .grid(row=row, column=1, columnspan=2, pady=1, sticky='we')

        # SSH settings title
        row += 1
        Tkinter.Label(self, text=_('Settings for SSH'), font=FONT_TITLE, background=COLOR_BG)\
            .grid(row=row, column=0, columnspan=3, pady=(3,0), sticky='w')

        # SSH port
        row += 1
        Tkinter.Label(self, text=_('SSH Port-Nr'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=row, column=0, padx=5, pady=1, sticky='e')
        Tkinter.Entry(self, width=10, textvariable=self.settings.ssh_port, font=FONT_BASE, background=COLOR_BG)\
            .grid(row=row, column=1, columnspan=2, sticky='we')

        # SSH user
        row += 1
        Tkinter.Label(self, text=_('User'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=row, column=0, padx=5, pady=1, sticky='e')
        Tkinter.Entry(self, width=10, textvariable=self.settings.ssh_user, font=FONT_BASE, background=COLOR_BG)\
            .grid(row=row, column=1, columnspan=2, pady=1, sticky='we')

        # SSH password
        row += 1
        Tkinter.Label(self, text=_('Password'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=row, column=0, padx=5, pady=1, sticky='e')
        Tkinter.Entry(self, width=10, textvariable=self.settings.ssh_password, font=FONT_BASE, background=COLOR_BG)\
            .grid(row=row, column=1, columnspan=2, pady=1, sticky='we')

        # SSH keyfile
        row += 1
        Tkinter.Label(self, text=_('Private Key'), font=FONT_SMALL, background=COLOR_BG)\
            .grid(row=row, column=0, padx=5, pady=1, sticky='e')
        self.ssh_key = Tkinter.Entry(self, width=10, textvariable=self.settings.ssh_keyfile, font=FONT_BASE, background=COLOR_BG)
        self.ssh_key.grid(row=row, column=1, pady=1, sticky='we')
        self.ssh_key_button = Tkinter.Button(self, text=_('Select'), command=self.on_click_ssh_keyfile_select, background=COLOR_BG, font=FONT_BUTTON, pady=0)
        self.ssh_key_button.grid(row=row, pady=1, column=2, sticky='e')

        # SSH preconfigured key
        if not PROVIDED_SSH_KEY is None:
            row += 1
            Tkinter.Checkbutton(self, text=_('Use provided private key.'), borderwidth=0, highlightthickness=0, relief=Tkinter.FLAT, font=FONT_SMALL, background=COLOR_BG, variable=self.settings.ssh_use_provided_key, offvalue=False, onvalue=True, command=self.update_form)\
                .grid(row=row, column=1, columnspan=2, sticky='w')

        # layout grid
        self.grid_columnconfigure(index=0, weight=0)
        self.grid_columnconfigure(index=1, weight=1)
        self.grid_columnconfigure(index=2, weight=0)
Beispiel #13
0
 def set_disconnected(self, show_message=True):
     self.connection.set_enabled()
     self.buttons.set_disconnected()
     self.status.set_disconnected()
     if show_message: self.status.set_message(_('The connection was closed.'))
Beispiel #14
0
 def set_connecting(self):
     self.connection.set_disabled()
     self.buttons.set_connecting()
     self.status.set_connecting()
     self.status.set_message(_('Establishing a connection...'))
Beispiel #15
0
 def set_connected(self):
     self.connection.set_disabled()
     self.buttons.set_connected()
     self.status.set_connected()
     self.status.set_message(_('Connection is established.'))
Beispiel #16
0
    try:
        # Redirect stdin & stderr into a log file,
        # if the program was started via executable binary.
        stdout = None
        logfile = get_log_file()
        if not logfile is None:
            stdout = open(logfile, 'w', 0)
            sys.stdout = stdout
            sys.stderr = sys.stdout

        #print 'default vnc application: %s' % DEFAULT_VNC_APPLICATION
        if DEFAULT_VNC_APPLICATION is None:
            top = Tkinter.Tk()
            top.option_add('*Dialog.msg.font', FONT_DIALOG)
            top.iconify()
            msg = _('Unfortunately your operating system ({0}) is not supported.').format(sys.platform)
            #print msg
            tkMessageBox.showerror(title=_('Error on startup!'), message=msg)
            sys.exit(1)

        socket.setdefaulttimeout(TIMEOUT)

        #import pprint
        #pp = pprint.PrettyPrinter(indent=4)
        #print ''
        #print '-'*80
        #print ' env'
        #print '-'*80
        #pp.pprint(os.environ.data)
        #print ''
        #print '-'*80