def __init__(self, frame): self.g_settings = GeneralSettingsData() self.frame = frame super(TaskBarIcon, self).__init__() self.set_icon(TRAY_ICON) # self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.on_left_down) self.Bind(wx.adv.EVT_TASKBAR_LEFT_DCLICK, self.configure_wallpapers) # Initialize display data # get_display_data() wpproc.refresh_display_data() # profile initialization self.job_lock = Lock() self.repeating_timer = None self.pause_item = None self.is_paused = False # if sp_logging.DEBUG: # sp_logging.G_LOGGER.info("START Listing profiles for menu.") self.list_of_profiles = list_profiles() # if sp_logging.DEBUG: # sp_logging.G_LOGGER.info("END Listing profiles for menu.") # Should now return an object if a previous profile was written or # None if no previous data was found if STARTUP_PROFILE: self.active_profile = open_profile(STARTUP_PROFILE) else: self.active_profile = read_active_profile() if self.active_profile: wpproc.G_ACTIVE_PROFILE = self.active_profile.name self.start_prev_profile(self.active_profile) # if self.active_profile is None: # sp_logging.G_LOGGER.info("Starting up the first profile found.") # self.start_profile(wx.EVT_MENU, self.list_of_profiles[0]) # self.hk = None # self.hk2 = None if self.g_settings.use_hotkeys is True: try: # import keyboard # https://github.com/boppreh/keyboard # This import is here to have the module in the class scope from system_hotkey import SystemHotkey self.hk = SystemHotkey(check_queue_interval=0.05) self.hk2 = SystemHotkey(consumer=self.profile_consumer, check_queue_interval=0.05) self.seen_binding = set() self.register_hotkeys() except ImportError as excep: sp_logging.G_LOGGER.info( "WARNING: Could not import keyboard hotkey hook library, \ hotkeys will not work. Exception: %s", excep) if self.g_settings.show_help is True: config_frame = ConfigFrame(self) help_frame = HelpFrame()
def configure_wallpapers(self, event): """Opens wallpaper configuration panel.""" config_frame = ConfigFrame(self)