[preview] Pass textview instead of chatcontrol
HistoryWindow doesnt have a ChatControl
This commit is contained in:
@@ -89,7 +89,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
|||||||
jid = chat_control.contact.jid
|
jid = chat_control.contact.jid
|
||||||
if account not in self.controls:
|
if account not in self.controls:
|
||||||
self.controls[account] = {}
|
self.controls[account] = {}
|
||||||
self.controls[account][jid] = Base(self, chat_control)
|
self.controls[account][jid] = Base(self, chat_control.conv_textview)
|
||||||
|
|
||||||
@log_calls('UrlImagePreviewPlugin')
|
@log_calls('UrlImagePreviewPlugin')
|
||||||
def disconnect_from_chat_control(self, chat_control):
|
def disconnect_from_chat_control(self, chat_control):
|
||||||
@@ -105,7 +105,7 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
|||||||
self.history_window_control.deinit_handlers()
|
self.history_window_control.deinit_handlers()
|
||||||
log.error("connect_with_history: create base")
|
log.error("connect_with_history: create base")
|
||||||
self.history_window_control = Base(
|
self.history_window_control = Base(
|
||||||
self, history_window.history_textview, history_window)
|
self, history_window.history_textview)
|
||||||
|
|
||||||
@log_calls('UrlImagePreviewPlugin')
|
@log_calls('UrlImagePreviewPlugin')
|
||||||
def disconnect_from_history(self, history_window):
|
def disconnect_from_history(self, history_window):
|
||||||
@@ -129,11 +129,10 @@ class UrlImagePreviewPlugin(GajimPlugin):
|
|||||||
|
|
||||||
|
|
||||||
class Base(object):
|
class Base(object):
|
||||||
def __init__(self, plugin, chatcontrol):
|
def __init__(self, plugin, textview):
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.textview = chatcontrol.conv_textview
|
self.textview = textview
|
||||||
self.handlers = {}
|
self.handlers = {}
|
||||||
self.chatcontrol = chatcontrol
|
|
||||||
|
|
||||||
self.directory = os.path.join(configpaths.gajimpaths['MY_DATA'],
|
self.directory = os.path.join(configpaths.gajimpaths['MY_DATA'],
|
||||||
'downloads')
|
'downloads')
|
||||||
|
|||||||
Reference in New Issue
Block a user