def __init__(self, mem): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem = mem self.append( Activity(self.mem, self.tr("Sedentary"), self.tr("If you get minimal or no exercise"), Decimal(1.2), eActivity.Sedentary)) self.append( Activity( self.mem, self.tr("Lightly active"), self.tr( "If you exercise moderately three to five days a week"), Decimal(1.375), eActivity.LightlyActive)) self.append( Activity( self.mem, self.tr("Moderately active"), self.tr( "If you exercise moderately three to five days a week"), Decimal(1.55), eActivity.ModeratelyActive)) self.append( Activity( self.mem, self.tr("Very active"), self.tr( "If you engage in hard exercise six to seven days a week"), Decimal(1.725), eActivity.VeryActive)) self.append( Activity( self.mem, self.tr("Extra active"), self. tr("If you engage in very hard exercise six to seven days a week or have a physical job" ), Decimal(1.9), eActivity.ExtraActive))
def __init__(self, *args ): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem=args[0] if len(args)==3: self.elaboratedproduct=args[1] self.load_db_data(args[2])
def __init__(self, *args): def load_from_db(sql, progress): self.clean() cur = self.mem.con.cursor() cur.execute(sql) if progress == True: pd = QProgressDialog( self.tr("Loading {0} users from database").format( cur.rowcount), None, 0, cur.rowcount) pd.setWindowIcon(QIcon(":/caloriestracker/coins.png")) pd.setModal(True) pd.setWindowTitle(self.tr("Loading users...")) pd.forceShow() for rowms in cur: if progress == True: pd.setValue(cur.rownumber) pd.update() QApplication.processEvents() self.append(User(self.mem, rowms)) cur.close() # #################################################### QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem = args[0] if len(args) == 3: load_from_db(*args[1:])
def __init__(self, *args ): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem=args[0] if len(args)==2: self.load_db_data(*args[1:]) self.setSelectionMode(ManagerSelectionMode.Object)
def __init__(self, mem): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem = mem self.append( WeightWish(self.mem, self.tr("Lose weight"), eWeightWish.Lose)) self.append( WeightWish(self.mem, self.tr("Mantain weight"), eWeightWish.Mantain)) self.append( WeightWish(self.mem, self.tr("Gain weight"), eWeightWish.Gain))
def __init__(self, mem, elaboratedproduct): ObjectManager_With_IdName_Selectable.__init__(self) QObject.__init__(self) self.mem = mem self.elaboratedproduct = elaboratedproduct
def __init__(self, mem): ObjectManager_With_IdName_Selectable.__init__(self) QObject.__init__(self) self.setConstructorParameters(mem) self.mem = mem
def __init__(self, mem): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem=mem
def __init__(self, *args): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem=args[0] self.product=args[1]
def __init__(self, mem ): ObjectManager_With_IdName_Selectable.__init__(self) QObject.__init__(self) self.mem=mem self.setSelectionMode(ManagerSelectionMode.Object)
def __init__(self, mem): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.setConstructorParameters(mem) self.setSelectionMode(ManagerSelectionMode.List) self.mem = mem
def __init__(self, *args): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.mem = args[0] if len(args) == 3: self.load_from_db(*args[1:])
def __init__(self, *args): QObject.__init__(self) ObjectManager_With_IdName_Selectable.__init__(self) self.args = args #To launch ObjectManagers self.mem = args[0]