示例#1
0
 def __setBottomContent(self):
     bottomContent = self.bottomContentViewModel
     year, collectionName = new_year.getCollectionByIntID(
         self.__collectionID)
     price = getCollectionCost(year, collectionName)
     bottomContent.setValue(str(price))
     self.__updateIsEnough(price)
示例#2
0
 def __updateState(self, model):
     collectionIntID = self.__getCollectionIntID()
     self.__updateCollections(model)
     self.__updateAdditionalData(model, collectionIntID)
     model.setCurrentCollectionName(self.__collectionName)
     model.setYear(self.__yearName)
     cost = getCollectionCost(self.__yearName, self.__collectionName)
     model.setCost(cost or 0)
     if self.__yearName == YEARS_INFO.CURRENT_YEAR_STR:
         model.setCollectionState(CollectionState.CURRENTYEAR)
     elif self.__itemsCache.items.festivity.getMaxLevel(
     ) != MAX_ATMOSPHERE_LVL and cost == 0:
         model.setCollectionState(CollectionState.RECEIVEDEARLIER)
     elif self.__itemsCache.items.festivity.getMaxLevel(
     ) != MAX_ATMOSPHERE_LVL:
         model.setCollectionState(CollectionState.MAXLVLNOTREACHED)
     elif cost == 0:
         model.setCollectionState(CollectionState.RECEIVED)
     elif cost > self.__itemsCache.items.festivity.getShardsCount():
         model.setCollectionState(CollectionState.LACKSHARDS)
     else:
         model.setCollectionState(CollectionState.READYTOGET)
     self.__nyController.markPreviousYearTabVisited(
         self.__yearName, NY_OLD_REWARDS_BY_YEAR_VISITED)
示例#3
0
 def _setPrice(self, template, price=None):
     year, collectionName = getCollectionByIntID(self.__collectionID)
     super(AlbumCollectionDialogBuilder,
           self)._setPrice(template,
                           getCollectionCost(year, collectionName))
示例#4
0
 def __onUpdated(self, keys):
     if SyncDataKeys.TOY_FRAGMENTS in keys:
         year, collectionName = new_year.getCollectionByIntID(
             self.__collectionID)
         self.__updateIsEnough(getCollectionCost(year, collectionName))
         self.__setBalanceContent()
示例#5
0
 def __updateShards(self):
     self.viewModel.setFullCollectionCost(
         getCollectionCost(self._collectionBuilder.YEAR_NAME,
                           self._collectionType))
     self.viewModel.setTotalShardsPrice(
         self._itemsCache.items.festivity.getShardsCount())