Beispiel #1
0
jRoster::jRoster(const QString &account_name, const QString &profile_name, jAccount *jabber_account) :
	m_account_name(account_name),
	m_profile_name(profile_name),
	m_plugin_system(jPluginSystem::instance()),
	m_list_string(QChar(0)+QString("list")),
	m_jabber_account(jabber_account)
{
	QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name/*+"/jabber."+m_account_name*/, "jabbericons");
	m_path_to_avatars = account_settings.fileName();
	m_path_to_avatars.truncate(m_path_to_avatars.length()-4);
        m_add_contact_action = new QAction(m_plugin_system.getIcon("add_user"),tr("Add to contact list"),this);
        connect(m_add_contact_action,SIGNAL(triggered()),this,SLOT(onAddContact()));
	m_rename_action = new QAction(m_plugin_system.getIcon("edituser"),tr("Rename contact"),this);
	connect(m_rename_action,SIGNAL(triggered()),this,SLOT(onRenameAction()));
	m_delete_action = new QAction(m_plugin_system.getIcon("deleteuser"),tr("Delete contact"),this);
	connect(m_delete_action,SIGNAL(triggered()),this,SLOT(onDeleteAction()));
	m_move_action = new QAction(m_plugin_system.getIcon("moveuser"),tr("Move to group"),this);
	connect(m_move_action,SIGNAL(triggered()),this,SLOT(onMoveAction()));
	m_subscription_menu = new QMenu(tr("Authorization"));
	m_subscription_menu->menuAction()->setIcon(m_plugin_system.getIcon("auth"));
	m_send_subscription_action = new QAction(tr("Send authorization to"),this);
	m_subscription_menu->addAction(m_send_subscription_action);
	connect(m_send_subscription_action,SIGNAL(triggered()),this,SLOT(onSendSubscriptionAction()));
	m_ask_subscription_action = new QAction(tr("Ask authorization from"),this);
	m_subscription_menu->addAction(m_ask_subscription_action);
	connect(m_ask_subscription_action,SIGNAL(triggered()),this,SLOT(onAskSubscriptionAction()));
	m_remove_subscription_action = new QAction(tr("Remove authorization from"),this);
	m_subscription_menu->addAction(m_remove_subscription_action);
	connect(m_remove_subscription_action,SIGNAL(triggered()),this,SLOT(onRemoveSubscriptionAction()));
	m_transports_menu = new QMenu(tr("Transports"));
	m_register_transport = new QAction(tr("Register"),this);
	connect(m_register_transport,SIGNAL(triggered()),this,SLOT(onRegisterAction()));
	m_transports_menu->addAction(m_register_transport);
	m_unregister_transport = new QAction(tr("Unregister"),this);
	connect(m_unregister_transport,SIGNAL(triggered()),this,SLOT(onUnregisterAction()));
	m_transports_menu->addAction(m_unregister_transport);
	m_transports_menu->addSeparator();
	m_login_transport = new QAction(tr("Log In"),this);
	connect(m_login_transport,SIGNAL(triggered()),this,SLOT(onLogInTransportAction()));
	m_transports_menu->addAction(m_login_transport);
	m_logout_transport = new QAction(tr("Log Out"),this);
	connect(m_logout_transport,SIGNAL(triggered()),this,SLOT(onLogOutTransportAction()));
	m_transports_menu->addAction(m_logout_transport);
	m_menu_label = new QLabel;
	m_menu_label->setAlignment(Qt::AlignCenter);
	m_menu_title = new QWidgetAction(this);
	m_menu_title->setDefaultWidget(m_menu_label);
}
int MoodBox::LogonWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = ServerWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            forgotPassword();
            break;
        case 1:
            registerNewUser();
            break;
        case 2:
            inviteCodeNeeded();
            break;
        case 3:
            changePassword();
            break;
        case 4:
            showSettings();
            break;
        case 5:
            logonStarted();
            break;
        case 6:
            logonStopped();
            break;
        case 7:
            successLogon();
            break;
        case 8:
            waitingStart();
            break;
        case 9:
            waitingStop();
            break;
        case 10:
            onLogonResult((*reinterpret_cast< Fault(*)>(_a[1])),(*reinterpret_cast< AuthTicketResult(*)>(_a[2])));
            break;
        case 11:
            onInviteNeedResult((*reinterpret_cast< Fault(*)>(_a[1])),(*reinterpret_cast< ServerInfo(*)>(_a[2])));
            break;
        case 12:
            onRequestCancelled();
            break;
        case 13:
            callLogon();
            break;
        case 14:
            onForgotPasswordAction();
            break;
        case 15:
            onSettingsAction();
            break;
        case 16:
            onRegisterAction();
            break;
        case 17:
            onSignInAction();
            break;
        case 18:
            onPasswordChangeAction();
            break;
        case 19:
            onLoginChoosen((*reinterpret_cast< const QString(*)>(_a[1])));
            break;
        case 20:
            on_savePasswordCheck_stateChanged((*reinterpret_cast< int(*)>(_a[1])));
            break;
        case 21:
            on_autoLogonCheckBox_stateChanged((*reinterpret_cast< int(*)>(_a[1])));
            break;
        default:
            ;
        }
        _id -= 22;
    }
    return _id;
}