fix RepeatedController
a snap update was offered the second time even if it had been offered already
This commit is contained in:
parent
2ad6f0b2ee
commit
0090aec3be
|
@ -69,7 +69,10 @@ class BaseController(ABC):
|
|||
|
||||
@property
|
||||
def showing(self):
|
||||
return self.app.controllers.cur is self
|
||||
inst = self.app.controllers.cur
|
||||
while isinstance(inst, RepeatedController):
|
||||
inst = inst.orig
|
||||
return inst is self
|
||||
|
||||
@abstractmethod
|
||||
def start_ui(self):
|
||||
|
|
|
@ -298,7 +298,7 @@ class ControllerSet:
|
|||
log.debug("Importing controller: %s", name)
|
||||
klass = getattr(controllers_mod, name+"Controller")
|
||||
if hasattr(self, name):
|
||||
c = 0
|
||||
c = 1
|
||||
for instance in self.instances:
|
||||
if isinstance(instance, klass):
|
||||
c += 1
|
||||
|
@ -313,10 +313,7 @@ class ControllerSet:
|
|||
def cur(self):
|
||||
if self.out_of_bounds():
|
||||
return None
|
||||
inst = self.instances[self.index]
|
||||
while isinstance(inst, RepeatedController):
|
||||
inst = inst.orig
|
||||
return inst
|
||||
return self.instances[self.index]
|
||||
|
||||
def out_of_bounds(self):
|
||||
return self.index < 0 or self.index >= len(self.instances)
|
||||
|
|
Loading…
Reference in New Issue