def on_entry_changed_greeter_theme_name(self, entry, pattern=GtkThemesPattern):
     value = entry.value
     if value:
         path = (p if p != '*' else value.strip() for p in pattern)
         entry.error = helpers.check_path_accessibility(os.path.join(*path))
     else:
         entry.error = None
 def on_entry_changed_greeter_keyboard(self, entry):
     error = None
     if entry.enabled:
         value = entry.value
         if os.path.isabs(value):
             argv = shlex.split(value)
             error = helpers.check_path_accessibility(argv[0], executable=True)
     entry.error = error
Exemple #3
0
 def on_entry_changed_greeter_keyboard(self, entry):
     error = None
     if entry.enabled:
         value = entry.value
         if os.path.isabs(value):
             argv = shlex.split(value)
             error = helpers.check_path_accessibility(argv[0],
                                                      executable=True)
     entry.error = error
Exemple #4
0
 def on_entry_changed_greeter_theme_name(self,
                                         entry,
                                         pattern=GtkThemesPattern):
     value = entry.value
     if value:
         path = (p if p != '*' else value.strip() for p in pattern)
         entry.error = helpers.check_path_accessibility(os.path.join(*path))
     else:
         entry.error = None
    def _update_row_appearance(self, rowiter):
        row = self._widgets.model[rowiter]
        bg = row[Row.Background]

        error = None
        color = Gdk.RGBA()
        if color.parse(bg):
            pixbuf = row[Row.BackgroundPixbuf]
            if not pixbuf:
                pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, False, 8, 16, 16)
                row[Row.BackgroundPixbuf] = pixbuf
            value = (int(0xFF * color.red) << 24) + \
                    (int(0xFF * color.green) << 16) + \
                    (int(0xFF * color.blue) << 8)
            pixbuf.fill(value)
            row[Row.BackgroundIsColor] = True
        else:
            row[Row.BackgroundIsColor] = False
            if bg:
                error = check_path_accessibility(bg)

        row[Row.ErrorVisible] = error is not None
        row[Row.ErrorText] = error
Exemple #6
0
 def _on_background_changed(self, entry, data):
     value = entry.value
     if not value or Gdk.RGBA().parse(value):
         entry.error = None
     else:
         entry.error = check_path_accessibility(value)
Exemple #7
0
 def on_entry_changed_greeter_background(self, entry):
     value = entry.value
     if not value or Gdk.RGBA().parse(value):
         entry.error = None
     else:
         entry.error = helpers.check_path_accessibility(value)
Exemple #8
0
 def on_entry_changed_greeter_default_user_image(self, entry):
     value = entry.value
     if value.startswith('#'):
         entry.error = None
     else:
         entry.error = helpers.check_path_accessibility(value)
 def on_entry_changed_greeter_background(self, entry):
     value = entry.value
     if not value or Gdk.RGBA().parse(value):
         entry.error = None
     else:
         entry.error = helpers.check_path_accessibility(value)
 def on_entry_changed_greeter_default_user_image(self, entry):
     value = entry.value
     if value.startswith('#'):
         entry.error = None
     else:
         entry.error = helpers.check_path_accessibility(value)
 def _on_background_changed(self, entry, data):
     value = entry.value
     if not value or Gdk.RGBA().parse(value):
         entry.error = None
     else:
         entry.error = check_path_accessibility(value)