Ejemplo n.º 1
0
 def urlActions(self, symbol):
     settings = Settings()
     settings.beginGroup(settings.keys.urls)
     urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
     settings.endGroup()
     urls = [str(s) for s in defaults.tickerUrls()]
     actions = []
     for url in urls: #urls.toStringList():
         try:
             name, url = str(url).split(':', 1)
             url = Template(url).substitute(symbol=symbol)
         except (KeyError, ValueError, ):
             continue
         action = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
         actions.append(action)
     return actions
Ejemplo n.º 2
0
 def urlActions(self, symbol):
     settings = Settings()
     settings.beginGroup(settings.keys.urls)
     urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
     settings.endGroup()
     urls = [str(s) for s in defaults.tickerUrls()]
     actions = []
     for url in urls:  #urls.toStringList():
         try:
             name, url = str(url).split(':', 1)
             url = Template(url).substitute(symbol=symbol)
         except (
                 KeyError,
                 ValueError,
         ):
             continue
         action = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
         actions.append(action)
     return actions
Ejemplo n.º 3
0
    def urlActions(self, symbol):
        """ Returns a list of actions for the given symbol.

        """
        actions = []
        settings = self.settings
        settings.beginGroup(self.settings.keys.urls)
        urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
        settings.endGroup()
        urls = [str(s) for s in defaults.tickerUrls()]
        for url in urls:
            try:
                name, url = str(url).split(':', 1)
                url = Template(url).substitute(symbol=symbol)
            except (KeyError, ValueError, ):
                continue
            act = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
            request = partial(self.requestUrl, action=act)
            self.connect(act, Signals.triggered, request)
            actions.append(act)
        return actions
Ejemplo n.º 4
0
    def urlActions(self, symbol):
        """ Returns a list of actions for the given symbol.

        """
        actions = []
        settings = self.settings
        settings.beginGroup(self.settings.keys.urls)
        urls = settings.value(settings.keys.tickerurls, defaults.tickerUrls())
        settings.endGroup()
        urls = [str(s) for s in defaults.tickerUrls()]
        for url in urls:
            try:
                name, url = str(url).split(':', 1)
                url = Template(url).substitute(symbol=symbol)
            except (
                    KeyError,
                    ValueError,
            ):
                continue
            act = makeUrlAction(name, url, toolTip='%s %s' % (symbol, name))
            request = partial(self.requestUrl, action=act)
            self.connect(act, Signals.triggered, request)
            actions.append(act)
        return actions
Ejemplo n.º 5
0
    ('confirmCloseWhenConnected', getCheckState, setCheckState, Qt.Checked),
    ('useSystemTrayIcon', getCheckState, setCheckState, Qt.Checked),
    ('externalEditor', getText, setText, ''),
    ('useSystemBrowser', getCheckState, setCheckState, Qt.Unchecked),
]

schema[Settings.keys.appearance] = [
    ('shellFont', getFont, setFont, 'Monospace'),
    ('increaseColor', getColor, colorSetter('increaseColor'),
     QColor(Qt.darkGreen)),
    ('neutralColor', getColor, colorSetter('neutralColor'), QColor(Qt.blue)),
    ('decreaseColor', getColor, colorSetter('decreaseColor'), QColor(Qt.red)),
]

schema[Settings.keys.urls] = [
    ('tickerUrls', getList, setList, defaults.tickerUrls()),
]


def sysPathSelectMethod(target):
    @pyqtSignature('')
    def selector(self):
        dlg = SysPathDialog(self)
        if dlg.exec_() == dlg.Accepted:
            widget = getattr(self, target)
            widget.setText(dlg.selectedEdit.text())

    return selector


def colorValueSelectMethod(target):
Ejemplo n.º 6
0
    ('confirmCloseWhenModified', getCheckState, setCheckState, Qt.Checked),
    ('confirmCloseWhenConnected', getCheckState, setCheckState, Qt.Checked),
    ('useSystemTrayIcon', getCheckState, setCheckState, Qt.Checked),
    ('externalEditor', getText, setText, ''),
    ('useSystemBrowser', getCheckState, setCheckState, Qt.Unchecked),
]

schema[Settings.keys.appearance] = [
    ('shellFont', getFont, setFont, 'Monospace'),
    ('increaseColor', getColor, colorSetter('increaseColor'), QColor(Qt.darkGreen)),
    ('neutralColor', getColor, colorSetter('neutralColor'), QColor(Qt.blue)),
    ('decreaseColor', getColor, colorSetter('decreaseColor'), QColor(Qt.red)),
]

schema[Settings.keys.urls] = [
    ('tickerUrls', getList, setList, defaults.tickerUrls()),
]


def sysPathSelectMethod(target):
    @pyqtSignature('')
    def selector(self):
        dlg = SysPathDialog(self)
        if dlg.exec_() == dlg.Accepted:
            widget = getattr(self, target)
            widget.setText(dlg.selectedEdit.text())
    return selector


def colorValueSelectMethod(target):
    @pyqtSignature('')