Exemplo n.º 1
0
    def __init__(self):
        QtGui.QWidget.__init__(self)
        Ui_PreferencesGeneral.setupUi(self, self)

        self.langs = globals.GApp.translator.getAvailables()
        for lang in self.langs:
            lang_code = lang[0]
            lang_name = lang[1]
            lang_displayText = u"%s (%s)" % (lang_name, lang_code)
            self.langsBox.addItem(lang_displayText)
        
        self.connect(self.pushButton_ClearConfiguration, QtCore.SIGNAL('clicked()'), self.__clearConfiguration)
        self.connect(self.ProjectPath_browser, QtCore.SIGNAL('clicked()'), self.__setProjectPath)
        self.connect(self.IOSPath_browser, QtCore.SIGNAL('clicked()'), self.__setIOSPath)
        self.connect(self.pushButtonUseTerminalCommand, QtCore.SIGNAL('clicked()'), self.__setTerminalCmd)
        self.loadConf()

        terminal_cmds = {'Putty (Windows 64 bits)': 'C:\Program Files (x86)\Putty\putty.exe -telnet %h %p',
                         'Putty (Windows 32 bits)': 'C:\Program Files\Putty\putty.exe -telnet %h %p',
                         'Putty (Windows, included with GNS3)': 'putty.exe -telnet %h %p',
                         'SecureCRT (Windows 32 bits)': 'start C:\progra~1\vandyk~1\SecureCRT\SecureCRT.EXE /script C:\progra~1\gns3\securecrt.vbs /arg %d /T /telnet %h %p',
                         'SecureCRT (Windows 64 bits)': 'start C:\progra~2\vandyk~1\SecureCRT\SecureCRT.EXE /script C:\progra~2\gns3\securecrt.vbs /arg %d /T /telnet %h %p',
                         'TeraTerm (Windows)': 'C:\TTERMPRO\\ttermpro.exe %h:%p',
                         'Telnet (Windows)': 'start telnet %h %p',
                         'xterm (Linux)': 'xterm -T %d -e \'telnet %h %p\' >/dev/null 2>&1 &',
                         'Gnome Terminal (Linux)': 'gnome-terminal -t %d -e \'telnet %h %p\' >/dev/null 2>&1 &',
                         'Konsole (Linux KDE)': '/usr/bin/konsole --new-tab -p tabtitle=%d -e telnet %h %p >/dev/null 2>&1 &',
                         'Terminal (Mac OS X)': "/usr/bin/osascript -e 'tell application \"terminal\" to do script with command \"telnet %h %p ; exit\"'",
                         'iTerm (Mac OS X)': "/usr/bin/osascript -e 'tell app \"iTerm\"' -e 'activate' -e 'set myterm to the first terminal' -e 'tell myterm' -e 'set mysession to (make new session at the end of sessions)' -e 'tell mysession' -e 'exec command \"telnet %h %p\"' -e 'set name to \"%d\"' -e 'end tell' -e 'end tell' -e 'end tell'"
                         }
        
        for (name, cmd) in terminal_cmds.iteritems():
            self.comboBoxPreconfigTerminalCommands.addItem(name, cmd)
    def __init__(self):
        QtGui.QWidget.__init__(self)
        Ui_PreferencesGeneral.setupUi(self, self)

        self.langs = globals.GApp.translator.getAvailables()
        for lang in self.langs:
            lang_code = lang[0]
            lang_name = lang[1]
            lang_displayText = u"%s (%s)" % (lang_name, lang_code)
            self.langsBox.addItem(lang_displayText)

        if platform.system() == 'Darwin':
            self.checkBoxBringConsoleToFront.setVisible(False)

        self.connect(self.pushButton_ClearConfiguration,
                     QtCore.SIGNAL('clicked()'), self.__clearConfiguration)
        self.connect(self.pushButton_ExportConfiguration,
                     QtCore.SIGNAL('clicked()'), self.__exportConfiguration)
        self.connect(self.pushButton_ImportConfiguration,
                     QtCore.SIGNAL('clicked()'), self.__importConfiguration)
        self.connect(self.ProjectPath_browser, QtCore.SIGNAL('clicked()'),
                     self.__setProjectPath)
        self.connect(self.IOSPath_browser, QtCore.SIGNAL('clicked()'),
                     self.__setIOSPath)
        self.connect(self.pushButtonUseTerminalCommand,
                     QtCore.SIGNAL('clicked()'), self.__setTerminalCmd)

        for (name, cmd) in sorted(TERMINAL_PRESET_CMDS.iteritems()):
            self.comboBoxPreconfigTerminalCommands.addItem(name, cmd)

        self.loadConf()
    def __init__(self):
        QtGui.QWidget.__init__(self)
        Ui_PreferencesGeneral.setupUi(self, self)

        self.langs = globals.GApp.translator.getAvailables()
        for lang in self.langs:
            lang_code = lang[0]
            lang_name = lang[1]
            lang_displayText = u"%s (%s)" % (lang_name, lang_code)
            self.langsBox.addItem(lang_displayText)

        if platform.system() == "Darwin":
            self.checkBoxBringConsoleToFront.setVisible(False)

        self.connect(self.pushButton_ClearConfiguration, QtCore.SIGNAL("clicked()"), self.__clearConfiguration)
        self.connect(self.pushButton_ExportConfiguration, QtCore.SIGNAL("clicked()"), self.__exportConfiguration)
        self.connect(self.pushButton_ImportConfiguration, QtCore.SIGNAL("clicked()"), self.__importConfiguration)
        self.connect(self.ProjectPath_browser, QtCore.SIGNAL("clicked()"), self.__setProjectPath)
        self.connect(self.IOSPath_browser, QtCore.SIGNAL("clicked()"), self.__setIOSPath)
        self.connect(self.pushButtonUseTerminalCommand, QtCore.SIGNAL("clicked()"), self.__setTerminalCmd)

        for (name, cmd) in sorted(TERMINAL_PRESET_CMDS.iteritems()):
            self.comboBoxPreconfigTerminalCommands.addItem(name, cmd)

        self.loadConf()