Example #1
0
	def get_actions(self):
		if launch.application_is_running(self.get_id()):
			yield Launch(_("Go To"), is_running=True)
			yield CloseAll()
		else:
			yield Launch()
		yield LaunchAgain()
Example #2
0
 def get_actions(self):
     id_ = self.get_id()
     if id_ == DESKTOP_ID:
         return
     if launch.application_is_running(id_):
         yield Launch(_("Go To"), is_running=True)
         yield CloseAll()
     else:
         yield Launch()
     yield LaunchAgain()
Example #3
0
 def activate(self, leaf):
     closer = CloseAll()
     if closer.valid_for_item(leaf): closer.activate(leaf)
     if (not launch.application_is_running(leaf.get_id())):
         pretty.print_debug(__name__, 'App stoped')
         launcher = Launch()
         if launcher.valid_for_item(leaf): launcher.activate(leaf, self.wants_context())
     else:
         pretty.print_debug(__name__, 'App not ended yet')
         interval = utils.parse_time_interval("%ss" % (__kupfer_settings__["app_ended_interval"]))
         self.retry+=1
         if self.try_again(self.retry):
             pretty.print_debug(__name__, 'App not ended yet - retry')
             from kupfer import scheduler
             timer = scheduler.Timer(True)
             timer.set(interval, RestartApp, leaf, self.retry)
         else:
             pretty.print_debug(__name__, 'App will not end - abort')
Example #4
0
	def valid_for_item(self, leaf):
		return launch.application_is_running(leaf.get_id())
Example #5
0
 def valid_for_item(self, item):
     return super(Show, self).valid_for_item(item) \
            and not launch.application_is_running('hotot')