diff options
Diffstat (limited to 'konversation/src/channeloptionsdialog.cpp')
-rw-r--r-- | konversation/src/channeloptionsdialog.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/konversation/src/channeloptionsdialog.cpp b/konversation/src/channeloptionsdialog.cpp index e10f950..5681872 100644 --- a/konversation/src/channeloptionsdialog.cpp +++ b/konversation/src/channeloptionsdialog.cpp @@ -16,11 +16,11 @@ #include "channeloptionsui.h" #include "channel.h" -#include <qcheckbox.h> -#include <qpushbutton.h> -#include <qregexp.h> -#include <qheader.h> -#include <qtoolbutton.h> +#include <tqcheckbox.h> +#include <tqpushbutton.h> +#include <tqregexp.h> +#include <tqheader.h> +#include <tqtoolbutton.h> #include <klocale.h> #include <klistview.h> @@ -48,7 +48,7 @@ namespace Konversation // don't allow sorting. most recent topic is always first m_widget->topicHistoryList->setSortColumn(-1); m_widget->clearButton->setIconSet(SmallIconSet("locationbar_erase")); - m_widget->banList->setDefaultRenameAction(QListView::Accept); + m_widget->banList->setDefaultRenameAction(TQListView::Accept); m_widget->banListSearchLine->setListView(m_widget->banList); // hide column where the complete topic will be put in for convenience m_widget->topicHistoryList->hideColumn(2); @@ -58,28 +58,28 @@ namespace Konversation m_channel = channel; m_editingTopic = false; - connect(m_widget->topicHistoryList, SIGNAL(clicked(QListViewItem*)), this, SLOT(topicHistoryItemClicked(QListViewItem*))); - connect(m_widget->topicHistoryList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(topicHistoryItemClicked(QListViewItem*))); - connect(m_widget->toggleAdvancedModes, SIGNAL(clicked()), this, SLOT(toggleAdvancedModes())); - connect(m_widget->topicEdit, SIGNAL(modificationChanged(bool)), this, SLOT(topicBeingEdited(bool))); + connect(m_widget->topicHistoryList, TQT_SIGNAL(clicked(TQListViewItem*)), this, TQT_SLOT(topicHistoryItemClicked(TQListViewItem*))); + connect(m_widget->topicHistoryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(topicHistoryItemClicked(TQListViewItem*))); + connect(m_widget->toggleAdvancedModes, TQT_SIGNAL(clicked()), this, TQT_SLOT(toggleAdvancedModes())); + connect(m_widget->topicEdit, TQT_SIGNAL(modificationChanged(bool)), this, TQT_SLOT(topicBeingEdited(bool))); - connect(m_channel, SIGNAL(topicHistoryChanged()), this, SLOT(refreshTopicHistory())); + connect(m_channel, TQT_SIGNAL(topicHistoryChanged()), this, TQT_SLOT(refreshTopicHistory())); - connect(m_channel, SIGNAL(modesChanged()), this, SLOT(refreshModes())); - connect(m_channel->getOwnChannelNick(), SIGNAL(channelNickChanged()), this, SLOT(refreshEnableModes())); + connect(m_channel, TQT_SIGNAL(modesChanged()), this, TQT_SLOT(refreshModes())); + connect(m_channel->getOwnChannelNick(), TQT_SIGNAL(channelNickChanged()), this, TQT_SLOT(refreshEnableModes())); - connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelClicked())); - connect(this, SIGNAL(okClicked()), this, SLOT(changeOptions())); - connect(this, SIGNAL(okClicked()), this, SLOT(okClicked())); + connect(this, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(cancelClicked())); + connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(changeOptions())); + connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(okClicked())); - connect(m_channel, SIGNAL(banAdded(const QString&)), this, SLOT(addBan(const QString&))); - connect(m_channel, SIGNAL(banRemoved(const QString&)), this, SLOT(removeBan(const QString&))); - connect(m_channel, SIGNAL(banListCleared()), m_widget->banList, SLOT(clear())); + connect(m_channel, TQT_SIGNAL(banAdded(const TQString&)), this, TQT_SLOT(addBan(const TQString&))); + connect(m_channel, TQT_SIGNAL(banRemoved(const TQString&)), this, TQT_SLOT(removeBan(const TQString&))); + connect(m_channel, TQT_SIGNAL(banListCleared()), m_widget->banList, TQT_SLOT(clear())); - connect(m_widget->addBan, SIGNAL(clicked()), this, SLOT(addBanClicked())); - connect(m_widget->removeBan, SIGNAL(clicked()), this, SLOT(removeBanClicked())); - connect(m_widget->banList, SIGNAL(itemRenamed (QListViewItem*)), this, SLOT(banEdited(QListViewItem*))); - connect(m_widget->banList, SIGNAL(itemRenamed (QListViewItem*, int, const QString&)), this, SLOT(banEdited(QListViewItem*))); + connect(m_widget->addBan, TQT_SIGNAL(clicked()), this, TQT_SLOT(addBanClicked())); + connect(m_widget->removeBan, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeBanClicked())); + connect(m_widget->banList, TQT_SIGNAL(itemRenamed (TQListViewItem*)), this, TQT_SLOT(banEdited(TQListViewItem*))); + connect(m_widget->banList, TQT_SIGNAL(itemRenamed (TQListViewItem*, int, const TQString&)), this, TQT_SLOT(banEdited(TQListViewItem*))); refreshTopicHistory(); refreshBanList(); @@ -93,7 +93,7 @@ namespace Konversation void ChannelOptionsDialog::changeOptions() { - QString newTopic = topic(), oldTopic=m_channel->getTopicHistory().first().section(' ', 2); + TQString newTopic = topic(), oldTopic=m_channel->getTopicHistory().first().section(' ', 2); if(newTopic != oldTopic) { @@ -107,20 +107,20 @@ namespace Konversation m_channel->sendChannelText(Preferences::commandChar() + "TOPIC " + m_channel->getName() + ' ' + newTopic); } - QStringList newModeList = modes(); - QStringList currentModeList = m_channel->getModeList(); - QStringList rmModes; - QStringList addModes; - QStringList tmp; - QString modeString; + TQStringList newModeList = modes(); + TQStringList currentModeList = m_channel->getModeList(); + TQStringList rmModes; + TQStringList addModes; + TQStringList tmp; + TQString modeString; bool plus; - QString command("MODE %1 %2%3 %4"); + TQString command("MODE %1 %2%3 %4"); - for(QStringList::iterator it = newModeList.begin(); it != newModeList.end(); ++it) + for(TQStringList::iterator it = newModeList.begin(); it != newModeList.end(); ++it) { modeString = (*it).mid(1); plus = ((*it)[0] == '+'); - tmp = currentModeList.grep(QRegExp('^' + modeString)); + tmp = currentModeList.grep(TQRegExp('^' + modeString)); if(tmp.isEmpty() && plus) { @@ -158,19 +158,19 @@ namespace Konversation m_editingTopic = state; } - QString ChannelOptionsDialog::topic() + TQString ChannelOptionsDialog::topic() { return m_widget->topicEdit->text().replace("\n"," "); } void ChannelOptionsDialog::refreshTopicHistory() { - QStringList history = m_channel->getTopicHistory(); + TQStringList history = m_channel->getTopicHistory(); m_widget->topicHistoryList->clear(); - for(QStringList::const_iterator it = history.fromLast(); it != history.end(); --it) + for(TQStringList::const_iterator it = history.fromLast(); it != history.end(); --it) { - QDateTime date; + TQDateTime date; date.setTime_t((*it).section(' ', 0 ,0).toUInt()); new KListViewItem(m_widget->topicHistoryList, (*it).section(' ', 1, 1), date.toString(Qt::LocalDate), (*it).section(' ', 2)); } @@ -182,7 +182,7 @@ namespace Konversation m_widget->topicEdit->setText(history.first().section(' ', 2)); } - void ChannelOptionsDialog::topicHistoryItemClicked(QListViewItem* item) + void ChannelOptionsDialog::topicHistoryItemClicked(TQListViewItem* item) { // if they didn't click on anything, item is null if(item) @@ -216,7 +216,7 @@ namespace Konversation void ChannelOptionsDialog::refreshAllowedChannelModes() { - QString modeString = m_channel->getServer()->allowedChannelModes(); + TQString modeString = m_channel->getServer()->allowedChannelModes(); // These modes are handled in a special way: ntimslkbeI modeString.remove('t'); modeString.remove('n'); @@ -234,13 +234,13 @@ namespace Konversation for(unsigned int i = 0; i < modeString.length(); i++) { - new QCheckListItem(m_widget->otherModesList, QString(modeString[i]), QCheckListItem::CheckBox); + new TQCheckListItem(m_widget->otherModesList, TQString(modeString[i]), TQCheckListItem::CheckBox); } } void ChannelOptionsDialog::refreshModes() { - QStringList modes = m_channel->getModeList(); + TQStringList modes = m_channel->getModeList(); m_widget->topicModeChBox->setChecked(false); m_widget->messageModeChBox->setChecked(false); @@ -252,17 +252,17 @@ namespace Konversation m_widget->keyModeChBox->setChecked(false); m_widget->keyModeEdit->setText(""); - QListViewItem* item = m_widget->otherModesList->firstChild(); + TQListViewItem* item = m_widget->otherModesList->firstChild(); while(item) { - static_cast<QCheckListItem*>(item)->setOn(false); + static_cast<TQCheckListItem*>(item)->setOn(false); item = item->nextSibling(); } char mode; - for(QStringList::const_iterator it = modes.begin(); it != modes.end(); ++it) + for(TQStringList::const_iterator it = modes.begin(); it != modes.end(); ++it) { mode = (*it)[0]; @@ -295,7 +295,7 @@ namespace Konversation { bool found = false; item = m_widget->otherModesList->firstChild(); - QString modeString; + TQString modeString; modeString = mode; while(item && !found) @@ -303,7 +303,7 @@ namespace Konversation if(item->text(0) == modeString) { found = true; - static_cast<QCheckListItem*>(item)->setOn(true); + static_cast<TQCheckListItem*>(item)->setOn(true); item->setText(1, (*it).mid(1)); } else @@ -320,10 +320,10 @@ namespace Konversation refreshEnableModes(); } - QStringList ChannelOptionsDialog::modes() + TQStringList ChannelOptionsDialog::modes() { - QStringList modes; - QString mode; + TQStringList modes; + TQString mode; mode = (m_widget->topicModeChBox->isChecked() ? "+" : "-"); mode += 't'; @@ -332,7 +332,7 @@ namespace Konversation mode += 'n'; modes.append(mode); mode = (m_widget->userLimitChBox->isChecked() ? "+" : "-"); - mode += 'l' + QString::number( m_widget->userLimitEdit->value() ); + mode += 'l' + TQString::number( m_widget->userLimitEdit->value() ); modes.append(mode); mode = (m_widget->inviteModeChBox->isChecked() ? "+" : "-"); mode += 'i'; @@ -357,11 +357,11 @@ namespace Konversation modes.append(mode); } - QListViewItem* item = m_widget->otherModesList->firstChild(); + TQListViewItem* item = m_widget->otherModesList->firstChild(); while(item) { - mode = (static_cast<QCheckListItem*>(item)->isOn() ? "+" : "-"); + mode = (static_cast<TQCheckListItem*>(item)->isOn() ? "+" : "-"); mode += item->text(0) + item->text(1); modes.append(mode); item = item->nextSibling(); @@ -374,30 +374,30 @@ namespace Konversation void ChannelOptionsDialog::refreshBanList() { - QStringList banlist = m_channel->getBanList(); + TQStringList banlist = m_channel->getBanList(); m_widget->banList->clear(); - for (QStringList::const_iterator it = banlist.fromLast(); it != banlist.end(); --it) + for (TQStringList::const_iterator it = banlist.fromLast(); it != banlist.end(); --it) addBan((*it)); } - void ChannelOptionsDialog::addBan(const QString& newban) + void ChannelOptionsDialog::addBan(const TQString& newban) { new BanListViewItem(m_widget->banList, newban.section(' ', 0, 0), newban.section(' ', 1, 1).section('!', 0, 0), newban.section(' ', 2 ,2).toUInt()); } - void ChannelOptionsDialog::removeBan(const QString& ban) + void ChannelOptionsDialog::removeBan(const TQString& ban) { delete m_widget->banList->findItem(ban, 0); } - void ChannelOptionsDialog::banEdited(QListViewItem *edited) + void ChannelOptionsDialog::banEdited(TQListViewItem *edited) { if (edited == m_NewBan) { if (!m_NewBan->text(0).isEmpty()) { - m_channel->getServer()->requestBan(QStringList(m_NewBan->text(0)), m_channel->getName(), QString()); + m_channel->getServer()->requestBan(TQStringList(m_NewBan->text(0)), m_channel->getName(), TQString()); } // We will delete the item and let the addBan slot handle @@ -418,7 +418,7 @@ namespace Konversation if (!new_edited->text(0).isEmpty()) { - m_channel->getServer()->requestBan(QStringList(new_edited->text(0)), m_channel->getName(), QString()); + m_channel->getServer()->requestBan(TQStringList(new_edited->text(0)), m_channel->getName(), TQString()); } // We delete the existing item because it's possible the server may @@ -446,7 +446,7 @@ namespace Konversation { if (m_widget->banList->renameLineEdit()->isShown()) { - QKeyEvent e(QEvent::KeyPress, Qt::Key_Escape, 27, Qt::NoButton); + TQKeyEvent e(TQEvent::KeyPress, Qt::Key_Escape, 27, Qt::NoButton); KApplication::sendEvent(m_widget->banList->renameLineEdit(), &e); } @@ -459,7 +459,7 @@ namespace Konversation { if (m_widget->banList->renameLineEdit()->isShown()) { - QKeyEvent e(QEvent::KeyPress, Qt::Key_Return, 13, Qt::NoButton); + TQKeyEvent e(TQEvent::KeyPress, Qt::Key_Return, 13, Qt::NoButton); KApplication::sendEvent(m_widget->banList->renameLineEdit(), &e); } @@ -467,33 +467,33 @@ namespace Konversation // This is our implementation of BanListViewItem - BanListViewItem::BanListViewItem(QListView *parent) + BanListViewItem::BanListViewItem(TQListView *parent) : KListViewItem(parent) { m_isNewBan = 0; } - BanListViewItem::BanListViewItem(QListView *parent, bool isNew) + BanListViewItem::BanListViewItem(TQListView *parent, bool isNew) : KListViewItem(parent) { m_isNewBan = isNew; } - BanListViewItem::BanListViewItem (QListView *parent, const QString& label1, const QString& label2, + BanListViewItem::BanListViewItem (TQListView *parent, const TQString& label1, const TQString& label2, uint timestamp) : KListViewItem(parent, label1, label2) { m_isNewBan = 0; m_timestamp.setTime_t(timestamp); } - BanListViewItem::BanListViewItem (QListView *parent, bool isNew, const QString& label1, const QString& label2, + BanListViewItem::BanListViewItem (TQListView *parent, bool isNew, const TQString& label1, const TQString& label2, uint timestamp) : KListViewItem(parent, label1, label2) { m_isNewBan = isNew; m_timestamp.setTime_t(timestamp); } - QString BanListViewItem::text(int column) const + TQString BanListViewItem::text(int column) const { if (column == 2) return KGlobal::locale()->formatDateTime(m_timestamp, true, true); @@ -501,7 +501,7 @@ namespace Konversation return KListViewItem::text(column); } - int BanListViewItem::compare(QListViewItem *i, int col, bool ascending) const + int BanListViewItem::compare(TQListViewItem *i, int col, bool ascending) const { if (col == 2) { |