|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
# You should have received a copy of the GNU General Public License |
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
|
|
|
|
|
|
|
import gobject |
|
|
|
|
import gtk |
|
|
|
|
import logging |
|
|
|
|
import gettext |
|
|
|
@ -39,6 +40,15 @@ N_ = t.ngettext
|
|
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
|
class UpdateBox(gtk.VBox): |
|
|
|
|
"""Custom update box widget.""" |
|
|
|
|
|
|
|
|
|
__gsignals__ = { |
|
|
|
|
'text-focus': ( |
|
|
|
|
gobject.SIGNAL_RUN_LAST, |
|
|
|
|
gobject.TYPE_NONE, |
|
|
|
|
() |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def __init__(self, avatar, spell_check=True): |
|
|
|
|
super(UpdateBox, self).__init__(False, 0) |
|
|
|
|
|
|
|
|
@ -88,6 +98,7 @@ class UpdateBox(gtk.VBox):
|
|
|
|
|
|
|
|
|
|
self._text.get_buffer().connect('changed', self._count_chars) |
|
|
|
|
self._count_chars() # To show something |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
def show(self, reply_to=None): |
|
|
|
|
"""Show the update box and all related widgets.""" |
|
|
|
@ -101,6 +112,7 @@ class UpdateBox(gtk.VBox):
|
|
|
|
|
self._update_info.set_text('') |
|
|
|
|
|
|
|
|
|
self._text.grab_focus() |
|
|
|
|
self.emit('text-focus') |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
def hide(self, caller=None): |
|
|
|
@ -139,4 +151,4 @@ class UpdateBox(gtk.VBox):
|
|
|
|
|
"""Update the avatar pixbuf.""" |
|
|
|
|
self.avatar.set_from_pixbuf(pixbuf) |
|
|
|
|
# pixbuf can only be set, not get. |
|
|
|
|
pixbuf = property(None, _set_pixbuf) |
|
|
|
|
pixbuf = property(None, _set_pixbuf) |
|
|
|
|