• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python extension.get_default函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中extension.get_default函数的典型用法代码示例。如果您正苦于以下问题:Python get_default函数的具体用法?Python get_default怎么用?Python get_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_default函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, handler, session):
        """
        constructor

        handler -- e3common.Handler.ActionsHandler
        """
        gtk.Menu.__init__(self)
        self.handler = handler

        ContactsMenu = extension.get_default('menu contact')
        GroupsMenu = extension.get_default('menu group')
        AccountMenu = extension.get_default('menu account')

        self.contact = gtk.ImageMenuItem(_('_Contact'))
        self.contact.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        self.contact_menu = ContactsMenu(self.handler.contact_handler, session)
        self.contact.set_submenu(self.contact_menu)
        self.group = gtk.ImageMenuItem(_('_Group'))
        self.group.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.group_chat))
        self.group_menu = GroupsMenu(self.handler.group_handler, session)
        self.group.set_submenu(self.group_menu)
        self.account = gtk.ImageMenuItem(_('_Account'))
        self.account.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))

        self.account_menu = AccountMenu(self.handler.my_account_handler)
        self.myaccount = gtk.ImageMenuItem(_('_Profile'))
        self.myaccount.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        self.myaccount.set_submenu(self.account_menu)

        self.append(self.contact)
        self.append(self.group)
        self.append(self.myaccount)
开发者ID:Narciso91,项目名称:emesene,代码行数:32,代码来源:MainMenu.py


示例2: _setup_main_menu

    def _setup_main_menu(self, session, contact_list, on_close, on_disconnect):
        '''build all the menus used on the client'''
        
        # retrieving classes:
        dialog_cls = extension.get_default('dialog')
        avatar_manager_cls = extension.get_default('avatar manager')
        # creating the avatar manager:
        avatar_manager = None #avatar_manager_cls(self._session)
        
        # create menu handlers
        menu_hnd = gui.base.MenuHandler(session, dialog_cls, contact_list,  
                                        on_disconnect, on_close)

        contact_hnd = gui.base.ContactHandler(session, dialog_cls,
                                              contact_list)
        group_hnd = gui.base.GroupHandler(session, dialog_cls,
                                          contact_list)
        # retrieve menu classes
        main_menu_cls = extension.get_default('main menu')
        contact_menu_cls = extension.get_default('menu contact')
        group_menu_cls = extension.get_default('menu group')
        
        # instantiate menu objects:
        menu = main_menu_cls(menu_hnd, session.config)

#        self._contact_menu = contact_menu_cls(contact_hnd)
#        self._group_menu = group_menu_cls(group_hnd)
#        self._contact_menu.show_all()
#        self._group_menu.show_all()
        self.setMenuBar(menu)
开发者ID:GunioRobot,项目名称:emesene,代码行数:30,代码来源:TopLevelWindow.py


示例3: on_contact_list_ready

    def on_contact_list_ready(self):
        '''callback called when the contact list is ready to be used'''
        self.window.content.contact_list.fill()

        def on_contact_added_you(responses):
            '''
            callback called when the dialog is closed
            '''
            for account in responses['accepted']:
                self.session.add_contact(account)

            for account in responses['rejected']:
                self.session.reject_contact(account)

        if self.session.contacts.pending:
            accounts = []
            for contact in self.session.contacts.pending.values():
                accounts.append((contact.account, contact.display_name))

            dialog = extension.get_default('dialog')
            dialog.contact_added_you(accounts, on_contact_added_you)

        glib.timeout_add(500, self.session.logger.check)

        notificationcls = extension.get_default('notification')
        self.notification = notificationcls(self.session)
开发者ID:fitoria,项目名称:emesene,代码行数:26,代码来源:emesene.py


示例4: __init__

    def __init__(self, handler, session):
        """
        constructor

        handler -- e3common.Handler.ActionsHandler
        """
        gtk.Menu.__init__(self)

        ContactsMenu = extension.get_default('menu contact')
        AccountMenu = extension.get_default('menu account')

        contact = gtk.ImageMenuItem(_('_Contact'))
        contact.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        contact_menu = ContactsMenu(handler.contact_handler, session)
        contact.set_submenu(contact_menu)
        account = gtk.ImageMenuItem(_('_Account'))
        account.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))

        account_menu = AccountMenu(handler.my_account_handler)
        myaccount = gtk.ImageMenuItem(_('_Profile'))
        myaccount.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        myaccount.set_submenu(account_menu)

        self.append(contact)

        if session.session_has_service(e3.Session.SERVICE_GROUP_MANAGING):
            GroupsMenu = extension.get_default('menu group')
            group = gtk.ImageMenuItem(_('_Group'))
            group.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.group_chat))
            group_menu = GroupsMenu(handler.group_handler)
            group.set_submenu(group_menu)
            self.append(group)

        self.append(myaccount)
开发者ID:AmiZya,项目名称:emesene,代码行数:34,代码来源:MainMenu.py


示例5: _build_menus

    def _build_menus(self):
        '''buildall the menus used on the client'''
        dialog = extension.get_default('dialog')
        avatar_manager = extension.get_default('avatar manager')

        am = avatar_manager(self.session)

        handler = gui.base.MenuHandler(self.session, dialog, self.contact_list,
            am, self.on_disconnect, self.on_close)

        contact_handler = gui.base.ContactHandler(self.session, dialog,
            self.contact_list)
        group_handler = gui.base.GroupHandler(self.session, dialog,
            self.contact_list)

        MainMenu = extension.get_default('main menu')
        ContactMenu = extension.get_default('menu contact')
        GroupMenu = extension.get_default('menu group')

        self.menu = MainMenu(handler, self.session.config)

        self.contact_menu = ContactMenu(contact_handler)
        self.group_menu = GroupMenu(group_handler)
        self.contact_menu.show_all()
        self.group_menu.show_all()
开发者ID:Rohedin,项目名称:emesene,代码行数:25,代码来源:MainWindow.py


示例6: start

    def start(self, account=None):
        '''the entry point to the class'''
        windowcls = extension.get_default('window frame')
        self.window = windowcls(None) # main window
        self._set_location(self.window)

        if self.tray_icon is not None:
            self.tray_icon.set_visible(False)

        trayiconcls = extension.get_default('tray icon')
        handler = gui.base.TrayIconHandler(self.session, gui.theme,
            self.on_user_disconnect, self.on_close)
        self.tray_icon = trayiconcls(handler, self.window)

        proxy = self._get_proxy_settings()
        use_http = self.config.get_or_set('b_use_http', False)
        account = self.config.get_or_set('last_logged_account', '')

        #autologin
        default_session = extension.get_default('session')
        if account != '' and int(self.config.d_remembers[account]) == 3:
            password = base64.b64decode(self.config.d_accounts[account])
            user = e3.Account(account, password,
                              int(self.config.d_status[account]),
                              default_session.DEFAULT_HOST)
            host = default_session.DEFAULT_HOST
            port = default_session.DEFAULT_PORT
            self.on_login_connect(user, self.config.session, proxy, use_http,
                    host, int(port))
        else:
            self.go_login(proxy, use_http)
开发者ID:bah,项目名称:emesene,代码行数:31,代码来源:emesene.py


示例7: start

    def start(self, account=None, accounts=None, on_disconnect=False):
        '''the entry point to the class'''
        Window = extension.get_default('window frame')
        self.window = Window(None) # main window

        if self.tray_icon is not None:
            self.tray_icon.set_visible(False)

        TrayIcon = extension.get_default('tray icon')
        handler = gui.base.TrayIconHandler(self.session, gui.theme,
            self.on_disconnect, self.on_close)
        self.tray_icon = TrayIcon(handler, self.window)

        proxy = self._get_proxy_settings()
        use_http = self.config.get_or_set('b_use_http', False)
        account = self.config.get_or_set('last_logged_account', '')
        
        #autologin
        if account != '' and int(self.config.d_remembers[account]) == 3 \
            and not on_disconnect:
            password = base64.b64decode(self.config.d_accounts[account])
            user = e3.Account(account, password,
                              int(self.config.d_status[account]))
            self.on_login_connect(user, self.config.session, proxy, use_http)
        else:
            self.go_login(on_disconnect, proxy, use_http)
开发者ID:DarKprince,项目名称:emesene2,代码行数:26,代码来源:emesene.py


示例8: __init__

    def __init__(self, handler, session):
        """
        constructor

        handler -- e3common.Handler.ActionsHandler
        """
        gtk.Menu.__init__(self)
        self.handler = handler

        ContactsMenu = extension.get_default("menu contact")
        AccountMenu = extension.get_default("menu account")

        self.contact = gtk.ImageMenuItem(_("_Contact"))
        self.contact.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        self.contact_menu = ContactsMenu(self.handler.contact_handler, session)
        self.contact.set_submenu(self.contact_menu)
        self.account = gtk.ImageMenuItem(_("_Account"))
        self.account.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))

        self.account_menu = AccountMenu(self.handler.my_account_handler)
        self.myaccount = gtk.ImageMenuItem(_("_Profile"))
        self.myaccount.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.chat))
        self.myaccount.set_submenu(self.account_menu)

        self.append(self.contact)

        if session.session_has_service(e3.Session.SERVICE_GROUP_MANAGING):
            GroupsMenu = extension.get_default("menu group")
            self.group = gtk.ImageMenuItem(_("_Group"))
            self.group.set_image(utils.safe_gtk_image_load(gui.theme.image_theme.group_chat))
            self.group_menu = GroupsMenu(self.handler.group_handler)
            self.group.set_submenu(self.group_menu)
            self.append(self.group)

        self.append(self.myaccount)
开发者ID:sreekumar-kr,项目名称:emesene,代码行数:35,代码来源:MainMenu.py


示例9: on_avatar_click

    def on_avatar_click(self,widget,data):
        '''method called when user click on his avatar 
        '''
        def set_picture_cb(response, filename):
            '''callback for the avatar chooser'''
            if response == gui.stock.ACCEPT:
                if self.config_dir.base_dir.replace('@', '-at-') == \
                   os.path.dirname(os.path.dirname(filename)):
                    self.session.set_picture(filename)
                    os.remove(self.avatar_path)
                    shutil.copy2(filename, self.avatar_path)
                    return
                #i save in 128*128 for the animation on connect..if somebody like it...:)
                try:
                    pix_128 = utils.safe_gtk_pixbuf_load(filename, (128,128))
                    pix_128.save(path_dir + '_temp', 'png')
                    self.session.set_picture(path_dir + '_temp')
                    if os.path.exists(self.avatar_path):  
                        os.remove(self.avatar_path)   
                    pix_128.save(self.avatar_path, 'png')
                except OSError as e:
                   print e
        #TODO better way to do this???
        path_dir = self.config_dir.join(os.path.dirname(self.config_dir.base_dir),
                   self.session.contacts.me.account.replace('@','-at-'),'avatars')

        extension.get_default('avatar chooser')(set_picture_cb, 
                                                self.avatar_path, path_dir).show()
开发者ID:Mindflyer,项目名称:emesene,代码行数:28,代码来源:UserPanel.py


示例10: start

    def start(self, account=None, accounts=None):
        '''the entry point to the class'''
        Window = extension.get_default('window frame')
        self.window = Window(None) # main window

        if self.tray_icon is not None:
            self.tray_icon.set_visible(False)

        TrayIcon = extension.get_default('tray icon')
        handler = gui.base.TrayIconHandler(self.session, gui.theme,
            self.on_disconnect, self.on_close)
        self.tray_icon = TrayIcon(handler, self.window)

        proxy = self._get_proxy_settings()
        use_http = self.config.get_or_set('b_use_http', False)

        posx = self.config.get_or_set('i_login_posx', 100)
        posy = self.config.get_or_set('i_login_posy', 100)
        width = self.config.get_or_set('i_login_width', 250)
        height = self.config.get_or_set('i_login_height', 410)

        self.window.go_login(self.on_login_connect,
            self.on_preferences_changed, account,
            self.config.d_accounts, self.config.l_remember_account,
            self.config.l_remember_password, self.config.d_status,
            self.config.session, proxy, use_http, self.config.session)
        self.window.set_location(width, height, posx, posy)

        self.window.show()
开发者ID:nicolaide,项目名称:emesene,代码行数:29,代码来源:emesene.py


示例11: _build_menus

    def _build_menus(self):
        '''buildall the menus used on the client'''
        dialog = extension.get_default('dialog')
        avatar_manager = extension.get_default('avatar manager')

        # TODO: probably there's no need to instantiate it from here, now.
        # (instantiate directly in MenuHandler)
        am = gui.base.AvatarManager(self.session)

        handler = gui.base.MenuHandler(self.session, dialog, self.contact_list,
            am, self.on_disconnect, self.on_close)

        contact_handler = gui.base.ContactHandler(self.session, dialog,
            self.contact_list)
        group_handler = gui.base.GroupHandler(self.session, dialog,
            self.contact_list)

        MainMenu = extension.get_default('main menu')
        ContactMenu = extension.get_default('menu contact')
        GroupMenu = extension.get_default('menu group')

        self.menu = MainMenu(handler, self.session.config)

        self.contact_menu = ContactMenu(contact_handler)
        self.group_menu = GroupMenu(group_handler)
        self.contact_menu.show_all()
        self.group_menu.show_all()
开发者ID:dkasak,项目名称:emesene,代码行数:27,代码来源:MainWindow.py


示例12: __init__

    def __init__(self, session, on_new_conversation, on_close, on_disconnect_cb):
        """class constructor"""
        gtk.VBox.__init__(self)
        self.session = session

        UserPanel = extension.get_default("user panel")
        ContactList = extension.get_default("contact list")

        self.below_menu = extension.get_and_instantiate("below menu", self)
        self.below_panel = extension.get_and_instantiate("below panel", self)
        self.below_userlist = extension.get_and_instantiate("below userlist", self)

        self.contact_list = ContactList(session)
        scroll = gtk.ScrolledWindow()
        scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        scroll.set_shadow_type(gtk.SHADOW_IN)
        scroll.set_border_width(1)
        self.on_new_conversation = on_new_conversation
        self.on_close = on_close
        self.on_disconnect_cb = on_disconnect_cb

        self.session.signals.contact_attr_changed.subscribe(self._on_contact_attr_changed)

        self.menu = None
        self.contact_menu = None
        self.contact_menu = None
        self.group_menu = None

        self._build_menus()

        self.panel = UserPanel(session)
        self.panel.nick.connect("text-changed", self._on_nick_changed)
        self.panel.message.connect("text-changed", self._on_message_changed)
        self.panel.search.connect("toggled", self._on_search_toggled)
        self.panel.enabled = False

        self.entry = gtk.Entry()
        self.entry.connect("changed", self._on_entry_changed)
        self.entry.connect("key-press-event", self._on_entry_key_press)

        self.pack_start(self.menu, False)
        self.pack_start(self.below_menu, False)
        self.pack_start(self.panel, False)
        self.pack_start(self.below_panel, False)
        self.pack_start(scroll, True, True)
        self.pack_start(self.below_userlist, False)
        self.pack_start(self.entry, False)

        self.contact_list.contact_selected.subscribe(self._on_contact_selected)
        self.contact_list.group_selected.subscribe(self._on_group_selected)
        self.contact_list.contact_menu_selected.subscribe(self._on_contact_menu_selected)
        self.contact_list.group_menu_selected.subscribe(self._on_group_menu_selected)

        scroll.add(self.contact_list)
        scroll.show_all()

        if self.session.config.b_show_userpanel:
            self.panel.hide()

        self.session.config.subscribe(self._on_show_userpanel_changed, "b_show_userpanel")
开发者ID:Otacon,项目名称:emesene,代码行数:60,代码来源:MainWindow.py


示例13: _setup_ui

    def _setup_ui(self):
        '''Instantiates the widgets, and sets the layout'''
        contact_list_cls = extension.get_default('contact list')
        user_panel_cls = extension.get_default('user panel')

        self.panel = user_panel_cls(self.session, self)
        self.panel.enabled = False
        self.contact_list = contact_list_cls(self.session)
        self.search_entry = widgets.SearchEntry()
        self.search_entry.setVisible(False)
        self.search_entry.textChanged.connect(
                                    self._on_search_changed)
        self.panel.search.clicked.connect(
                                    self._on_search_click)

        self.lay = QtGui.QGridLayout()
        self.lay.setContentsMargins(0, 0, 0, 0)
        self.lay.addWidget(self.below_menu, 1, 0)
        self.lay.addWidget(self.panel, 2, 0)
        self.lay.addWidget(self.below_panel, 3, 0)
        self.lay.addWidget(self.search_entry, 4, 0)
        self.lay.addWidget(self.contact_list, 5, 0)
        self.lay.addWidget(self.below_userlist, 6, 0)
        self.setLayout(self.lay)
        self.contact_list.new_conversation_requested.connect(
                                        self.on_new_conversation_requested)
        self.contact_list.contact_menu_selected.subscribe(
            self._on_contact_menu_selected)
        if self.session.session_has_service(e3.Session.SERVICE_GROUP_MANAGING):
            self.contact_list.group_menu_selected.subscribe(
                self._on_group_menu_selected)
开发者ID:AmiZya,项目名称:emesene,代码行数:31,代码来源:MainPage.py


示例14: _on_connection_preferences_clicked

    def _on_connection_preferences_clicked(self):
        '''Callback invoked when the user clicks the connection preferences
        button'''
        def new_preferences_cb(use_http, use_proxy, proxy_host, proxy_port,
                               use_auth, user, passwd, session_id, service, 
                               server_host, server_port):
            '''called when the user press accept on the preferences dialog'''
            
            self._proxy = e3.Proxy(use_proxy, proxy_host,
                                   proxy_port, use_auth, user, passwd)
            self._host = server_host
            self._port = server_port
            account_email = str(self._widget_d['account_combo'].currentText())
            if account_email != '':
                self._config.d_user_service[account_email] = service
                # to trigger eventual update of dp:
            self._on_account_combo_text_changed(account_email)
    
            # TODO: investigate on what does the following do:
            self._on_preferences_changed(use_http, self._proxy, session_id,
                    service)
            

        service = self._config.service
        account = str(self._widget_d['account_combo'].currentText())
        if account in self._config.d_user_service.keys():
            service = self._config.d_user_service[account]
        extension.get_default('dialog').login_preferences(service, self._host,
                                        self._port, new_preferences_cb, 
                                        self._config.b_use_http, self._proxy)
开发者ID:felippo,项目名称:emesene,代码行数:30,代码来源:LoginPage.py


示例15: __init__

    def __init__(self, session):
        """
        Class Constructor
        """
        self.session = session
        self.session.config.get_or_set('b_notify_contact_online', True)
        self.session.config.get_or_set('b_notify_contact_offline', True)
        self.session.config.get_or_set('b_notify_receive_message', True)

        self.notifier = extension.get_default('notificationGUI')
        self.sound_player = extension.get_default('sound')(session)

        if self.session:
            self.session.signals.conv_message.subscribe(
                self._on_message)
            self.session.signals.contact_attr_changed.subscribe(
                self._on_contact_attr_changed)
            self.session.signals.mail_received.subscribe(
                self._on_mail_received)
            self.session.signals.filetransfer_completed.subscribe(
                self._on_filetransfer_completed)
            self.session.signals.filetransfer_canceled.subscribe(
                self._on_filetransfer_canceled)
            self.session.signals.filetransfer_invitation.subscribe(
                self._on_filetransfer_invitation)

        self.notify_online = False
        self.last_online = None
开发者ID:chy168,项目名称:emesene,代码行数:28,代码来源:notification.py


示例16: __init__

    def __init__(self, session):
        """
        Class Constructor
        """
        self.session = session
        self.session.config.get_or_set('b_notify_contact_online', True)
        self.session.config.get_or_set('b_notify_contact_offline', True)
        self.session.config.get_or_set('b_notify_receive_message', True)
        self.session.config.get_or_set('b_notify_typing', False)
        self.session.config.get_or_set('b_notify_when_focussed', False)
        self.session.config.get_or_set('b_notify_only_when_available', True)

        self.notifier = extension.get_default('notificationGUI')
        self.picture_factory = extension.get_default('notificationImage')
        self.sound_player = extension.get_and_instantiate('sound', session)

        if self.session:
            self.session.signals.conv_message.subscribe(
                self._on_message)
            self.session.signals.user_typing.subscribe(
                self._on_user_typing)
            self.session.signals.contact_attr_changed.subscribe(
                self._on_contact_attr_changed)
            self.session.signals.mail_received.subscribe(
                self._on_mail_received)
            self.session.signals.filetransfer_completed.subscribe(
                self._on_filetransfer_completed)
            self.session.signals.filetransfer_canceled.subscribe(
                self._on_filetransfer_canceled)
            self.session.signals.filetransfer_invitation.subscribe(
                self._on_filetransfer_invitation)

        self.notify_online = False
        self.last_online = None
开发者ID:GunioRobot,项目名称:emesene,代码行数:34,代码来源:notification.py


示例17: on_set_picture_selected

    def on_set_picture_selected(self):
        '''called when set picture is selected'''
        def set_picture_cb(response, filename):
            '''callback for the avatar chooser'''
            if response == gui.stock.ACCEPT:
                self.session.set_picture(filename)

        extension.get_default('avatar chooser')(set_picture_cb).show()
开发者ID:JPtja,项目名称:emesene,代码行数:8,代码来源:Handler.py


示例18: _on_accept

 def _on_accept(self, button):
     '''method called when the user clicks the button'''
     filename = get_filename(self)
     if os.path.isfile(filename):
         self.hide()
         self.response_cb(gui.stock.ACCEPT, filename)
     else:
         extension.get_default('dialog').error("No picture selected")
开发者ID:Otacon,项目名称:emesene,代码行数:8,代码来源:ImageChooser.py


示例19: open_file_cb

        def open_file_cb(response, filepath):
            if response is not gui.stock.CANCEL and response is not gui.stock.CLOSE:

                if filepath is None:
                    extension.get_default("dialog").error(_("No file selected"))
                else:
                    filename = os.path.basename(filepath)
                    self.conversation.on_filetransfer_invite(filename, filepath)
开发者ID:bubuntux,项目名称:emesene,代码行数:8,代码来源:Handler.py


示例20: __init__

    def __init__(self, session, main_window):
        QtGui.QWidget.__init__(self)
        self.session = session
        self.main_window = main_window
        self.session = session
        # a widget dic to avoid proliferation of instance variables:
        self._widget_dict = {}
        self._enabled = True

        nick_edit_cls = extension.get_default("nick edit")
        avatar_cls = extension.get_default("avatar")

        widget_dict = self._widget_dict

        nick_box = QtGui.QHBoxLayout()
        widget_dict["nick_edit"] = nick_edit_cls()
        widget_dict["mail_btn"] = QtGui.QToolButton()
        widget_dict["mail_btn"].setAutoRaise(True)
        widget_dict["mail_btn"].setIcon(QtGui.QIcon.fromTheme("mail-unread"))
        widget_dict["mail_btn"].setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
        widget_dict["mail_btn"].setText("(0)")
        nick_box.addWidget(widget_dict["nick_edit"])
        nick_box.addWidget(widget_dict["mail_btn"])

        widget_dict["psm_edit"] = nick_edit_cls(
            allow_empty=True, empty_message=QtCore.QString(tr("<u>Click here to set a personal message...</u>"))
        )
        widget_dict["status_combo"] = StatusButton.StatusButton(self.session)
        psm_box = QtGui.QHBoxLayout()
        psm_box.setContentsMargins(0, 0, 0, 0)
        psm_box.addWidget(widget_dict["psm_edit"])
        psm_box.addWidget(widget_dict["status_combo"])
        widget_dict["psm_box"] = psm_box
        widget_dict["display_pic"] = avatar_cls(self.session)

        my_info_lay_left = QtGui.QVBoxLayout()
        my_info_lay_left.setContentsMargins(0, 0, 0, 0)
        my_info_lay_left.addLayout(nick_box)
        my_info_lay_left.addLayout(psm_box)

        my_info_lay = QtGui.QHBoxLayout()
        my_info_lay.addWidget(widget_dict["display_pic"])
        my_info_lay.addLayout(my_info_lay_left)
        my_info_lay.setContentsMargins(0, 0, 0, 0)
        self.setLayout(my_info_lay)
        self.session.signals.status_change_succeed.subscribe(self._widget_dict["status_combo"].set_status)
        self.session.config.subscribe(self._on_show_mail_inbox_changed, "b_show_mail_inbox")

        widget_dict["nick_edit"].nick_changed.connect(self.on_nick_changed)
        widget_dict["psm_edit"].nick_changed.connect(self.on_message_changed)
        if session.session_has_service(e3.Session.SERVICE_PROFILE_PICTURE):
            widget_dict["display_pic"].clicked.connect(self.on_avatar_click)
        widget_dict["mail_btn"].clicked.connect(self._on_mail_click)

        self.on_profile_update_succeed(self.session.contacts.me.display_name, self.session.contacts.me.message)
        self.on_picture_change_succeed(self.session.account.account, self.session.contacts.me.picture)
        self._on_show_mail_inbox_changed(self.session.config.b_show_mail_inbox)
        self._add_subscriptions()
开发者ID:firemountain,项目名称:emesene,代码行数:58,代码来源:UserPanel.py



注:本文中的extension.get_default函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python extension.get_extensions函数代码示例发布时间:2022-05-24
下一篇:
Python extension.get_category函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap