summaryrefslogtreecommitdiffstats
path: root/knode/kngroupbrowser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /knode/kngroupbrowser.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/kngroupbrowser.cpp')
-rw-r--r--knode/kngroupbrowser.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/knode/kngroupbrowser.cpp b/knode/kngroupbrowser.cpp
index 17342a4be..be91593a7 100644
--- a/knode/kngroupbrowser.cpp
+++ b/knode/kngroupbrowser.cpp
@@ -14,10 +14,10 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qtimer.h>
-#include <qapplication.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqtimer.h>
+#include <tqapplication.h>
#include <kseparator.h>
#include <kiconloader.h>
@@ -30,73 +30,73 @@
#include "knconfigmanager.h"
#include "knnntpaccount.h"
#include "kngroupbrowser.h"
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
-KNGroupBrowser::KNGroupBrowser(QWidget *parent, const QString &caption, KNNntpAccount *a,
- int buttons, bool newCBact, const QString &user1, const QString &user2) :
+KNGroupBrowser::KNGroupBrowser(TQWidget *parent, const TQString &caption, KNNntpAccount *a,
+ int buttons, bool newCBact, const TQString &user1, const TQString &user2) :
KDialogBase( parent, 0L, true, caption, buttons | Help | Ok | Cancel, Ok, true, user1, user2 ),
incrementalFilter(false), a_ccount(a)
{
- refilterTimer = new QTimer();
+ refilterTimer = new TQTimer();
- allList=new QSortedList<KNGroupInfo>;
+ allList=new TQSortedList<KNGroupInfo>;
allList->setAutoDelete(true);
- matchList=new QSortedList<KNGroupInfo>;
+ matchList=new TQSortedList<KNGroupInfo>;
matchList->setAutoDelete(false);
//create Widgets
- page=new QWidget(this);
+ page=new TQWidget(this);
setMainWidget(page);
filterEdit=new KLineEdit(page);
- QLabel *l=new QLabel(filterEdit,i18n("S&earch:"), page);
- noTreeCB=new QCheckBox(i18n("Disable &tree view"), page);
+ TQLabel *l=new TQLabel(filterEdit,i18n("S&earch:"), page);
+ noTreeCB=new TQCheckBox(i18n("Disable &tree view"), page);
noTreeCB->setChecked(false);
- subCB=new QCheckBox(i18n("&Subscribed only"), page);
+ subCB=new TQCheckBox(i18n("&Subscribed only"), page);
subCB->setChecked(false);
- newCB=new QCheckBox(i18n("&New only"), page);
+ newCB=new TQCheckBox(i18n("&New only"), page);
if (!newCBact)
newCB->hide();
newCB->setChecked(false);
KSeparator *sep=new KSeparator(KSeparator::HLine, page);
- QFont fnt=font();
+ TQFont fnt=font();
fnt.setBold(true);
- leftLabel=new QLabel(i18n("Loading groups..."), page);
- rightLabel=new QLabel(page);
+ leftLabel=new TQLabel(i18n("Loading groups..."), page);
+ rightLabel=new TQLabel(page);
leftLabel->setFont(fnt);
rightLabel->setFont(fnt);
pmGroup=knGlobals.configManager()->appearance()->icon(KNConfig::Appearance::group);
pmNew=knGlobals.configManager()->appearance()->icon(KNConfig::Appearance::redBall);
- pmRight=BarIconSet( QApplication::reverseLayout()? "back": "forward");
- pmLeft=BarIconSet( QApplication::reverseLayout() ? "forward" : "back");
+ pmRight=BarIconSet( TQApplication::reverseLayout()? "back": "forward");
+ pmLeft=BarIconSet( TQApplication::reverseLayout() ? "forward" : "back");
- arrowBtn1=new QPushButton(page);
+ arrowBtn1=new TQPushButton(page);
arrowBtn1->setEnabled(false);
- arrowBtn2=new QPushButton(page);
+ arrowBtn2=new TQPushButton(page);
arrowBtn2->setEnabled(false);
arrowBtn1->setIconSet(pmRight);
arrowBtn2->setIconSet(pmLeft);
arrowBtn1->setFixedSize(35,30);
arrowBtn2->setFixedSize(35,30);
- groupView=new QListView(page);
+ groupView=new TQListView(page);
groupView->setRootIsDecorated(true);
groupView->addColumn(i18n("Name"));
groupView->addColumn(i18n("Description"));
groupView->setTreeStepSize(15);
- connect(groupView, SIGNAL(doubleClicked(QListViewItem*)),
- this, SLOT(slotItemDoubleClicked(QListViewItem*)));
+ connect(groupView, TQT_SIGNAL(doubleClicked(TQListViewItem*)),
+ this, TQT_SLOT(slotItemDoubleClicked(TQListViewItem*)));
//layout
- QGridLayout *topL=new QGridLayout(page,3,1,0,5);
- QHBoxLayout *filterL=new QHBoxLayout(10);
- QVBoxLayout *arrL=new QVBoxLayout(10);
- listL=new QGridLayout(2, 3, 5);
+ TQGridLayout *topL=new TQGridLayout(page,3,1,0,5);
+ TQHBoxLayout *filterL=new TQHBoxLayout(10);
+ TQVBoxLayout *arrL=new TQVBoxLayout(10);
+ listL=new TQGridLayout(2, 3, 5);
topL->addLayout(filterL, 0,0);
topL->addWidget(sep,1,0);
@@ -121,22 +121,22 @@ KNGroupBrowser::KNGroupBrowser(QWidget *parent, const QString &caption, KNNntpAc
arrL->addWidget(arrowBtn2, AlignCenter);
//connect
- connect(filterEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotFilterTextChanged(const QString&)));
- connect(groupView, SIGNAL(expanded(QListViewItem*)),
- SLOT(slotItemExpand(QListViewItem*)));
+ connect(filterEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotFilterTextChanged(const TQString&)));
+ connect(groupView, TQT_SIGNAL(expanded(TQListViewItem*)),
+ TQT_SLOT(slotItemExpand(TQListViewItem*)));
- connect(refilterTimer, SIGNAL(timeout()), SLOT(slotRefilter()));
- connect(noTreeCB, SIGNAL(clicked()), SLOT(slotTreeCBToggled()));
- connect(subCB, SIGNAL(clicked()), SLOT(slotSubCBToggled()));
- connect(newCB, SIGNAL(clicked()), SLOT(slotNewCBToggled()));
+ connect(refilterTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotRefilter()));
+ connect(noTreeCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotTreeCBToggled()));
+ connect(subCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotSubCBToggled()));
+ connect(newCB, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewCBToggled()));
enableButton(User1,false);
enableButton(User2,false);
filterEdit->setFocus();
- QTimer::singleShot(2, this, SLOT(slotLoadList()));
+ TQTimer::singleShot(2, this, TQT_SLOT(slotLoadList()));
}
@@ -169,7 +169,7 @@ void KNGroupBrowser::slotReceiveList(KNGroupListData* d)
void KNGroupBrowser::changeItemState(const KNGroupInfo &gi, bool s)
{
- QListViewItemIterator it(groupView);
+ TQListViewItemIterator it(groupView);
for( ; it.current(); ++it)
if (it.current()->isSelectable() && (static_cast<CheckItem*>(it.current())->info==gi))
@@ -177,10 +177,10 @@ void KNGroupBrowser::changeItemState(const KNGroupInfo &gi, bool s)
}
-bool KNGroupBrowser::itemInListView(QListView *view, const KNGroupInfo &gi)
+bool KNGroupBrowser::itemInListView(TQListView *view, const KNGroupInfo &gi)
{
if(!view) return false;
- QListViewItemIterator it(view);
+ TQListViewItemIterator it(view);
for( ; it.current(); ++it)
if(static_cast<GroupItem*>(it.current())->info==gi)
@@ -190,16 +190,16 @@ bool KNGroupBrowser::itemInListView(QListView *view, const KNGroupInfo &gi)
}
-void KNGroupBrowser::createListItems(QListViewItem *parent)
+void KNGroupBrowser::createListItems(TQListViewItem *parent)
{
- QString prefix, tlgn, compare;
- QListViewItem *it;
+ TQString prefix, tlgn, compare;
+ TQListViewItem *it;
CheckItem *cit;
int colon;
bool expandit=false;
if(parent) {
- QListViewItem *p=parent;
+ TQListViewItem *p=parent;
while(p) {
prefix.prepend(p->text(0));
p=p->parent();
@@ -229,9 +229,9 @@ void KNGroupBrowser::createListItems(QListViewItem *parent)
if(expandit) {
if(parent)
- it=new QListViewItem(parent, tlgn);
+ it=new TQListViewItem(parent, tlgn);
else
- it=new QListViewItem(groupView, tlgn);
+ it=new TQListViewItem(groupView, tlgn);
it->setSelectable(false);
it->setExpandable(true);
@@ -248,10 +248,10 @@ void KNGroupBrowser::createListItems(QListViewItem *parent)
}
-void KNGroupBrowser::removeListItem(QListView *view, const KNGroupInfo &gi)
+void KNGroupBrowser::removeListItem(TQListView *view, const KNGroupInfo &gi)
{
if(!view) return;
- QListViewItemIterator it(view);
+ TQListViewItemIterator it(view);
for( ; it.current(); ++it)
if(static_cast<GroupItem*>(it.current())->info==gi) {
@@ -267,7 +267,7 @@ void KNGroupBrowser::slotLoadList()
}
-void KNGroupBrowser::slotItemExpand(QListViewItem *it)
+void KNGroupBrowser::slotItemExpand(TQListViewItem *it)
{
if(!it) return;
@@ -287,7 +287,7 @@ void KNGroupBrowser::slotItemExpand(QListViewItem *it)
{
groupView->ensureVisible(groupView->contentsX(), y+h/2, 0, h/2);
delayedCenter = y+h/2;
- QTimer::singleShot(300, this, SLOT(slotCenterDelayed()));
+ TQTimer::singleShot(300, this, TQT_SLOT(slotCenterDelayed()));
}
}
@@ -299,29 +299,29 @@ void KNGroupBrowser::slotCenterDelayed()
}
-void KNGroupBrowser::slotItemDoubleClicked(QListViewItem *it)
+void KNGroupBrowser::slotItemDoubleClicked(TQListViewItem *it)
{
if (it && (it->childCount()==0)) static_cast<CheckItem*>(it)->setOn(!static_cast<CheckItem*>(it)->isOn());
}
#define MIN_FOR_TREE 200
-void KNGroupBrowser::slotFilter(const QString &txt)
+void KNGroupBrowser::slotFilter(const TQString &txt)
{
- QString filtertxt = txt.lower();
- QRegExp reg(filtertxt, false, false);
+ TQString filtertxt = txt.lower();
+ TQRegExp reg(filtertxt, false, false);
CheckItem *cit=0;
bool notCheckSub = !subCB->isChecked();
bool notCheckNew = !newCB->isChecked();
bool notCheckStr = (filtertxt.isEmpty());
- bool isRegexp = filtertxt.contains(QRegExp("[^a-z0-9\\-\\+.]"));
+ bool isRegexp = filtertxt.contains(TQRegExp("[^a-z0-9\\-\\+.]"));
bool doIncrementalUpdate = (!isRegexp && incrementalFilter && (filtertxt.left(lastFilter.length())==lastFilter));
if (doIncrementalUpdate) {
- QSortedList<KNGroupInfo> *tempList = new QSortedList<KNGroupInfo>();
+ TQSortedList<KNGroupInfo> *tempList = new TQSortedList<KNGroupInfo>();
tempList->setAutoDelete(false);
for(KNGroupInfo *g=matchList->first(); g; g=matchList->next()) {
@@ -386,7 +386,7 @@ void KNGroupBrowser::slotNewCBToggled()
}
-void KNGroupBrowser::slotFilterTextChanged(const QString &)
+void KNGroupBrowser::slotFilterTextChanged(const TQString &)
{
if (subCB->isChecked() || newCB->isChecked())
slotRefilter();
@@ -405,10 +405,10 @@ void KNGroupBrowser::slotRefilter()
//=======================================================================================
-KNGroupBrowser::CheckItem::CheckItem(QListView *v, const KNGroupInfo &gi, KNGroupBrowser *b) :
- QCheckListItem(v, gi.name, QCheckListItem::CheckBox), info(gi), browser(b)
+KNGroupBrowser::CheckItem::CheckItem(TQListView *v, const KNGroupInfo &gi, KNGroupBrowser *b) :
+ TQCheckListItem(v, gi.name, TQCheckListItem::CheckBox), info(gi), browser(b)
{
- QString des(gi.description);
+ TQString des(gi.description);
if (gi.status == KNGroup::moderated) {
setText(0,gi.name+" (m)");
if (!des.upper().contains(i18n("moderated").upper()))
@@ -418,10 +418,10 @@ KNGroupBrowser::CheckItem::CheckItem(QListView *v, const KNGroupInfo &gi, KNGrou
}
-KNGroupBrowser::CheckItem::CheckItem(QListViewItem *i, const KNGroupInfo &gi, KNGroupBrowser *b) :
- QCheckListItem(i, gi.name, QCheckListItem::CheckBox), info(gi), browser(b)
+KNGroupBrowser::CheckItem::CheckItem(TQListViewItem *i, const KNGroupInfo &gi, KNGroupBrowser *b) :
+ TQCheckListItem(i, gi.name, TQCheckListItem::CheckBox), info(gi), browser(b)
{
- QString des(gi.description);
+ TQString des(gi.description);
if (gi.status == KNGroup::moderated) {
setText(0,gi.name+" (m)");
if (!des.upper().contains(i18n("moderated").upper()))
@@ -440,7 +440,7 @@ void KNGroupBrowser::CheckItem::setChecked(bool c)
{
KNGroupBrowser *b=browser;
browser=0;
- QCheckListItem::setOn(c);
+ TQCheckListItem::setOn(c);
browser=b;
}
@@ -457,16 +457,16 @@ void KNGroupBrowser::CheckItem::stateChange(bool s)
//=======================================================================================
-KNGroupBrowser::GroupItem::GroupItem(QListView *v, const KNGroupInfo &gi)
- : QListViewItem(v, gi.name), info(gi)
+KNGroupBrowser::GroupItem::GroupItem(TQListView *v, const KNGroupInfo &gi)
+ : TQListViewItem(v, gi.name), info(gi)
{
if (gi.status == KNGroup::moderated)
setText(0,gi.name+" (m)");
}
-KNGroupBrowser::GroupItem::GroupItem(QListViewItem *i, const KNGroupInfo &gi)
- : QListViewItem(i, gi.name), info(gi)
+KNGroupBrowser::GroupItem::GroupItem(TQListViewItem *i, const KNGroupInfo &gi)
+ : TQListViewItem(i, gi.name), info(gi)
{
}