Compare commits
No commits in common. "49c7cc9a0517da93c144bf95a76499fccf235faf" and "c16943889618e7f1eee426a42b0ba9a50d55c7f4" have entirely different histories.
49c7cc9a05
...
c169438896
2 changed files with 11 additions and 11 deletions
|
@ -224,7 +224,7 @@ class WallpaperLogic(_ConfigLib):
|
||||||
self._notify_user()
|
self._notify_user()
|
||||||
return has_wallpaper_been_set
|
return has_wallpaper_been_set
|
||||||
|
|
||||||
def schedule_wallpapers(self):
|
def run_wallpapers(self):
|
||||||
def _schedule_background_wallpapers():
|
def _schedule_background_wallpapers():
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
scheduler = BackgroundScheduler()
|
scheduler = BackgroundScheduler()
|
||||||
|
@ -251,9 +251,9 @@ class WallpaperLogic(_ConfigLib):
|
||||||
from functools import partial
|
from functools import partial
|
||||||
scheduler = _schedule_background_wallpapers()
|
scheduler = _schedule_background_wallpapers()
|
||||||
menu = systray.Menu (
|
menu = systray.Menu (
|
||||||
systray.item("Re-Set Wallpaper", partial(systray.set_wallpaper_again, wallpaper_setter=self.set_wallpaper_by_time)),
|
systray.item("Re-Set Wallpaper", partial(systray.set_wallpaper_again, callback=self.set_wallpaper_by_time)),
|
||||||
systray.item("Reroll Wallpapers", partial(systray.reroll_wallpapers, wallpaper_chooser=self._choose_wallpaper_set, wallpaper_setter=self.set_wallpaper_by_time)),
|
systray.item("Reroll Wallpapers", partial(systray.reroll_wallpapers, first_callback=self._choose_wallpaper_set, second_callback=self.set_wallpaper_by_time)),
|
||||||
systray.item("Quit", partial(systray.on_quit, shutdown_scheduler=scheduler.shutdown))
|
systray.item("Quit", partial(systray.on_quit, callback=scheduler.shutdown))
|
||||||
)
|
)
|
||||||
icon = systray.Icon("wallman_icon", systray.icon_image, "My Tray Icon", menu)
|
icon = systray.Icon("wallman_icon", systray.icon_image, "My Tray Icon", menu)
|
||||||
icon.run()
|
icon.run()
|
||||||
|
|
|
@ -18,19 +18,19 @@ except ImportError:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# This should always be ran with "set_wallpaper_by_time" as input!
|
# This should always be ran with "set_wallpaper_by_time" as input!
|
||||||
def set_wallpaper_again(icon, item, wallpaper_setter):
|
def set_wallpaper_again(icon, item, callback):
|
||||||
logging.info("Re-Setting wallpaper due to systray input.")
|
logging.info("Re-Setting wallpaper due to systray input.")
|
||||||
wallpaper_setter()
|
callback()
|
||||||
|
|
||||||
def reroll_wallpapers(icon, item, wallpaper_chooser, wallpaper_setter):
|
def reroll_wallpapers(icon, item, first_callback, second_callback):
|
||||||
logging.info("Rerolling Wallpaper sets and resetting wallpaper due to systray input")
|
logging.info("Rerolling Wallpaper sets and resetting wallpaper due to systray input")
|
||||||
wallpaper_chooser()
|
first_callback()
|
||||||
wallpaper_setter()
|
second_callback()
|
||||||
|
|
||||||
# This should always be ran with "scheduler.shutdown" as input!
|
# This should always be ran with "scheduler.shutdown" as input!
|
||||||
def on_quit(icon, item, shutdown_scheduler):
|
def on_quit(icon, item, callback):
|
||||||
logging.info("Shutting down wallman due to systray input.")
|
logging.info("Shutting down wallman due to systray input.")
|
||||||
shutdown_scheduler()
|
callback()
|
||||||
icon.stop()
|
icon.stop()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue