コード例 #1
0
void AddedInfoEvent::activate( uint actionId )
{
	if ( actionId == AddAction )
	{
		if ( d->addDialog )
		{
			d->addDialog->raise();
		}
		else
		{
			UI::ContactAddedNotifyDialog::HideWidgetOptions hideFlags = UI::ContactAddedNotifyDialog::DefaultHide;
			if ( !(d->actions & AuthorizeAction) )
				hideFlags |= UI::ContactAddedNotifyDialog::AuthorizeCheckBox;
			if ( !(d->actions & InfoAction) )
				hideFlags |= UI::ContactAddedNotifyDialog::InfoButton;

			d->addDialog = new UI::ContactAddedNotifyDialog( d->contactId, d->contactNickname, d->account, hideFlags );
			d->addDialog->setAttribute( Qt::WA_DeleteOnClose, false );

			connect( d->addDialog, SIGNAL(finished()), this, SLOT(addDialogFinished()) );
			connect( d->addDialog, SIGNAL(applyClicked(QString)), this, SLOT(addDialogOk()) );
			connect( d->addDialog, SIGNAL(infoClicked(QString)), this, SLOT(addDialogInfo()) );
			d->addDialog->show();
		}
	}
	else
	{
		InfoEvent::activate( actionId );

		if ( !d->suppressClose && actionId != InfoAction && d->account->isConnected() )
			close();
	}
}
コード例 #2
0
ファイル: controlimp.cpp プロジェクト: icefox/kinkatta
/**
 * When you right click on a contact this is the menu that pops up.
 * @param pos the current position of the cursor
 */
void ChatRoomControlImp::rightClick(QListBoxItem *, const QPoint &pos){
  if ( buddyList->currentItem() == -1 /*|| buddyList->itemAt(pos) == NULL*/ ){
    QMessageBox::information(this, "Kinkatta - Message","Select a buddy.", QMessageBox::Ok);
    return;
  }

  if(_Menu == NULL){
    _Menu = new KPopupMenu(this, "rightclickmenu");
    _Menu->clear();
    _Menu->insertItem(SmallIcon("chat"), "&IM", this, SLOT(imClicked()));
    _Menu->insertItem(SmallIcon("fileclose"), "&Ignore", this, SLOT(ignoreClicked()));
    _Menu->insertItem(SmallIcon("buddy_info"), "&Info", this, SLOT(infoClicked()));
  }

  _Menu->exec(pos);
}
コード例 #3
0
void CompletionMenu::onAnchorClicked(QUrl url)
{
    emit infoClicked(QString(url.path()));
}