예제 #1
0
void IRCChannelPage::onUserBan(wxCommandEvent &e)
{
	e.Skip();

	shared_ptr<IRCUser> user = getSelectedUser();
	if(user != nullptr)
	{
		toggleUserMode(user, ircModeTypeBan);
		kickUser(user);
	}
}
예제 #2
0
IRCChannelWidget::IRCChannelWidget(QWidget *parent, IRCClient* client) :
    QWidget(parent), _kickAction(this), _sendFileAction(this), _whoIsAction(this), _userOptions(this), _defaultChannel(0), _privMsg(this)
{
    _subject = 0;
    _client = client;
    _msgScreen = new QPlainTextEdit(this);
    // we use the text-edit to display text
    _msgScreen->setReadOnly(true);
    _lineEdit = new QLineEdit(this);
    _submitText = new QPushButton(this);
    _submitText->setText("submit");
    _submitText->setMinimumWidth(180);
    _users = new QListWidget(this);
    _users->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding);

    // on entering or pressing submit we let the GUI know that we want to send text
    connect(_lineEdit, SIGNAL(returnPressed()),this, SLOT(textEntered()));
    connect(_submitText, SIGNAL(clicked()), this, SLOT(textEntered()));
    connect(this, SIGNAL(notified()), this, SLOT(updateGui()));

    // create our grid layout
    constructMainLayout();

    stealFocus();

    // create rightclickmenu and actions connected to functions handeling the actions
    _users->setContextMenuPolicy(Qt::CustomContextMenu);
    _whoIsAction.setText("Who Is");
    _sendFileAction.setText("Send File");
    _kickAction.setText("Kick");
    _privMsg.setText("Privmsg");
    _userOptions.addAction(&_whoIsAction);
    _userOptions.addAction(&_sendFileAction);
    _userOptions.addAction(&_kickAction);
    _userOptions.addAction(&_privMsg);


    connect(_users, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showUserOptionsMenu(const QPoint &)));
    connect(&_whoIsAction, SIGNAL(triggered()), this, SLOT(sendWhoIs()));
    connect(&_sendFileAction, SIGNAL(triggered()), this, SLOT(sendFile()));
    connect(&_kickAction, SIGNAL(triggered()), this, SLOT(kickUser()));
    connect(&_privMsg, SIGNAL(triggered()), this, SLOT(setMsg()));
}
jConference::jConference(jProtocol *real_parent, Client *client, jAccount *plugin_system, QObject *parent) :
		QObject(parent),
		m_jabber_account(plugin_system),
		m_client_base(client),
		m_real_parent(real_parent),
		m_plugin_system(jPluginSystem::instance())
{
	m_account_name = utils::fromStd(client->jid().bare());
	m_presence = &client->presence();


	m_context_menu = new QMenu();
	m_menu_label = new QLabel;
	m_menu_label->setAlignment(Qt::AlignCenter);
	m_menu_title = new QWidgetAction(this);
	m_menu_title->setDefaultWidget(m_menu_label);
	m_kick_user = new QAction(tr("Kick"), this);
	m_ban_user = new QAction(tr("Ban"), this);
	m_role_user = new QActionGroup(this);
	m_user_visitor = new QAction(tr("Visitor"), m_role_user);
	m_user_participant = new QAction(tr("Participant"), m_role_user);
	m_user_moderator = new QAction(tr("Moderator"), m_role_user);
	m_user_visitor->setCheckable(true);
	m_user_participant->setCheckable(true);
	m_user_moderator->setCheckable(true);
	connect(m_kick_user, SIGNAL(triggered()), this, SLOT(kickUser()));
	connect(m_ban_user, SIGNAL(triggered()), this, SLOT(banUser()));
	connect(m_user_visitor, SIGNAL(triggered()), this, SLOT(setVisitorUser()));
	connect(m_user_participant, SIGNAL(triggered()), this, SLOT(setParticipantUser()));
	connect(m_user_moderator, SIGNAL(triggered()), this, SLOT(setModeratorUser()));


	m_join_form = 0;

	//	m_client_base->registerPresenceHandler(this);
}
예제 #4
0
void IRCChannelPage::kickSelectedUser()
{
	kickUser(getSelectedUser());
}