def OnValid(self,event):
        if self.Validate() and self.TransferDataFromWindow():
            # get fields
            self.m_isin = self.editISIN.GetValue()
            self.m_name = self.editName.GetValue()
            self.m_ticker = self.editTicker.GetValue()
            self.m_market = self.editMarket.GetValue()
            self.m_country = self.dispCountry.GetValue()
            self.m_currency = self.editCurrency.GetValue()
            self.m_place = self.editPlace.GetValue()

            # check isin ?
            if self.qmode == QLIST_ADD:
                # check validity
                if self.m_isin!='':
                    if not checkISIN(self.m_isin):
                        #__xdlg = wx.MessageDialog(self, message('invalid_isin') % self.m_isin, self.tt, wx.OK | wx.ICON_ERROR)
                        #__xidRet = dlg.ShowModal()
                        #__xdlg.Destroy()
                        iTradeError(self, message('invalid_isin') % self.m_isin, self.tt)
                        self.editISIN.SetFocus()
                        return

                # check uniqueness
                ref = quote_reference(self.m_isin,self.m_ticker,self.m_market,self.m_place)
                if quotes.lookupKey(ref):
                    #__xdlg = wx.MessageDialog(self, message('listquote_duplicate_ref') % ref, self.tt, wx.OK | wx.ICON_ERROR)
                    #__xidRet = dlg.ShowModal()
                    #__xdlg.Destroy()
                    iTradeError(self, message('listquote_duplicate_ref') % ref, self.tt)
                    return

            # isin,name,ticker,market,currency,place,country
            self.aRet = (self.m_isin,self.m_name,self.m_ticker,self.m_market,self.m_currency,self.m_place,self.m_country)
            self.EndModal(wx.ID_OK)
Beispiel #2
0
    def OnValid(self, event):
        self.m_filename = self.wxFilenameCtrl.GetValue().lower().strip()
        self.m_vat = (self.wxVATCtrl.GetValue() / 100) + 1
        self.m_term = self.wxTermCtrl.GetValue()
        self.m_risk = self.wxRiskCtrl.GetValue()

        if (self.m_operation == 'create' or self.m_operation
                == 'rename') and portfolios.existPortfolio(self.m_filename):
            self.wxFilenameCtrl.SetValue('')
            self.wxFilenameCtrl.SetFocus()
            iTradeError(self,
                        message('portfolio_exist_info') % self.m_filename,
                        message('portfolio_exist_info_title'))
            return

        self.m_name = self.wxNameCtrl.GetValue().strip()
        self.m_accountref = self.wxAccountRefCtrl.GetValue().strip()
        if self.m_operation == 'delete':
            idRet = iTradeYesNo(
                self,
                message('portfolio_delete_confirm') % self.m_name,
                message('portfolio_delete_confirm_title'))
            if idRet == wx.ID_NO:
                return
        if self.m_operation == 'rename':
            idRet = iTradeYesNo(
                self,
                message('portfolio_rename_confirm') % self.m_filename,
                message('portfolio_rename_confirm_title'))
            if idRet == wx.ID_NO:
                return
        self.EndModal(wx.ID_OK)
 def OnTest(self,event):
     u = self.wxUsernameCtrl.GetValue().strip()
     p = self.wxPasswordCtrl.GetValue().strip()
     ret = self.m_connector.login(u,p)
     self.m_connector.logout()
     if ret:
         #__xdlg = wx.MessageDialog(self, message('login_test_ok'), message('login_testdesc') + ' - ' + self.m_connector.name(), wx.OK | wx.ICON_INFORMATION)
         iTradeInformation(self, message('login_test_ok'), message('login_testdesc') + ' - ' + self.m_connector.name())
     else:
         #__xdlg = wx.MessageDialog(self, message('login_test_nok'), message('login_testdesc') + ' - ' + self.m_connector.name(), wx.OK | wx.ICON_INFORMATION)
         iTradeError(self, message('login_test_nok'), message('login_testdesc') + ' - ' + self.m_connector.name())
Beispiel #4
0
 def OnTest(self, event):
     u = self.wxUsernameCtrl.GetValue().strip()
     p = self.wxPasswordCtrl.GetValue().strip()
     ret = self.m_connector.login(u, p)
     self.m_connector.logout()
     if ret:
         #__xdlg = wx.MessageDialog(self, message('login_test_ok'), message('login_testdesc') + ' - ' + self.m_connector.name(), wx.OK | wx.ICON_INFORMATION)
         iTradeInformation(
             self, message('login_test_ok'),
             message('login_testdesc') + ' - ' + self.m_connector.name())
     else:
         #__xdlg = wx.MessageDialog(self, message('login_test_nok'), message('login_testdesc') + ' - ' + self.m_connector.name(), wx.OK | wx.ICON_INFORMATION)
         iTradeError(
             self, message('login_test_nok'),
             message('login_testdesc') + ' - ' + self.m_connector.name())
    def OnCheckSoftware(self,e):
        # can be long ...
        wx.SetCursor(wx.HOURGLASS_CURSOR)

        url = itrade_config.checkNewRelease()

        # restore
        wx.SetCursor(wx.STANDARD_CURSOR)

        if url=='ok':
            iTradeInformation(self,message('checksoftware_uptodate'),message('checksoftware_title'))
        elif url=='dev':
            iTradeInformation(self,message('checksoftware_development'),message('checksoftware_title'))
        elif url=='err':
            iTradeError(self,message('checksoftware_error'),message('checksoftware_title'))
        else:
            if iTradeYesNo(self,message('checksoftware_needupdate'),message('checksoftware_title'))==wx.ID_YES:
                iTradeLaunchBrowser(url,new=True)
    def OnValid(self, event):
        if self.Validate() and self.TransferDataFromWindow():
            # get fields
            self.m_isin = self.editISIN.GetLabel()
            self.m_name = self.editName.GetLabel()
            self.m_ticker = self.editTicker.GetLabel()
            self.m_market = self.editMarket.GetLabel()
            self.m_country = self.dispCountry.GetLabel()
            self.m_currency = self.editCurrency.GetLabel()
            self.m_place = self.editPlace.GetLabel()

            # check isin ?
            if self.qmode == QLIST_ADD:
                # check validity
                if self.m_isin != '':
                    if not checkISIN(self.m_isin):
                        #__xdlg = wx.MessageDialog(self, message('invalid_isin') % self.m_isin, self.tt, wx.OK | wx.ICON_ERROR)
                        #__xidRet = dlg.ShowModal()
                        #__xdlg.Destroy()
                        iTradeError(self,
                                    message('invalid_isin') % self.m_isin,
                                    self.tt)
                        self.editISIN.SetFocus()
                        return

                # check uniqueness
                ref = quote_reference(self.m_isin, self.m_ticker,
                                      self.m_market, self.m_place)
                if quotes.lookupKey(ref):
                    #__xdlg = wx.MessageDialog(self, message('listquote_duplicate_ref') % ref, self.tt, wx.OK | wx.ICON_ERROR)
                    #__xidRet = dlg.ShowModal()
                    #__xdlg.Destroy()
                    iTradeError(self,
                                message('listquote_duplicate_ref') % ref,
                                self.tt)
                    return

            # isin,name,ticker,market,currency,place,country
            self.aRet = (self.m_isin, self.m_name, self.m_ticker,
                         self.m_market, self.m_currency, self.m_place,
                         self.m_country)
            self.EndModal(wx.ID_OK)
    def OnValid(self,event):
        self.m_filename = self.wxFilenameCtrl.GetValue().lower().strip()
        self.m_vat = (self.wxVATCtrl.GetValue()/100) + 1
        self.m_term = self.wxTermCtrl.GetValue()
        self.m_risk = self.wxRiskCtrl.GetValue()

        if (self.m_operation=='create' or self.m_operation=='rename') and portfolios.existPortfolio(self.m_filename):
            self.wxFilenameCtrl.SetValue('')
            self.wxFilenameCtrl.SetFocus()
            iTradeError(self, message('portfolio_exist_info') % self.m_filename, message('portfolio_exist_info_title'))
            return

        self.m_name = self.wxNameCtrl.GetValue().strip()
        self.m_accountref = self.wxAccountRefCtrl.GetValue().strip()
        if self.m_operation=='delete':
            idRet = iTradeYesNo(self, message('portfolio_delete_confirm')%self.m_name, message('portfolio_delete_confirm_title'))
            if idRet == wx.ID_NO:
                return
        if self.m_operation=='rename':
            idRet = iTradeYesNo(self, message('portfolio_rename_confirm')%self.m_filename, message('portfolio_rename_confirm_title'))
            if idRet == wx.ID_NO:
                return
        self.EndModal(wx.ID_OK)