Commit f8934751 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Only use absolute imports from gtk module

- This reduces import cycles
parent b2a7c949
......@@ -13,8 +13,8 @@
from gajim.common.zeroconf.connection_zeroconf import ConnectionZeroconf
from gajim.options_dialog import OptionsDialog, OptionsBox
from gajim.common.const import Option, OptionKind, OptionType
from gajim.gtk import ConfirmationDialog
from gajim.gtk import YesNoDialog
from gajim.gtk.dialogs import ConfirmationDialog
from gajim.gtk.dialogs import YesNoDialog
class AccountsWindow(Gtk.ApplicationWindow):
......
......@@ -22,16 +22,17 @@
# be entities that often change the list, it may be slow to fetch it every time
from gi.repository import Gtk
import nbxmpp
from gajim.common import app
from gajim.common.modules import dataforms
from gajim.common import ged
from gajim import gtkgui_helpers
from gajim.gtk import HigDialog
from gajim import dataforms_widget
from gajim.gtk.dialogs import HigDialog
class CommandWindow:
"""
......
......@@ -23,25 +23,26 @@
from gajim.common.exceptions import GajimGeneralException
from gajim import config
from gajim import dialogs
from gajim.gtk import shortcuts_window
from gajim.accounts_window import AccountsWindow
import gajim.plugins.gui
from gajim import disco
from gajim.gtk.dialogs import ShortcutsWindow
from gajim.gtk.history_sync import HistorySyncAssistant
from gajim.gtk.server_info import ServerInfoDialog
from gajim.gtk.mam_preferences import MamPreferences
from gajim.gtk.preferences import Preferences
from gajim.gtk import JoinGroupchatWindow
from gajim.gtk import StartChatDialog
from gajim.gtk import AddNewContactWindow
from gajim.gtk import SingleMessageWindow
from gajim.gtk import XMLConsoleWindow
from gajim.gtk import AboutDialog
from gajim.gtk import PrivacyListsWindow
from gajim.gtk import ManageBookmarksWindow
from gajim.gtk import FeaturesDialog
from gajim.gtk import AccountCreationWizard
from gajim.gtk import HistoryWindow
from gajim.gtk.join_groupchat import JoinGroupchatWindow
from gajim.gtk.start_chat import StartChatDialog
from gajim.gtk.add_contact import AddNewContactWindow
from gajim.gtk.single_message import SingleMessageWindow
from gajim.gtk.xml_console import XMLConsoleWindow
from gajim.gtk.about import AboutDialog
from gajim.gtk.privacy_list import PrivacyListsWindow
from gajim.gtk.bookmarks import ManageBookmarksWindow
from gajim.gtk.features import FeaturesDialog
from gajim.gtk.account_wizard import AccountCreationWizard
from gajim.gtk.history import HistoryWindow
# General Actions
......@@ -289,7 +290,7 @@ def on_faq(action, param):
def on_keyboard_shortcuts(action, param):
shortcuts_window.show(app.app.get_active_window())
ShortcutsWindow()
def on_features(action, param):
......
......@@ -42,8 +42,8 @@
from gajim import gui_menu_builder
from gajim import message_control
from gajim import dialogs
from gajim.gtk import ConfirmationDialog
from gajim.gtk import AddNewContactWindow
from gajim.gtk.dialogs import ConfirmationDialog
from gajim.gtk.add_contact import AddNewContactWindow
from gajim.common import app
from gajim.common import helpers
......
......@@ -34,7 +34,7 @@
from gajim import gtkgui_helpers
from gajim import message_control
from gajim.gtk import NonModalConfirmationDialog
from gajim.gtk.dialogs import NonModalConfirmationDialog
from gajim.gtk.util import convert_rgb_to_hex
from gajim import notify
from gajim.gtk.emoji_chooser import emoji_chooser
......@@ -406,7 +406,7 @@ def _on_history(self, action, param):
app.interface.instances['logs'].window.present()
app.interface.instances['logs'].open_history(jid, self.account)
else:
from gajim.gtk import HistoryWindow
from gajim.gtk.history import HistoryWindow
app.interface.instances['logs'] = HistoryWindow(jid, self.account)
def change_encryption(self, action, param):
......@@ -1099,7 +1099,7 @@ def _on_history_menuitem_activate(self, widget=None, jid=None):
app.interface.instances['logs'].window.present()
app.interface.instances['logs'].open_history(jid, self.account)
else:
from gajim.gtk import HistoryWindow
from gajim.gtk.history import HistoryWindow
app.interface.instances['logs'] = HistoryWindow(jid, self.account)
def _on_send_file(self, action, param):
......
......@@ -505,7 +505,7 @@ def generate(self):
if self.msg_obj.form_node:
# It could be a voice request. See
# http://www.xmpp.org/extensions/xep-0045.html#voiceapprove
from gajim.gtk import SingleMessageWindow
from gajim.gtk.single_message import SingleMessageWindow
SingleMessageWindow(
self.conn.name, self.fjid,
action='receive', from_whom=self.fjid,
......
......@@ -37,13 +37,13 @@
from gajim import dialogs
from gajim import dataforms_widget
from gajim import gui_menu_builder
from gajim.gtk import ConfirmationDialog
from gajim.gtk import ConfirmationDialogDoubleRadio
from gajim.gtk import ErrorDialog
from gajim.gtk import InputDialog
from gajim.common import helpers
from gajim.common import app
from gajim.gtk.dialogs import ConfirmationDialog
from gajim.gtk.dialogs import ConfirmationDialogDoubleRadio
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InputDialog
#---------- ManageProxiesWindow class -------------#
class ManageProxiesWindow:
......
......@@ -21,8 +21,8 @@
from gajim.common.app import app
from gajim.common.i18n import _
from gajim.gtk import ErrorDialog
from gajim.gtk import InformationDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InformationDialog
Message = namedtuple('Message', ['title', 'text', 'dialog'])
......
......@@ -53,7 +53,8 @@
from gajim.common.exceptions import GajimGeneralException
# Compat with Gajim 1.0.3 for plugins
from gajim.gtk import *
from gajim.gtk.dialogs import *
from gajim.gtk.add_contact import AddNewContactWindow
log = logging.getLogger('gajim.dialogs')
......
......@@ -49,19 +49,20 @@
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gajim.gtk import ErrorDialog
from gajim.gtk import InformationDialog
from gajim import gtkgui_helpers
from gajim import groups
from gajim import adhoc_commands
from gajim import search_window
from gajim.gtk import ServiceRegistration
from gajim.common import app
from gajim.common.i18n import _
from gajim.common import helpers
from gajim.common.const import StyleAttr
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InformationDialog
from gajim.gtk.service_registration import ServiceRegistration
LABELS = {
1: _('This service has not yet responded with detailed information'),
2: _('This service could not respond with detailed information.\n'
......
......@@ -17,36 +17,39 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GLib
from gi.repository import Pango
import os
import time
import logging
from functools import partial
from pathlib import Path
from enum import IntEnum, unique
from datetime import datetime
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GLib
from gi.repository import Pango
from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER_5
from gajim import gtkgui_helpers
from gajim import tooltips
from gajim.gtk import HigDialog
from gajim.gtk import InformationDialog
from gajim.gtk import YesNoDialog
from gajim.gtk import ErrorDialog
from gajim.gtk import FTOverwriteConfirmationDialog
from gajim.gtk import NonModalConfirmationDialog
from gajim.common import app
from gajim.common import helpers
from gajim.common.file_props import FilesProp
from gajim.common.protocol.bytestream import (is_transfer_active, is_transfer_paused,
is_transfer_stopped)
from gajim.gtk.filechoosers import FileSaveDialog, FileChooserDialog
from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER_5
import logging
from gajim.gtk.dialogs import HigDialog
from gajim.gtk.dialogs import InformationDialog
from gajim.gtk.dialogs import YesNoDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import FTOverwriteConfirmationDialog
from gajim.gtk.dialogs import NonModalConfirmationDialog
from gajim.gtk.filechoosers import FileSaveDialog
from gajim.gtk.filechoosers import FileChooserDialog
log = logging.getLogger('gajim.filetransfer_window')
@unique
......
......@@ -48,7 +48,7 @@
from gajim import vcard
from gajim import dataforms_widget
from gajim import adhoc_commands
from gajim.gtk import AddNewContactWindow
from gajim.common.const import AvatarSize
from gajim.common.caps_cache import muc_caps_cache
from gajim.common import events
......@@ -61,18 +61,20 @@
from gajim.common.const import StyleAttr
from gajim.chat_control import ChatControl
from gajim.chat_control_base import ChatControlBase
from gajim.gtk.filechoosers import AvatarChooserDialog
from gajim.gtk import ErrorDialog
from gajim.gtk import InputTextDialog
from gajim.gtk import ConfirmationDialogCheck
from gajim.gtk import DoubleInputDialog
from gajim.gtk import InputDialog
from gajim.gtk import ChangeNickDialog
from gajim.command_system.implementation.hosts import PrivateChatCommands
from gajim.command_system.implementation.hosts import GroupChatCommands
from gajim.common.connection_handlers_events import GcMessageOutgoingEvent
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InputTextDialog
from gajim.gtk.dialogs import ConfirmationDialogCheck
from gajim.gtk.dialogs import DoubleInputDialog
from gajim.gtk.dialogs import InputDialog
from gajim.gtk.dialogs import ChangeNickDialog
from gajim.gtk.filechoosers import AvatarChooserDialog
from gajim.gtk.add_contact import AddNewContactWindow
log = logging.getLogger('gajim.groupchat_control')
......
......@@ -31,41 +31,3 @@
#
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.dialogs import InformationDialog
from gajim.gtk.dialogs import ChangeNickDialog
from gajim.gtk.dialogs import FTOverwriteConfirmationDialog
from gajim.gtk.dialogs import InputDialog
from gajim.gtk.dialogs import ConfirmationDialogDoubleRadio
from gajim.gtk.dialogs import InputDialogCheck
from gajim.gtk.dialogs import DoubleInputDialog
from gajim.gtk.dialogs import InputTextDialog
from gajim.gtk.dialogs import PlainConnectionDialog
from gajim.gtk.dialogs import ConfirmationDialogDoubleCheck
from gajim.gtk.dialogs import ConfirmationDialogCheck
from gajim.gtk.dialogs import YesNoDialog
from gajim.gtk.dialogs import WarningDialog
from gajim.gtk.dialogs import NonModalConfirmationDialog
from gajim.gtk.dialogs import ConfirmationDialog
from gajim.gtk.dialogs import AspellDictError
from gajim.gtk.dialogs import HigDialog
from gajim.gtk.dialogs import SSLErrorDialog
from gajim.gtk.dialogs import ChangePasswordDialog
from gajim.gtk.dialogs import NewConfirmationDialog
from gajim.gtk.about import AboutDialog
from gajim.gtk.join_groupchat import JoinGroupchatWindow
from gajim.gtk.add_contact import AddNewContactWindow
from gajim.gtk.start_chat import StartChatDialog
from gajim.gtk.xml_console import XMLConsoleWindow
from gajim.gtk.privacy_list import PrivacyListsWindow
from gajim.gtk.single_message import SingleMessageWindow
from gajim.gtk.server_info import ServerInfoDialog
from gajim.gtk.pep_config import ManagePEPServicesWindow
from gajim.gtk.bookmarks import ManageBookmarksWindow
from gajim.gtk.profile import ProfileWindow
from gajim.gtk.features import FeaturesDialog
from gajim.gtk.account_wizard import AccountCreationWizard
from gajim.gtk.service_registration import ServiceRegistration
from gajim.gtk.history import HistoryWindow
......@@ -27,7 +27,7 @@
from gajim.config import ManageProxiesWindow
from gajim.config import FakeDataForm
from gajim.gtk.util import get_builder
from gajim.gtk import ErrorDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim import gtkgui_helpers
from gajim import dataforms_widget
from gajim import gui_menu_builder
......
......@@ -19,7 +19,7 @@
from gajim.common import ged
from gajim.common import helpers
from gajim.common.i18n import _
from gajim.gtk import ErrorDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.util import get_builder
......@@ -205,7 +205,7 @@ def on_register_button_clicked(self, widget):
model = self.protocol_jid_combobox.get_model()
row = self.protocol_jid_combobox.get_active()
jid = model[row][0]
from gajim.gtk import ServiceRegistration
from gajim.gtk.service_registration import ServiceRegistration
ServiceRegistration(self.account, jid)
def _on_key_press(self, widget, event):
......
......@@ -19,7 +19,7 @@
from gajim.common import app
from gajim.common import helpers
from gajim.common.i18n import Q_
from gajim.gtk import ErrorDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.util import get_builder
......
......@@ -1015,3 +1015,18 @@ def _on_response(self, dialog, response):
if button.callback is not None:
button.callback()
self.destroy()
class ShortcutsWindow:
def __init__(self):
transient = app.app.get_active_window()
print(transient)
builder = get_builder('shortcuts_window.ui')
self.window = builder.get_object('shortcuts_window')
self.window.connect('destroy', self._on_window_destroy)
self.window.set_transient_for(transient)
self.window.show_all()
self.window.present()
def _on_window_destroy(self, widget):
self.window = None
......@@ -30,7 +30,7 @@
from gi.repository import GLib
from gajim import conversation_textview
from gajim.gtk import ErrorDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk import util
from gajim.gtk.util import python_month, gtk_month
from gajim.common import app
......
......@@ -20,7 +20,7 @@
from gajim.common import helpers
from gajim.common.caps_cache import muc_caps_cache
from gajim.common.exceptions import GajimGeneralException
from gajim.gtk import ErrorDialog
from gajim.gtk.dialogs import ErrorDialog
from gajim.gtk.util import get_builder
......
......@@ -19,9 +19,9 @@
from gajim.common import app
from gajim.common import ged
from gajim.gtk.util import get_builder
from gajim.gtk import HigDialog
from gajim.gtk.util import get_builder
from gajim.gtk.dialogs import HigDialog
log = logging.getLogger('gajim.gtk.mam_preferences')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment