Example #1
0
 def on_languagebar_realize(self, widget):
     try:
         size = open(os.path.join(CONFIG_ROOT, 'gimpanel-state')).read().strip()
         x, y = size.split()
         self.panel_x, self.panel_y = int(x), int(y)
     except Exception, e:
         log_traceback(log)
Example #2
0
 def on_languagebar_destroy(self, widget):
     try:
         f = open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w')
         f.write("%d %d" % (self.panel_x, self.panel_y))
         f.close()
     except Exception, e:
         log_traceback(log)
Example #3
0
 def on_languagebar_realize(self, widget):
     try:
         with open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w+') as f:
             size = f.read().strip()
         if size:
             x, y = size.split()
             self.panel_x, self.panel_y = int(x), int(y)
     except Exception, e:
         log_traceback(log)
Example #4
0
 def is_default_im(self):
     #TODO do not hard code
     try:
         value = self.get_property('im').split(':')[2]
         log.debug("Current IM: %s" % value)
         return value == 'fcitx-kbd'
     except Exception, e:
         log_traceback(log)
         return True
Example #5
0
 def is_default_im(self):
     #TODO do not hard code
     try:
         value = self.get_property('im').split(':')[2]
         log.debug("Current IM: %s" % value)
         return value == 'fcitx-kbd'
     except Exception, e:
         log_traceback(log)
         return True
Example #6
0
    def _init_languagebar_position(self):
        try:
            with open(os.path.join(CONFIG_ROOT, 'gimpanel-state')) as f:
                size = f.read().strip()

            if size:
                x, y = size.split()
                self.panel_x, self.panel_y = int(x), int(y)
        except Exception, e:
            log_traceback(log)
Example #7
0
    def _init_languagebar_position(self):
        try:
            with open(os.path.join(CONFIG_ROOT, 'gimpanel-state')) as f:
                size = f.read().strip()

            if size:
                x, y = size.split()
                self.panel_x, self.panel_y = int(x), int(y)
        except Exception, e:
            log_traceback(log)
Example #8
0
 def is_default_im(self):
     #TODO do not hard code
     try:
         value = self.get_property('im').split(':')[2]
         if value != 'fcitx-kbd':
             return True
         else:
             return False
     except Exception, e:
         log_traceback(log)
         return True
Example #9
0
 def on_languagebar_destroy(self, widget):
     try:
         with open(os.path.join(CONFIG_ROOT, 'gimpanel-state'), 'w') as f:
             f.write("%d %d" % (self.panel_x, self.panel_y))
     except Exception, e:
         log_traceback(log)
Example #10
0
 def get_current_im_icon_name(self):
     try:
         return self.get_property('im').split(':')[2]
     except Exception, e:
         log_traceback(log)
         return ''