예제 #1
0
 def set_autorun(self, widget, event):
     if state_lock:
         return
     if widget.get_active() == True:
         if WIN:
             autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.exe'))
         else:
             autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.py'), gw_config_set['delay_start_time'], gw_config_set['instances_count'])
     else:
         autorun.remove("gis-weather")
예제 #2
0
    def clear_settings(self, widget):
        global gw_config_set
        w_name = Gtk.Buildable.get_name(widget)
        w_name = w_name.split('_')
        name = '_'.join(w_name[1:])
        gw_config_set[name] = gw_config_default_set[name]
        Save_Config()
        drawing_area_set.redraw(False, False, load_config = True)
        self.load_config_into_form()

        if (name == 'delay_start_time' or 'instances_count') and self.switch_autostart.get_active():
            if WIN:
                autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.exe'))
            else:
                autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.py'), gw_config_set['delay_start_time'], gw_config_set['instances_count'])
예제 #3
0
    def save_settings(self, widget, event=None):
        if state_lock:
            return
        global gw_config_set
        value = None
        w_type = widget.get_name()
        w_name = Gtk.Buildable.get_name(widget)
        w_name = w_name.split('_')
        name = '_'.join(w_name[1:])
        if w_type == 'GtkSpinButton':
            if name in ('opacity', 'scale'):
                value = widget.get_value()
            else:
                value = int(widget.get_value())
        else:
            value = widget.get_active()
        if value != None:
            if name.count('__'):
                name, key = name.split('__')[0], name.split('__')[1]
                gw_config_set[name][key] = value
            else:
                gw_config_set[name] = value
        Save_Config()
        drawing_area_set.redraw(False, False, load_config = True)
        if name == 'delay_start_time' and self.switch_autostart.get_active():
            if WIN:
                autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.exe'))
            else:
                autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.py'), gw_config_set['delay_start_time'], gw_config_set['instances_count'])
        if name == 'indicator_is_appindicator':
            if value:
                self.frame_status_icon.hide()
                self.frame_app_indicator.show()
            else:
                self.frame_status_icon.show()
                self.frame_app_indicator.hide()

        if name == 'show_bg_png':
            if value:
                self.frame_image.show()
                self.frame_not_image.hide()
            else:
                self.frame_image.hide()
                self.frame_not_image.show()

        if name == 'instances_count':
            autorun.add("gis-weather", os.path.join(os.path.split(work_path)[0], 'gis-weather.py'), gw_config_set['delay_start_time'], gw_config_set['instances_count'])

        if name == 'swap_d_and_m':
            drawing_area_set.redraw(False, True, load_config = True)