summaryrefslogtreecommitdiffstats
path: root/src/setupdialogprg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/setupdialogprg.cpp')
-rw-r--r--src/setupdialogprg.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/setupdialogprg.cpp b/src/setupdialogprg.cpp
index e2b9c39..1723af1 100644
--- a/src/setupdialogprg.cpp
+++ b/src/setupdialogprg.cpp
@@ -19,13 +19,13 @@
#include <kpushbutton.h>
#include <keditlistbox.h>
#include <klineedit.h>
-#include <qlistbox.h>
+#include <ntqlistbox.h>
#include <krun.h>
-#include <qiconview.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qtabwidget.h>
+#include <ntqiconview.h>
+#include <ntqdir.h>
+#include <ntqstringlist.h>
+#include <ntqtabwidget.h>
#include "setupdialog.h"
#include "setupdialogprg.h"
@@ -33,7 +33,7 @@
#include "appProp.h"
#include "kooldock.h"
-SetupDialogPrg::SetupDialogPrg(QWidget *parent, const char *name)
+SetupDialogPrg::SetupDialogPrg(TQWidget *parent, const char *name)
: SetupDialog(parent, name)
{
//Ignore list handlers
@@ -51,7 +51,7 @@ SetupDialogPrg::SetupDialogPrg(QWidget *parent, const char *name)
// some configuration variables
progPath = locateLocal("data", "kooldock");
- menuPath = progPath + QString("/menu/");
+ menuPath = progPath + TQString("/menu/");
KConfig *config = KGlobal::config();
config->setGroup("kooldock");
@@ -66,12 +66,12 @@ SetupDialogPrg::SetupDialogPrg(QWidget *parent, const char *name)
//Lets load the theme List
KStandardDirs sys;
- QStringList bgPath = sys.findDirs("data", "kooldock/backgrounds");
+ TQStringList bgPath = sys.findDirs("data", "kooldock/backgrounds");
for(unsigned int i=0; i<bgPath.count();i++)
{
- QDir tmpdir(bgPath[i]);
- QStringList theme_tmp(tmpdir.entryList(QDir::Dirs, QDir::Name));
- //We do it like this to avoid showing "." and ".." instead of copying QDir::entryList directly into "theme"
+ TQDir tmpdir(bgPath[i]);
+ TQStringList theme_tmp(tmpdir.entryList(TQDir::Dirs, TQDir::Name));
+ //We do it like this to avoid showing "." and ".." instead of copying TQDir::entryList directly into "theme"
for(unsigned int j=2; j<theme_tmp.count(); j++) theme->insertItem(theme_tmp[j]);
}
}
@@ -235,13 +235,13 @@ void SetupDialogPrg::configApply()
{
//Lets find exactly where the selected theme is
KStandardDirs sys;
- QString theme_dir="kooldock/backgrounds/"+theme->currentText();
- QStringList bgPath = sys.findDirs("data", theme_dir);
+ TQString theme_dir="kooldock/backgrounds/"+theme->currentText();
+ TQStringList bgPath = sys.findDirs("data", theme_dir);
//Lets set the images and write the config
- QString LeftImg=(QString)bgPath[0]+"background-left.png";
- QString CenterImg=(QString)bgPath[0]+"background-center.png";
- QString RightImg=(QString)bgPath[0]+"background-right.png";
+ TQString LeftImg=(TQString)bgPath[0]+"background-left.png";
+ TQString CenterImg=(TQString)bgPath[0]+"background-center.png";
+ TQString RightImg=(TQString)bgPath[0]+"background-right.png";
// background image enabled
config->writeEntry("Solid", 0);
@@ -267,15 +267,15 @@ void SetupDialogPrg::configApply()
config->sync();
// write ignore list to file
- QString progPath = locateLocal("data", "kooldock");
- QString menuPath = progPath + QString("/menu/");
- filepath = QString(progPath + "/ignorelist.conf");
+ TQString progPath = locateLocal("data", "kooldock");
+ TQString menuPath = progPath + TQString("/menu/");
+ filepath = TQString(progPath + "/ignorelist.conf");
if(ignoreBox->count()>0)
{
- QFile out(filepath);
+ TQFile out(filepath);
if (out.open(IO_WriteOnly))
{
- QTextStream out_s(&out);
+ TQTextStream out_s(&out);
for(int i=0; i<ignoreBox->count(); i++)
{
out_s << ignoreBox->text(i) << "\n";
@@ -285,7 +285,7 @@ void SetupDialogPrg::configApply()
}
else
{
- QFile::remove(filepath);
+ TQFile::remove(filepath);
}
emit apply();
}
@@ -299,7 +299,7 @@ void SetupDialogPrg::configCancel()
this->hide();
}
-void SetupDialogPrg::closeEvent( QCloseEvent *e )
+void SetupDialogPrg::closeEvent( TQCloseEvent *e )
{
e->ignore();
configCancel();
@@ -371,14 +371,14 @@ void SetupDialogPrg::chkHidden()
cbStayBelow->setEnabled(!tmp);
}
-void SetupDialogPrg::applist_dropped(QDropEvent*e,const QValueList<QIconDragItem>&)
+void SetupDialogPrg::applist_dropped(TQDropEvent*e,const TQValueList<TQIconDragItem>&)
{
KIconLoader icon_obj;
- QStringList lst;
- QString name;
+ TQStringList lst;
+ TQString name;
int pos;
- QUriDrag::decodeLocalFiles(e, lst);
+ TQUriDrag::decodeLocalFiles(e, lst);
name=lst[0];
//Lets see if it is a desktop file
@@ -421,18 +421,18 @@ void SetupDialogPrg::removeLauncher()
{
if(fileName!=NULL)
{
- QString question=i18n("Do you want to remove ") + fileName + QString("?");
+ TQString question=i18n("Do you want to remove ") + fileName + TQString("?");
int remove = KMessageBox::questionYesNo(0, question, i18n("Remove Launcher"));
if(remove!=KMessageBox::Yes) return;
KSimpleConfig *desktopfile;
- QDir homeDir = QDir::home();
+ TQDir homeDir = TQDir::home();
if (homeDir.exists(progPath))
{
- QDir dir(menuPath);
- QStringList fileListRemove;
+ TQDir dir(menuPath);
+ TQStringList fileListRemove;
fileListRemove = dir.entryList("*.desktop");
- for ( QStringList::Iterator it = fileListRemove.begin(); it != fileListRemove.end(); ++it )
+ for ( TQStringList::Iterator it = fileListRemove.begin(); it != fileListRemove.end(); ++it )
{
if ( ((*it) != ".") && ((*it) != "..") )
{
@@ -442,15 +442,15 @@ void SetupDialogPrg::removeLauncher()
{
kdDebug(0) << "Removing " << menuPath + (*it) << endl;
delete(desktopfile);
- if(QFile::remove(menuPath+(*it))==TRUE)
+ if(TQFile::remove(menuPath+(*it))==TRUE)
{
kdDebug(0) << "Item removed!" << endl;
//Lets update the launchers index
- QString preffix;
+ TQString preffix;
fileListRemove.clear();
fileListRemove=dir.entryList("*.desktop");
- QStringList fileListRemove2=fileListRemove;
+ TQStringList fileListRemove2=fileListRemove;
//Not really sure why I couldn't do this within the other for, something like fileListRemove[i].remove(0,2).prepend(preffix), but hell it works
for(unsigned int i=0; i<fileListRemove2.count(); i++)
@@ -461,10 +461,10 @@ void SetupDialogPrg::removeLauncher()
//Rename the files so they reflect their new position
for(unsigned int i=0; i<fileListRemove.count(); i++)
{
- if(i<10) preffix=QString("0%1").arg(i);
- if(i>=10) preffix=QString("%1").arg(i);
+ if(i<10) preffix=TQString("0%1").arg(i);
+ if(i>=10) preffix=TQString("%1").arg(i);
- dir.rename(fileListRemove[i], QString("%1%2").arg(preffix).arg(fileListRemove2[i]));
+ dir.rename(fileListRemove[i], TQString("%1%2").arg(preffix).arg(fileListRemove2[i]));
}
//End updating
@@ -507,7 +507,7 @@ void SetupDialogPrg::activeWindowChanged(WId id)
{
KWin::WindowInfo winfo;
winfo=KWin::windowInfo(id);
- QString ninfo=winfo.visibleName();
+ TQString ninfo=winfo.visibleName();
if(ninfo!=caption())
{
@@ -523,7 +523,7 @@ void SetupDialogPrg::buttonadd_clicked()
appdlg->show();
}
-void SetupDialogPrg::showEvent(QShowEvent *)
+void SetupDialogPrg::showEvent(TQShowEvent *)
{
//Here we fill the applist
appFill();
@@ -534,23 +534,23 @@ void SetupDialogPrg::appFill()
// fill the application list.
KSimpleConfig *desktopfile;
- QDir homeDir = QDir::home();
+ TQDir homeDir = TQDir::home();
KIconLoader icon_obj;
- QPixmap pixm;
+ TQPixmap pixm;
if(homeDir.exists(progPath))
{
- QDir dir(menuPath);
+ TQDir dir(menuPath);
fileList.clear();
fileList = dir.entryList("*.desktop");
- for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
+ for ( TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
{
if ( ((*it) != ".") && ((*it) != "..") )
{
desktopfile = new KSimpleConfig( menuPath + (*it), TRUE);
desktopfile->setGroup("Desktop Entry");
- QPixmap pixm=icon_obj.loadIcon(desktopfile->readEntry("Icon") ,KIcon::Desktop,0,KIcon::DefaultState,0L,false);
+ TQPixmap pixm=icon_obj.loadIcon(desktopfile->readEntry("Icon") ,KIcon::Desktop,0,KIcon::DefaultState,0L,false);
new KIconViewItem(applist, desktopfile->readEntry("Name"), pixm);
delete(desktopfile);
}
@@ -558,7 +558,7 @@ void SetupDialogPrg::appFill()
}
}
-void SetupDialogPrg::hideEvent ( QHideEvent * )
+void SetupDialogPrg::hideEvent ( TQHideEvent * )
{
// the application list is erased here.
appClear();
@@ -579,14 +579,14 @@ void SetupDialogPrg::right()
if (oldPos!=-1 && oldPos < (int)fileList.count()-1) {setnewpos(oldPos+1); oldPos++;iconsChanged();}
}
-void SetupDialogPrg::applist_clicked(QIconViewItem *e, const QPoint&)
+void SetupDialogPrg::applist_clicked(TQIconViewItem *e, const TQPoint&)
{
if(e!=NULL)
{oldPos=e->index();}
else
{oldPos=-1;}
}
-void SetupDialogPrg::applist_contextMenuRequested(QIconViewItem *e,const QPoint&)
+void SetupDialogPrg::applist_contextMenuRequested(TQIconViewItem *e,const TQPoint&)
{
if(e!=NULL)
{
@@ -600,17 +600,17 @@ void SetupDialogPrg::applist_contextMenuRequested(QIconViewItem *e,const QPoint&
//Load desktop data
KSimpleConfig *desktopfile;
- QDir dir(menuPath);
+ TQDir dir(menuPath);
fileList.clear();
fileList = dir.entryList("*.desktop");
int i=0;
- for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
+ for ( TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
{
if ( ((*it) != ".") && ((*it) != "..") )
{
desktopfile = new KSimpleConfig( menuPath + (*it), TRUE);
desktopfile->setGroup("Desktop Entry");
- int menustate=setpos->insertItem(QString("%1").arg(desktopfile->readEntry("Name")),i);
+ int menustate=setpos->insertItem(TQString("%1").arg(desktopfile->readEntry("Name")),i);
if(i==oldPos) {setpos->setItemEnabled(menustate, false);filepath=menuPath + (*it);}
delete(desktopfile);
i++;
@@ -622,7 +622,7 @@ void SetupDialogPrg::applist_contextMenuRequested(QIconViewItem *e,const QPoint&
popup->insertItem(i18n("Swap with"), setpos);
popup->insertItem(i18n("&Edit item"), this, SLOT(editItem()));
popup->insertItem(i18n("Remove"), this, SLOT(removeLauncher()));
- popup->exec(QCursor::pos());
+ popup->exec(TQCursor::pos());
if(popup) delete(popup);
if(setpos) delete(setpos);
}
@@ -639,15 +639,15 @@ void SetupDialogPrg::editItem()
void SetupDialogPrg::setnewpos(int newpos)
{
- kdDebug(0) << "New pos " << QString("0%1").arg(newpos) << "requested for: " << fileName<< endl;
+ kdDebug(0) << "New pos " << TQString("0%1").arg(newpos) << "requested for: " << fileName<< endl;
if(newpos==oldPos) return; //Nothing to be done
computeNewPos(newpos);
}
void SetupDialogPrg::computeNewPos(int pos)
{
- QString preffix, preffix2;
- QDir dir(menuPath);
+ TQString preffix, preffix2;
+ TQDir dir(menuPath);
fileList.clear();
fileList = dir.entryList("*.desktop");
@@ -659,18 +659,18 @@ void SetupDialogPrg::computeNewPos(int pos)
}
//Preffix for old position
- if(oldPos<10) preffix=QString("0%1").arg(oldPos);
- if(oldPos>=10) preffix=QString("%1").arg(oldPos);
+ if(oldPos<10) preffix=TQString("0%1").arg(oldPos);
+ if(oldPos>=10) preffix=TQString("%1").arg(oldPos);
//Preffix for new position
- if(pos<10) preffix2=QString("0%1").arg(pos);
- if(pos>=10) preffix2=QString("%1").arg(pos);
+ if(pos<10) preffix2=TQString("0%1").arg(pos);
+ if(pos>=10) preffix2=TQString("%1").arg(pos);
kdDebug(0) << "Old Position: " << oldPos << endl;
kdDebug(0) << "New Position: " << pos << endl;
- dir.rename(QString("%1%2").arg(preffix).arg(fileList[oldPos]), QString("%1%2").arg(preffix2).arg(fileList[oldPos]));
- dir.rename(QString("%1%2").arg(preffix2).arg(fileList[pos]), QString("%1%2").arg(preffix).arg(fileList[pos]));
+ dir.rename(TQString("%1%2").arg(preffix).arg(fileList[oldPos]), TQString("%1%2").arg(preffix2).arg(fileList[oldPos]));
+ dir.rename(TQString("%1%2").arg(preffix2).arg(fileList[pos]), TQString("%1%2").arg(preffix).arg(fileList[pos]));
appClear();
appFill();