def HandleDialogText (self, accel): name = self.ReorderKeyString (accel) if len (accel) != len (name): accel = protect_pango_markup (accel) ErrorDialog (self.Widget.get_toplevel (), _("\"%s\" is not a valid shortcut") % accel) return self.BindingEdited (accel)
def HandleDialogText(self, accel): name = self.ReorderKeyString(accel) if len(accel) != len(name): accel = protect_pango_markup(accel) ErrorDialog(self.Widget.get_toplevel(), _("\"%s\" is not a valid shortcut") % accel) return self.BindingEdited(accel)
def __init__(self, value=""): gtk.Alignment.__init__(self, 0.5, 0.5, 0.0, 0.0) box = gtk.HBox() self.Warning = gtk.Label() self.Markup = _("<span size=\"large\"><b>No matches found.</b> </span><span>\n\n Your filter \"<b>%s</b>\" does not match any items.</span>") value = protect_pango_markup(value) self.Warning.set_markup(self.Markup % value) image = Image("face-surprise", ImageThemed, 48) box.pack_start(image, False, False, 0) box.pack_start(self.Warning, True, True, 15) self.add(box)
def HandleDialogText(self, mask): edges = mask.split("|") valid = True for edge in edges: if edge not in Edges: valid = False break if not valid: mask = protect_pango_markup(mask) ErrorDialog(self.Widget.get_toplevel(), _("\"%s\" is not a valid edge mask") % mask) return self.EdgeEdited("|".join(edges))
def HandleDialogText (self, mask): edges = mask.split ("|") valid = True for edge in edges: if edge not in Edges: valid = False break if not valid: mask = protect_pango_markup (mask) ErrorDialog (self.Widget.get_toplevel (), _("\"%s\" is not a valid edge mask") % mask) return self.EdgeEdited ("|".join (edges))
def __init__(self, value=""): GObject.GObject.__init__(self, 0.5, 0.5, 0.0, 0.0) box = Gtk.HBox() self.Warning = Gtk.Label() self.Markup = _("<span size=\"large\"><b>No matches found.</b> </span><span>\n\n Your filter \"<b>%s</b>\" does not match any items.</span>") value = protect_pango_markup(value) self.Warning.set_markup(self.Markup % value) image = Image("face-surprise", ImageThemed, 48) box.pack_start(image, False, False, 0) box.pack_start(self.Warning, True, True, 15) self.add(box)
def MakeLabel(self): if not self.Setting: return label = Gtk.Label() desc = protect_pango_markup(self.Setting.ShortDesc) style = "%s" if self.Setting.Integrated: style = "<i>%s</i>" label.set_markup(style % desc) label.props.xalign = 0 label.set_size_request(160, -1) label.props.wrap_mode = Gtk.WrapMode.WORD label.set_line_wrap(True) self.Label = label
def MakeLabel(self): if not self.Setting: return label = Gtk.Label() desc = protect_pango_markup (self.Setting.ShortDesc) style = "%s" if self.Setting.Integrated: style = "<i>%s</i>" label.set_markup(style % desc) label.props.xalign = 0 label.set_size_request(160, -1) label.props.wrap_mode = Gtk.WrapMode.WORD label.set_line_wrap(True) self.Label = label
def protect_markup_dict(dict_): return dict((k, protect_pango_markup(v)) for (k, v) in dict_.iteritems())
def update(self, value): value = protect_pango_markup(value) self.Warning.set_markup(self.Markup % value)
def protect_markup_dict (dict_): return dict((k, protect_pango_markup (v)) for (k, v) in dict_.items())
def ShowErrorDialog(button): button = protect_pango_markup(button) ErrorDialog(self.Widget.get_toplevel(), _("\"%s\" is not a valid button") % button)
def ShowErrorDialog (button): button = protect_pango_markup (button) ErrorDialog (self.Widget.get_toplevel (), _("\"%s\" is not a valid button") % button)