Beispiel #1
0
    def __init__(self, reactor, plugins, plugins_dir, parent=None):
        super(MainDialog, self).__init__(parent)
        self.reactor = reactor
        self.setupUi(self)
        self.settings = Settings(self)

        self.anim = QPropertyAnimation(self, 'windowOpacity')
        self.anim.setDuration(1000)
        self.anim.setStartValue(0)
        self.anim.setEndValue(self.settings.moderatOpacity)
        self.anim.start()

        self.clientsTable.horizontalHeader().setStyleSheet('background: none;')

        # Multi Lang
        self.translate = Translate(self)
        self.MString = lambda _word: self.translate.word(_word)
        self.theme = Theme(self)

        # Init Log Dir
        if not os.path.exists(self.DATA):
            os.makedirs(self.DATA)
        self.assets = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                                   'assets')
        self.flags = os.path.join(self.assets, 'flags')
        self.plugins = plugins
        self.plugins_dir = plugins_dir
        self.directServerRunning = False
        self.filter = Filter(self)
        # Setup Settings
        self.set_config()
        self.pagination = pagination.Pagination(self)
        self.tables = tables.updateClientsTable(self)
        # Init UI
        self.ui = ui.updateUi(self)
        # Init Tray
        self.tray = tray.ModeratTrayIcon(self)
        self.rmenu = rmenu.moderatRightClickMenu(self)
        # Session ID
        self.session_id = None
        # Privileges
        self.privs = 0
        # Checkers
        self.moderators_checker = None
        self.clients_checker = None
        # Create Protocol
        self.create_server_protocol()
        self.create_moderator_protocol()
        # Init Triggers
        triggers.ModeratTriggers(self)
        # Init Shortcuts
        shortcuts.ModeratShortcuts(self)
        # Create Actions Object
        self.action = Actions(self)
        # Create Modes Object
        self.modes = Modes(self)

        self.onlineLoading = loading.Loading(self.clientsTabs)
        self.onlineLoading.hide()
        self.showMaximized()
Beispiel #2
0
 def __init__(self, reactor, plugins, plugins_dir, parent=None):
     super(MainDialog, self).__init__(parent)
     self.reactor = reactor
     self.setupUi(self)
     # Init Log Dir
     if not os.path.exists(self.DATA):
         os.makedirs(self.DATA)
     # Initial Folders
     self.assets = os.path.join(os.path.dirname(sys.argv[0]), 'assets')
     self.flags = os.path.join(self.assets, 'flags')
     self.plugins = plugins
     self.plugins_dir = plugins_dir
     # Setup Language
     self.set_language()
     # Init Settings
     self.config = Config()
     self.settings = Settings(self)
     self.rmenu = rmenu.moderatRightClickMenu(self)
     self.SERVER_HOST = self.config.ip_address
     self.SERVER_PORT = self.config.port
     # Session ID
     self.session_id = None
     # Privileges
     self.privs = 0
     # Checkers
     self.moderators_checker = None
     self.clients_checker = None
     # Create Protocol
     self.create_moderator_protocol()
     # Init Triggers
     triggers.moderatTriggers(self)
     # Init Shortcuts
     shortcuts.moderatShortcuts(self)
     # Create Actions Object
     self.action = Actions(self)
     # Create Modes Object
     self.modes = Modes(self)