fix profile window
This commit is contained in:
parent
f28d5574d0
commit
42b5a1c912
2 changed files with 10 additions and 8 deletions
|
@ -1458,9 +1458,9 @@ class FileChooserDialog(Gtk.FileChooserDialog):
|
||||||
select_multiple=False, current_folder=None, on_response_ok=None,
|
select_multiple=False, current_folder=None, on_response_ok=None,
|
||||||
on_response_cancel=None):
|
on_response_cancel=None):
|
||||||
|
|
||||||
GObject.GObject.__init__(self, title=title_text, action=action,
|
GObject.GObject.__init__(self, title=title_text, action=action)
|
||||||
buttons=buttons)
|
self.add_button(buttons[0],buttons[1])
|
||||||
|
self.add_button(buttons[2],buttons[3])
|
||||||
self.set_default_response(default_response)
|
self.set_default_response(default_response)
|
||||||
self.set_select_multiple(select_multiple)
|
self.set_select_multiple(select_multiple)
|
||||||
if current_folder and os.path.isdir(current_folder):
|
if current_folder and os.path.isdir(current_folder):
|
||||||
|
@ -4702,7 +4702,8 @@ class ImageChooserDialog(FileChooserDialog):
|
||||||
if path_to_file is None or os.path.isdir(path_to_file):
|
if path_to_file is None or os.path.isdir(path_to_file):
|
||||||
# nothing to preview or directory
|
# nothing to preview or directory
|
||||||
# make sure you clean image do show nothing
|
# make sure you clean image do show nothing
|
||||||
widget.get_preview_widget().set_from_file(None)
|
preview = widget.get_preview_widget()
|
||||||
|
preview.clear()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(path_to_file, 100, 100)
|
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(path_to_file, 100, 100)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
# THIS FILE IS FOR **OUR** PROFILE (when we edit our INFO)
|
# THIS FILE IS FOR **OUR** PROFILE (when we edit our INFO)
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gdk
|
||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
import base64
|
import base64
|
||||||
|
@ -46,7 +47,7 @@ class ProfileWindow:
|
||||||
def __init__(self, account, transient_for=None):
|
def __init__(self, account, transient_for=None):
|
||||||
self.xml = gtkgui_helpers.get_gtk_builder('profile_window.ui')
|
self.xml = gtkgui_helpers.get_gtk_builder('profile_window.ui')
|
||||||
self.window = self.xml.get_object('profile_window')
|
self.window = self.xml.get_object('profile_window')
|
||||||
self.set_transient_for(transient_for)
|
self.window.set_transient_for(transient_for)
|
||||||
self.progressbar = self.xml.get_object('progressbar')
|
self.progressbar = self.xml.get_object('progressbar')
|
||||||
self.statusbar = self.xml.get_object('statusbar')
|
self.statusbar = self.xml.get_object('statusbar')
|
||||||
self.context_id = self.statusbar.get_context_id('profile')
|
self.context_id = self.statusbar.get_context_id('profile')
|
||||||
|
@ -84,7 +85,7 @@ class ProfileWindow:
|
||||||
return True # loop forever
|
return True # loop forever
|
||||||
|
|
||||||
def remove_statusbar(self, message_id):
|
def remove_statusbar(self, message_id):
|
||||||
self.statusbar.remove_message(self.context_id, message_id)
|
self.statusbar.remove(self.context_id, message_id)
|
||||||
self.remove_statusbar_timeout_id = None
|
self.remove_statusbar_timeout_id = None
|
||||||
|
|
||||||
def on_profile_window_destroy(self, widget):
|
def on_profile_window_destroy(self, widget):
|
||||||
|
@ -288,7 +289,7 @@ class ProfileWindow:
|
||||||
self.set_value(i + '_entry', vcard_[i])
|
self.set_value(i + '_entry', vcard_[i])
|
||||||
if self.update_progressbar_timeout_id is not None:
|
if self.update_progressbar_timeout_id is not None:
|
||||||
if self.message_id:
|
if self.message_id:
|
||||||
self.statusbar.remove_message(self.context_id, self.message_id)
|
self.statusbar.remove(self.context_id, self.message_id)
|
||||||
self.message_id = self.statusbar.push(self.context_id,
|
self.message_id = self.statusbar.push(self.context_id,
|
||||||
_('Information received'))
|
_('Information received'))
|
||||||
self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
|
self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
|
||||||
|
@ -398,7 +399,7 @@ class ProfileWindow:
|
||||||
if obj.conn.name != self.account:
|
if obj.conn.name != self.account:
|
||||||
return
|
return
|
||||||
if self.message_id:
|
if self.message_id:
|
||||||
self.statusbar.remove_message(self.context_id, self.message_id)
|
self.statusbar.remove(self.context_id, self.message_id)
|
||||||
self.message_id = self.statusbar.push(self.context_id,
|
self.message_id = self.statusbar.push(self.context_id,
|
||||||
_('Information NOT published'))
|
_('Information NOT published'))
|
||||||
self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
|
self.remove_statusbar_timeout_id = GObject.timeout_add_seconds(3,
|
||||||
|
|
Loading…
Add table
Reference in a new issue