summaryrefslogtreecommitdiffstats
path: root/kopete/kopete/config/appearance/emoticonseditdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/kopete/config/appearance/emoticonseditdialog.cpp')
-rw-r--r--kopete/kopete/config/appearance/emoticonseditdialog.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/kopete/kopete/config/appearance/emoticonseditdialog.cpp b/kopete/kopete/config/appearance/emoticonseditdialog.cpp
index 21e12231..af62e4ff 100644
--- a/kopete/kopete/config/appearance/emoticonseditdialog.cpp
+++ b/kopete/kopete/config/appearance/emoticonseditdialog.cpp
@@ -25,19 +25,19 @@
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kio/job.h>
-#include <qpixmap.h>
-#include <qheader.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqpixmap.h>
+#include <tqheader.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
-EditDialog::EditDialog(QWidget *parent, const char* name)
+EditDialog::EditDialog(TQWidget *parent, const char* name)
: KDialogBase(parent, name, true, i18n(name), Ok|Cancel, Ok, true)
{
setupDlg();
}
-EditDialog::EditDialog(QWidget *parent, const char* name, QPixmap emot, QString text, QString file)
+EditDialog::EditDialog(TQWidget *parent, const char* name, TQPixmap emot, TQString text, TQString file)
: KDialogBase(parent, name, true, i18n(name), Ok|Cancel, Ok, true)
{
setupDlg();
@@ -48,19 +48,19 @@ EditDialog::EditDialog(QWidget *parent, const char* name, QPixmap emot, QString
void EditDialog::setupDlg()
{
- wdg = new QWidget(this);
- QVBoxLayout *vl = new QVBoxLayout(wdg, 11, 6);
- QHBoxLayout *hb = new QHBoxLayout(wdg, 0, 6);
+ wdg = new TQWidget(this);
+ TQVBoxLayout *vl = new TQVBoxLayout(wdg, 11, 6);
+ TQHBoxLayout *hb = new TQHBoxLayout(wdg, 0, 6);
leText = new KLineEdit(wdg);
btnIcon = new KPushButton(wdg);
- btnIcon->setFixedSize(QSize(64, 64));
+ btnIcon->setFixedSize(TQSize(64, 64));
- vl->addWidget(new QLabel(i18n("Insert the string for the emoticon\nseparated by space if you want multiple strings"), wdg));
+ vl->addWidget(new TQLabel(i18n("Insert the string for the emoticon\nseparated by space if you want multiple strings"), wdg));
hb->addWidget(btnIcon);
hb->addWidget(leText);
vl->addLayout(hb);
setMainWidget(wdg);
- connect(btnIcon, SIGNAL(clicked()), this, SLOT(btnIconClicked()));
+ connect(btnIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(btnIconClicked()));
}
void EditDialog::btnIconClicked()
@@ -75,17 +75,17 @@ void EditDialog::btnIconClicked()
if(emoticon.isEmpty())
return;
- btnIcon->setPixmap(QPixmap(emoticon));
+ btnIcon->setPixmap(TQPixmap(emoticon));
}
-EmoticonsEditDialog::EmoticonsEditDialog(QWidget *parent, QString theme, const char* name)
+EmoticonsEditDialog::EmoticonsEditDialog(TQWidget *parent, TQString theme, const char* name)
: KDialogBase(parent, name, true, i18n("Emoticons Editor"), Ok|Cancel, Ok, true)
{
themeName = theme;
mMainWidget = new EmoticonsEditWidget(this, "EmoticonsEditDialog::mMainWidget");
setMainWidget(mMainWidget);
- resize(QSize(450, 350));
+ resize(TQSize(450, 350));
mMainWidget->btnAdd->setGuiItem(KStdGuiItem::add());
mMainWidget->btnEdit->setText(i18n("Edit..."));
mMainWidget->btnRemove->setGuiItem(KStdGuiItem::remove());
@@ -96,22 +96,22 @@ EmoticonsEditDialog::EmoticonsEditDialog(QWidget *parent, QString theme, const c
mMainWidget->klvEmoticons->addColumn("File", 0);
mMainWidget->klvEmoticons->header()->hide();
Kopete::Emoticons emoticons( theme );
- QMap<QString, QStringList> smileys = emoticons.emoticonAndPicList();
+ TQMap<TQString, TQStringList> smileys = emoticons.emoticonAndPicList();
- for(QMap<QString, QStringList>::Iterator it = smileys.begin(); it != smileys.end(); ++it )
+ for(TQMap<TQString, TQStringList>::Iterator it = smileys.begin(); it != smileys.end(); ++it )
{
KListViewItem *itm = new KListViewItem(mMainWidget->klvEmoticons);
- itm->setPixmap(0, QPixmap(it.key()));
- itm->setText(2, QFileInfo(it.key()).baseName());
- QString text = *it.data().at(0);
+ itm->setPixmap(0, TQPixmap(it.key()));
+ itm->setText(2, TQFileInfo(it.key()).baseName());
+ TQString text = *it.data().at(0);
for(uint i = 1; i < it.data().size(); i++) {
text += " " + *it.data().at(i);
}
itm->setText(1, text);
}
- QFile *fp = new QFile(KGlobal::dirs()->saveLocation( "emoticons", themeName, false ) + "/emoticons.xml");
+ TQFile *fp = new TQFile(KGlobal::dirs()->saveLocation( "emoticons", themeName, false ) + "/emoticons.xml");
if( !fp->exists() ) {
kdWarning() << "EmoticonsEditDialog::EmoticonsEditDialog() " << fp->name() << " doesn't exist!" << endl;
@@ -131,18 +131,18 @@ EmoticonsEditDialog::EmoticonsEditDialog(QWidget *parent, QString theme, const c
fp->close();
- mMainWidget->klvEmoticons->setColumnWidth(0, QListView::Maximum);
- mMainWidget->klvEmoticons->setColumnWidth(1, QListView::Maximum);
+ mMainWidget->klvEmoticons->setColumnWidth(0, TQListView::Maximum);
+ mMainWidget->klvEmoticons->setColumnWidth(1, TQListView::Maximum);
- connect(this, SIGNAL(okClicked()), this, SLOT(slotOkClicked()));
- connect(mMainWidget->btnAdd, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
- connect(mMainWidget->btnEdit, SIGNAL(clicked()), this, SLOT(slotEditClicked()));
- connect(mMainWidget->btnRemove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
+ connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotOkClicked()));
+ connect(mMainWidget->btnAdd, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddClicked()));
+ connect(mMainWidget->btnEdit, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditClicked()));
+ connect(mMainWidget->btnRemove, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoveClicked()));
}
void EmoticonsEditDialog::slotOkClicked()
{
- QFile *fp = new QFile(KGlobal::dirs()->saveLocation( "emoticons", themeName, false ) + "/emoticons.xml");
+ TQFile *fp = new TQFile(KGlobal::dirs()->saveLocation( "emoticons", themeName, false ) + "/emoticons.xml");
if( !fp->exists() ) {
kdWarning() << "EmoticonsEditDialog::slotOkClicked() " << fp->name() << " doesn't exist!" << endl;
@@ -154,7 +154,7 @@ void EmoticonsEditDialog::slotOkClicked()
return;
}
- QTextStream emoStream(fp);
+ TQTextStream emoStream(fp);
emoStream << themeXml.toString(4);
fp->close();
}
@@ -163,7 +163,7 @@ void EmoticonsEditDialog::slotAddClicked()
{
EditDialog *dlg = new EditDialog(this, "Add emoticon");
- if(dlg->exec() == QDialog::Rejected)
+ if(dlg->exec() == TQDialog::Rejected)
return;
if(dlg->getText().isEmpty() || !dlg->getEmoticon())
@@ -182,29 +182,29 @@ void EmoticonsEditDialog::slotEditClicked()
dlg = new EditDialog(this, "Edit emoticon", *mMainWidget->klvEmoticons->selectedItem()->pixmap(0), mMainWidget->klvEmoticons->selectedItem()->text(1), mMainWidget->klvEmoticons->selectedItem()->text(2));
- if(dlg->exec() == QDialog::Rejected)
+ if(dlg->exec() == TQDialog::Rejected)
return;
if(dlg->getText().isEmpty() || !dlg->getEmoticon())
return;
bool copy;
- QString emo = dlg->getEmoticon();
+ TQString emo = dlg->getEmoticon();
if(mMainWidget->klvEmoticons->selectedItem()->text(2) != dlg->getEmoticon()) {
copy = true;
} else {
copy = false;
- QString f = mMainWidget->klvEmoticons->selectedItem()->text(2);
+ TQString f = mMainWidget->klvEmoticons->selectedItem()->text(2);
KStandardDirs *dir = KGlobal::dirs();
- emo = dir->findResource( "emoticons", themeName + QString::fromLatin1( "/" ) + f );
+ emo = dir->findResource( "emoticons", themeName + TQString::fromLatin1( "/" ) + f );
if( emo.isNull() )
- emo = dir->findResource( "emoticons", themeName + QString::fromLatin1( "/" ) + f + QString::fromLatin1( ".mng" ) );
+ emo = dir->findResource( "emoticons", themeName + TQString::fromLatin1( "/" ) + f + TQString::fromLatin1( ".mng" ) );
if ( emo.isNull() )
- emo = dir->findResource( "emoticons", themeName + QString::fromLatin1( "/" ) + f + QString::fromLatin1( ".png" ) );
+ emo = dir->findResource( "emoticons", themeName + TQString::fromLatin1( "/" ) + f + TQString::fromLatin1( ".png" ) );
if ( emo.isNull() )
- emo = dir->findResource( "emoticons", themeName + QString::fromLatin1( "/" ) + f + QString::fromLatin1( ".gif" ) );
+ emo = dir->findResource( "emoticons", themeName + TQString::fromLatin1( "/" ) + f + TQString::fromLatin1( ".gif" ) );
if ( emo.isNull() )
return;
}
@@ -223,44 +223,44 @@ void EmoticonsEditDialog::slotRemoveClicked()
removeEmoticon(mMainWidget->klvEmoticons->selectedItem()->text(2));
}
-void EmoticonsEditDialog::addEmoticon(QString emo, QString text, bool copy)
+void EmoticonsEditDialog::addEmoticon(TQString emo, TQString text, bool copy)
{
if(copy)
KIO::copy(emo, KGlobal::dirs()->saveLocation( "emoticons", themeName, false ));
KListViewItem *itm = new KListViewItem(mMainWidget->klvEmoticons);
- itm->setPixmap(0, QPixmap(emo));
+ itm->setPixmap(0, TQPixmap(emo));
itm->setText(1, text);
- itm->setText(2, QFileInfo(emo).baseName());
+ itm->setText(2, TQFileInfo(emo).baseName());
- QDomNode lc = themeXml.lastChild();
+ TQDomNode lc = themeXml.lastChild();
if(lc.isNull())
return;
- QDomElement emoticon = themeXml.createElement("emoticon");
- emoticon.setAttribute("file", QFileInfo(emo).baseName());
+ TQDomElement emoticon = themeXml.createElement("emoticon");
+ emoticon.setAttribute("file", TQFileInfo(emo).baseName());
lc.appendChild(emoticon);
- QStringList splitted = QStringList::split(" ", text);
- QStringList::const_iterator constIterator;
+ TQStringList splitted = TQStringList::split(" ", text);
+ TQStringList::const_iterator constIterator;
for(constIterator = splitted.begin(); constIterator != splitted.end(); constIterator++)
{
- QDomElement emotext = themeXml.createElement("string");
- QDomText txt = themeXml.createTextNode((*constIterator).stripWhiteSpace());
+ TQDomElement emotext = themeXml.createElement("string");
+ TQDomText txt = themeXml.createTextNode((*constIterator).stripWhiteSpace());
emotext.appendChild(txt);
emoticon.appendChild(emotext);
}
}
-void EmoticonsEditDialog::removeEmoticon(QString emo)
+void EmoticonsEditDialog::removeEmoticon(TQString emo)
{
- QDomNode lc = themeXml.lastChild();
+ TQDomNode lc = themeXml.lastChild();
if(lc.isNull())
return;
- QDomNodeList nl = lc.childNodes();
+ TQDomNodeList nl = lc.childNodes();
for(uint i = 0; i < nl.length(); i++) {
- QDomElement de = nl.item(i).toElement();
+ TQDomElement de = nl.item(i).toElement();
if(!de.isNull() && de.tagName() == "emoticon" && de.attribute("file") == emo) {
lc.removeChild(de);
delete mMainWidget->klvEmoticons->selectedItem();