Esempio n. 1
0
    def __init__(self, richaction,webview):
        QWidget.__init__(self)
        self.setMouseTracking(True)
        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.richaction = richaction
        self.webview = webview
        self.lastKey = "-1-1"
        
        self.squareSize = 24
        self.basiccolors = {
                    "00":"#000000","10":"#800000","20":"#8b4513","30":"#2f4f4f",
                    "40":"#008080","50":"#000080","60":"#4b0082","70":"#696969",
                    "01":"#b22222","11":"#a52a2a","21":"#daa520","31":"#006400",
                    "41":"#40e0d0","51":"#0000cd","61":"#800080","71":"#808080",
                    "02":"#ff0000","12":"#ff8c00","22":"#ffd700","32":"#008000",
                    "42":"#00ffff","52":"#0000ff","62":"#ee82ee","72":"#a9a9a9",
                    "03":"#ffa07a","13":"#ffa500","23":"#ffff00","33":"#00ff00",
                    "43":"#afeeee","53":"#add8e6","63":"#dda0dd","73":"#d3d3d3",
                    "04":"#fff0f5","14":"#faebd7","24":"#ffffe0","34":"#f0fff0",
                    "44":"#f0ffff","54":"#f0f8ff","64":"#e6e6fa","74":"#ffffff"}

        self.setMinimumHeight(self.squareSize*5)
        self.setMaximumHeight(self.squareSize*5)
        self.setMinimumWidth(self.squareSize*8)
        self.setMaximumWidth(self.squareSize*8)
Esempio n. 2
0
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     self._layout = QHBoxLayout(self)
     self._label = QLabel("Very important option", self)
     self._layout.addWidget(self._label)
     self.edit = QLineEdit(self)
     self._layout.addWidget(self.edit)
Esempio n. 3
0
 def __init__(self, page, parent = None):
     """
     Constructor
     
     @param mainWindow reference to the main window (QMainWindow)
     @param parent parent widget of this dialog (QWidget)
     """
     QWidget.__init__(self, parent)
     self.setupUi(self)
     
     self.__page = page
     
     
     self.wrapCheckBox.setChecked(True)
     self.closeButton.setIcon(QIcon(getPath('iconDir','heditor/close.png')))
     self.findPrevButton.setIcon(QIcon(getPath('iconDir','heditor/pre.png')))
     self.findNextButton.setIcon(QIcon(getPath('iconDir','heditor/next.png')))
     
     self.__defaultBaseColor = \
         self.input.palette().color(QPalette.Base)
     self.__defaultTextColor = \
         self.input.palette().color(QPalette.Text)
     
     self.findHistory = []
     self.havefound = False
     self.__findBackwards = False
     
     self.connect(self.input, SIGNAL("returnPressed()"), 
                  self.__findByReturnPressed)
Esempio n. 4
0
    def __init__(self,dlg):
        """
        Constructor
        """
        QWidget.__init__(self)
        self.setupUi(self)


        #center this window 
        screen = QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
        self.shortcutsList.header().setResizeMode(0,QHeaderView.ResizeToContents)


        self.dlg = dlg
        
        self.shortcutDialog = ShortcutDialog()
        
        self.__setupActions(QApplication.translate("default","Global"),Seeking.new().getActions())
        self.__setupPlugins()
        
        QObject.connect(self.shortcutsList,\
                SIGNAL("itemDoubleClicked (QTreeWidgetItem *,int)"),\
                self.__evt_dbclick)
        QObject.connect(self.shortcutsList, SIGNAL("itemChanged (QTreeWidgetItem *,int)"),self.__has_change)
        QObject.connect(self.searchEdit,SIGNAL("textChanged (const QString&)"),self.__search)
        QObject.connect(self.shortcutDialog,SIGNAL("shortcutChanged"),self.__shortcut)
Esempio n. 5
0
 def __init__(self, parent, prop, value):
     QPropertyWidget.__init__(self, parent)
     self.ui = Ui_PropertyWidget()
     self.ui.setupUi(self)
     self.ui.prop.setTextFormat(QtCore.Qt.RichText)
     self.ui.prop.setText("<b>%s:</b>" % prop)
     self.ui.value.setText(value)
Esempio n. 6
0
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     self._layout = QHBoxLayout(self)
     self._label = QLabel("Very important option", self)
     self._layout.addWidget(self._label)
     self.edit = QLineEdit(self)
     self._layout.addWidget(self.edit)
Esempio n. 7
0
    def __init__(self, actions, parent=None):
        QWidget.__init__(self, parent)
        itab_item.ITabItem.__init__(self)
        self.actions = actions
        self.graphicView = QGraphicsView(self)
        self.scene = QGraphicsScene()
        self.graphicView.setScene(self.scene)
        self.graphicView.setViewportUpdateMode(
            QGraphicsView.BoundingRectViewportUpdate)

        vLayout = QVBoxLayout(self)
        self.setLayout(vLayout)
        vLayout.addWidget(self.graphicView)
        self.scene.setItemIndexMethod(QGraphicsScene.NoIndex)
        self.scene.setSceneRect(-200, -200, 400, 400)
        self.graphicView.setMinimumSize(400, 400)
        actualProject = self.actions.ide.explorer.get_actual_project()
        arrClasses = self.actions._locator.get_classes_from_project(
            actualProject)
        #FIXME:dirty need to fix
        self.mX = -400
        self.mY = -320
        self.hightestY = self.mY
        filesList = []
        for elem in arrClasses:
            #loking for paths
            filesList.append(elem[2])
        for path in set(filesList):
            self.create_class(path)
Esempio n. 8
0
    def __init__(self, dlg):
        """
        Constructor
        """
        QWidget.__init__(self)
        self.setupUi(self)

        #center this window
        screen = QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width() - size.width()) / 2,
                  (screen.height() - size.height()) / 2)
        self.shortcutsList.header().setResizeMode(0,
                                                  QHeaderView.ResizeToContents)

        self.dlg = dlg

        self.shortcutDialog = ShortcutDialog()

        self.__setupActions(QApplication.translate("default", "Global"),
                            Seeking.new().getActions())
        self.__setupPlugins()

        QObject.connect(self.shortcutsList,\
                SIGNAL("itemDoubleClicked (QTreeWidgetItem *,int)"),\
                self.__evt_dbclick)
        QObject.connect(self.shortcutsList,
                        SIGNAL("itemChanged (QTreeWidgetItem *,int)"),
                        self.__has_change)
        QObject.connect(self.searchEdit,
                        SIGNAL("textChanged (const QString&)"), self.__search)
        QObject.connect(self.shortcutDialog, SIGNAL("shortcutChanged"),
                        self.__shortcut)
Esempio n. 9
0
    def __init__(self, parent, available):
        QWidget.__init__(self, parent)
        self._parent = parent
        self._available = available
        vbox = QVBoxLayout(self)
        self._table = ui_tools.CheckableHeaderTable(1, 2)
        self._table.setSelectionMode(QTableWidget.SingleSelection)
        self._table.removeRow(0)
        vbox.addWidget(self._table)
        ui_tools.load_table(
            self._table,
            (translations.TR_PROJECT_NAME, translations.TR_VERSION),
            _format_for_table(available))
        self._table.setColumnWidth(0, 500)
        self._table.setSortingEnabled(True)
        self._table.setAlternatingRowColors(True)
        hbox = QHBoxLayout()
        btnInstall = QPushButton(translations.TR_INSTALL)
        btnInstall.setMaximumWidth(100)
        hbox.addWidget(btnInstall)
        hbox.addWidget(QLabel(translations.TR_NINJA_NEEDS_TO_BE_RESTARTED))
        vbox.addLayout(hbox)

        self.connect(btnInstall, SIGNAL("clicked()"), self._install_plugins)
        self.connect(self._table, SIGNAL("itemSelectionChanged()"),
                     self._show_item_description)
Esempio n. 10
0
    def __init__(self, page, parent=None):
        """
        Constructor
        
        @param mainWindow reference to the main window (QMainWindow)
        @param parent parent widget of this dialog (QWidget)
        """
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self.__page = page

        self.wrapCheckBox.setChecked(True)
        self.closeButton.setIcon(QIcon(getPath('iconDir',
                                               'heditor/close.png')))
        self.findPrevButton.setIcon(
            QIcon(getPath('iconDir', 'heditor/pre.png')))
        self.findNextButton.setIcon(
            QIcon(getPath('iconDir', 'heditor/next.png')))

        self.__defaultBaseColor = \
            self.input.palette().color(QPalette.Base)
        self.__defaultTextColor = \
            self.input.palette().color(QPalette.Text)

        self.findHistory = []
        self.havefound = False
        self.__findBackwards = False

        self.connect(self.input, SIGNAL("returnPressed()"),
                     self.__findByReturnPressed)
Esempio n. 11
0
    def __init__(self, parent, color = None):
        QWidget.__init__(self, parent)

        self.angle = 0
        self.timerId = -1
        self.delay = 80
        self.displayedWhenStopped = False
        self.color = self.palette().color(QPalette.Text) if not color else QColor(color)
Esempio n. 12
0
 def __init__(self):
     QWidget.__init__(self)
     PluginBase.__init__(self)
     
     self.setKeepme("__portscan_scanner__")
     self.setupUi(self)
     
     self.execute("Port Scanner",QIcon(getPath('pluginsDir','webscan/port.png')))
Esempio n. 13
0
 def __init__(self):
     QWidget.__init__(self)
     self.plugin_manager = plugin_manager.PluginManager()
     vbox = QVBoxLayout(self)
     self._tabs = QTabWidget()
     vbox.addWidget(self._tabs)
     #load widgets
     self._load_widgets()
Esempio n. 14
0
    def __init__(self, parent, label, default):
        QValueWidget.__init__(self, parent)
        self.ui = Ui_ValueWidget()
        self.ui.setupUi(self)
        self.ui.label.setText(label)
        self.ui.valueEdit.setText(default)

        self.validator = QtGui.QDoubleValidator(self)
        self.ui.valueEdit.setValidator(self.validator)
Esempio n. 15
0
 def __init__(self, parent, label, default):
     QBoolWidget.__init__(self, parent)
     self.ui = Ui_BoolWidget()
     self.ui.setupUi(self)
     self.ui.checkBox.setText(label)
     if default == "True":
         self.ui.checkBox.setChecked(True)
     else:
         self.ui.checkBox.setChecked(False)
Esempio n. 16
0
    def __init__(self, parent=None):

        QWidget.__init__(self, parent)
        palette = QPalette(self.palette())
        palette.setColor(palette.Background, Qt.transparent)
        self.setPalette(palette)
        self.MINCOUNTER = 10

        self.minloopkeep = False
Esempio n. 17
0
    def __init__(self):
        QWidget.__init__(self)
        PluginBase.__init__(self)

        self.setKeepme("__portscan_scanner__")
        self.setupUi(self)

        self.execute("Port Scanner",
                     QIcon(getPath('pluginsDir', 'webscan/port.png')))
Esempio n. 18
0
    def __init__(self, parent, color=None):
        QWidget.__init__(self, parent)

        self.angle = 0
        self.timerId = -1
        self.delay = 80
        self.displayedWhenStopped = False
        self.color = self.palette().color(
            QPalette.Text) if not color else QColor(color)
Esempio n. 19
0
    def __init__(self, parent = None):

        QWidget.__init__(self, parent)
        palette = QPalette(self.palette())
        palette.setColor(palette.Background, Qt.transparent)
        self.setPalette(palette)
        self.MINCOUNTER = 10

        self.minloopkeep = False
Esempio n. 20
0
    def __init__(self, richaction, webview):
        QWidget.__init__(self)
        self.setMouseTracking(True)
        self.setCursor(QCursor(Qt.PointingHandCursor))
        self.richaction = richaction
        self.webview = webview
        self.lastKey = "-1-1"

        self.squareSize = 24
        self.basiccolors = {
            "00": "#000000",
            "10": "#800000",
            "20": "#8b4513",
            "30": "#2f4f4f",
            "40": "#008080",
            "50": "#000080",
            "60": "#4b0082",
            "70": "#696969",
            "01": "#b22222",
            "11": "#a52a2a",
            "21": "#daa520",
            "31": "#006400",
            "41": "#40e0d0",
            "51": "#0000cd",
            "61": "#800080",
            "71": "#808080",
            "02": "#ff0000",
            "12": "#ff8c00",
            "22": "#ffd700",
            "32": "#008000",
            "42": "#00ffff",
            "52": "#0000ff",
            "62": "#ee82ee",
            "72": "#a9a9a9",
            "03": "#ffa07a",
            "13": "#ffa500",
            "23": "#ffff00",
            "33": "#00ff00",
            "43": "#afeeee",
            "53": "#add8e6",
            "63": "#dda0dd",
            "73": "#d3d3d3",
            "04": "#fff0f5",
            "14": "#faebd7",
            "24": "#ffffe0",
            "34": "#f0fff0",
            "44": "#f0ffff",
            "54": "#f0f8ff",
            "64": "#e6e6fa",
            "74": "#ffffff"
        }

        self.setMinimumHeight(self.squareSize * 5)
        self.setMaximumHeight(self.squareSize * 5)
        self.setMinimumWidth(self.squareSize * 8)
        self.setMaximumWidth(self.squareSize * 8)
Esempio n. 21
0
    def __init__(self, parent, label, keys, default):
        QTableIndexWidget.__init__(self, parent)
        self.ui = Ui_TableIndexWidget()
        self.ui.setupUi(self)
        self.ui.label.setText(label)

        for key, i in zip(keys, range(len(keys))):
            self.ui.comboBox.addItem(key)
            if key == default:
                self.ui.comboBox.setCurrentIndex(i)
Esempio n. 22
0
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        vbox = QVBoxLayout(self)
        self._webInspector = QWebInspector(self)
        vbox.addWidget(self._webInspector)
        self.btnDock = QPushButton(translations.TR_UNDOCK)
        vbox.addWidget(self.btnDock)

        ExplorerContainer.register_tab(translations.TR_TAB_WEB_INSPECTOR, self)
        IDE.register_service('web_inspector', self)
Esempio n. 23
0
 def __init__(self, traceback_msg):
     QWidget.__init__(self)
     vbox = QVBoxLayout(self)
     self._editor = QPlainTextEdit()
     vbox.addWidget(QLabel(translations.TR_TRACEBACK))
     vbox.addWidget(self._editor)
     self._editor.setReadOnly(True)
     self._editor.setLineWrapMode(0)
     self._editor.insertPlainText(traceback_msg)
     self._editor.selectAll()
Esempio n. 24
0
    def __init__(self, parent=None):
        """
        Constructor
        """
        QWidget.__init__(self, parent)
        self.setupUi(self)
        self.th = Thread1()
        self.th.start()

        QtCore.QObject.connect(self.th, QtCore.SIGNAL("pressed()"),
                               self.display)
        self.pushButton.clicked.connect(self.sendMsg)
        self.setBkground()
Esempio n. 25
0
 def __init__(self, richaction):
     QWidget.__init__(self)
     self.setMouseTracking(True)
     self.setCursor(QCursor(Qt.CrossCursor))
     self.richaction = richaction
     
     self.squareSize = 25
     
     self.lastKey = [0,0]
     
     self.setMinimumWidth(250)
     self.setMaximumWidth(250)
     self.setMinimumHeight(200)
     self.setMaximumHeight(200)
Esempio n. 26
0
    def __init__(self, richaction):
        QWidget.__init__(self)
        self.setMouseTracking(True)
        self.setCursor(QCursor(Qt.CrossCursor))
        self.richaction = richaction

        self.squareSize = 25

        self.lastKey = [0, 0]

        self.setMinimumWidth(250)
        self.setMaximumWidth(250)
        self.setMinimumHeight(200)
        self.setMaximumHeight(200)
Esempio n. 27
0
 def __init__(self, parent, schemes):
     QWidget.__init__(self, parent)
     self._parent = parent
     self._schemes = schemes
     vbox = QVBoxLayout(self)
     self._table = ui_tools.CheckableHeaderTable(1, 2)
     self._table.removeRow(0)
     vbox.addWidget(self._table)
     ui_tools.load_table(self._table,
                         [self.tr('Name'), self.tr('URL')], self._schemes)
     btnUninstall = QPushButton(self.tr('Download'))
     btnUninstall.setMaximumWidth(100)
     vbox.addWidget(btnUninstall)
     self._table.setColumnWidth(0, 200)
     self._table.setSortingEnabled(True)
     self._table.setAlternatingRowColors(True)
     self.connect(btnUninstall, SIGNAL("clicked()"), self._download_scheme)
Esempio n. 28
0
 def __init__(self,dlg):
     """
     Constructor
     """
     QWidget.__init__(self)
     self.setupUi(self)
     self.dlg = dlg 
     
     self.styleSelector.addItem("System")
     for style_item in QStyleFactory.keys():
         self.styleSelector.addItem(style_item)
     for i in range(self.styleSelector.count()):
         if self.styleSelector.itemText(i)==Prefs.new().getStyle():
             self.styleSelector.setCurrentIndex(i)
             break
     self.quitOnClose.setChecked(Prefs.new().getQuitOnClose())
     
     QObject.connect(self.styleSelector, SIGNAL("currentIndexChanged (const QString&)"),self.__evt_style_change)
     QObject.connect(self.quitOnClose, SIGNAL("stateChanged (int)"),self.__evt_change)
Esempio n. 29
0
    def __init__(self, parent=None):
        """
        Constructor
        """
        QWidget.__init__(self, parent)
        self.setupUi(self)

        self.Host = "localhost"
        self.Port = 4959
        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  # 新建socket
        self.s.connect((self.Host, self.Port))

        self.th = Thread2(self.s)
        self.th.start()

        QtCore.QObject.connect(self.th, QtCore.SIGNAL("pressed()"),
                               self.display)
        self.pushButton.clicked.connect(self.sendMsg)
        self.setBkground()
Esempio n. 30
0
    def __init__(self, url, process=None, parent=None):
        QWidget.__init__(self, parent)
        self._process = process
        vbox = QVBoxLayout(self)
        #Web Frame
        self.webFrame = QWebView(self)
        self.webFrame.setAcceptDrops(False)

        self.webFrame.load(QUrl(url))

        vbox.addWidget(self.webFrame)

        if process is not None:
            time.sleep(0.5)
            self.webFrame.load(QUrl(url))

        self.webFrame.page().currentFrame().setScrollBarPolicy(
            Qt.Vertical, Qt.ScrollBarAsNeeded)
        self.webFrame.page().currentFrame().setScrollBarPolicy(
            Qt.Horizontal, Qt.ScrollBarAsNeeded)
Esempio n. 31
0
    def __init__(self,parent=None):
        QWidget.__init__(self,parent)
        
        self.__toolBar = QToolBar(self)
        self.__toolBar.setIconSize(QSize(16,16))
        self.__htmlBrowserView = HtmlBrowserView(self)
        self.__addressinput = QLineEdit(self)
        self.__loadlabel = QLabel(self)

        layout=QVBoxLayout(self)
        layout.setSpacing(0)
        layout.setMargin(0)
        layout.addWidget(self.__toolBar)
        layout.addWidget(self.__htmlBrowserView)
        
        self.__setupToolBarAction()
        
        QObject.connect(self.__addressinput, SIGNAL("returnPressed ()"),self.__evt_load)
        QObject.connect(self.__htmlBrowserView, SIGNAL("loadFinished (bool)"),lambda:self.__loadlabel.setMovie(None))
        QObject.connect(self.__htmlBrowserView, SIGNAL("loadStarted ()"),self.__evt_loadstarted)
Esempio n. 32
0
 def __init__(self):
     QWidget.__init__(self)
     PluginBase.__init__(self)
     
     self.setKeepme("__webadminscan_scanner__")
     self.setupUi(self)
     
     self.execute("Web Admin Scanner",QIcon(getPath('pluginsDir','webscan/admin.png')))
     
     
     self.txts = os.listdir(getPath('pluginsDir','webscan/txt'))
     if len(self.txts) is 0:
         self.emit(SIGNAL("feedback"),0, 0, "You need supply some dictionary")
     else:
         self.emit(SIGNAL("feedback"),0, 0, "I'm ready ! Input a URL to Scan...")
         for txt in self.txts:
             lines = self.readlinenumber(getPath('pluginsDir','webscan/txt')+"/"+txt)
             qcb = QCheckBox(txt+"("+str(lines)+")")
             qcb.setChecked(True)
             qcb.setWindowTitle(txt)
             self.txtLayout.addWidget(qcb)
Esempio n. 33
0
    def __init__(self, dlg):
        """
        Constructor
        """
        QWidget.__init__(self)
        self.setupUi(self)
        self.dlg = dlg

        self.styleSelector.addItem("System")
        for style_item in QStyleFactory.keys():
            self.styleSelector.addItem(style_item)
        for i in range(self.styleSelector.count()):
            if self.styleSelector.itemText(i) == Prefs.new().getStyle():
                self.styleSelector.setCurrentIndex(i)
                break
        self.quitOnClose.setChecked(Prefs.new().getQuitOnClose())

        QObject.connect(self.styleSelector,
                        SIGNAL("currentIndexChanged (const QString&)"),
                        self.__evt_style_change)
        QObject.connect(self.quitOnClose, SIGNAL("stateChanged (int)"),
                        self.__evt_change)
Esempio n. 34
0
    def __init__(self, parent, updates):
        QWidget.__init__(self, parent)
        self._parent = parent
        self._updates = updates
        vbox = QVBoxLayout(self)
        self._table = ui_tools.CheckableHeaderTable(1, 2)
        self._table.removeRow(0)
        self._table.setSelectionMode(QTableWidget.SingleSelection)
        self._table.setColumnWidth(0, 500)
        self._table.setSortingEnabled(True)
        self._table.setAlternatingRowColors(True)
        vbox.addWidget(self._table)
        ui_tools.load_table(
            self._table,
            (translations.TR_PROJECT_NAME, translations.TR_VERSION),
            _format_for_table(updates))
        btnUpdate = QPushButton(translations.TR_UPDATE)
        btnUpdate.setMaximumWidth(100)
        vbox.addWidget(btnUpdate)

        self.connect(btnUpdate, SIGNAL("clicked()"), self._update_plugins)
        self.connect(self._table, SIGNAL("itemSelectionChanged()"),
                     self._show_item_description)
Esempio n. 35
0
    def __init__(self, editor, neditable):
        QWidget.__init__(self, editor)
        self.edit = editor
        self._neditable = neditable
        self.highest_line = 0
        self.foldArea = 15
        self.rightArrowIcon = QPixmap()
        self.downArrowIcon = QPixmap()
        self.pat = re.compile(
            r"(\s)*\"\"\"|(\s)*def |(\s)*class |(\s)*if |(\s)*while |"
            "(\s)*else:|(\s)*elif |(\s)*for |"
            "(\s)*try:|(\s)*except:|(\s)*except |(\s)*#begin-fold:")
        self.patNotPython = re.compile('(\s)*#begin-fold:|(.)*{')
        self.patComment = re.compile(r"(\s)*\"\"\"")
        self._endDocstringBlocks = []
        self.foldedBlocks = []
        self.breakpoints = []
        self.bookmarks = []

        if self._neditable.file_path in settings.BREAKPOINTS:
            self.breakpoints = settings.BREAKPOINTS[self._neditable.file_path]
        if self._neditable.file_path in settings.BOOKMARKS:
            self.bookmarks = settings.BOOKMARKS[self._neditable.file_path]
Esempio n. 36
0
    def __init__(self):
        QWidget.__init__(self)
        PluginBase.__init__(self)

        self.setKeepme("__webadminscan_scanner__")
        self.setupUi(self)

        self.execute("Web Admin Scanner",
                     QIcon(getPath('pluginsDir', 'webscan/admin.png')))

        self.txts = os.listdir(getPath('pluginsDir', 'webscan/txt'))
        if len(self.txts) is 0:
            self.emit(SIGNAL("feedback"), 0, 0,
                      "You need supply some dictionary")
        else:
            self.emit(SIGNAL("feedback"), 0, 0,
                      "I'm ready ! Input a URL to Scan...")
            for txt in self.txts:
                lines = self.readlinenumber(
                    getPath('pluginsDir', 'webscan/txt') + "/" + txt)
                qcb = QCheckBox(txt + "(" + str(lines) + ")")
                qcb.setChecked(True)
                qcb.setWindowTitle(txt)
                self.txtLayout.addWidget(qcb)
Esempio n. 37
0
    def __init__(self):
        QWidget.__init__(self)

        self.shortcuts_text = {
            "Duplicate": translations.TR_DUPLICATE,
            "Remove-line": translations.TR_REMOVE_LINE,
            "Move-up": translations.TR_MOVE_UP,
            "Move-down": translations.TR_MOVE_DOWN,
            "Close-file": translations.TR_CLOSE_CURRENT_TAB,
            "New-file": translations.TR_NEW_TAB,
            "New-project": translations.TR_NEW_PROJECT,
            "Open-file": translations.TR_OPEN,
            "Open-project": translations.TR_OPEN_PROJECT,
            "Save-file": translations.TR_SAVE,
            "Save-project": translations.TR_SAVE_PROJECT_FILE,
            "Print-file": translations.TR_PRINT_FILE,
            "Redo": translations.TR_REDO,
            "Comment": translations.TR_COMMENT,
            "Uncomment": translations.TR_UNCOMMENT,
            "Horizontal-line": translations.TR_INSERT_HORIZONTAL_LINE,
            "Title-comment": translations.TR_INSERT_TITLE_COMMENT,
            "Indent-less": translations.TR_INDENT_LESS,
            "Hide-misc": translations.TR_HIDE_MISC_CONTAINER,
            "Hide-editor": translations.TR_HIDE_EDITOR,
            "Hide-explorer": translations.TR_HIDE_EXPLORER,
            "Run-file": translations.TR_EXECUTE_FILE,
            "Run-project": translations.TR_EXECUTE_PROJECT,
            "Debug": translations.DEBUG,
            "Switch-Focus": translations.TR_SWITCH_KEYBOARD_FOCUS,
            "Stop-execution": translations.TR_STOP,
            "Hide-all": translations.TR_ALL_VISIBILITY,
            "Full-screen": translations.TR_FULLSCREEN_VISIBILITY,
            "Find": translations.TR_FIND,
            "Find-replace": translations.TR_FIND_REPLACE,
            "Find-with-word": translations.TR_FIND_WORD_UNDER_CURSOR,
            "Find-next": translations.TR_FIND_NEXT,
            "Find-previous": translations.TR_FIND_PREVIOUS,
            "Help": translations.TR_SHOW_PYTHON_HELP,
            "Split-vertical": translations.TR_SPLIT_VERTICALLY,
            "Split-horizontal": translations.TR_SPLIT_HORIZONTALLY,
            "Follow-mode": translations.TR_ACTIVATE_FOLLOW_MODE,
            "Reload-file": translations.TR_RELOAD_FILE,
            "Jump": translations.TR_JUMP_TO_LINE,
            "Find-in-files": translations.TR_FIND_IN_FILES,
            "Import": translations.TR_IMPORT_FROM_EVERYWHERE,
            "Go-to-definition": translations.GO_TO_DEFINITION,
            "Complete-Declarations": translations.TR_COMPLETE_DECLARATION,
            "Code-locator": translations.TR_SHOW_CODE_LOCATOR,
            "File-Opener": translations.TR_SHOW_FILE_OPENER,
            "Navigate-back": translations.TR_GO_BACK,
            "Navigate-forward": translations.TR_GO_FORWARD,
            "Open-recent-closed": translations.TR_OPEN_RECENT_CLOSED_FILE,
            "Change-Tab": translations.TR_CHANGE_TO_NEXT_TAB,
            "Change-Tab-Reverse": translations.TR_CHANGE_TO_PREVIOUS_TAB,
            "Move-Tab-to-right": translations.TR_MOVE_TAB_TO_RIGHT,
            "Move-Tab-to-left": translations.TR_MOVE_TAB_TO_LEFT,
            "Show-Code-Nav": translations.TR_ACTIVATE_HISTORY,
            "Show-Bookmarks-Nav": translations.TR_ACTIVATE_BOOKMARKS,
            "Show-Breakpoints-Nav": translations.TR_ACTIVATE_BREAKPOINTS,
            "Show-Paste-History": translations.TR_SHOW_CLIPBOARD_HISTORY,
            "History-Copy": translations.TR_COPY_TO_HISTORY,
            "History-Paste": translations.TR_PASTE_FROM_HISTORY,
            #"change-split-focus":
            #translations.TR_CHANGE_KEYBOARD_FOCUS_BETWEEN_SPLITS,
            "Add-Bookmark-or-Breakpoint": translations.TR_INSERT_BREAKPOINT,
            "move-tab-to-next-split": translations.TR_MOVE_TAB_TO_NEXT_SPLIT,
            "change-tab-visibility": translations.TR_SHOW_TABS_IN_EDITOR,
            "Highlight-Word": translations.TR_HIGHLIGHT_OCCURRENCES,
        }

        self.shortcut_dialog = ShortcutDialog(self)
        #main layout
        main_vbox = QVBoxLayout(self)
        #layout for buttons
        buttons_layout = QVBoxLayout()
        #widgets
        self.result_widget = TreeResult()
        load_defaults_button = QPushButton(translations.TR_LOAD_DEFAULTS)
        #add widgets
        main_vbox.addWidget(self.result_widget)
        buttons_layout.addWidget(load_defaults_button)
        main_vbox.addLayout(buttons_layout)
        main_vbox.addWidget(
            QLabel(translations.TR_SHORCUTS_IN_MENUS_REFRESH_ON_RESTART))
        #load data!
        self.result_widget.setColumnWidth(0, 400)
        self._load_shortcuts()
        #signals
        #open the set shortcut dialog
        self.connect(self.result_widget,
                     SIGNAL("itemDoubleClicked(QTreeWidgetItem*, int)"),
                     self._open_shortcut_dialog)
        #load defaults shortcuts
        self.connect(load_defaults_button, SIGNAL("clicked()"),
                     self._load_defaults_shortcuts)
        #one shortcut has changed
        self.connect(self.shortcut_dialog, SIGNAL('shortcutChanged'),
                     self._shortcut_changed)
Esempio n. 38
0
 def __init__(self, parent, label, default):
     QValueWidget.__init__(self, parent)
     self.ui = Ui_ValueWidget()
     self.ui.setupUi(self)
     self.ui.label.setText(label)
     self.ui.valueEdit.setText(default)