diff options
Diffstat (limited to 'k3bsetup')
-rw-r--r-- | k3bsetup/base_k3bsetup2.ui | 54 | ||||
-rw-r--r-- | k3bsetup/k3bsetup2.cpp | 150 | ||||
-rw-r--r-- | k3bsetup/k3bsetup2.h | 11 |
3 files changed, 108 insertions, 107 deletions
diff --git a/k3bsetup/base_k3bsetup2.ui b/k3bsetup/base_k3bsetup2.ui index 05af5fd..002b43f 100644 --- a/k3bsetup/base_k3bsetup2.ui +++ b/k3bsetup/base_k3bsetup2.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>base_K3bSetup2</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>Form1</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,15 +19,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -38,15 +38,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout1</cstring> + <cstring>tqlayout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>m_checkUseBurningGroup</cstring> </property> @@ -58,7 +58,7 @@ <p>Otherwise all users on the system have access to the devices and to all K3b functionality.</string> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_editBurningGroup</cstring> </property> @@ -71,9 +71,9 @@ </widget> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> @@ -89,14 +89,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>10</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -104,7 +104,7 @@ <string>Users allowed to burn (separated by space):</string> </property> </widget> - <widget class="QLineEdit"> + <widget class="TQLineEdit"> <property name="name"> <cstring>m_editUsers</cstring> </property> @@ -116,7 +116,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -127,7 +127,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -184,9 +184,9 @@ <cstring>m_viewDevices</cstring> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> @@ -202,14 +202,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>40</width> <height>20</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>m_buttonAddDevice</cstring> </property> @@ -221,7 +221,7 @@ </widget> </vbox> </widget> - <widget class="QGroupBox"> + <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -232,11 +232,11 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QTabWidget"> + <widget class="TQTabWidget"> <property name="name"> <cstring>tabWidget2</cstring> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -247,7 +247,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -317,7 +317,7 @@ </widget> </vbox> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>tab</cstring> </property> @@ -339,7 +339,7 @@ <bool>false</bool> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_3</cstring> </property> @@ -370,7 +370,7 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> <includehint>klistview.h</includehint> diff --git a/k3bsetup/k3bsetup2.cpp b/k3bsetup/k3bsetup2.cpp index 37c23a1..95cdf9e 100644 --- a/k3bsetup/k3bsetup2.cpp +++ b/k3bsetup/k3bsetup2.cpp @@ -15,16 +15,16 @@ #include <config.h> -#include <qlayout.h> -#include <qmap.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qcheckbox.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qscrollview.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqcheckbox.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqscrollview.h> +#include <tqtimer.h> #include <klocale.h> #include <kglobal.h> @@ -95,19 +95,19 @@ public: bool changesNeeded; - QMap<QCheckListItem*, QString> listDeviceMap; - QMap<QString, QCheckListItem*> deviceListMap; + TQMap<TQCheckListItem*, TQString> listDeviceMap; + TQMap<TQString, TQCheckListItem*> deviceListMap; - QMap<QCheckListItem*, K3bExternalBin*> listBinMap; - QMap<K3bExternalBin*, QCheckListItem*> binListMap; + TQMap<TQCheckListItem*, K3bExternalBin*> listBinMap; + TQMap<K3bExternalBin*, TQCheckListItem*> binListMap; KConfig* config; }; -K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& ) - : KCModule( parent, "k3bsetup" ) +K3bSetup2::K3bSetup2( TQWidget *tqparent, const char *, const TQStringList& ) + : KCModule( tqparent, "k3bsetup" ) { d = new Private(); d->config = new KConfig( "k3bsetup2rc" ); @@ -120,7 +120,7 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& ) setButtons( KCModule::Apply|KCModule::Cancel|KCModule::Ok|KCModule::Default ); - QHBoxLayout* box = new QHBoxLayout( this ); + TQHBoxLayout* box = new TQHBoxLayout( this ); box->setAutoAdd(true); box->setMargin(0); box->setSpacing( KDialog::spacingHint() ); @@ -144,14 +144,14 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& ) w->textLabel2->hide(); - connect( w->m_checkUseBurningGroup, SIGNAL(toggled(bool)), - this, SLOT(updateViews()) ); - connect( w->m_editBurningGroup, SIGNAL(textChanged(const QString&)), - this, SLOT(updateViews()) ); - connect( w->m_editSearchPath, SIGNAL(changed()), - this, SLOT(slotSearchPrograms()) ); - connect( w->m_buttonAddDevice, SIGNAL(clicked()), - this, SLOT(slotAddDevice()) ); + connect( w->m_checkUseBurningGroup, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(updateViews()) ); + connect( w->m_editBurningGroup, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(updateViews()) ); + connect( w->m_editSearchPath, TQT_SIGNAL(changed()), + this, TQT_SLOT(slotSearchPrograms()) ); + connect( w->m_buttonAddDevice, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotAddDevice()) ); d->externalBinManager = new K3bExternalBinManager( this ); @@ -171,7 +171,7 @@ K3bSetup2::K3bSetup2( QWidget *parent, const char *, const QStringList& ) // This is a hack to work around a kcm bug which makes the faulty assumption that // every module starts without anything to apply // - QTimer::singleShot( 0, this, SLOT(updateViews()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(updateViews()) ); if( getuid() != 0 || !d->config->checkConfigFilesWritable( true ) ) makeReadOnly(); @@ -200,33 +200,33 @@ void K3bSetup2::updateViews() void K3bSetup2::updatePrograms() { // first save which were checked - QMap<K3bExternalBin*, bool> checkMap; - QListViewItemIterator listIt( w->m_viewPrograms ); + TQMap<K3bExternalBin*, bool> checkMap; + TQListViewItemIterator listIt( w->m_viewPrograms ); for( ; listIt.current(); ++listIt ) - checkMap.insert( d->listBinMap[(QCheckListItem*)*listIt], ((QCheckListItem*)*listIt)->isOn() ); + checkMap.insert( d->listBinMap[(TQCheckListItem*)*listIt], ((TQCheckListItem*)*listIt)->isOn() ); w->m_viewPrograms->clear(); d->binListMap.clear(); d->listBinMap.clear(); // load programs - const QMap<QString, K3bExternalProgram*>& map = d->externalBinManager->programs(); - for( QMap<QString, K3bExternalProgram*>::const_iterator it = map.begin(); it != map.end(); ++it ) { + const TQMap<TQString, K3bExternalProgram*>& map = d->externalBinManager->programs(); + for( TQMap<TQString, K3bExternalProgram*>::const_iterator it = map.begin(); it != map.end(); ++it ) { K3bExternalProgram* p = it.data(); - QPtrListIterator<K3bExternalBin> binIt( p->bins() ); + TQPtrListIterator<K3bExternalBin> binIt( p->bins() ); for( ; binIt.current(); ++binIt ) { K3bExternalBin* b = *binIt; - QFileInfo fi( b->path ); - // we need the uid bit which is not supported by QFileInfo + TQFileInfo fi( b->path ); + // we need the uid bit which is not supported by TQFileInfo struct stat s; - if( ::stat( QFile::encodeName(b->path), &s ) ) { + if( ::stat( TQFile::encodeName(b->path), &s ) ) { kdDebug() << "(K3bSetup2) unable to stat " << b->path << endl; } else { // create a checkviewitem - QCheckListItem* bi = new QCheckListItem( w->m_viewPrograms, b->name(), QCheckListItem::CheckBox ); + TQCheckListItem* bi = new TQCheckListItem( w->m_viewPrograms, b->name(), TQCheckListItem::CheckBox ); bi->setText( 1, b->version ); bi->setText( 2, b->path ); @@ -234,11 +234,11 @@ void K3bSetup2::updatePrograms() d->binListMap.insert( b, bi ); // check the item on first insertion or if it was checked before - bi->setOn( checkMap.contains(b) ? checkMap[b] : true ); + bi->setOn( checkMap.tqcontains(b) ? checkMap[b] : true ); int perm = s.st_mode & 0007777; - QString wantedGroup("root"); + TQString wantedGroup("root"); if( w->m_checkUseBurningGroup->isChecked() ) wantedGroup = burningGroup(); @@ -256,11 +256,11 @@ void K3bSetup2::updatePrograms() wantedPerm = 0000755; } - bi->setText( 3, QString::number( perm, 8 ).rightJustify( 4, '0' ) + " " + fi.owner() + "." + fi.group() ); + bi->setText( 3, TQString::number( perm, 8 ).rightJustify( 4, '0' ) + " " + fi.owner() + "." + fi.group() ); if( perm != wantedPerm || fi.owner() != "root" || fi.group() != wantedGroup ) { - bi->setText( 4, QString("%1 root.%2").arg(wantedPerm,0,8).arg(wantedGroup) ); + bi->setText( 4, TQString("%1 root.%2").tqarg(wantedPerm,0,8).tqarg(wantedGroup) ); if( bi->isOn() ) d->changesNeeded = true; } @@ -275,45 +275,45 @@ void K3bSetup2::updatePrograms() void K3bSetup2::updateDevices() { // first save which were checked - QMap<QString, bool> checkMap; - QListViewItemIterator listIt( w->m_viewDevices ); + TQMap<TQString, bool> checkMap; + TQListViewItemIterator listIt( w->m_viewDevices ); for( ; listIt.current(); ++listIt ) - checkMap.insert( d->listDeviceMap[(QCheckListItem*)*listIt], ((QCheckListItem*)*listIt)->isOn() ); + checkMap.insert( d->listDeviceMap[(TQCheckListItem*)*listIt], ((TQCheckListItem*)*listIt)->isOn() ); w->m_viewDevices->clear(); d->listDeviceMap.clear(); d->deviceListMap.clear(); - QPtrListIterator<K3bDevice::Device> it( d->deviceManager->allDevices() ); + TQPtrListIterator<K3bDevice::Device> it( d->deviceManager->allDevices() ); for( ; it.current(); ++it ) { K3bDevice::Device* device = *it; // check the item on first insertion or if it was checked before - QCheckListItem* item = createDeviceItem( device->blockDeviceName() ); - item->setOn( checkMap.contains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true ); + TQCheckListItem* item = createDeviceItem( device->blockDeviceName() ); + item->setOn( checkMap.tqcontains(device->blockDeviceName()) ? checkMap[device->blockDeviceName()] : true ); item->setText( 0, device->vendor() + " " + device->description() ); if( !device->genericDevice().isEmpty() ) { - QCheckListItem* item = createDeviceItem( device->genericDevice() ); - item->setOn( checkMap.contains(device->genericDevice()) ? checkMap[device->genericDevice()] : true ); + TQCheckListItem* item = createDeviceItem( device->genericDevice() ); + item->setOn( checkMap.tqcontains(device->genericDevice()) ? checkMap[device->genericDevice()] : true ); item->setText( 0, device->vendor() + " " + device->description() + " (" + i18n("Generic SCSI Device") + ")" ); } } } -QCheckListItem* K3bSetup2::createDeviceItem( const QString& deviceNode ) +TQCheckListItem* K3bSetup2::createDeviceItem( const TQString& deviceNode ) { - QFileInfo fi( deviceNode ); + TQFileInfo fi( deviceNode ); struct stat s; - if( ::stat( QFile::encodeName(deviceNode), &s ) ) { + if( ::stat( TQFile::encodeName(deviceNode), &s ) ) { kdDebug() << "(K3bSetup2) unable to stat " << deviceNode << endl; return 0; } else { // create a checkviewitem - QCheckListItem* bi = new QCheckListItem( w->m_viewDevices, + TQCheckListItem* bi = new TQCheckListItem( w->m_viewDevices, deviceNode, - QCheckListItem::CheckBox ); + TQCheckListItem::CheckBox ); d->listDeviceMap.insert( bi, deviceNode ); d->deviceListMap.insert( deviceNode, bi ); @@ -322,7 +322,7 @@ QCheckListItem* K3bSetup2::createDeviceItem( const QString& deviceNode ) int perm = s.st_mode & 0000777; - bi->setText( 2, QString::number( perm, 8 ).rightJustify( 3, '0' ) + " " + fi.owner() + "." + fi.group() ); + bi->setText( 2, TQString::number( perm, 8 ).rightJustify( 3, '0' ) + " " + fi.owner() + "." + fi.group() ); if( w->m_checkUseBurningGroup->isChecked() ) { // we ignore the device's owner here if( perm != 0000660 || @@ -383,7 +383,7 @@ void K3bSetup2::defaults() // This is a hack to work around a kcm bug which makes the faulty assumption that // every module defaults to a state where nothing is to be applied // - QTimer::singleShot( 0, this, SLOT(updateViews()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(updateViews()) ); } @@ -405,30 +405,30 @@ void K3bSetup2::save() // TODO: create the group if it's not there g = getgrnam( burningGroup().local8Bit() ); if( !g ) { - KMessageBox::error( this, i18n("There is no group %1.").arg(burningGroup()) ); + KMessageBox::error( this, i18n("There is no group %1.").tqarg(burningGroup()) ); return; } } // save the device permissions - QListViewItemIterator listIt( w->m_viewDevices ); + TQListViewItemIterator listIt( w->m_viewDevices ); for( ; listIt.current(); ++listIt ) { - QCheckListItem* checkItem = (QCheckListItem*)listIt.current(); + TQCheckListItem* checkItem = (TQCheckListItem*)listIt.current(); if( checkItem->isOn() ) { - QString dev = d->listDeviceMap[checkItem]; + TQString dev = d->listDeviceMap[checkItem]; if( w->m_checkUseBurningGroup->isChecked() ) { - if( ::chmod( QFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP ) ) + if( ::chmod( TQFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP ) ) success = false; - if( ::chown( QFile::encodeName(dev), (gid_t)-1, g->gr_gid ) ) + if( ::chown( TQFile::encodeName(dev), (gid_t)-1, g->gr_gid ) ) success = false; } else { - if( ::chmod( QFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH ) ) + if( ::chmod( TQFile::encodeName(dev), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH ) ) success = false; } } @@ -436,17 +436,17 @@ void K3bSetup2::save() // save the program permissions - listIt = QListViewItemIterator( w->m_viewPrograms ); + listIt = TQListViewItemIterator( w->m_viewPrograms ); for( ; listIt.current(); ++listIt ) { - QCheckListItem* checkItem = (QCheckListItem*)listIt.current(); + TQCheckListItem* checkItem = (TQCheckListItem*)listIt.current(); if( checkItem->isOn() ) { K3bExternalBin* bin = d->listBinMap[checkItem]; if( w->m_checkUseBurningGroup->isChecked() ) { - if( ::chown( QFile::encodeName(bin->path), (gid_t)0, g->gr_gid ) ) + if( ::chown( TQFile::encodeName(bin->path), (gid_t)0, g->gr_gid ) ) success = false; int perm = 0; @@ -455,11 +455,11 @@ void K3bSetup2::save() else perm = S_IRWXU|S_IXGRP|S_IRGRP; - if( ::chmod( QFile::encodeName(bin->path), perm ) ) + if( ::chmod( TQFile::encodeName(bin->path), perm ) ) success = false; } else { - if( ::chown( QFile::encodeName(bin->path), 0, 0 ) ) + if( ::chown( TQFile::encodeName(bin->path), 0, 0 ) ) success = false; int perm = 0; @@ -468,7 +468,7 @@ void K3bSetup2::save() else perm = S_IRWXU|S_IXGRP|S_IRGRP|S_IXOTH|S_IROTH; - if( ::chmod( QFile::encodeName(bin->path), perm ) ) + if( ::chmod( TQFile::encodeName(bin->path), perm ) ) success = false; } } @@ -490,7 +490,7 @@ void K3bSetup2::save() } -QString K3bSetup2::quickHelp() const +TQString K3bSetup2::quickHelp() const { return i18n("<h2>K3bSetup 2</h2>" "<p>This simple setup assistant is able to set the permissions needed by K3b in order to " @@ -504,10 +504,10 @@ QString K3bSetup2::quickHelp() const } -QString K3bSetup2::burningGroup() const +TQString K3bSetup2::burningGroup() const { - QString g = w->m_editBurningGroup->text(); - return g.isEmpty() ? QString("burning") : g; + TQString g = w->m_editBurningGroup->text(); + return g.isEmpty() ? TQString("burning") : g; } @@ -524,7 +524,7 @@ void K3bSetup2::slotSearchPrograms() void K3bSetup2::slotAddDevice() { bool ok; - QString newDevicename = KInputDialog::getText( i18n("Location of New Drive"), + TQString newDevicename = KInputDialog::getText( i18n("Location of New Drive"), i18n("Please enter the device name where K3b should search\n" "for a new drive (example: /dev/mebecdrom):"), "/dev/", &ok, this ); @@ -536,7 +536,7 @@ void K3bSetup2::slotAddDevice() emit changed( d->changesNeeded ); } else - KMessageBox::error( this, i18n("Could not find an additional device at\n%1").arg(newDevicename), + KMessageBox::error( this, i18n("Could not find an additional device at\n%1").tqarg(newDevicename), i18n("Error"), false ); } } @@ -553,7 +553,7 @@ void K3bSetup2::makeReadOnly() } -typedef KGenericFactory<K3bSetup2, QWidget> K3bSetup2Factory; +typedef KGenericFactory<K3bSetup2, TQWidget> K3bSetup2Factory; K_EXPORT_COMPONENT_FACTORY( kcm_k3bsetup2, K3bSetup2Factory("k3bsetup") ) diff --git a/k3bsetup/k3bsetup2.h b/k3bsetup/k3bsetup2.h index ea86664..6576640 100644 --- a/k3bsetup/k3bsetup2.h +++ b/k3bsetup/k3bsetup2.h @@ -22,18 +22,19 @@ class base_K3bSetup2; -class QCheckListItem; +class TQCheckListItem; class K3bSetup2: public KCModule { Q_OBJECT + TQ_OBJECT public: - K3bSetup2( QWidget* parent = 0, const char* name = 0, const QStringList& args = QStringList() ); + K3bSetup2( TQWidget* tqparent = 0, const char* name = 0, const TQStringList& args = TQStringList() ); ~K3bSetup2(); - QString quickHelp() const; + TQString quickHelp() const; const KAboutData* aboutData() { return m_aboutData; }; void load(); @@ -50,9 +51,9 @@ class K3bSetup2: public KCModule private: void updatePrograms(); void updateDevices(); - QString burningGroup() const; + TQString burningGroup() const; void makeReadOnly(); - QCheckListItem* createDeviceItem( const QString& deviceNode ); + TQCheckListItem* createDeviceItem( const TQString& deviceNode ); class Private; Private* d; |