Exemplo n.º 1
0
    def __init__(self, parent, updater):

        QDialog.__init__(self, parent)

        self.updater = updater
        self.prop = MaeMoneyProperties.instance()
        self.setupUi()
Exemplo n.º 2
0
 def __init__(self):
     QObject.__init__(self)
     self.cachedQuotes = {}
     self.prop = MaeMoneyProperties.instance()
     self.baseUrl = "http://%s/finance/info?client=ig&infotype=infoquoteall&q=%s"
     self.networkMgr = QNetworkAccessManager()
     self.connect(self.networkMgr, SIGNAL("finished(QNetworkReply*)"), self.replyFinished)
Exemplo n.º 3
0
 def __init__(self, throttledQuoter):
     QObject.__init__(self)
     self._isRunning = False
     self.throttledQuoter = throttledQuoter
     self.setUpdateInterval(MaeMoneyProperties.instance().getUpdateInterval())
     self.exchangeTickerTuples = []
     self.connect(self.throttledQuoter, SIGNAL("quotesCached"), self.quotesUpdated)
Exemplo n.º 4
0
 def __init__(self, controller):
     QMainWindow.__init__(self)
     self.prop = MaeMoneyProperties.instance()
     self.controller = controller
     self.loginDialog = MMGoogleClientLoginDialog(self)
     self.switchToLandscapeText = self.tr("Switch to Landscape")
     self.switchToPortraitText = self.tr("Switch to Portrait")
     self.setupUi()
Exemplo n.º 5
0
    def __init__(self, parent):

        QDialog.__init__(self, parent)

        self.prop = MaeMoneyProperties.instance()
        self.locales = {}
        self.locales[self.prop.LANGUAGE_ZH_CN] = self.prop.LOCALE_ZH_CN
        self.locales[self.prop.LANGUAGE_ZH_HK] = self.prop.LOCALE_ZH_HK
        self.locales[self.prop.LANGUAGE_EN_US] = self.prop.LOCALE_EN_US

        self.setupUi()
    def __init__(self, parent):

        QDialog.__init__(self, parent)

        self.prop = MaeMoneyProperties.instance()
        self.urls = {}
        self.urls[self.prop.GOOGLE_COUNTRY_HK] = 'www.google.com.hk'
        self.urls[self.prop.GOOGLE_COUNTRY_CN] = 'www.google.com.cn'
        self.urls[self.prop.GOOGLE_COUNTRY_CAN] = 'www.google.ca'
        self.urls[self.prop.GOOGLE_COUNTRY_UK] = 'www.google.co.uk'
        self.urls[self.prop.GOOGLE_COUNTRY_US] = 'www.google.com'

        self.setupUi()
Exemplo n.º 7
0
    def adjustPosition(self, eventPos):
        '''
        @param eventPos - QPoint
        '''
        prop = MaeMoneyProperties.instance()

        newPos = QPoint(eventPos.x(), eventPos.y())
        if prop.isPortraitMode():
            offset = 50
        else:
            offset = 72

        newY = max(0, eventPos.y() - offset)
        newPos.setY(newY)


        return newPos
Exemplo n.º 8
0
    def __init__(self, parent, exchange, ticker, transactionModel):
        QMainWindow.__init__(self, parent)

        self.prop = MaeMoneyProperties.instance()
        self.setupUi(exchange, ticker, transactionModel)
Exemplo n.º 9
0
                  color: #333333; \
                  selection-color: #ffffff; \
                  border: 1px solid #616161; \
                  padding: 8px; \
                } \
                \
                QTableView::item:selected { \
                  color: #ffffff; \
                  background-color: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5,\
                                                    stop: 0   #007000, stop: 0.1 #00bc00, \
                                                    stop: 0.9 #00cf00, stop: 1   #008000); \
                } \
                ")

# Find out the directory of this file, which has the localization files
# (Could have used QCoreApplication.applicationFilePath but it only
# returns the path to the python executable on the N900)
absFilePath = os.path.abspath(__file__)
dir = os.path.dirname(absFilePath)

prop = MaeMoneyProperties.instance()
locale = prop.getAppLocale()
translator = QTranslator()
loaded = translator.load(QString("app-") + locale.name(), dir)
if not loaded:
    qDebug("Cannot load %s locale from %s" %(locale.name(), dir))
qtApp.installTranslator(translator)

app = MaeMoney()
sys.exit(qtApp.exec_())
Exemplo n.º 10
0
 def __init__(self):
     QStyledItemDelegate.__init__(self)
     self.prop = MaeMoneyProperties.instance()
     self.portraitSpecificDelegate = PortraitSpecificDelegate(self)
     self.landscapeSpecificDelegate = LandscapeSpecificDelegate(self)