GObject -> GLib

This commit is contained in:
Yann Leboulanger 2013-07-29 21:41:01 +02:00
parent 134f87ced5
commit d1a6467d82
4 changed files with 29 additions and 29 deletions

View File

@ -23,7 +23,7 @@
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import GLib
import gtkgui_helpers
from common import helpers
@ -85,23 +85,23 @@ class AtomWindow:
if newentry.feed_link is not None:
self.feed_title_label.set_markup(
'<span foreground="blue" underline="single">%s</span>' % \
GObject.markup_escape_text(newentry.feed_title))
GLib.markup_escape_text(newentry.feed_title))
else:
self.feed_title_label.set_markup(
GObject.markup_escape_text(newentry.feed_title))
self.feed_title_label.set_markup(GLib.markup_escape_text(
newentry.feed_title))
self.feed_tagline_label.set_markup(
'<small>%s</small>' % \
GObject.markup_escape_text(newentry.feed_tagline))
'<small>%s</small>' % GLib.markup_escape_text(
newentry.feed_tagline))
if newentry.title:
if newentry.uri is not None:
self.entry_title_label.set_markup(
'<span foreground="blue" underline="single">%s</span>' % \
GObject.markup_escape_text(newentry.title))
GLib.markup_escape_text(newentry.title))
else:
self.entry_title_label.set_markup(
GObject.markup_escape_text(newentry.title))
self.entry_title_label.set_markup(GLib.markup_escape_text(
newentry.title))
else:
self.entry_title_label.set_markup('')

View File

@ -215,7 +215,7 @@ LOCATION_DATA = {
'timestamp': _('timestamp'),
'uri': _('uri')}
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GdkPixbuf
@ -299,10 +299,10 @@ class UserMoodPEP(AbstractPEP):
assert not self._retracted
untranslated_mood = self._pep_specific_data['mood']
mood = self._translate_mood(untranslated_mood)
markuptext = '<b>%s</b>' % GObject.markup_escape_text(mood)
markuptext = '<b>%s</b>' % GLib.markup_escape_text(mood)
if 'text' in self._pep_specific_data:
text = self._pep_specific_data['text']
markuptext += ' (%s)' % GObject.markup_escape_text(text)
markuptext += ' (%s)' % GLib.markup_escape_text(text)
return markuptext
def _translate_mood(self, mood):
@ -339,13 +339,13 @@ class UserTunePEP(AbstractPEP):
tune = self._pep_specific_data
artist = tune.get('artist', _('Unknown Artist'))
artist = GObject.markup_escape_text(artist)
artist = GLib.markup_escape_text(artist)
title = tune.get('title', _('Unknown Title'))
title = GObject.markup_escape_text(title)
title = GLib.markup_escape_text(title)
source = tune.get('source', _('Unknown Source'))
source = GObject.markup_escape_text(source)
source = GLib.markup_escape_text(source)
tune_string = _('<b>"%(title)s"</b> by <i>%(artist)s</i>\n'
'from <i>%(source)s</i>') % {'title': title,
@ -392,12 +392,12 @@ class UserActivityPEP(AbstractPEP):
subactivity = ACTIVITIES[activity][subactivity]
activity = ACTIVITIES[activity]['category']
markuptext = '<b>' + GObject.markup_escape_text(activity)
markuptext = '<b>' + GLib.markup_escape_text(activity)
if subactivity:
markuptext += ': ' + GObject.markup_escape_text(subactivity)
markuptext += ': ' + GLib.markup_escape_text(subactivity)
markuptext += '</b>'
if text:
markuptext += ' (%s)' % GObject.markup_escape_text(text)
markuptext += ' (%s)' % GLib.markup_escape_text(text)
return markuptext
@ -463,7 +463,7 @@ class UserLocationPEP(AbstractPEP):
for entry in location.keys():
text = location[entry]
text = GObject.markup_escape_text(text)
text = GLib.markup_escape_text(text)
# Translate standart location tag
tag = LOCATION_DATA.get(entry, entry)
location_string += '\n<b>%(tag)s</b>: %(text)s' % \
@ -473,4 +473,4 @@ class UserLocationPEP(AbstractPEP):
SUPPORTED_PERSONAL_USER_EVENTS = [UserMoodPEP, UserTunePEP, UserActivityPEP,
UserNicknamePEP, UserLocationPEP]
UserNicknamePEP, UserLocationPEP]

View File

@ -51,7 +51,7 @@ import sys
import signal
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import GLib
import time
import locale
@ -417,10 +417,9 @@ class HistoryManager:
message_ = '<span'
if color:
message_ += ' foreground="%s"' % color
message_ += '>%s</span>' % \
GObject.markup_escape_text(message)
self.logs_liststore.append((str(log_line_id), str(jid_id), time_,
message_, subject, nickname))
message_ += '>%s</span>' % GLib.markup_escape_text(message)
self.logs_liststore.append((str(log_line_id), str(jid_id),
time_, message_, subject, nickname))
def _fill_search_results_listview(self, text):
"""

View File

@ -31,6 +31,7 @@ import os
import time
from dialogs import PopupNotificationWindow
from gi.repository import GObject
from gi.repository import GLib
import gtkgui_helpers
from gi.repository import Gtk
@ -89,7 +90,7 @@ text=None, timeout=-1):
if gajim.config.get('use_notif_daemon') and dbus_support.supported:
try:
DesktopNotification(event_type, jid, account, msg_type,
path_to_image, title, GObject.markup_escape_text(text), timeout)
path_to_image, title, GLib.markup_escape_text(text), timeout)
return # sucessfully did D-Bus Notification procedure!
except dbus.DBusException as e:
# Connection to D-Bus failed
@ -103,10 +104,10 @@ text=None, timeout=-1):
if not text and event_type == 'new_message':
# empty text for new_message means do_preview = False
# -> default value for text
_text = GObject.markup_escape_text(
gajim.get_name_from_jid(account, jid))
_text = GLib.markup_escape_text(gajim.get_name_from_jid(account,
jid))
else:
_text = GObject.markup_escape_text(text)
_text = GLib.markup_escape_text(text)
if not title:
_title = ''