use less long variables
This commit is contained in:
parent
7d9d47ac9b
commit
9377f0223b
|
@ -185,23 +185,27 @@ class Preferences_window:
|
||||||
buf1 = {}
|
buf1 = {}
|
||||||
buf2 = {}
|
buf2 = {}
|
||||||
saved_var = {}
|
saved_var = {}
|
||||||
jids = self.plugin.windows[acct][kind].keys()
|
windows = self.plugin.windows[acct][kind]
|
||||||
|
jids = windows.keys()
|
||||||
for jid in jids:
|
for jid in jids:
|
||||||
buf1[jid] = self.plugin.windows[acct][kind][jid].\
|
window = windows[jid]
|
||||||
xmls[jid].get_widget('conversation_textview').get_buffer()
|
buf1[jid] = window.xmls[jid].get_widget('conversation_textview').\
|
||||||
buf2[jid] = self.plugin.windows[acct][kind][jid].\
|
get_buffer()
|
||||||
xmls[jid].get_widget('message_textview').get_buffer()
|
buf2[jid] = window.xmls[jid].get_widget('message_textview').\
|
||||||
saved_var[jid] = self.plugin.windows[acct][kind][jid].save_var(jid)
|
get_buffer()
|
||||||
self.plugin.windows[acct][kind][jid].window.destroy()
|
saved_var[jid] = window.save_var(jid)
|
||||||
|
window.window.destroy()
|
||||||
#open new tabbed chat windows
|
#open new tabbed chat windows
|
||||||
for jid in jids:
|
for jid in jids:
|
||||||
user = self.plugin.roster.contacts[acct][jid][0]
|
user = self.plugin.roster.contacts[acct][jid][0]
|
||||||
self.plugin.roster.new_chat(user, acct)
|
if kind == 'chats':
|
||||||
self.plugin.windows[acct][kind][jid].xmls[jid].\
|
self.plugin.roster.new_chat(user, acct)
|
||||||
get_widget('conversation_textview').set_buffer(buf1[jid])
|
window = windows[jid]
|
||||||
self.plugin.windows[acct][kind][jid].xmls[jid].\
|
window.xmls[jid].get_widget('conversation_textview').set_buffer(\
|
||||||
get_widget('message_textview').set_buffer(buf2[jid])
|
buf1[jid])
|
||||||
self.plugin.windows[acct][kind][jid].load_var(jid, saved_var[jid])
|
window.xmls[jid].get_widget('message_textview').set_buffer(\
|
||||||
|
buf2[jid])
|
||||||
|
window.load_var(jid, saved_var[jid])
|
||||||
|
|
||||||
def split_windows(self, kind):
|
def split_windows(self, kind):
|
||||||
for acct in gajim.connections:
|
for acct in gajim.connections:
|
||||||
|
@ -209,26 +213,30 @@ class Preferences_window:
|
||||||
buf1 = {}
|
buf1 = {}
|
||||||
buf2 = {}
|
buf2 = {}
|
||||||
saved_var = {}
|
saved_var = {}
|
||||||
jids = self.plugin.windows[acct][kind].keys()
|
windows = self.plugin.windows[acct][kind]
|
||||||
|
jids = windows.keys()
|
||||||
if not 'tabbed' in jids:
|
if not 'tabbed' in jids:
|
||||||
continue
|
continue
|
||||||
jids.remove('tabbed')
|
jids.remove('tabbed')
|
||||||
for jid in jids:
|
for jid in jids:
|
||||||
buf1[jid] = self.plugin.windows[acct][kind][jid].\
|
window = windows[jid]
|
||||||
xmls[jid].get_widget('conversation_textview').get_buffer()
|
buf1[jid] = window.xmls[jid].get_widget('conversation_textview').\
|
||||||
buf2[jid] = self.plugin.windows[acct][kind][jid].\
|
get_buffer()
|
||||||
xmls[jid].get_widget('message_textview').get_buffer()
|
buf2[jid] = window.xmls[jid].get_widget('message_textview').\
|
||||||
saved_var[jid] = self.plugin.windows[acct][kind][jid].save_var(jid)
|
get_buffer()
|
||||||
self.plugin.windows[acct][kind]['tabbed'].window.destroy()
|
saved_var[jid] = window.save_var(jid)
|
||||||
|
windows['tabbed'].window.destroy()
|
||||||
#open new tabbed chat windows
|
#open new tabbed chat windows
|
||||||
for jid in jids:
|
for jid in jids:
|
||||||
user = self.plugin.roster.contacts[acct][jid][0]
|
user = self.plugin.roster.contacts[acct][jid][0]
|
||||||
self.plugin.roster.new_chat(user, acct)
|
if kind == 'chats':
|
||||||
self.plugin.windows[acct][kind][jid].xmls[jid].\
|
self.plugin.roster.new_chat(user, acct)
|
||||||
get_widget('conversation_textview').set_buffer(buf1[jid])
|
window = windows[jid]
|
||||||
self.plugin.windows[acct][kind][jid].xmls[jid].\
|
window.xmls[jid].get_widget('conversation_textview').set_buffer(\
|
||||||
get_widget('message_textview').set_buffer(buf2[jid])
|
buf1[jid])
|
||||||
self.plugin.windows[acct][kind][jid].load_var(jid, saved_var[jid])
|
window.xmls[jid].get_widget('message_textview').set_buffer(\
|
||||||
|
buf2[jid])
|
||||||
|
window.load_var(jid, saved_var[jid])
|
||||||
|
|
||||||
def on_use_tabbed_chat_window_checkbutton_toggled(self, widget):
|
def on_use_tabbed_chat_window_checkbutton_toggled(self, widget):
|
||||||
if widget.get_active():
|
if widget.get_active():
|
||||||
|
|
Loading…
Reference in New Issue