summaryrefslogtreecommitdiffstats
path: root/kpackage/managementWidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:25:18 +0000
commitaa3a1ca934bc541bddd3fa136a85f106f7da266e (patch)
tree9ad0b795aed8fa4ac30c2fe0fd1aacb8175714c0 /kpackage/managementWidget.cpp
parentb10cf7066791a2f362495890cd50c984e8025412 (diff)
downloadtdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.tar.gz
tdeadmin-aa3a1ca934bc541bddd3fa136a85f106f7da266e.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1157635 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpackage/managementWidget.cpp')
-rw-r--r--kpackage/managementWidget.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/kpackage/managementWidget.cpp b/kpackage/managementWidget.cpp
index 50cda53..e8dbcb6 100644
--- a/kpackage/managementWidget.cpp
+++ b/kpackage/managementWidget.cpp
@@ -29,8 +29,8 @@
*/
-#include <qsplitter.h>
-#include <qtoolbutton.h>
+#include <tqsplitter.h>
+#include <tqtoolbutton.h>
#include <klocale.h>
#include <kdebug.h>
@@ -52,7 +52,7 @@
extern Opts *opts;
-KpListViewSearchLine::KpListViewSearchLine(QWidget *parent, KpTreeList *listView)
+KpListViewSearchLine::KpListViewSearchLine(TQWidget *parent, KpTreeList *listView)
:KListViewSearchLine(parent, listView)
{
list = listView;
@@ -62,7 +62,7 @@ KpListViewSearchLine::~KpListViewSearchLine()
{
}
-void KpListViewSearchLine::updateSearch(const QString &s)
+void KpListViewSearchLine::updateSearch(const TQString &s)
{
list->expand();
KListViewSearchLine::updateSearch(s);
@@ -72,27 +72,27 @@ void KpListViewSearchLine::updateSearch(const QString &s)
// constructor -- initialise variables
-managementWidget::managementWidget(QWidget *parent)
- : QFrame(parent)
+managementWidget::managementWidget(TQWidget *parent)
+ : TQFrame(parent)
{
install_action = 0;
uninstall_action = 0;
- allPackages = new QPtrList<packageInfo>;
+ allPackages = new TQPtrList<packageInfo>;
tType[0] = i18n("Installed");
tType[1] = i18n("Updated");
tType[2] = i18n("New");
tType[3] = i18n("All");
- dirInstPackages = new QDict<packageInfo>(7717);
- dirUninstPackages = new QDict<packageInfo>(7717);
- dirInfoPackages = new QDict<packageInfo>(7717);
+ dirInstPackages = new TQDict<packageInfo>(7717);
+ dirUninstPackages = new TQDict<packageInfo>(7717);
+ dirInfoPackages = new TQDict<packageInfo>(7717);
setupWidgets();
- connect(treeList,SIGNAL(updateMarked()),
- this, SLOT( checkMarked()));
+ connect(treeList,TQT_SIGNAL(updateMarked()),
+ this, TQT_SLOT( checkMarked()));
}
managementWidget::~managementWidget()
@@ -103,7 +103,7 @@ managementWidget::~managementWidget()
// delete dirUninstPackages;
}
-void managementWidget::resizeEvent(QResizeEvent *)
+void managementWidget::resizeEvent(TQResizeEvent *)
{
arrangeWidgets();
}
@@ -111,46 +111,46 @@ void managementWidget::resizeEvent(QResizeEvent *)
void managementWidget::setupWidgets()
{
- QTab t;
+ TQTab t;
- top = new QBoxLayout(this,QBoxLayout::TopToBottom);
- vPan = new QSplitter(QSplitter::Horizontal, this);
+ top = new TQBoxLayout(this,TQBoxLayout::TopToBottom);
+ vPan = new TQSplitter(TQSplitter::Horizontal, this);
top->addWidget(vPan);
// the left panel
- leftpanel = new QFrame(vPan);
- leftbox = new QBoxLayout(leftpanel,QBoxLayout::TopToBottom);
+ leftpanel = new TQFrame(vPan);
+ leftbox = new TQBoxLayout(leftpanel,TQBoxLayout::TopToBottom);
- QTabBar *ltab = new QTabBar(leftpanel);
+ TQTabBar *ltab = new TQTabBar(leftpanel);
treeList = new KpTreeList(leftpanel);
for (int i = 0; i < 4; i++) {
- QTab *t = new QTab();
+ TQTab *t = new TQTab();
t->setText( tType[i] );
ltab->addTab(t);
}
// Quick Search Bar
searchToolBar = new KToolBar( leftpanel, "search toolbar");
- QToolButton *clearSearch = new QToolButton(searchToolBar);
+ TQToolButton *clearSearch = new TQToolButton(searchToolBar);
clearSearch->setTextLabel(i18n("Clear Search"), true);
- clearSearch->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left"
+ clearSearch->setIconSet(SmallIconSet(TQApplication::reverseLayout() ? "clear_left"
: "locationbar_erase"));
- (void) new QLabel(i18n("Search: "),searchToolBar);
+ (void) new TQLabel(i18n("Search: "),searchToolBar);
searchLine = new KpListViewSearchLine(searchToolBar, treeList);
// searchLine->setKeepParentsVisible(false);
- connect( clearSearch, SIGNAL( pressed() ), searchLine, SLOT( clear() ));
+ connect( clearSearch, TQT_SIGNAL( pressed() ), searchLine, TQT_SLOT( clear() ));
- QValueList<int> clist; clist.append(0); clist.append(2);
+ TQValueList<int> clist; clist.append(0); clist.append(2);
searchLine->setSearchColumns(clist);
searchToolBar->setStretchableWidget( searchLine );
- connect( treeList, SIGNAL( cleared() ), searchLine, SLOT( clear() ));
+ connect( treeList, TQT_SIGNAL( cleared() ), searchLine, TQT_SLOT( clear() ));
- connect(ltab,SIGNAL(selected (int)),SLOT(tabChanged(int)));
+ connect(ltab,TQT_SIGNAL(selected (int)),TQT_SLOT(tabChanged(int)));
ltab->setCurrentTab(treeList->treeType);
leftbox->addWidget(ltab,10);
@@ -159,16 +159,16 @@ void managementWidget::setupWidgets()
leftbox->addStretch();
- lbuttons = new QBoxLayout(QBoxLayout::LeftToRight);
+ lbuttons = new TQBoxLayout(TQBoxLayout::LeftToRight);
- luinstButton = new QPushButton(i18n("Uninstall Marked"),leftpanel);
+ luinstButton = new TQPushButton(i18n("Uninstall Marked"),leftpanel);
luinstButton->setEnabled(FALSE);
- connect(luinstButton,SIGNAL(clicked()),
- SLOT(uninstallMultClicked()));
- linstButton = new QPushButton(i18n("Install Marked"),leftpanel);
+ connect(luinstButton,TQT_SIGNAL(clicked()),
+ TQT_SLOT(uninstallMultClicked()));
+ linstButton = new TQPushButton(i18n("Install Marked"),leftpanel);
linstButton->setEnabled(FALSE);
- connect(linstButton,SIGNAL(clicked()),
- SLOT(installMultClicked()));
+ connect(linstButton,TQT_SIGNAL(clicked()),
+ TQT_SLOT(installMultClicked()));
leftbox->addLayout(lbuttons,0); // top level layout as child
@@ -177,27 +177,27 @@ void managementWidget::setupWidgets()
lbuttons->addWidget(luinstButton,1,AlignBottom);
lbuttons->addStretch(1);
- connect(treeList, SIGNAL(selectionChanged(QListViewItem *)),
- SLOT(packageHighlighted(QListViewItem *)));
+ connect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ TQT_SLOT(packageHighlighted(TQListViewItem *)));
// the right panel
- rightpanel = new QFrame(vPan);
- rightbox = new QBoxLayout(rightpanel,QBoxLayout::TopToBottom);
+ rightpanel = new TQFrame(vPan);
+ rightbox = new TQBoxLayout(rightpanel,TQBoxLayout::TopToBottom);
packageDisplay = new packageDisplayWidget(rightpanel);
- // connect(this, SIGNAL(changePackage(packageInfo *)),
- // packageDisplay, SLOT(changePackage(packageInfo *)));
+ // connect(this, TQT_SIGNAL(changePackage(packageInfo *)),
+ // packageDisplay, TQT_SLOT(changePackage(packageInfo *)));
- rbuttons = new QBoxLayout(QBoxLayout::LeftToRight);
+ rbuttons = new TQBoxLayout(TQBoxLayout::LeftToRight);
- uinstButton = new QPushButton(i18n("Uninstall"),rightpanel);
+ uinstButton = new TQPushButton(i18n("Uninstall"),rightpanel);
uinstButton->setEnabled(FALSE);
- connect(uinstButton,SIGNAL(clicked()),
- SLOT(uninstallSingleClicked()));
- instButton = new QPushButton(i18n("Install"),rightpanel);
+ connect(uinstButton,TQT_SIGNAL(clicked()),
+ TQT_SLOT(uninstallSingleClicked()));
+ instButton = new TQPushButton(i18n("Install"),rightpanel);
instButton->setEnabled(FALSE);
- connect(instButton,SIGNAL(clicked()),
- SLOT(installSingleClicked()));
+ connect(instButton,TQT_SIGNAL(clicked()),
+ TQT_SLOT(installSingleClicked()));
// Setup the `right panel' layout
@@ -235,7 +235,7 @@ void managementWidget::readPSeparator()
int w1 = config->readNumEntry("panel1Width",200);
int w2 = config->readNumEntry("panel2Width",200);
- QValueList<int> size;
+ TQValueList<int> size;
size << w1 << w2;
vPan->setSizes(size);
}
@@ -309,15 +309,15 @@ void managementWidget::collectData(bool refresh)
return; // if refresh not required already initialised
}
- QApplication::setOverrideCursor( waitCursor );
+ TQApplication::setOverrideCursor( waitCursor );
// stop clear() sending selectionChanged signal
- disconnect(treeList, SIGNAL(selectionChanged(QListViewItem *)),
- this, SLOT(packageHighlighted(QListViewItem *)));
+ disconnect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ this, TQT_SLOT(packageHighlighted(TQListViewItem *)));
treeList->hide(); // hide list tree
treeList->clear(); // empty it
- connect(treeList, SIGNAL(selectionChanged(QListViewItem *)),
- SLOT(packageHighlighted(QListViewItem *)));
+ connect(treeList, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
+ TQT_SLOT(packageHighlighted(TQListViewItem *)));
packageDisplay->changePackage(0);
@@ -326,7 +326,7 @@ void managementWidget::collectData(bool refresh)
delete allPackages;
}
- allPackages = new QPtrList<packageInfo>;
+ allPackages = new TQPtrList<packageInfo>;
allPackages->setAutoDelete(TRUE);
dirInstPackages->clear();
@@ -343,7 +343,7 @@ void managementWidget::collectData(bool refresh)
// Rebuild the list tree
rebuildListTree();
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
// Rebuild the list tree
@@ -384,7 +384,7 @@ void managementWidget::rebuildListTree()
}
// A package has been highlighted in the list tree
-void managementWidget::packageHighlighted(QListViewItem *item)
+void managementWidget::packageHighlighted(TQListViewItem *item)
{
treeList->packageHighlighted(item, packageDisplay);
@@ -399,12 +399,12 @@ void managementWidget::packageHighlighted(QListViewItem *item)
void managementWidget::installSingleClicked()
{
int result;
- QPtrList<packageInfo> plist;
+ TQPtrList<packageInfo> plist;
packageInfo *package = packageDisplay->package;
if (package) {
- QString filename = package->getFilename();
+ TQString filename = package->getFilename();
kdDebug() << "File=" << filename <<"\n";
pkgInterface *interface = package->interface;
if (interface->noFetch || !filename.isEmpty()) {
@@ -414,7 +414,7 @@ void managementWidget::installSingleClicked()
}
result = interface->installation->exec();
- if (interface->installation->result() == QDialog::Accepted ||
+ if (interface->installation->result() == TQDialog::Accepted ||
interface->installation->modified) {
// it was accepted, so the package has been installed
packageInfo *inf;
@@ -433,9 +433,9 @@ void managementWidget::installSingleClicked()
// kdDebug() << "Result=" << result <<"\n";
} else {
- QString url = package->getUrl();
+ TQString url = package->getUrl();
if (!url.isEmpty()) {
- QString s = kpackage->fetchNetFile(url);
+ TQString s = kpackage->fetchNetFile(url);
if (!s.isEmpty()) {
packageDisplay->changePackage(package);
setupInstButton();
@@ -457,14 +457,14 @@ void managementWidget::installMultClicked()
int i;
KpTreeListItem *it;
packageInfo *inf;
- QPtrList<packageInfo> **lst = new QPtrList<packageInfo>*[kpinterfaceN];
+ TQPtrList<packageInfo> **lst = new TQPtrList<packageInfo>*[kpinterfaceN];
selList.clear();
treeList->findMarked(treeList->firstChild(), selList);
for (i = 0; i < kpinterfaceN; i++) {
if (kpinterface[i]) {
- lst[i] = new QPtrList<packageInfo>;
+ lst[i] = new TQPtrList<packageInfo>;
for (it = selList.first(); it != 0; it = selList.next()) {
if (it->info->interface == kpinterface[i] &&
it->childCount() == 0 &&
@@ -505,7 +505,7 @@ void managementWidget::installMultClicked()
void managementWidget::uninstallSingleClicked()
{
int result;
- QPtrList<packageInfo> plist;
+ TQPtrList<packageInfo> plist;
packageInfo *package = packageDisplay->package;
@@ -517,7 +517,7 @@ void managementWidget::uninstallSingleClicked()
}
result = interface->uninstallation->exec();
- if(result == QDialog::Accepted ||
+ if(result == TQDialog::Accepted ||
interface->installation->modified) {
packageInfo *inf;
for (inf = plist.first(); inf != 0; inf = plist.next()) {
@@ -545,13 +545,13 @@ void managementWidget::uninstallMultClicked()
int i;
KpTreeListItem *it;
packageInfo *inf;
- QPtrList<packageInfo> **lst = new QPtrList<packageInfo>*[kpinterfaceN];
+ TQPtrList<packageInfo> **lst = new TQPtrList<packageInfo>*[kpinterfaceN];
selList.clear();
treeList->findMarked(treeList->firstChild(), selList);
for (i = 0; i < kpinterfaceN; i++) {
if (kpinterface[i]) {
- lst[i] = new QPtrList<packageInfo>;
+ lst[i] = new TQPtrList<packageInfo>;
for (it = selList.first(); it != 0; it = selList.next()) {
if (it->info->interface == kpinterface[i] &&
it->childCount() == 0 &&
@@ -596,7 +596,7 @@ void managementWidget::doChangePackage(packageInfo *p)
///////////////////////////////////////////////////////////////////////////
-KpTreeListItem *managementWidget::search(QString str, bool subStr, bool wrap,
+KpTreeListItem *managementWidget::search(TQString str, bool subStr, bool wrap,
bool start)
{
return treeList->search(str, subStr, wrap, start);
@@ -606,11 +606,11 @@ KpTreeListItem *managementWidget::search(QString str, bool subStr, bool wrap,
///////////////////////////////////////////////////////////////////////////
KpTreeListItem *managementWidget::updatePackage(packageInfo *pki, bool install)
{
- QString version;
+ TQString version;
KpTreeListItem *q;
if (allPackages) {
- QString name(pki->getProperty("name"));
+ TQString name(pki->getProperty("name"));
if (pki->hasProperty("version"))
version = pki->getProperty("version");
else
@@ -618,7 +618,7 @@ KpTreeListItem *managementWidget::updatePackage(packageInfo *pki, bool install)
pkgInterface *interface = pki->interface;
packageInfo *pnew = interface->getPackageInfo('i', name, version);
packageInfo *ptree;
- QString pkgId = name + interface->typeID;
+ TQString pkgId = name + interface->typeID;
if (install) {
if (pnew) {