Fix some problematic imports

This commit is contained in:
Philipp Hörist 2018-03-26 00:19:59 +02:00
parent b54f27599c
commit 6f55cf3dd4
4 changed files with 7 additions and 12 deletions

View File

@ -48,6 +48,8 @@ from gajim import dialogs
from gajim import cell_renderer_image from gajim import cell_renderer_image
from gajim import message_control from gajim import message_control
from gajim.chat_control_base import ChatControlBase from gajim.chat_control_base import ChatControlBase
from gajim.gajim_themes_window import GajimThemesWindow
from gajim.advanced_configuration_window import AdvancedConfigurationWindow
from gajim import dataforms_widget from gajim import dataforms_widget
from gajim import gui_menu_builder from gajim import gui_menu_builder
@ -696,7 +698,7 @@ class PreferencesWindow:
def on_manage_theme_button_clicked(self, widget): def on_manage_theme_button_clicked(self, widget):
if self.theme_preferences is None: if self.theme_preferences is None:
self.theme_preferences = dialogs.GajimThemesWindow() self.theme_preferences = GajimThemesWindow()
else: else:
self.theme_preferences.window.present() self.theme_preferences.window.present()
self.theme_preferences.select_active_theme() self.theme_preferences.select_active_theme()
@ -1188,7 +1190,7 @@ class PreferencesWindow:
app.interface.instances['advanced_config'].window.present() app.interface.instances['advanced_config'].window.present()
else: else:
app.interface.instances['advanced_config'] = \ app.interface.instances['advanced_config'] = \
dialogs.AdvancedConfigurationWindow() AdvancedConfigurationWindow()
#---------- ManageProxiesWindow class -------------# #---------- ManageProxiesWindow class -------------#
class ManageProxiesWindow: class ManageProxiesWindow:

View File

@ -53,12 +53,6 @@ from gajim.common import const
from gajim.options_dialog import OptionsDialog from gajim.options_dialog import OptionsDialog
from gajim.common.const import Option, OptionKind, OptionType from gajim.common.const import Option, OptionKind, OptionType
# those imports are not used in this file, but in files that 'import dialogs'
# so they can do dialog.GajimThemesWindow() for example
from gajim.filetransfers_window import FileTransfersWindow
from gajim.gajim_themes_window import GajimThemesWindow
from gajim.advanced_configuration_window import AdvancedConfigurationWindow
from gajim.common import app from gajim.common import app
from gajim.common import helpers from gajim.common import helpers
from gajim.common import i18n from gajim.common import i18n

View File

@ -86,9 +86,6 @@ def get_icon_path(icon_name, size=16):
log.error("Unable to find icon %s: %s" % (icon_name, str(e))) log.error("Unable to find icon %s: %s" % (icon_name, str(e)))
from gajim import dialogs
HAS_PYWIN32 = True HAS_PYWIN32 = True
if os.name == 'nt': if os.name == 'nt':
try: try:
@ -447,6 +444,7 @@ def scale_with_ratio(size, width, height):
return size, int(size / ratio) return size, int(size / ratio)
def on_avatar_save_as_menuitem_activate(widget, avatar, default_name=''): def on_avatar_save_as_menuitem_activate(widget, avatar, default_name=''):
from gajim import dialogs
def on_continue(response, file_path): def on_continue(response, file_path):
if response < 0: if response < 0:
return return

View File

@ -73,6 +73,7 @@ from gajim.chat_control import ChatControl
from gajim.groupchat_control import GroupchatControl from gajim.groupchat_control import GroupchatControl
from gajim.groupchat_control import PrivateChatControl from gajim.groupchat_control import PrivateChatControl
from gajim.message_window import MessageWindowMgr from gajim.message_window import MessageWindowMgr
from gajim.filetransfers_window import FileTransfersWindow
from gajim.atom_window import AtomWindow from gajim.atom_window import AtomWindow
from gajim.session import ChatControlSession from gajim.session import ChatControlSession
@ -2717,7 +2718,7 @@ class Interface:
self.roster._after_fill() self.roster._after_fill()
# get instances for windows/dialogs that will show_all()/hide() # get instances for windows/dialogs that will show_all()/hide()
self.instances['file_transfers'] = dialogs.FileTransfersWindow() self.instances['file_transfers'] = FileTransfersWindow()
GLib.timeout_add(100, self.autoconnect) GLib.timeout_add(100, self.autoconnect)
if sys.platform == 'win32': if sys.platform == 'win32':