Ejemplo n.º 1
0
void icqAccount::loadAccountSettings()
{
        QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
        QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin, "accountsettings");
        autoConnect = settings.value("connection/auto", false).toBool();
	statusIconIndex = settings.value("main/staticon", 0).toInt();
	thisIcqProtocol->reconnectOnDisc = settings.value("connection/reconnect", true).toBool();
/*	thisIcqProtocol->getContactListClass()->fileTransferObject->setListenPort(settings.value("connection/listen", 5191).toUInt());*/
	settings.beginGroup("clientid");

	clientIndex = settings.value("index", 0).toUInt();
	protocolVersion = settings.value("protocol", 1).toUInt();

		clientCap1 = settings.value("cap1").toString();
		clientCap2 = settings.value("cap2").toString();
		clientCap3 = settings.value("cap3").toString();

	settings.endGroup();


	networkSettingsChanged();



	currentXstatus = account_settings.value("xstatus/index", 0).toInt();
	if ( currentXstatus )
	{
		customStatus->setIcon(QIcon(statusIconClass::getInstance()->xstatusList.at(currentXstatus - 1)));
	}else
		customStatus->setIcon(QIcon());
}
Ejemplo n.º 2
0
void LoginForm::LoadSettings()
{
    if (!m_client) return;

    QSettings account_settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profileName+"/mrim."+m_client->AccountName(), "accountsettings");
    ui.emailEdit->setText(account_settings.value("main/login").toString());
    ui.emailEdit->setReadOnly(true);
    ui.passEdit->setText(account_settings.value("main/password").toString());
}
Ejemplo n.º 3
0
void icqAccount::setStatusFromPlugin(accountStatus status, const QString &status_text)
{

	
	if ( status > -1)
	{
	
		if ((status != online) && (status != offline) && (status != ffc)
		&& (status != invisible))
	{
		QString sName(StatusNames[static_cast<int>(status)]);
                QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
                QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin , "accountsettings");
			if ( m_restore_status == restoreAccount )
				m_restore_status_text = account_settings.value("autoreply/" + sName
					+ "msg", "").toString();	
		account_settings.setValue("autoreply/" + sName
					+ "msg", status_text.left(1000));	
		thisIcqProtocol->setStatus(status);


	}
	// Disconnecting
	else
	{
		if (status == offline)
			thisIcqProtocol->userDisconnected = true;

		// Apply new status
		thisIcqProtocol->setStatus(status);
	}
			if ( m_restore_status == restoreAccount )
		m_restore_status = thisIcqProtocol->getStatus();
	} else
	{
		QString sName(StatusNames[static_cast<int>(m_restore_status)]);
                QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
                QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin , "accountsettings");
		m_restore_status_text = account_settings.value("autoreply/" + sName
				+ "msg", "").toString();	
		account_settings.setValue("autoreply/" + sName
					+ "msg", status_text.left(1000));	
	}
}
Ejemplo n.º 4
0
void icqAccount::autoconnecting()
{
    qDebug()<<"icqAccount::autoConnect="<<autoConnect;
	if ( autoConnect )
	{
                QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
                QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin, "accountsettings");
		if ( settings.value("connection/statonexit", true).toBool() )
			thisIcqProtocol->setStatus(static_cast<accountStatus>(account_settings.value("connection/currstatus", 0).toInt()));
		else
			thisIcqProtocol->setStatus(online);
	}
}
Ejemplo n.º 5
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);
}
Ejemplo n.º 6
0
void LoginForm::SaveSettings()
{
    QSettings settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profileName, "mrimsettings");
    QStringList accounts = settings.value("accounts/list").toStringList();
    QString email = GetEmail(), pass = GetPass();

    if( !accounts.contains(email) )
    {
        accounts<<email;
        accounts.sort();
        settings.setValue("accounts/list", accounts);
    }
    QSettings account_settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_profileName+"/mrim."+email, "accountsettings");
    account_settings.setValue("main/login", email);
    account_settings.setValue("main/password", pass);
}
Ejemplo n.º 7
0
void jConference::loadSettings()
{
	QSettings account_settings(QSettings::defaultFormat(), QSettings::UserScope, "qutim/qutim."+m_jabber_account->getProfileName()+"/jabber."+m_account_name, "accountsettings");
	m_auto_retrieve_vcards = account_settings.value("main/getavatars",true).toBool();

}
Ejemplo n.º 8
0
jAccount::jAccount(const QString &account_name, const QString &profile_name, QObject *parent) : QObject(parent), m_jabber_plugin_system(jPluginSystem::instance())
{
	m_status_icon = m_jabber_plugin_system.getStatusIcon("offline", "jabber");
	m_account_name = account_name;
	m_profile_name = profile_name;

	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_jabber_slotsignal = new jSlotSignal(this);
	m_jabber_roster = new jRoster(account_name, profile_name, this);
	m_jabber_protocol = new jProtocol(m_account_name, m_profile_name, m_jabber_roster, this);
	m_conference_management_object = m_jabber_protocol->getConferenceManagmentObject();

	createStatusMenu();

	m_status = Presence::Unavailable;
	connect(m_jabber_roster, SIGNAL(addItemToContactList(const TreeModelItem &, QString)), m_jabber_slotsignal, SLOT(addItemToContactList(const TreeModelItem &, QString)));
	connect(m_jabber_roster, SIGNAL(removeItemFromContactList(TreeModelItem)), m_jabber_slotsignal, SLOT(removeItemFromContactList(TreeModelItem)));
	connect(m_jabber_roster, SIGNAL(setContactItemStatus(const TreeModelItem &, QString, int)), m_jabber_slotsignal, SLOT(setContactItemStatus(const TreeModelItem &, QString, int)));
	connect(m_jabber_roster, SIGNAL(setItemInvisible(const TreeModelItem &, bool)), m_jabber_slotsignal, SLOT(setItemInvisible(const TreeModelItem &, bool)));
	connect(m_jabber_protocol, SIGNAL(setRealStatus(int)), this, SLOT(setRealStatus(int)));
	connect(m_jabber_protocol, SIGNAL(setClientCustomIcon(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomIcon(const TreeModelItem &, const QString &, int)));
	connect(m_jabber_protocol, SIGNAL(setClientCustomText(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomText(const TreeModelItem &, const QString &, int)));
	connect(m_jabber_protocol, SIGNAL(addMessageFrom(const TreeModelItem &, const QDateTime &, const QString &)), m_jabber_slotsignal, SLOT(addMessageFrom(const TreeModelItem &, const QDateTime &, const QString &)));
	connect(m_jabber_roster, SIGNAL(addServiceMessage(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(addServiceMessage(const TreeModelItem &, const QString &)));
	connect(m_jabber_protocol, SIGNAL(messageDelievered(const TreeModelItem &, int)), m_jabber_slotsignal, SLOT(messageDelievered(const TreeModelItem &, int)));
	connect(m_jabber_protocol, SIGNAL(sendTypingNotification(const TreeModelItem &, bool)), m_jabber_slotsignal, SLOT(sendTypingNotification(const TreeModelItem &, bool)));
	connect(m_conference_management_object, SIGNAL(addConferenceItem(const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(addConferenceItem(const QString &,const QString &,const QString &,const QString &)));
	connect(m_conference_management_object, SIGNAL(removeConferenceItem(const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(removeConferenceItem(const QString &,const QString &,const QString &,const QString &)));
	connect(m_conference_management_object, SIGNAL(renameConferenceItem(const QString &,const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(renameConferenceItem(const QString &,const QString &,const QString &,const QString &,const QString &)));
	connect(m_conference_management_object, SIGNAL(setConferenceItemStatus(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemStatus(const QString &,const QString &,const QString &,const QString &,const QString &, int)));
	connect(m_conference_management_object, SIGNAL(setConferenceItemRole(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemRole(const QString &,const QString &,const QString &,const QString &,const QString &, int)));
	connect(m_conference_management_object, SIGNAL(setConferenceItemIcon(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemIcon(const QString &,const QString &,const QString &,const QString &,const QString &, int)));
	connect(m_conference_management_object, SIGNAL(addMessageToConference(const QString &, const QString &,const QString &, const QString &, const QDateTime &, bool)), m_jabber_slotsignal, SLOT(addMessageToConference(const QString &, const QString &,const QString &, const QString &, const QDateTime &, bool)));
	connect(m_conference_management_object, SIGNAL(changeOwnConferenceNickName(const QString &,const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(changeOwnConferenceNickName(const QString &,const QString &, const QString &, const QString &)));
	connect(m_conference_management_object, SIGNAL(createConference(const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(createConference(const QString &, const QString &, const QString &)));
	connect(m_jabber_roster, SIGNAL(clientVersion(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(clientVersion(const TreeModelItem &, const QString &)));
	connect(m_jabber_protocol, SIGNAL(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)), m_jabber_slotsignal, SLOT(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)));
	connect(m_conference_management_object, SIGNAL(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)), m_jabber_slotsignal, SLOT(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)));
	connect(m_jabber_protocol, SIGNAL(systemNotification(const QString &, const QString &)), m_jabber_slotsignal, SLOT(systemNotification(const QString &, const QString &)));
	connect(m_jabber_protocol, SIGNAL(onFetchVCard(const QString&, const VCard*, const QString&)), m_jabber_slotsignal, SLOT(s_onFetchVCard(const QString&, const VCard*, const QString&)));
	//connect(m_jabber_protocol, SIGNAL(receiveSDisco(const JID&, const Disco::Items&, QString&)), m_jabber_slotsignal, SLOT(s_receiveSDisco(const JID&, const Disco::Items&, QString&)));
	//connect(m_jabber_protocol, SIGNAL(receiveSDiscoInfo(const JID&, const Disco::Info&, QString&)), m_jabber_slotsignal, SLOT(s_receiveSDiscoInfo(const JID&, const Disco::Info&, QString&)));
	connect(m_jabber_roster, SIGNAL(setItemIcon(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomIcon(const TreeModelItem &, const QString &, int)));
	connect(m_jabber_roster, SIGNAL(setItemCustomText(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomText(const TreeModelItem &, const QString &, int)));
	connect(m_conference_management_object, SIGNAL(setConferenceTopic(const QString &, const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(setConferenceTopic(const QString &, const QString &, const QString &, const QString &)));
	connect(m_conference_management_object, SIGNAL(addSystemMessageToConference(const QString &, const QString &, const QString &, const QString &, const QDateTime &, bool)), m_jabber_slotsignal, SLOT(addSystemMessageToConference(const QString &, const QString &, const QString &, const QString &, const QDateTime &, bool)));
	connect(m_jabber_protocol, SIGNAL(createAcceptAuthDialog(const QString &, const JID &, Client *)), m_jabber_slotsignal, SLOT(createAcceptAuthDialog(const QString &, const JID &, Client *)));
	connect(m_jabber_roster, SIGNAL(s_customNotification(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(customNotification(const TreeModelItem &, const QString &)));
	connect(m_jabber_roster, SIGNAL(moveItemInContactList(TreeModelItem, TreeModelItem)), m_jabber_slotsignal, SLOT(moveItemInContactList(TreeModelItem, TreeModelItem)));
	connect(m_jabber_roster, SIGNAL(setContactItemName(TreeModelItem, QString)), m_jabber_slotsignal, SLOT(setContactItemName(TreeModelItem, QString)));
	connect(m_jabber_protocol, SIGNAL(bookmarksHandled(const BookmarkList &, const ConferenceList &)), m_jabber_slotsignal, SLOT(bookmarksHandled(const BookmarkList &, const ConferenceList &)));
	connect(m_jabber_protocol, SIGNAL(tagHandled(const QString &, bool)), m_jabber_slotsignal, SLOT(tagHandled(const QString &, bool)));
	connect(m_jabber_protocol, SIGNAL(conferenceInvite(const JID&, const JID&, const QString&, const QString&)), m_conference_management_object, SLOT(s_conferenceInvite(const JID&, const JID&, const QString&, const QString&)));
//	connect(m_jabber_roster, SIGNAL(), m_jabber_slotsignal, SLOT());

        m_jabber_roster->constr();
        m_jabber_roster->loadSettings();
        m_jabber_roster->loadRosterFromSettings();
}
Ejemplo n.º 9
0
void icqAccount::setStatus()
// shold not be used directly!!!
// use statusAction->trigger() if you have to
// call setStatus() slot
{
	// default status
	accountStatus status = online;
	// Getting triggered action
	QAction *act = qobject_cast<QAction *>(sender());

	// Set all of status actions as unchecked
	QVectorIterator<QAction *> iterator(statusMenuActions);
	while (iterator.hasNext())
	{
		iterator.next()->setChecked(false);
	}

	// Set button checked
	//act->setChecked(true);

	// setting status
	if (act == offlineAction)status = offline;
	else if (act == ffcAction) status = ffc;
	else if (act == awayAction) status = away;
	else if (act == naAction) status = na;
	else if (act == occupiedAction) status = occupied;
	else if (act == dndAction) status = dnd;
	else if (act == invisibleAction) status = invisible;
	else if (act == lunchAction) status = lunch;
	else if (act == evilAction) status = evil;
	else if (act == depressionAction) status = depression;
	else if (act == atHomeAction) status = athome;
	else if (act == atWorkAction) status = atwork;
	m_restore_status = status;
	// Saving settings routine
	if ((status != online) && (status != offline) && (status != ffc)
		&& (status != invisible))
	{

		QString sName(StatusNames[static_cast<int>(status)]);
                QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
                QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin , "accountsettings");
		m_restore_status_text = account_settings.value("autoreply/" + sName
				+ "msg", "").toString();
		if (!settings.value("autoreply/" + sName + "dshow", false).toBool())
		{
//			statusDialog sDialog (m_iconManager);
			QString status_message = account_settings.value("autoreply/" + sName
					+ "msg", "").toString();
//			sDialog.setStatusMessage(account_settings.value("autoreply/" + sName
//				+ "msg", "").toString());
			IcqPluginSystem &ips = IcqPluginSystem::instance();
//			if ( sDialog.exec() )
			bool do_not_show = false;
			if ( ips.setStatusMessage(status_message, do_not_show) )
			{
//				bool do_not_show = sDialog.dontShow;
				settings.setValue("autoreply/" + sName + "dshow", do_not_show);
				if( do_not_show )
				{
					settings.setValue("autoreply/" + sName
//						+ "msg", sDialog.statusMessage.left(1000));
						+ "msg", status_message.left(1000));	
				}
				account_settings.setValue("autoreply/" + sName
//					+ "msg", sDialog.statusMessage.left(1000));
					+ "msg", status_message.left(1000));	
				thisIcqProtocol->setStatus(status);
			}
		} else
			thisIcqProtocol->setStatus(status);


	}
	// Disconnecting
	else
	{
		if (status == offline)
			thisIcqProtocol->userDisconnected = true;

		// Apply new status
		thisIcqProtocol->setStatus(status);
	}
}
Ejemplo n.º 10
0
void icqAccount::createStatusMenu()
{
  QSettings settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name, "icqsettings");
  QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name+"/ICQ."+icqUin, "accountsettings");
  showCustomStatus = settings.value("statuses/customstat",true).toBool();
  
  onlineAction = new QAction(m_icq_plugin_system.getStatusIcon("online", "icq"), tr("Online"), this);
  connect(onlineAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(onlineAction);

  offlineAction = new QAction(m_icq_plugin_system.getStatusIcon("offline", "icq"), tr("Offline"), this);
  connect(offlineAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(offlineAction);

  ffcAction = new QAction(m_icq_plugin_system.getStatusIcon("ffc", "icq"), tr("Free for chat"), this);
  connect(ffcAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(ffcAction);

  awayAction = new QAction(m_icq_plugin_system.getStatusIcon("away", "icq"), tr("Away"), this);
  connect(awayAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(awayAction);

  naAction = new QAction(m_icq_plugin_system.getStatusIcon("na", "icq"), tr("NA"), this);
  connect(naAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(naAction);

  occupiedAction = new QAction(m_icq_plugin_system.getStatusIcon("occupied", "icq"), tr("Occupied"), this);
  connect(occupiedAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(occupiedAction);

  dndAction = new QAction(m_icq_plugin_system.getStatusIcon("dnd", "icq"), tr("DND"), this);
  connect(dndAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(dndAction);

  invisibleAction = new QAction(m_icq_plugin_system.getStatusIcon("invisible", "icq"), tr("Invisible"), this);
  connect(invisibleAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(invisibleAction);

  lunchAction = new QAction(m_icq_plugin_system.getStatusIcon("lunch", "icq"), tr("Lunch"), this);
  connect(lunchAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(lunchAction);

  evilAction = new QAction(m_icq_plugin_system.getStatusIcon("evil", "icq"), tr("Evil"), this);
  connect(evilAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(evilAction);

  depressionAction = new QAction(m_icq_plugin_system.getStatusIcon("depression", "icq"), tr("Depression"), this);
  connect(depressionAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(depressionAction);

  atHomeAction = new QAction(m_icq_plugin_system.getStatusIcon("athome", "icq"), tr("At Home"), this);
  connect(atHomeAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(atHomeAction);

  atWorkAction = new QAction(m_icq_plugin_system.getStatusIcon("atwork", "icq"), tr("At Work"), this);
  connect(atWorkAction, SIGNAL(triggered()), this, SLOT(setStatus()));
  statusMenuActions.push_back(atWorkAction);

	// Set all of status actions as unchecked
	QVectorIterator<QAction *> iterator(statusMenuActions);
	while (iterator.hasNext())
	{
		iterator.next()->setCheckable(true);
	}

	customStatus = new QAction(tr("Custom status"), this);
	connect(customStatus, SIGNAL(triggered()), this, SLOT(customStatusTriggered()));
  
  protoMenu = new QMenu(tr("ICQ"));
	statusMenu = new QMenu(tr("Status"));
  
	privacyStatus = new QMenu(tr("Privacy status"));
	privacyStatus->setIcon(IcqPluginSystem::instance().getIcon("privacy"));

	privacyGroup = new QActionGroup(this);

	visibleForAll = new QAction(tr("Visible for all"), this);
	visibleForAll->setCheckable(true);
	privacyGroup->addAction(visibleForAll);
	connect(visibleForAll, SIGNAL(triggered()), this, SLOT(setVisibleForAll()));

	visibleForVis = new QAction(tr("Visible only for visible list"), this);
	visibleForVis->setCheckable(true);
	privacyGroup->addAction(visibleForVis);
	connect(visibleForVis, SIGNAL(triggered()), this, SLOT(setVisibleForVis()));

	notVisibleForInv = new QAction(tr("Invisible only for invisible list"), this);
	notVisibleForInv->setCheckable(true);
	privacyGroup->addAction(notVisibleForInv);
	connect(notVisibleForInv, SIGNAL(triggered()), this, SLOT(setNotVisibleForInv()));

	visibleForContact = new QAction(tr("Visible only for contact list"), this);
	visibleForContact->setCheckable(true);
	privacyGroup->addAction(visibleForContact);
	connect(visibleForContact, SIGNAL(triggered()), this, SLOT(setVisibleForContact()));

	invisibleForAll = new QAction(tr("Invisible for all"), this);
	invisibleForAll->setCheckable(true);
	privacyGroup->addAction(invisibleForAll);
	connect(invisibleForAll, SIGNAL(triggered()), this, SLOT(setInvisibleForAll()));

	privacyStatus->addAction(visibleForAll);
	privacyStatus->addAction(visibleForVis);
	privacyStatus->addAction(notVisibleForInv);
	privacyStatus->addAction(visibleForContact);
	privacyStatus->addAction(invisibleForAll);

	protoMenu->setTitle(icqUin);
	protoMenu->setIcon(currentIcon);
  
	statusMenu->addAction(onlineAction);
	statusMenu->addAction(ffcAction);
	statusMenu->addAction(awayAction);
	statusMenu->addAction(lunchAction);
	statusMenu->addAction(evilAction);
	statusMenu->addAction(depressionAction);
	statusMenu->addAction(atHomeAction);
	statusMenu->addAction(atWorkAction);
	statusMenu->addAction(naAction);
	statusMenu->addAction(occupiedAction);
	statusMenu->addAction(dndAction);
	statusMenu->addAction(invisibleAction);
  
  protoMenu->addMenu(statusMenu);
	protoMenu->addAction(customStatus);
  
	protoMenu->addSeparator();
  
	protoMenu->addMenu(privacyStatus);
  
	m_account_additional_menu = new QMenu(tr("Additional"));
	protoMenu->addMenu(m_account_additional_menu);
	thisIcqProtocol->getContactListClass()->initializaMenus(m_account_additional_menu);
	protoMenu->addAction(offlineAction);

	updateStatusMenu(showCustomStatus);

	quint32 privacy = account_settings.value("statuses/privacy", 4).toUInt();

	switch( privacy )
	{
	case 1:
		visibleForAll->setChecked(true);
		break;
	case 2:
		visibleForVis->setChecked(true);
		break;
	case 3:
		notVisibleForInv->setChecked(true);
		break;
	case 4:
		visibleForContact->setChecked(true);
		break;
	case 5:
		invisibleForAll->setChecked(true);
		break;
	default:
		visibleForContact->setChecked(true);
	}
}