Beispiel #1
0
void ActionListEditor::setupActions(KActionCollection *ac)
{
    m_add = ac->addAction("editor_add_action", this, SLOT(focusActionEdit()));
    m_add->setText(i18n("New Action"));
    m_add->setIcon(KIcon("list-add"));
    if (qgetenv("ZANSHIN_KONTACT_PLUGIN").isEmpty()) {
        m_add->setShortcut(Qt::CTRL | Qt::Key_N);
    }

    m_cancelAdd = ac->addAction("editor_cancel_action", m_stack, SLOT(setFocus()));
    connect(m_cancelAdd, SIGNAL(triggered()), this, SLOT(clearActionEdit()));
    m_cancelAdd->setText(i18n("Cancel New Action"));
    m_cancelAdd->setIcon(KIcon("edit-undo"));
    m_cancelAdd->setShortcut(Qt::Key_Escape);

    m_remove = ac->addAction("editor_remove_action", this, SLOT(onRemoveAction()));
    m_remove->setText(i18n("Remove Action"));
    m_remove->setIcon(KIcon("list-remove"));
    m_remove->setShortcut(Qt::Key_Delete);

    m_move = ac->addAction("editor_move_action", this, SLOT(onMoveAction()));
    m_move->setText(i18n("Move Action..."));
    m_move->setShortcut(Qt::Key_M);

    m_promote = ac->addAction("editor_promote_action", this, SLOT(onPromoteAction()));
    m_promote->setText(i18n("Promote Action as Project"));
    m_promote->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);

    m_dissociate = ac->addAction("editor_dissociate_action", this, SLOT(onDissociateAction()));
    m_dissociate->setText(i18n("Dissociate Action from Context"));
    m_dissociate->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_D);
}
Beispiel #2
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);
}