diff options
Diffstat (limited to 'lib/kofficeui/KoInsertLink.cpp')
-rw-r--r-- | lib/kofficeui/KoInsertLink.cpp | 250 |
1 files changed, 125 insertions, 125 deletions
diff --git a/lib/kofficeui/KoInsertLink.cpp b/lib/kofficeui/KoInsertLink.cpp index 56c19081..947624b9 100644 --- a/lib/kofficeui/KoInsertLink.cpp +++ b/lib/kofficeui/KoInsertLink.cpp @@ -20,11 +20,11 @@ #include <kapplication.h> #include <klocale.h> -#include <qlayout.h> -#include <qvbox.h> +#include <tqlayout.h> +#include <tqvbox.h> #include <kdebug.h> -#include <qlabel.h> -#include <qcombobox.h> +#include <tqlabel.h> +#include <tqcombobox.h> #include <klineedit.h> #include <kurlrequester.h> @@ -36,38 +36,38 @@ using namespace KOfficePrivate; -KoInsertLinkDia::KoInsertLinkDia( QWidget *parent, const char *name, bool displayBookmarkLink ) +KoInsertLinkDia::KoInsertLinkDia( TQWidget *tqparent, const char *name, bool displayBookmarkLink ) : KDialogBase( KDialogBase::IconList, i18n("Insert Link"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name ) + KDialogBase::Ok, tqparent, name ) { bookmarkLink = 0L; - QVBox *page=addVBoxPage(i18n("Internet"), QString::null,BarIcon("html",KIcon::SizeMedium)); + TQVBox *page=addVBoxPage(i18n("Internet"), TQString(),BarIcon("html",KIcon::SizeMedium)); internetLink = new internetLinkPage(page ); - connect(internetLink,SIGNAL(textChanged()),this,SLOT(slotTextChanged ( ))); + connect(internetLink,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged ( ))); - page=addVBoxPage(i18n("Mail & News"), QString::null,BarIcon("mail_generic",KIcon::SizeMedium)); + page=addVBoxPage(i18n("Mail & News"), TQString(),BarIcon("mail_generic",KIcon::SizeMedium)); mailLink = new mailLinkPage(page ); - connect(mailLink,SIGNAL(textChanged()),this,SLOT(slotTextChanged ())); + connect(mailLink,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged ())); - page=addVBoxPage(i18n("File"), QString::null,BarIcon("filenew",KIcon::SizeMedium)); + page=addVBoxPage(i18n("File"), TQString(),BarIcon("filenew",KIcon::SizeMedium)); fileLink = new fileLinkPage(page ); - connect(fileLink,SIGNAL(textChanged()),this,SLOT(slotTextChanged ())); + connect(fileLink,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged ())); if ( displayBookmarkLink) { - page=addVBoxPage(i18n("Bookmark"), QString::null,BarIcon("bookmark",KIcon::SizeMedium)); + page=addVBoxPage(i18n("Bookmark"), TQString(),BarIcon("bookmark",KIcon::SizeMedium)); bookmarkLink = new bookmarkLinkPage(page ); - connect(bookmarkLink,SIGNAL(textChanged()),this,SLOT(slotTextChanged ())); + connect(bookmarkLink,TQT_SIGNAL(textChanged()),this,TQT_SLOT(slotTextChanged ())); } - connect( this, SIGNAL( aboutToShowPage(QWidget *) ), this, SLOT( tabChanged(QWidget *) ) ); + connect( this, TQT_SIGNAL( aboutToShowPage(TQWidget *) ), this, TQT_SLOT( tabChanged(TQWidget *) ) ); slotTextChanged ( ); resize(400,300); } -void KoInsertLinkDia::tabChanged(QWidget *) +void KoInsertLinkDia::tabChanged(TQWidget *) { switch( activePageIndex() ) { @@ -98,11 +98,11 @@ void KoInsertLinkDia::slotTextChanged ( ) currentText = linkName(); } -bool KoInsertLinkDia::createLinkDia(QString & _linkName, QString & _hrefName, const QStringList& bkmlist, bool displayBookmarkLink, QWidget* parent, const char* name) +bool KoInsertLinkDia::createLinkDia(TQString & _linkName, TQString & _hrefName, const TQStringList& bkmlist, bool displayBookmarkLink, TQWidget* tqparent, const char* name) { bool res = false; - KoInsertLinkDia *dlg = new KoInsertLinkDia( parent, name, displayBookmarkLink ); + KoInsertLinkDia *dlg = new KoInsertLinkDia( tqparent, name, displayBookmarkLink ); dlg->setHrefLinkName(_hrefName,_linkName, bkmlist); if ( dlg->exec() == Accepted ) { @@ -115,7 +115,7 @@ bool KoInsertLinkDia::createLinkDia(QString & _linkName, QString & _hrefName, co return res; } -void KoInsertLinkDia::setHrefLinkName(const QString &_href, const QString &_link, const QStringList & bkmlist) +void KoInsertLinkDia::setHrefLinkName(const TQString &_href, const TQString &_link, const TQStringList & bkmlist) { if ( bookmarkLink) bookmarkLink->setBookmarkList(bkmlist); @@ -129,25 +129,25 @@ void KoInsertLinkDia::setHrefLinkName(const QString &_href, const QString &_link } return; } - if(_href.find("http://")!=-1 || _href.find("https://")!=-1 ||_href.find("ftp://")!=-1 ) + if(_href.tqfind("http://")!=-1 || _href.tqfind("https://")!=-1 ||_href.tqfind("ftp://")!=-1 ) { internetLink->setHrefName(_href); internetLink->setLinkName(_link); showPage(0); } - else if(_href.find("file:/")!=-1) + else if(_href.tqfind("file:/")!=-1) { fileLink->setHrefName(_href); fileLink->setLinkName(_link); showPage(2); } - else if(_href.find("mailto:")!=-1 || _href.find("news:")!=-1) + else if(_href.tqfind("mailto:")!=-1 || _href.tqfind("news:")!=-1) { mailLink->setHrefName(_href); mailLink->setLinkName(_link); showPage(1); } - else if(_href.find("bkm://")!=-1) + else if(_href.tqfind("bkm://")!=-1) { if ( bookmarkLink ) { @@ -159,9 +159,9 @@ void KoInsertLinkDia::setHrefLinkName(const QString &_href, const QString &_link slotTextChanged ( ); } -QString KoInsertLinkDia::linkName() const +TQString KoInsertLinkDia::linkName() const { - QString result; + TQString result; switch(activePageIndex()) { case 0: @@ -185,9 +185,9 @@ QString KoInsertLinkDia::linkName() const return result; } -QString KoInsertLinkDia::hrefName() const +TQString KoInsertLinkDia::hrefName() const { - QString result; + TQString result; switch(activePageIndex()) { case 0: @@ -217,27 +217,27 @@ void KoInsertLinkDia::slotOk() } -internetLinkPage::internetLinkPage( QWidget *parent , char *name ) - : QWidget(parent,name) +internetLinkPage::internetLinkPage( TQWidget *tqparent , char *name ) + : TQWidget(tqparent,name) { - QVBoxLayout *lay1 = new QVBoxLayout( this ); + TQVBoxLayout *lay1 = new TQVBoxLayout( this ); lay1->setSpacing( KDialog::spacingHint() ); - QVBoxLayout *lay2 = new QVBoxLayout( lay1); + TQVBoxLayout *lay2 = new TQVBoxLayout( lay1); lay2->setSpacing( KDialog::spacingHint() ); - QLabel* tmpQLabel = new QLabel( this); + TQLabel* tmpTQLabel = new TQLabel( this); - lay2->addWidget(tmpQLabel); - tmpQLabel->setText(i18n("Text to display:")); + lay2->addWidget(tmpTQLabel); + tmpTQLabel->setText(i18n("Text to display:")); - m_linkName = new QLineEdit( this ); + m_linkName = new TQLineEdit( this ); lay2->addWidget(m_linkName); - tmpQLabel = new QLabel( this); - lay2->addWidget(tmpQLabel); + tmpTQLabel = new TQLabel( this); + lay2->addWidget(tmpTQLabel); - tmpQLabel->setText(i18n("Internet address:")); - m_hrefName = new QLineEdit( this ); + tmpTQLabel->setText(i18n("Internet address:")); + m_hrefName = new TQLineEdit( this ); lay2->addWidget(m_hrefName); @@ -245,72 +245,72 @@ internetLinkPage::internetLinkPage( QWidget *parent , char *name ) m_linkName->setFocus(); - connect(m_linkName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); - connect(m_hrefName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); + connect(m_linkName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); + connect(m_hrefName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); KSeparator* bar1 = new KSeparator( KSeparator::HLine, this); bar1->setFixedHeight( 10 ); lay2->addWidget( bar1 ); } -QString internetLinkPage::createInternetLink() +TQString internetLinkPage::createInternetLink() { - QString result=m_hrefName->text(); + TQString result=m_hrefName->text(); if(result.isEmpty()) return result; - if(result.find("http://")==-1 && result.find("https://")==-1 && result.find("ftp://")==-1) + if(result.tqfind("http://")==-1 && result.tqfind("https://")==-1 && result.tqfind("ftp://")==-1) result = "http://"+result; return result; } -void internetLinkPage::setLinkName(const QString & _name) +void internetLinkPage::setLinkName(const TQString & _name) { m_linkName->setText(_name); } -void internetLinkPage::setHrefName(const QString &_name) +void internetLinkPage::setHrefName(const TQString &_name) { m_hrefName->setText(_name); } -QString internetLinkPage::linkName()const +TQString internetLinkPage::linkName()const { return m_linkName->text(); } -QString internetLinkPage::hrefName() +TQString internetLinkPage::hrefName() { return createInternetLink(); } -void internetLinkPage::textChanged ( const QString & ) +void internetLinkPage::textChanged ( const TQString & ) { emit textChanged(); } -bookmarkLinkPage::bookmarkLinkPage( QWidget *parent , char *name ) - : QWidget(parent,name) +bookmarkLinkPage::bookmarkLinkPage( TQWidget *tqparent , char *name ) + : TQWidget(tqparent,name) { - QVBoxLayout *lay1 = new QVBoxLayout( this ); + TQVBoxLayout *lay1 = new TQVBoxLayout( this ); lay1->setSpacing( KDialog::spacingHint() ); - QVBoxLayout *lay2 = new QVBoxLayout( lay1); + TQVBoxLayout *lay2 = new TQVBoxLayout( lay1); lay2->setSpacing( KDialog::spacingHint() ); - QLabel* tmpQLabel = new QLabel( this); + TQLabel* tmpTQLabel = new TQLabel( this); - lay2->addWidget(tmpQLabel); - tmpQLabel->setText(i18n("Text to display:")); + lay2->addWidget(tmpTQLabel); + tmpTQLabel->setText(i18n("Text to display:")); - m_linkName = new QLineEdit( this ); + m_linkName = new TQLineEdit( this ); lay2->addWidget(m_linkName); - tmpQLabel = new QLabel( this); - lay2->addWidget(tmpQLabel); + tmpTQLabel = new TQLabel( this); + lay2->addWidget(tmpTQLabel); - tmpQLabel->setText(i18n("Bookmark name:")); - m_hrefName = new QComboBox( this ); + tmpTQLabel->setText(i18n("Bookmark name:")); + m_hrefName = new TQComboBox( this ); lay2->addWidget(m_hrefName); @@ -318,37 +318,37 @@ bookmarkLinkPage::bookmarkLinkPage( QWidget *parent , char *name ) m_linkName->setFocus(); - connect(m_linkName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); - connect(m_hrefName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); + connect(m_linkName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); + connect(m_hrefName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); KSeparator* bar1 = new KSeparator( KSeparator::HLine, this); bar1->setFixedHeight( 10 ); lay2->addWidget( bar1 ); } -QString bookmarkLinkPage::createBookmarkLink() +TQString bookmarkLinkPage::createBookmarkLink() { - QString result=m_hrefName->currentText(); + TQString result=m_hrefName->currentText(); if(result.isEmpty()) return result; - if(result.find("bkm://")==-1) + if(result.tqfind("bkm://")==-1) result = "bkm://"+result; return result; } -void bookmarkLinkPage::setLinkName(const QString & _name) +void bookmarkLinkPage::setLinkName(const TQString & _name) { m_linkName->setText(_name); } -void bookmarkLinkPage::setHrefName(const QString &_name) +void bookmarkLinkPage::setHrefName(const TQString &_name) { m_hrefName->setCurrentText(_name); } -void bookmarkLinkPage::setBookmarkList(const QStringList & bkmlist) +void bookmarkLinkPage::setBookmarkList(const TQStringList & bkmlist) { m_hrefName->clear(); m_hrefName->insertStringList(bkmlist, 0); @@ -357,119 +357,119 @@ void bookmarkLinkPage::setBookmarkList(const QStringList & bkmlist) //m_hrefName->setEditable(true); } -QString bookmarkLinkPage::linkName()const +TQString bookmarkLinkPage::linkName()const { return m_linkName->text(); } -QString bookmarkLinkPage::hrefName() +TQString bookmarkLinkPage::hrefName() { return createBookmarkLink(); } -void bookmarkLinkPage::textChanged ( const QString & ) +void bookmarkLinkPage::textChanged ( const TQString & ) { emit textChanged(); } -mailLinkPage::mailLinkPage( QWidget *parent , char *name ) - : QWidget(parent,name) +mailLinkPage::mailLinkPage( TQWidget *tqparent , char *name ) + : TQWidget(tqparent,name) { - QVBoxLayout *lay1 = new QVBoxLayout( this ); + TQVBoxLayout *lay1 = new TQVBoxLayout( this ); lay1->setSpacing( KDialog::spacingHint() ); - QVBoxLayout *lay2 = new QVBoxLayout( lay1); + TQVBoxLayout *lay2 = new TQVBoxLayout( lay1); lay2->setSpacing( KDialog::spacingHint() ); - QLabel* tmpQLabel = new QLabel( this); + TQLabel* tmpTQLabel = new TQLabel( this); - lay2->addWidget(tmpQLabel); - tmpQLabel->setText(i18n("Text to display:")); + lay2->addWidget(tmpTQLabel); + tmpTQLabel->setText(i18n("Text to display:")); - m_linkName = new QLineEdit( this ); + m_linkName = new TQLineEdit( this ); lay2->addWidget(m_linkName); - tmpQLabel = new QLabel( this); - lay2->addWidget(tmpQLabel); + tmpTQLabel = new TQLabel( this); + lay2->addWidget(tmpTQLabel); - tmpQLabel->setText(i18n("Target:")); - m_hrefName = new QLineEdit( this ); + tmpTQLabel->setText(i18n("Target:")); + m_hrefName = new TQLineEdit( this ); lay2->addWidget(m_hrefName); lay2->addStretch( 1 ); - connect(m_linkName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); - connect(m_hrefName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); + connect(m_linkName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); + connect(m_hrefName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); KSeparator* bar1 = new KSeparator( KSeparator::HLine, this); bar1->setFixedHeight( 10 ); lay2->addWidget( bar1 ); } -QString mailLinkPage::createMailLink() +TQString mailLinkPage::createMailLink() { - QString result=m_hrefName->text(); + TQString result=m_hrefName->text(); if(result.isEmpty()) return result; - if(result.find("mailto:")==-1 && result.find("news:")==-1) + if(result.tqfind("mailto:")==-1 && result.tqfind("news:")==-1) result = "mailto:"+result; return result; } -void mailLinkPage::setLinkName(const QString & _name) +void mailLinkPage::setLinkName(const TQString & _name) { m_linkName->setText(_name); } -void mailLinkPage::setHrefName(const QString &_name) +void mailLinkPage::setHrefName(const TQString &_name) { m_hrefName->setText(_name); } -QString mailLinkPage::linkName()const +TQString mailLinkPage::linkName()const { return m_linkName->text(); } -QString mailLinkPage::hrefName() +TQString mailLinkPage::hrefName() { return createMailLink(); } -void mailLinkPage::textChanged ( const QString & ) +void mailLinkPage::textChanged ( const TQString & ) { emit textChanged(); } -fileLinkPage::fileLinkPage( QWidget *parent , char *name ) - : QWidget(parent,name) +fileLinkPage::fileLinkPage( TQWidget *tqparent , char *name ) + : TQWidget(tqparent,name) { - QVBoxLayout *lay1 = new QVBoxLayout( this ); + TQVBoxLayout *lay1 = new TQVBoxLayout( this ); lay1->setSpacing( KDialog::spacingHint() ); - QVBoxLayout *lay2 = new QVBoxLayout( lay1); + TQVBoxLayout *lay2 = new TQVBoxLayout( lay1); lay2->setSpacing( KDialog::spacingHint() ); - QLabel* tmpQLabel = new QLabel( this); + TQLabel* tmpTQLabel = new TQLabel( this); - lay2->addWidget(tmpQLabel); - tmpQLabel->setText(i18n("Text to display:")); + lay2->addWidget(tmpTQLabel); + tmpTQLabel->setText(i18n("Text to display:")); - m_linkName = new QLineEdit( this ); + m_linkName = new TQLineEdit( this ); lay2->addWidget(m_linkName); - tmpQLabel = new QLabel( this); - lay2->addWidget(tmpQLabel); - tmpQLabel->setText(i18n("Recent file:")); + tmpTQLabel = new TQLabel( this); + lay2->addWidget(tmpTQLabel); + tmpTQLabel->setText(i18n("Recent file:")); - QComboBox * recentFile = new QComboBox( this ); + TQComboBox * recentFile = new TQComboBox( this ); recentFile->setMaximumWidth( kapp->desktop()->width()*3/4 ); lay2->addWidget(recentFile); - QStringList fileList = KRecentDocument::recentDocuments(); - QStringList lst; + TQStringList fileList = KRecentDocument::recentDocuments(); + TQStringList lst; lst <<""; - for (QStringList::ConstIterator it = fileList.begin();it != fileList.end(); ++it) + for (TQStringList::ConstIterator it = fileList.begin();it != fileList.end(); ++it) { KDesktopFile f(*it, true /* read only */); if ( !f.readURL().isEmpty()) @@ -484,64 +484,64 @@ fileLinkPage::fileLinkPage( QWidget *parent , char *name ) else recentFile->insertStringList( lst); - recentFile->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + recentFile->tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); - connect( recentFile , SIGNAL(highlighted ( const QString &)), this, SLOT( slotSelectRecentFile( const QString & ))); + connect( recentFile , TQT_SIGNAL(highlighted ( const TQString &)), this, TQT_SLOT( slotSelectRecentFile( const TQString & ))); - tmpQLabel = new QLabel( this); - lay2->addWidget(tmpQLabel); + tmpTQLabel = new TQLabel( this); + lay2->addWidget(tmpTQLabel); - tmpQLabel->setText(i18n("File location:")); + tmpTQLabel->setText(i18n("File location:")); m_hrefName = new KURLRequester( this ); lay2->addWidget(m_hrefName); lay2->addStretch( 1 ); - connect(m_linkName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); - connect(m_hrefName,SIGNAL(textChanged ( const QString & )),this,SLOT(textChanged ( const QString & ))); + connect(m_linkName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); + connect(m_hrefName,TQT_SIGNAL(textChanged ( const TQString & )),this,TQT_SLOT(textChanged ( const TQString & ))); KSeparator* bar1 = new KSeparator( KSeparator::HLine, this); bar1->setFixedHeight( 10 ); lay2->addWidget( bar1 ); } -void fileLinkPage::slotSelectRecentFile( const QString &_file ) +void fileLinkPage::slotSelectRecentFile( const TQString &_file ) { m_hrefName->lineEdit()->setText(_file ); } -QString fileLinkPage::createFileLink() +TQString fileLinkPage::createFileLink() { - QString result=m_hrefName->lineEdit()->text(); + TQString result=m_hrefName->lineEdit()->text(); if(result.isEmpty()) return result; - if(result.find("file:/")==-1) + if(result.tqfind("file:/")==-1) result = "file://"+result; return result; } -void fileLinkPage::setLinkName(const QString & _name) +void fileLinkPage::setLinkName(const TQString & _name) { m_linkName->setText(_name); } -void fileLinkPage::setHrefName(const QString &_name) +void fileLinkPage::setHrefName(const TQString &_name) { m_hrefName->lineEdit()->setText(_name); } -QString fileLinkPage::linkName()const +TQString fileLinkPage::linkName()const { return m_linkName->text(); } -QString fileLinkPage::hrefName() +TQString fileLinkPage::hrefName() { return createFileLink(); } -void fileLinkPage::textChanged ( const QString & ) +void fileLinkPage::textChanged ( const TQString & ) { emit textChanged(); } |