Ejemplo n.º 1
0
 def category_register(self):
     if os.name == "nt":
         extension.category_register('idle timer', WindowsTimer.WindowsTimer,
             None, True)
     else:
         extension.category_register('idle timer', LinuxTimer,
             None, True)
Ejemplo n.º 2
0
    def _setup(self):
        """register core extensions"""
        extension.category_register("session", dummy.Session, single_instance=True)
        # extension.category_register('session', msn.Session,
        #        single_instance=True)
        if jabber is not None:
            extension.register("session", jabber.Session)
        extension.register("session", dummy.Session)
        # extension.register('session', msn.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", dummy.Session)

        # DBus extension stuffs
        if DBusController is not None:
            extension.category_register("external api", DBusController)
            extension.set_default("external api", DBusController)
            self.dbus_ext = extension.get_and_instantiate("external api")
        else:
            self.dbus_ext = None

        extension.category_register("sound", e3.common.play_sound.play)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
Ejemplo n.º 3
0
 def category_register(self):
     import songretriever
     extension.category_register(CATEGORY, songretriever.BaseMusicHandler,
                                 songretriever.BaseMusicHandler, True)
     if self._supported_version("2.11.12-devel"):
         extension.register('userpanel button', MusicButton.MusicButton)
     return True
Ejemplo n.º 4
0
    def category_register(self):
        import songretriever

        extension.category_register(CATEGORY, songretriever.BaseMusicHandler, songretriever.BaseMusicHandler, True)
        if self._supported_version("2.11.12-devel"):
            extension.register("userpanel button", MusicButton.MusicButton)
        return True
Ejemplo n.º 5
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session, single_instance=True)
        #extension.category_register('session', msn.Session,
        #        single_instance=True)
        extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        #extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', dummy.Session)

        #DBus extension stuffs
        extension.category_register('external api', DBusController)
        extension.set_default('external api', DBusController)
        self.dbus_ext = extension.get_and_instantiate('external api')
        
        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 6
0
 def category_register(self):
     if os.name == "nt":
         extension.category_register('idle timer', WindowsTimer.WindowsTimer,
             None, True)
     else: #TODO: add some unix extensions that works always
         if HAS_XLIB:
             extension.category_register('idle timer', XlibTimer.XlibTimer,
                 None, True)
Ejemplo n.º 7
0
 def category_register(self):
     if os.name == "nt":
         extension.category_register('idle timer',
                                     WindowsTimer.WindowsTimer, None, True)
     else:  #TODO: add some unix extensions that works always
         if HAS_XLIB:
             extension.category_register('idle timer', XlibTimer.XlibTimer,
                                         None, True)
Ejemplo n.º 8
0
def import_and_register(category_name, cls):
    try:
        imported_cls = __import__('gui.common.' + cls)
        if extension.get_category(category_name) is None:
            extension.category_register(category_name, eval(cls + '.' + cls))
        else:
            extension.register(category_name, eval(cls + '.' + cls))
        return imported_cls
    except ImportError:
        return None
Ejemplo n.º 9
0
def import_and_register(category_name, cls):
    try:
        imported_cls = __import__('gui.common.'+cls)
        if extension.get_category(category_name) is None:
            extension.category_register(category_name, eval(cls+'.'+cls))
        else:
            extension.register(category_name, eval(cls+'.'+cls))
        return imported_cls
    except ImportError:
        return None
Ejemplo n.º 10
0
def main():
    """
    the main method of emesene
    """
    extension.category_register("session", dummy.Session, single_instance=True)
    extension.category_register("option provider", None, interfaces=interfaces.IOptionProvider)
    extension.get_category("option provider").multi_extension = True
    extension.get_category("option provider").activate(ExtensionDefault)
    options = PluggableOptionParser(args=emesene_args)
    options.read_options()
    main_method = extension.get_default("main")
    main_method(Controller)
Ejemplo n.º 11
0
    def _setup(self):
        '''register core extensions'''
        #extension.category_register('session', dummy.Session,
        #        single_instance=True)
        #if Info.EMESENE_VERSION.endswith("dev"):
        #    extension.register('session', dummy.Session)

        #if webqq is not None:
        #    extension.register('session', webqq.Session)
        #    extension.set_default('session', webqq.Session)

        #if xmpp is not None:
        #    extension.register('session', xmpp.Session)
        #    extension.set_default('session', xmpp.Session)
            
        if whatsapp is not None:
            extension.register('session', whatsapp.Session)
            extension.set_default('session', whatsapp.Session)

        #if papylib is not None:
        #    extension.register('session', papylib.Session)
        #    extension.set_default('session', papylib.Session)

        #external API stuff
        self.dbus_ext = extension.get_and_instantiate('external api')
        self.network_checker = extension.get_and_instantiate(
            'network checker')

        self.unity_launcher = extension.get_and_instantiate('unity launcher')

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter', e3.Logger.ExporterTxt)
        extension.register('history exporter', e3.Logger.ExporterXml)
        extension.register('history exporter', e3.Logger.ExporterHtml)
        extension.register('history exporter', e3.Logger.ExporterCsv)
        extension.register('history exporter', e3.Logger.ExporterJSON)

        # ui callbacks for plugins
        extension.category_register('send message callback handler',
            e3.common.PriorityList, single_instance=True)
        extension.category_register('receive message callback handler',
            e3.common.PriorityList, single_instance=True)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 12
0
def main():
    """
    the main method of emesene
    """
    extension.category_register('session', msn.Session, single_instance=True)
    extension.category_register('option provider', None,
            interfaces=interfaces.IOptionProvider)
    extension.get_category('option provider').multi_extension = True
    extension.get_category('option provider').activate(ExtensionDefault)
    options = PluggableOptionParser(argv)
    options.read_options()
    main_method = extension.get_default('main')
    main_method(Controller)
Ejemplo n.º 13
0
def main():
    """
    the main method of emesene
    """
    extension.category_register('session', dummy.Session, single_instance=True)
    extension.category_register('option provider', None,
            interfaces=interfaces.IOptionProvider)
    extension.get_category('option provider').multi_extension = True
    extension.get_category('option provider').activate(ExtensionDefault)
    options = PluggableOptionParser(argv)
    options.read_options()
    main_method = extension.get_default('main')
    main_method(Controller)
Ejemplo n.º 14
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session',
                                    msn.Session,
                                    single_instance=True)
        extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', msn.Session)

        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                                    e3.common.notification.Notification)
        extension.category_register('history exporter',
                                    e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
        get_pluginmanager().scan_directory('plugins')
Ejemplo n.º 15
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', msn.Session,
                single_instance=True)
        extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)

        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
        get_pluginmanager().scan_directory('plugins')
Ejemplo n.º 16
0
    def _setup(self):
        """register core extensions"""
        extension.category_register("session", dummy.Session, single_instance=True)
        if xmpp is not None:
            extension.register("session", xmpp.Session)
        extension.register("session", dummy.Session)

        if webqq is not None:
            extension.register("session", webqq.Session)
        extension.register("session", dummy.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", dummy.Session)

        # external API stuff
        self.dbus_ext = extension.get_and_instantiate("external api")
        self.network_checker = extension.get_and_instantiate("network checker")

        self.unity_launcher = extension.get_and_instantiate("unity launcher")

        extension.category_register("sound", e3.common.Sounds.SoundPlayer, None, True)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)
        extension.register("history exporter", e3.Logger.save_logs_as_xml)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
Ejemplo n.º 17
0
def main():
    """
    the main method of emesene
    """
    #extension.category_register('session', dummy.Session, single_instance=True)
    extension.category_register('option provider', None,
            interfaces=interfaces.IOptionProvider)
    extension.register('quit', sys.exit)
    extension.get_category('option provider').multi_extension = True
    extension.get_category('option provider').activate(optionprovider.ExtensionDefault)
    options = optionprovider.PluggableOptionParser(args=emesene_args)
    options.read_options()
    main_method = extension.get_default('main')
    main_method(Controller)
Ejemplo n.º 18
0
    def _setup(self):
        """register core extensions"""
        extension.category_register("session", msn.Session, single_instance=True)
        extension.register("session", jabber.Session)
        extension.register("session", dummy.Session)
        extension.register("session", msn.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", msn.Session)

        extension.category_register("sound", e3.common.play_sound.play)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
        get_pluginmanager().scan_directory("plugins")
Ejemplo n.º 19
0
    def start(self, session):
        """start the plugin"""
        self.session = session

        extension.category_register(CATEGORY, songretriever.BaseMusicHandler, songretriever.BaseMusicHandler, True)
        self.extensions_register()

        extension.get_and_instantiate(CATEGORY, session)

        if hasattr(extension, "unregister"):
            extension.register("userpanel button", MusicButton.MusicButton, force_default=True)
        else:
            extension.register("userpanel button", MusicButton.MusicButton)

        return True
Ejemplo n.º 20
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session,
                single_instance=True)
        extension.register('session', dummy.Session)

        if webqq is not None:
            extension.register('session', webqq.Session)
            extension.set_default('session', webqq.Session)

        if xmpp is not None:
            extension.register('session', xmpp.Session)
            extension.set_default('session', xmpp.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)

        #external API stuff
        self.dbus_ext = extension.get_and_instantiate('external api')
        self.network_checker = extension.get_and_instantiate(
            'network checker')

        self.unity_launcher = extension.get_and_instantiate('unity launcher')

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter', e3.Logger.ExporterTxt)
        extension.register('history exporter', e3.Logger.ExporterXml)
        extension.register('history exporter', e3.Logger.ExporterHtml)
        extension.register('history exporter', e3.Logger.ExporterCsv)
        extension.register('history exporter', e3.Logger.ExporterJSON)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 21
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INFOBARERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.register('quit', gtk.main_quit)
    extension.set_default('quit', gtk.main_quit)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar manager', AvatarManager.AvatarManager)

    extension.category_register('preferences', Preferences.Preferences,
            single_instance=True)
    extension.category_register('login window', Login.Login)
    extension.category_register('connecting window', Login.ConnectingWindow)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('synch tool', SyncTool.SyncTool)
    if not check_gtk3():
        extension.category_register('avatar renderer', Renderers.AvatarRenderer)
        extension.category_register('nick renderer', Renderers.CellRendererPlus)
        extension.register('nick renderer', Renderers.CellRendererNoPlus)
    else:
        extension.category_register('avatar renderer', RenderersNew.AvatarRenderer)
        extension.category_register('nick renderer', RenderersNew.CellRendererPlus)
        extension.register('nick renderer', RenderersNew.CellRendererNoPlus)

    extension.category_register('user panel', UserPanel.UserPanel)

    extension.category_register('debug window', DebugWindow.DebugWindow)

    if not INFOBARERROR:
        extension.category_register('nice bar', InfoBar.NiceBar)
        extension.register('nice bar', NiceBar.NiceBar)
    else:
        extension.category_register('nice bar', NiceBar.NiceBar)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('call widget', CallWidget.CallWindow)
    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info',
                                ContactInfoRotate.ContactInfoRotate)
    extension.register('conversation info', ContactInfoList.ContactInfoList)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    extension.category_register('plugin window', \
        PluginWindow.PluginWindow)
    if not check_gtk3():
        extension.category_register('image area selector', ImageAreaSelector.ImageAreaSelectorDialog)
    else:
        extension.category_register('image area selector', ImageAreaSelectorNew.ImageAreaSelectorDialog)
    extension.category_register('filetransfer pool', FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register('filetransfer widget', FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register('conversation output', AdiumTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)

    extension.category_register('picture handler', PictureHandler.PictureHandler)
Ejemplo n.º 22
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session',
                                    dummy.Session,
                                    single_instance=True)
        if Info.EMESENE_VERSION.endswith("dev"):
            extension.register('session', dummy.Session)

        if webqq is not None:
            extension.register('session', webqq.Session)
            extension.set_default('session', webqq.Session)

        if xmpp is not None:
            extension.register('session', xmpp.Session)
            extension.set_default('session', xmpp.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)

        #external API stuff
        self.dbus_ext = extension.get_and_instantiate('external api')
        self.network_checker = extension.get_and_instantiate('network checker')

        handler = gui.base.TrayIconHandler(self.session, gui.theme,
                                           self.close_session)
        unitylaunchercls = extension.get_default('unity launcher')
        self.unity_launcher = unitylaunchercls(handler)

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                                    None, True)
        extension.category_register('notification',
                                    e3.common.notification.Notification)
        extension.category_register('history exporter', e3.Logger.ExporterTxt)
        extension.register('history exporter', e3.Logger.ExporterXml)
        extension.register('history exporter', e3.Logger.ExporterHtml)
        extension.register('history exporter', e3.Logger.ExporterCsv)
        extension.register('history exporter', e3.Logger.ExporterJSON)

        # ui callbacks for plugins
        extension.category_register('send message callback handler',
                                    e3.common.PriorityList,
                                    single_instance=True)
        extension.category_register('receive message callback handler',
                                    e3.common.PriorityList,
                                    single_instance=True)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 23
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INFOBARERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.register('quit', gtk.main_quit)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar manager', AvatarManager.AvatarManager)

    extension.category_register('preferences',
                                Preferences.Preferences,
                                single_instance=True)
    extension.category_register('login window', Login.Login)
    extension.category_register('connecting window', Login.ConnectingWindow)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('synch tool', SyncTool.SyncTool)
    if not check_gtk3():
        extension.category_register('avatar renderer',
                                    Renderers.AvatarRenderer)
        extension.category_register('nick renderer',
                                    Renderers.CellRendererPlus)
        extension.register('nick renderer', Renderers.CellRendererNoPlus)
        extension.register('smiley label', Renderers.SmileyLabel)
    else:
        extension.category_register('avatar renderer',
                                    RenderersNew.AvatarRenderer)
        extension.category_register('nick renderer',
                                    RenderersNew.CellRendererPlus)
        extension.register('nick renderer', RenderersNew.CellRendererNoPlus)
        extension.register('smiley label', RenderersNew.SmileyLabel)

    extension.category_register('user panel', UserPanel.UserPanel)

    extension.category_register('debug window', DebugWindow.DebugWindow)

    if not INFOBARERROR:
        extension.category_register('nice bar', InfoBar.NiceBar)
        extension.register('nice bar', NiceBar.NiceBar)
    else:
        extension.category_register('nice bar', NiceBar.NiceBar)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('call widget', CallWidget.CallWindow)
    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info',
                                ContactInfoRotate.ContactInfoRotate)
    extension.register('conversation info', ContactInfoList.ContactInfoList)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    if not check_gtk3():
        extension.category_register('image area selector',
                                    ImageAreaSelector.ImageAreaSelectorDialog)
        extension.category_register('tiny button', TinyButton.TinyButton)
    else:
        extension.category_register(
            'image area selector',
            ImageAreaSelectorNew.ImageAreaSelectorDialog)
        extension.category_register('tiny button', TinyButtonNew.TinyButton)

    extension.category_register('filetransfer pool',
                                FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register('filetransfer widget',
                                FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register('conversation output',
                                    AdiumTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)

    extension.category_register('picture handler',
                                PictureHandler.PictureHandler)
    extension.category_register('toolkit tags', utils.GTKTags)
Ejemplo n.º 24
0
 def category_register(self):
     extension.category_register(CATEGORY, songretriever.MusicHandler, songretriever.MusicHandler, True)
     return True
Ejemplo n.º 25
0
def setup():
    """
    define all the components for a Qt4 environment
    """
    # pylint: disable=W0403
    import AvatarChooser
    import Conversation
    import DebugWindow
    import Dialog
    import Notifier
    import PictureHandler
    import Preferences
    import TopLevelWindow
    import TrayIcon
    import menus
    import pages
    import widgets

    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('debug window', DebugWindow.DebugWindow)
    extension.category_register('notificationGUI', Notifier.Notifier)
    extension.category_register('preferences',
                                Preferences.Preferences,
                                single_instance=True)
    extension.category_register('window frame', TopLevelWindow.TopLevelWindow)
    extension.category_register('tray icon', TrayIcon.TrayIcon)
    #FIXME:
    extension.set_default('tray icon', TrayIcon.TrayIcon)

    extension.category_register('connecting window', pages.ConnectingPage)
    extension.category_register('conversation window', pages.ConversationPage)
    extension.category_register('login window', pages.LoginPage)
    extension.category_register('main window', pages.MainPage)

    extension.category_register('contact list', widgets.ContactList)
    extension.category_register('conversation input', widgets.ChatInput)
    extension.category_register('conversation toolbar',
                                widgets.ConversationToolbar)
    extension.category_register('avatar', widgets.DisplayPic)
    extension.category_register('image area selector',
                                widgets.ImageAreaSelector)
    extension.category_register('nick edit', widgets.NickEdit)
    extension.category_register('smiley chooser', widgets.SmileyPopupChooser)
    extension.category_register('status combo', widgets.StatusCombo)
    # TODO: change this extension's name to 'conversation header' ??
    extension.category_register('info panel', widgets.UserInfoPanel)
    #extension.category_register('filetransfer widget', widgets.FileTransfer)
    try:
        import PyQt4.QtWebKit
        extension.category_register('conversation output',
                                    widgets.AdiumChatOutput)
        extension.register('conversation output', widgets.ChatOutput)
    except:
        extension.category_register('conversation output', widgets.ChatOutput)

    extension.category_register('main menu', menus.MainMenu)
    extension.category_register('menu file', menus.FileMenu)
    extension.category_register('menu actions', menus.ActionsMenu)
    extension.category_register('menu options', menus.OptionsMenu)
    extension.category_register('menu help', menus.HelpMenu)

    extension.category_register('menu contact', menus.ContactMenu)
    extension.category_register('menu group', menus.GroupMenu)
    extension.category_register('menu profile', menus.ProfileMenu)
    extension.category_register('menu status', menus.StatusMenu)

    extension.category_register('tray main menu', menus.TrayMainMenu)
    extension.category_register('tray login menu', menus.TrayLoginMenu)

    extension.category_register('picture handler',
                                PictureHandler.PictureHandler)
Ejemplo n.º 26
0
        if sys.executable.endswith("portable.exe") or \
           sys.executable.endswith("portable_debug.exe"):
            os.environ['APPDATA'] = path
        return path

    this_module_path = os.path.dirname(unicode(__file__,
        sys.getfilesystemencoding()))

    return os.path.abspath(this_module_path)

os.chdir(os.path.abspath(project_path()))

from Language import Language
import extension

extension.category_register('language', Language, 
                            single_instance=True)

language_management = extension.get_and_instantiate('language')
language_management.install_default_translation()

if 'USE_GI' in os.environ:
    try:
        import pygicompat
    except ImportError:
        print "error: pygi compat not found"
        pass

import glib
import shutil
import signal
import Info
Ejemplo n.º 27
0
#    the Free Software Foundation; either version 3 of the License, or
#    (at your option) any later version.
#
#    emesene is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with emesene; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
"""Dummy Implementation of a Network Manager."""

import logging
log = logging.getLogger("emesene.e3.common.NetworkManagerHelper")
import extension

class DummyNetworkChecker():
    ''' this class does lazy checks for network availability and 
    disconnects emesene if the network goes down '''

    #Public methods
    def set_new_session(self, session):
        pass

    def stop(self):
        pass

extension.category_register('network checker', DummyNetworkChecker)
extension.set_default('network checker', DummyNetworkChecker)
Ejemplo n.º 28
0
def setup():
    """
    define all the components for a Qt4 environment
    """
    # pylint: disable=W0403
    import AvatarChooser
    import Conversation
    import DebugWindow
    import Dialog
    import Notifier
    import PictureHandler
    import Preferences
    import TopLevelWindow
    import TrayIcon
    import menus
    import pages
    import widgets

    
    extension.category_register('avatar chooser',  AvatarChooser.AvatarChooser)
    extension.category_register('conversation',    Conversation.Conversation)
    extension.category_register('dialog',          Dialog.Dialog)
    extension.category_register('debug window',    DebugWindow.DebugWindow)
    extension.category_register('notificationGUI', Notifier.Notifier)
    extension.category_register('preferences',     Preferences.Preferences,
                                                   single_instance=True)
    extension.category_register('window frame',  TopLevelWindow.TopLevelWindow)
    extension.category_register('tray icon',       TrayIcon.TrayIcon)
    #FIXME:
    extension.set_default('tray icon', TrayIcon.TrayIcon)

    extension.category_register('connecting window',   pages.ConnectingPage)
    extension.category_register('conversation window', pages.ConversationPage)
    extension.category_register('login window',        pages.LoginPage)
    extension.category_register('main window',         pages.MainPage)
    
    
    extension.category_register('contact list',        widgets.ContactList)
    extension.category_register('conversation input',  widgets.ChatInput)
    extension.category_register('conversation toolbar',  widgets.ConversationToolbar)
    extension.category_register('avatar',              widgets.DisplayPic)
    extension.category_register('image area selector', 
                                                    widgets.ImageAreaSelector)
    extension.category_register('nick edit',           widgets.NickEdit)
    extension.category_register('smiley chooser',   widgets.SmileyPopupChooser)
    extension.category_register('status combo',        widgets.StatusCombo)
    # TODO: change this extension's name to 'conversation header' ??
    extension.category_register('info panel',          widgets.UserInfoPanel)
    #extension.category_register('filetransfer widget', widgets.FileTransfer)
    try:
        import PyQt4.QtWebKit
        extension.category_register('conversation output',
                                                  widgets.AdiumChatOutput)
        extension.register('conversation output', widgets.ChatOutput)
    except:
        extension.category_register('conversation output', widgets.ChatOutput)
        
    extension.category_register('main menu',    menus.MainMenu)
    extension.category_register('menu file',    menus.FileMenu)
    extension.category_register('menu actions', menus.ActionsMenu)
    extension.category_register('menu options', menus.OptionsMenu)
    extension.category_register('menu help',    menus.HelpMenu)
    
    extension.category_register('menu contact', menus.ContactMenu)
    extension.category_register('menu group',   menus.GroupMenu)
    extension.category_register('menu profile', menus.ProfileMenu)
    extension.category_register('menu status',  menus.StatusMenu)
    
    extension.category_register('tray main menu',  menus.TrayMainMenu)
    extension.category_register('tray login menu', menus.TrayLoginMenu)
    
    extension.category_register('picture handler', 
                                PictureHandler.PictureHandler)
Ejemplo n.º 29
0
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    gtk.quit_add(0, controller.on_close)
    gtk.main()
    gtk.gdk.threads_leave()


gtk_main.NAME = "Gtk main function"
gtk_main.DESCRIPTION  = "This extensions uses Gtk to build the GUI"
gtk_main.AUTHOR = "marianoguerra"
gtk_main.WEBSITE = "emesene.org"

extension.category_register('main', gtk_main)

def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INDICATORERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('image chooser', ImageChooser.ImageChooser)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar renderer', Renderers.AvatarRenderer)
Ejemplo n.º 30
0
    def stop(self):
        pass

    def connected_cb(self):
        self.connected = True

    def connected_info_cb(self):
        self.connected = True

    def disconnected_cb(self):
        self.connected = False
        # 1 means reconnect
        self.__session.add_event(Event.EVENT_DISCONNECTED, 'Network error', 1)


extension.category_register('network checker', Win32NetworkChecker)
extension.set_default('network checker', Win32NetworkChecker)

if __name__ == '__main__':
    # Run an expample of the code so that the user can test the code in
    # real life.
    from threading import Thread

    def connected():
        print 'Connected'

    def connected_info():
        print 'Connected'

    def disconnected():
        print 'Disconnected'
Ejemplo n.º 31
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INDICATORERROR

    import gtk

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('image chooser', ImageChooser.ImageChooser)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar manager', AvatarManager.AvatarManager)
    extension.category_register('avatar renderer', Renderers.AvatarRenderer)

    extension.category_register('preferences', Preferences.Preferences)
    extension.category_register('login window', Login.Login)
    extension.category_register('connecting window', Login.ConnectingWindow)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('nick renderer', Renderers.CellRendererPlus)
    extension.register('nick renderer', gtk.CellRendererText)
    extension.register('nick renderer', Renderers.CellRendererNoPlus)
    extension.register('nick renderer', Renderers.GtkCellRenderer)
    extension.category_register('user panel', UserPanel.UserPanel)
    if not INDICATORERROR:
        extension.category_register('tray icon', Indicator.Indicator)
        extension.register('tray icon', TrayIcon.TrayIcon)
    else:
        extension.category_register('tray icon', TrayIcon.TrayIcon)
    extension.category_register('debug window', DebugWindow.DebugWindow)
    extension.category_register('nice bar', NiceBar.NiceBar)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info', ContactInfo.ContactInfo)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    extension.category_register('plugin window', \
        PluginWindow.PluginWindow)
    extension.category_register('preferences dialog', config_gtk.build_window)
    extension.category_register('image area selector',
                                ImageAreaSelector.ImageAreaSelectorDialog)
    extension.category_register('filetransfer pool',
                                FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register('filetransfer widget',
                                FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register('conversation output',
                                    AdiumTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)
Ejemplo n.º 32
0
 def __init__(self):
     extension.category_register('bar', IBar)
     extension.category_register('xyz')
     extension.category_register('magic')
Ejemplo n.º 33
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session',
                                    dummy.Session,
                                    single_instance=True)
        #extension.category_register('session', msn.Session,
        #        single_instance=True)
        if jabber is not None:
            extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        #extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', dummy.Session)

        #DBus extension stuffs
        if DBusController is not None:
            extension.category_register('external api', DBusController)
            extension.set_default('external api', DBusController)
            self.dbus_ext = extension.get_and_instantiate('external api')
        else:
            self.dbus_ext = None

        if DBusNetworkChecker is not None:
            extension.category_register('network checker', DBusNetworkChecker)
            extension.set_default('network checker', DBusNetworkChecker)
            self.network_checker = extension.get_and_instantiate(
                'network checker')
        else:
            self.network_checker = None

        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                                    e3.common.notification.Notification)
        extension.category_register('history exporter',
                                    e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 34
0
 def category_register(self):
     import songretriever
     extension.category_register(CATEGORY, songretriever.BaseMusicHandler, songretriever.BaseMusicHandler, True)
     if self.version_value(Handler.EMESENE_VERSION) > self.version_value("2.11.12-devel"):
         extension.register('userpanel button', MusicButton.MusicButton)
     return True
Ejemplo n.º 35
0
            self.connected = False
        # in doubt (STATE_UNKNOWN), assume connected
        elif state in (NetworkManagerHelper.NM_STATE_CONNECTED_GLOBAL,
                       NetworkManagerHelper.NM_STATE_CONNECTED,
                       NetworkManagerHelper.NM_STATE_UNKNOWN):
            self.connected = True
        else:
            self.connected = False

        if not self.connected:
            # 1 means reconnect
            self.__session.add_event(Event.EVENT_DISCONNECTED, 'Network error',
                                     1)


extension.category_register('network checker', DBusNetworkChecker)
extension.set_default('network checker', DBusNetworkChecker)


class ModemManagerHelper(object):

    # data taken from
    #  http://projects.gnome.org/NetworkManager/developers/mm-spec-04.html
    MM_DBUS_IFACE = "org.freedesktop.ModemManager"
    MM_DBUS_IFACE_MODEM = MM_DBUS_IFACE + ".Modem"

    # MM_MODEM_TYPE
    MM_MODEM_TYPE_GSM = 1
    MM_MODEM_TYPE_CDMA = 2

    # GSM
Ejemplo n.º 36
0
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    extension.set_default("quit", gtk.main_quit)
    gtk.main()
    gtk.gdk.threads_leave()


gtk_main.NAME = "Gtk main function"
gtk_main.DESCRIPTION = "This extensions uses Gtk to build the GUI"
gtk_main.AUTHOR = "marianoguerra"
gtk_main.WEBSITE = "emesene.org"

extension.category_register("main", gtk_main)


def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INFOBARERROR

    import gtk

    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.register("quit", gtk.main_quit)

    extension.category_register("dialog", Dialog.Dialog)
Ejemplo n.º 37
0
    gobject.threads_init()
    gtk.gdk.threads_init()
    gtk.gdk.threads_enter()
    controller = Controller()
    controller.start()
    extension.set_default('quit', gtk.main_quit)
    gtk.main()
    gtk.gdk.threads_leave()


gtk_main.NAME = "Gtk main function"
gtk_main.DESCRIPTION = "This extensions uses Gtk to build the GUI"
gtk_main.AUTHOR = "marianoguerra"
gtk_main.WEBSITE = "emesene.org"

extension.category_register('main', gtk_main)


def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INFOBARERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.register('quit', gtk.main_quit)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
Ejemplo n.º 38
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INFOBARERROR

    import gtk

    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.register("quit", gtk.main_quit)

    extension.category_register("dialog", Dialog.Dialog)
    extension.category_register("avatar chooser", AvatarChooser.AvatarChooser)
    extension.category_register("avatar", Avatar.Avatar)
    extension.category_register("avatar manager", AvatarManager.AvatarManager)

    extension.category_register("preferences", Preferences.Preferences, single_instance=True)
    extension.category_register("login window", Login.Login)
    extension.category_register("connecting window", Login.ConnectingWindow)
    extension.category_register("window frame", Window.Window)
    extension.category_register("main window", MainWindow.MainWindow)
    extension.category_register("contact list", ContactList.ContactList)
    extension.category_register("synch tool", SyncTool.SyncTool)
    if not check_gtk3():
        extension.category_register("avatar renderer", Renderers.AvatarRenderer)
        extension.category_register("nick renderer", Renderers.CellRendererPlus)
        extension.register("nick renderer", Renderers.CellRendererNoPlus)
    else:
        extension.category_register("avatar renderer", RenderersNew.AvatarRenderer)
        extension.category_register("nick renderer", RenderersNew.CellRendererPlus)
        extension.register("nick renderer", RenderersNew.CellRendererNoPlus)

    extension.category_register("user panel", UserPanel.UserPanel)

    extension.category_register("debug window", DebugWindow.DebugWindow)

    if not INFOBARERROR:
        extension.category_register("nice bar", InfoBar.NiceBar)
        extension.register("nice bar", NiceBar.NiceBar)
    else:
        extension.category_register("nice bar", NiceBar.NiceBar)

    extension.category_register("main menu", MainMenu.MainMenu)
    extension.category_register("menu file", MainMenu.FileMenu)
    extension.category_register("menu actions", MainMenu.ActionsMenu)
    extension.category_register("menu options", MainMenu.OptionsMenu)
    extension.category_register("menu contact", ContactMenu.ContactMenu)
    extension.category_register("menu group", GroupMenu.GroupMenu)
    extension.category_register("menu account", AccountMenu.AccountMenu)
    extension.category_register("menu help", MainMenu.HelpMenu)
    extension.category_register("menu status", StatusMenu.StatusMenu)

    extension.category_register("below menu", EmptyWidget.EmptyWidget)
    extension.category_register("below panel", EmptyWidget.EmptyWidget)
    extension.category_register("below userlist", EmptyWidget.EmptyWidget)

    extension.category_register("call widget", CallWidget.CallWindow)
    extension.category_register("conversation window", ConversationManager.ConversationManager)
    extension.category_register("conversation", Conversation.Conversation)
    extension.category_register("conversation header", Header.Header)
    extension.category_register("conversation info", ContactInfoRotate.ContactInfoRotate)
    extension.register("conversation info", ContactInfoList.ContactInfoList)
    extension.category_register("conversation tab", TabWidget.TabWidget)
    extension.category_register("conversation input", TextBox.InputText)
    extension.category_register("conversation toolbar", ConversationToolbar.ConversationToolbar)
    if not check_gtk3():
        extension.category_register("image area selector", ImageAreaSelector.ImageAreaSelectorDialog)
    else:
        extension.category_register("image area selector", ImageAreaSelectorNew.ImageAreaSelectorDialog)
    extension.category_register("filetransfer pool", FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register("filetransfer widget", FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register("conversation output", AdiumTextBox.OutputText)
        extension.register("conversation output", TextBox.OutputText)
    else:
        extension.category_register("conversation output", TextBox.OutputText)

    extension.category_register("picture handler", PictureHandler.PictureHandler)
Ejemplo n.º 39
0
 def category_register(self):
     extension.category_register(CATEGORY, songretriever.MusicHandler,
                                 songretriever.MusicHandler, True)
     return True
Ejemplo n.º 40
0
def setup():
    """
    define all the components for a gtk environment
    """
    import gtk

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('image chooser', ImageChooser.ImageChooser)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)

    extension.category_register('preferences', Preferences.Preferences)
    extension.category_register('login window', Login.Login)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('nick renderer', ContactList.CellRendererPlus)
    extension.register('nick renderer', gtk.CellRendererText)
    extension.register('nick renderer', ContactList.CellRendererNoPlus)
    extension.category_register('user panel', UserPanel.UserPanel)
    extension.category_register('tray icon', TrayIcon.TrayIcon)
    extension.category_register('debug window', DebugWindow.DebugWindow)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info', ContactInfo.ContactInfo)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    extension.category_register('plugin window', \
        PluginWindow.PluginWindow)
    extension.category_register('preferences dialog', config_gtk.build_window)

    if not WebKitTextBox.ERROR:
        extension.category_register('conversation output', WebKitTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)
Ejemplo n.º 41
0
        if ps != -1:
            return ("plugin", file_name[:ps])
        else:
            return (None, None)

    def get_path(self, type_, label):
        ''' Get the path of the plugin'''
        return label

class SupportedPluginsCollection(PluginsCollection):
    def __init__(self, dest_folder):
        PluginsCollection.__init__(self, 'emesene-supported-plugins',
                                   dest_folder)

extension.category_register('supported plugins collection',
                            SupportedPluginsCollection, single_instance=True)

class CommunityPluginsCollection(PluginsCollection):
    def __init__(self, dest_folder):
        PluginsCollection.__init__(self, 'emesene-community-plugins',
                                   dest_folder)

extension.category_register('community plugins collection',
                            CommunityPluginsCollection, single_instance=True)

class ThemesCollection(Collection):

    def plugin_name_from_file(self, file_name):

        ps = file_name.find("/")
        ps = file_name.find("/", ps + 1)
Ejemplo n.º 42
0
 def category_register(self):
     extension.category_register('idle timer', OSTimer,
             None, True)
Ejemplo n.º 43
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INDICATORERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('image chooser', ImageChooser.ImageChooser)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar renderer', Renderers.AvatarRenderer)

    extension.category_register('preferences', Preferences.Preferences)
    extension.category_register('login window', Login.Login)
    extension.category_register('connecting window', Login.ConnectingWindow)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('nick renderer', Renderers.CellRendererPlus)
    extension.register('nick renderer', Renderers.CellRendererNoPlus)
    extension.category_register('user panel', UserPanel.UserPanel)

    if not INDICATORERROR:
        extension.category_register('tray icon', Indicator.Indicator)
        extension.register('tray icon', TrayIcon.TrayIcon)
    else:
        extension.category_register('tray icon', TrayIcon.TrayIcon)

    extension.category_register('debug window', DebugWindow.DebugWindow)
    extension.category_register('nice bar', NiceBar.NiceBar)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info', ContactInfo.ContactInfo)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    extension.category_register('plugin window', \
        PluginWindow.PluginWindow)
    extension.category_register('preferences dialog', config_gtk.build_window)
    extension.category_register('image area selector', ImageAreaSelector.ImageAreaSelectorDialog)
    extension.category_register('filetransfer pool', FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register('filetransfer widget', FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register('conversation output', AdiumTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)

    try:
        import PyNotification
        extension.category_register(('notificationGUI'), PyNotification.pyNotification)
        extension.register(('notificationGUI'), GtkNotification.gtkNotification)
    except:
        extension.category_register(('notificationGUI'), GtkNotification.gtkNotification)
    
    extension.category_register('picture handler', PictureHandler.PictureHandler)
Ejemplo n.º 44
0
        if ps != -1:
            return ("plugin", file_name[:ps])
        else:
            return (None, None)

    def get_path(self, type_, label):
        ''' Get the path of the plugin'''
        return label

class SupportedPluginsCollection(PluginsCollection):
    def __init__(self, dest_folder):
        PluginsCollection.__init__(self, 'emesene-supported-plugins',
                                   dest_folder)

extension.category_register('supported plugins collection',
                            SupportedPluginsCollection, single_instance=True)

class CommunityPluginsCollection(PluginsCollection):
    def __init__(self, dest_folder):
        PluginsCollection.__init__(self, 'emesene-community-plugins',
                                   dest_folder)

extension.category_register('community plugins collection',
                            CommunityPluginsCollection, single_instance=True)

class ThemesCollection(Collection):

    def plugin_name_from_file(self, file_name):

        ps = file_name.find("/")
        ps = file_name.find("/", ps + 1)
Ejemplo n.º 45
0
    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session,
                single_instance=True)
        #extension.category_register('session', msn.Session,
        #        single_instance=True)
        if jabber is not None:
            extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        #extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', dummy.Session)

        #DBus extension stuffs
        if DBusController is not None:
            extension.category_register('external api', DBusController)
            extension.set_default('external api', DBusController)
            self.dbus_ext = extension.get_and_instantiate('external api')
        else:
            self.dbus_ext = None

        if DBusNetworkChecker is not None:
            extension.category_register('network checker', DBusNetworkChecker)
            extension.set_default('network checker', DBusNetworkChecker)
            self.network_checker = extension.get_and_instantiate(
                    'network checker')
        else:
            self.network_checker = None

        if UnityLauncher is not None:
            extension.category_register('unity launcher', UnityLauncher)
            extension.set_default('unity launcher', UnityLauncher)
            self.unity_launcher = extension.get_and_instantiate(
                    'unity launcher', self.close_session)
        else:
            self.unity_launcher = None

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
Ejemplo n.º 46
0
def setup():
    """
    define all the components for a gtk environment
    """
    global WEBKITERROR, INDICATORERROR, INFOBARERROR, PYNOTIFYERROR

    import gtk
    gtk.settings_get_default().set_property("gtk-error-bell", False)

    extension.category_register('dialog', Dialog.Dialog)
    extension.category_register('image chooser', ImageChooser.ImageChooser)
    extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
    extension.category_register('avatar', Avatar.Avatar)
    extension.category_register('avatar renderer', Renderers.AvatarRenderer)

    extension.category_register('preferences', Preferences.Preferences,
            single_instance=True)
    extension.category_register('login window', Login.Login)
    extension.category_register('connecting window', Login.ConnectingWindow)
    extension.category_register('window frame', Window.Window)
    extension.category_register('main window', MainWindow.MainWindow)
    extension.category_register('contact list', ContactList.ContactList)
    extension.category_register('synch tool', SyncTool.SyncTool)
    extension.category_register('nick renderer', Renderers.CellRendererPlus)
    extension.register('nick renderer', Renderers.CellRendererNoPlus)
    extension.category_register('user panel', UserPanel.UserPanel)

    if not INDICATORERROR:
        extension.category_register('tray icon', Indicator.Indicator)
        extension.register('tray icon', TrayIcon.TrayIcon)
    else:
        extension.category_register('tray icon', TrayIcon.TrayIcon)

    extension.category_register('debug window', DebugWindow.DebugWindow)

    if not INFOBARERROR:
        extension.category_register('nice bar', InfoBar.NiceBar)
        extension.register('nice bar', NiceBar.NiceBar)
    else:
        extension.category_register('nice bar', NiceBar.NiceBar)

    extension.category_register('main menu', MainMenu.MainMenu)
    extension.category_register('menu file', MainMenu.FileMenu)
    extension.category_register('menu actions', MainMenu.ActionsMenu)
    extension.category_register('menu options', MainMenu.OptionsMenu)
    extension.category_register('menu contact', ContactMenu.ContactMenu)
    extension.category_register('menu group', GroupMenu.GroupMenu)
    extension.category_register('menu account', AccountMenu.AccountMenu)
    extension.category_register('menu help', MainMenu.HelpMenu)
    extension.category_register('menu status', StatusMenu.StatusMenu)

    extension.category_register('below menu', EmptyWidget.EmptyWidget)
    extension.category_register('below panel', EmptyWidget.EmptyWidget)
    extension.category_register('below userlist', EmptyWidget.EmptyWidget)

    extension.category_register('call widget', CallWidget.CallWindow)
    extension.category_register('conversation window', \
        ConversationManager.ConversationManager)
    extension.category_register('conversation', Conversation.Conversation)
    extension.category_register('conversation header', Header.Header)
    extension.category_register('conversation info', ContactInfo.ContactInfo)
    extension.category_register('conversation tab', TabWidget.TabWidget)
    extension.category_register('conversation input', TextBox.InputText)
    extension.category_register('conversation toolbar', \
        ConversationToolbar.ConversationToolbar)
    extension.category_register('plugin window', \
        PluginWindow.PluginWindow)
    extension.category_register('preferences dialog', config_gtk.build_window)
    extension.category_register('image area selector', ImageAreaSelector.ImageAreaSelectorDialog)
    extension.category_register('filetransfer pool', FileTransferBarWidget.FileTransferBarWidget)
    extension.category_register('filetransfer widget', FileTransferWidget.FileTransferWidget)

    if not WEBKITERROR:
        extension.category_register('conversation output', AdiumTextBox.OutputText)
        extension.register('conversation output', TextBox.OutputText)
    else:
        extension.category_register('conversation output', TextBox.OutputText)

    if not PYNOTIFYERROR:
        extension.category_register(('notificationGUI'), ThemeNotification.themeNotification)
        extension.register(('notificationGUI'), PyNotification.pyNotification)
        extension.register(('notificationGUI'), GtkNotification.gtkNotification)
    else: #leave this here for Windows users!
        extension.category_register(('notificationGUI'), GtkNotification.gtkNotification)
    
    extension.category_register('picture handler', PictureHandler.PictureHandler)