void KTextBrowser::setSource( const TQString& name ) { if( name.isNull() ) { return; } if( name.find('@') > -1 ) { if( !mNotifyClick ) { kapp->invokeMailer( KURL( name ) ); } else { emit mailClick( TQString::null, name ); } } else { if( !mNotifyClick ) { kapp->invokeBrowser( name ); } else { emit urlClick( name ); } } }
void KTextBrowser::setSource(const QUrl &name) { QString strName = name.toString(); if (strName.isNull()) { return; } QRegExp whatsthis("whatsthis:/*([^/].*)"); if (!d->notifyClick && whatsthis.exactMatch(strName)) { QWhatsThis::showText(QCursor::pos(), whatsthis.cap(1)); } else if (strName.indexOf('@') > -1) { if (!d->notifyClick) { QDesktopServices::openUrl(name); } else { emit mailClick(QString(), strName); } } else { if (!d->notifyClick) { QDesktopServices::openUrl(name); } else { emit urlClick(strName); } } }
AIMUserInfoDialog::AIMUserInfoDialog( Kopete::Contact *c, AIMAccount *acc, QWidget *parent ) : KDialog( parent ) { setCaption( i18n( "User Information on %1" , c->displayName() ) ); setButtons( KDialog::Cancel | KDialog::Ok ); setDefaultButton(KDialog::Ok); showButtonSeparator(true); kDebug(14200) << "for contact '" << c->contactId() << "'"; m_contact = c; mAccount = acc; QWidget* w = new QWidget( this ); mMainWidget = new Ui::AIMUserInfoWidget(); mMainWidget->setupUi( w ); setMainWidget( w ); QObject::connect(this, SIGNAL(okClicked()), this, SLOT(slotSaveClicked())); QObject::connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUpdateClicked())); QObject::connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCloseClicked())); QObject::connect(c, SIGNAL(updatedProfile()), this, SLOT(slotUpdateProfile())); QObject::connect(c, SIGNAL(statusMessageChanged( Kopete::Contact* )), this, SLOT(slotUpdateProfile())); mMainWidget->txtScreenName->setText( c->contactId() ); mMainWidget->txtNickName->setText( c->customName() ); if(m_contact == mAccount->myself()) // edit own account profile { mMainWidget->lblWarnLevel->hide(); mMainWidget->txtWarnLevel->hide(); mMainWidget->lblIdleTime->hide(); mMainWidget->txtIdleTime->hide(); mMainWidget->lblOnlineSince->hide(); mMainWidget->txtOnlineSince->hide(); mMainWidget->txtAwayMessage->hide(); mMainWidget->lblAwayMessage->hide(); userInfoView=0L; mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain); QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame); l->setContentsMargins( 0, 0, 0, 0 ); userInfoEdit = new KTextEdit(QString(), mMainWidget->userInfoFrame); AIMMyselfContact* aimmc = dynamic_cast<AIMMyselfContact*>( c ); if ( aimmc ) userInfoEdit->setPlainText( aimmc->userProfile() ); else userInfoEdit->setPlainText( QString() ); setButtonText(Ok, i18n("&Save Profile")); showButton(User1, false); l->addWidget(userInfoEdit); } else { userInfoEdit=0L; mMainWidget->userInfoFrame->setFrameStyle(QFrame::NoFrame | QFrame::Plain); QVBoxLayout *l = new QVBoxLayout(mMainWidget->userInfoFrame); l->setContentsMargins( 0, 0, 0, 0 ); userInfoView = new KTextBrowser(mMainWidget->userInfoFrame); userInfoView->setObjectName("userInfoView"); userInfoView->setNotifyClick(true); QObject::connect( userInfoView, SIGNAL(urlClick(QString)), this, SLOT(slotUrlClicked(QString))); QObject::connect( userInfoView, SIGNAL(mailClick(QString,QString)), this, SLOT(slotMailClicked(QString,QString))); showButton(Cancel, false); setButtonText(Ok, i18n("&Close")); setEscapeButton(Ok); l->addWidget(userInfoView); if(m_contact->isOnline()) { // Update the user view to indicate that we're requesting the user's profile userInfoView->setPlainText(i18n("Requesting User Profile, please wait...")); } QTimer::singleShot(0, this, SLOT(slotUpdateProfile())); } }
void TDEAboutContainerBase::slotMailClick( const TQString &_name, const TQString &_address ) { emit mailClick( _name, _address ); }