summaryrefslogtreecommitdiffstats
path: root/kgpg/kgpgoptions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kgpg/kgpgoptions.cpp')
-rw-r--r--kgpg/kgpgoptions.cpp158
1 files changed, 79 insertions, 79 deletions
diff --git a/kgpg/kgpgoptions.cpp b/kgpg/kgpgoptions.cpp
index a45e8a6..8667c1d 100644
--- a/kgpg/kgpgoptions.cpp
+++ b/kgpg/kgpgoptions.cpp
@@ -18,19 +18,19 @@
/////////////////////////////////////////////// code for the option dialog box
#include <config.h>
-#include <qlayout.h>
-#include <qtabwidget.h>
-#include <qlabel.h>
-#include <qtoolbutton.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqtabwidget.h>
+#include <tqlabel.h>
+#include <tqtoolbutton.h>
+#include <tqfile.h>
#include <kconfig.h>
#include <kdeversion.h>
#include <klocale.h>
#include <kprocio.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qpushbutton.h>
-#include <qfont.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqpushbutton.h>
+#include <tqfont.h>
#include <kaction.h>
#include <kmessagebox.h>
#include <klineedit.h>
@@ -62,7 +62,7 @@ class QTabWidget;
/////////////////////// main window
-kgpgOptions::kgpgOptions(QWidget *parent, const char *name)
+kgpgOptions::kgpgOptions(TQWidget *parent, const char *name)
: KConfigDialog( parent, name, KGpgSettings::self())
{
defaultServerList="hkp://wwwkeys.eu.pgp.net ";
@@ -70,17 +70,17 @@ kgpgOptions::kgpgOptions(QWidget *parent, const char *name)
defaultServerList+=",hkp://search.keyserver.net,hkp://wwwkeys.pgp.net,hkp://pgp.dtype.org,hkp://wwwkeys.us.pgp.net";
config = new KConfig ("kgpgrc");
config->setGroup("Servers");
- serverList=QStringList::split (",",config->readEntry("Server_List",defaultServerList));
+ serverList=TQStringList::split (",",config->readEntry("Server_List",defaultServerList));
keyServer = KgpgInterface::getGpgSetting("keyserver", KGpgSettings::gpgConfigPath());
if (!keyServer.isEmpty()) serverList.prepend(keyServer+" "+i18n("(Default)"));
- defaultHomePath=QDir::homeDirPath()+"/.gnupg/";
- if (QFile(defaultHomePath+"options").exists()) defaultConfigPath="options";
+ defaultHomePath=TQDir::homeDirPath()+"/.gnupg/";
+ if (TQFile(defaultHomePath+"options").exists()) defaultConfigPath="options";
else
{
- if (QFile(defaultHomePath+"gpg.conf").exists()) defaultConfigPath="gpg.conf";
- else defaultConfigPath=QString::null;
+ if (TQFile(defaultHomePath+"gpg.conf").exists()) defaultConfigPath="gpg.conf";
+ else defaultConfigPath=TQString::null;
}
kdDebug(2100)<<"Adding pages"<<endl;
@@ -90,8 +90,8 @@ kdDebug(2100)<<"Adding pages"<<endl;
page4=new GPGConf();
page6=new ServerConf();
page7=new MiscConf();
- QBoxLayout *fontLayout=new QBoxLayout(page3->tabWidget3->page(1),QBoxLayout::TopToBottom,10);
- kfc=new KFontChooser(page3->tabWidget3->page(1),"kcfg_Font",false,QStringList(),false);
+ TQBoxLayout *fontLayout=new TQBoxLayout(page3->tabWidget3->page(1),TQBoxLayout::TopToBottom,10);
+ kfc=new KFontChooser(page3->tabWidget3->page(1),"kcfg_Font",false,TQStringList(),false);
fontLayout->addWidget(kfc);
page7->shredInfo->setText(i18n( "<qt><p>You must be aware that <b>shredding is not secure</b> on all file systems, and that parts of the file may have been saved in a temporary file or in the spooler of your printer if you previously opened it in an editor or tried to print it. Only works on files (not on folders).</p></qt>"));
@@ -105,30 +105,30 @@ kdDebug(2100)<<"Adding pages"<<endl;
addPage(page6, i18n("Key Servers"), "network");
addPage(page7, i18n("Misc"), "misc");
- page1->clear_akey->setIconSet(QIconSet(QPixmap(SmallIcon("clear_left"))));
- page1->clear_fkey->setIconSet(QIconSet(QPixmap(SmallIcon("clear_left"))));
+ page1->clear_akey->setIconSet(TQIconSet(TQPixmap(SmallIcon("clear_left"))));
+ page1->clear_fkey->setIconSet(TQIconSet(TQPixmap(SmallIcon("clear_left"))));
// The following widgets are managed manually.
- connect(page1->change_fkey, SIGNAL(clicked()), this, SLOT(insertFileKey()));
- connect(page1->clear_fkey, SIGNAL(clicked()), page1->kcfg_FileKey, SLOT(clear()));
- connect(page1->change_akey, SIGNAL(clicked()), this, SLOT(insertAlwaysKey()));
- connect(page1->clear_akey, SIGNAL(clicked()), page1->alwaysKey, SLOT(clear()));
- connect(page1->alwaysKey, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons()));
- connect(page4->gpg_conf_path, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons()));
- connect(page4->gpg_home_path, SIGNAL(textChanged(const QString&)), this, SLOT(updateButtons()));
- connect(page4->use_agent, SIGNAL(toggled(bool)), this, SLOT(updateButtons()));
- connect(page4->changeHome, SIGNAL(clicked()), this, SLOT(slotChangeHome()));
- connect(page4->kcfg_PubKeyring, SIGNAL(toggled (bool)), page4->kcfg_PubKeyringUrl, SLOT(setEnabled(bool)));
- connect(page4->kcfg_PubKeyring, SIGNAL(toggled (bool)), this, SLOT(checkAdditionalState(bool)));
- connect(page4->kcfg_PrivKeyring, SIGNAL(toggled (bool)), page4->kcfg_PrivKeyringUrl, SLOT(setEnabled(bool)));
- connect(page4->kcfg_PrivKeyring, SIGNAL(toggled (bool)), this, SLOT(checkAdditionalState(bool)));
- connect(page6->server_add, SIGNAL(clicked()), this, SLOT(slotAddKeyServer()));
- connect(page6->server_del, SIGNAL(clicked()), this, SLOT(slotDelKeyServer()));
- connect(page6->server_default, SIGNAL(clicked()), this, SLOT(slotDefaultKeyServer()));
- connect(page6->ServerBox, SIGNAL(currentChanged ( QListBoxItem *)), this, SLOT(updateButtons()));
- connect(page7->pushShredder, SIGNAL(clicked ()), this, SIGNAL(installShredder()));
-
- //connect(this, SIGNAL(settingsChanged()), SLOT(updateSettings()));
+ connect(page1->change_fkey, TQT_SIGNAL(clicked()), this, TQT_SLOT(insertFileKey()));
+ connect(page1->clear_fkey, TQT_SIGNAL(clicked()), page1->kcfg_FileKey, TQT_SLOT(clear()));
+ connect(page1->change_akey, TQT_SIGNAL(clicked()), this, TQT_SLOT(insertAlwaysKey()));
+ connect(page1->clear_akey, TQT_SIGNAL(clicked()), page1->alwaysKey, TQT_SLOT(clear()));
+ connect(page1->alwaysKey, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons()));
+ connect(page4->gpg_conf_path, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons()));
+ connect(page4->gpg_home_path, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(updateButtons()));
+ connect(page4->use_agent, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(updateButtons()));
+ connect(page4->changeHome, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotChangeHome()));
+ connect(page4->kcfg_PubKeyring, TQT_SIGNAL(toggled (bool)), page4->kcfg_PubKeyringUrl, TQT_SLOT(setEnabled(bool)));
+ connect(page4->kcfg_PubKeyring, TQT_SIGNAL(toggled (bool)), this, TQT_SLOT(checkAdditionalState(bool)));
+ connect(page4->kcfg_PrivKeyring, TQT_SIGNAL(toggled (bool)), page4->kcfg_PrivKeyringUrl, TQT_SLOT(setEnabled(bool)));
+ connect(page4->kcfg_PrivKeyring, TQT_SIGNAL(toggled (bool)), this, TQT_SLOT(checkAdditionalState(bool)));
+ connect(page6->server_add, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddKeyServer()));
+ connect(page6->server_del, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDelKeyServer()));
+ connect(page6->server_default, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotDefaultKeyServer()));
+ connect(page6->ServerBox, TQT_SIGNAL(currentChanged ( TQListBoxItem *)), this, TQT_SLOT(updateButtons()));
+ connect(page7->pushShredder, TQT_SIGNAL(clicked ()), this, TQT_SIGNAL(installShredder()));
+
+ //connect(this, TQT_SIGNAL(settingsChanged()), TQT_SLOT(updateSettings()));
keyGood=KGpgSettings::colorGood();
keyUnknown=KGpgSettings::colorUnknown();
@@ -155,11 +155,11 @@ page4->kcfg_OnlyAdditional->setEnabled(false);
void kgpgOptions::insertFileKey()
{
- QString signKeyID;
+ TQString signKeyID;
///// open key selection dialog
KgpgSelKey *opts=new KgpgSelKey(this,0,true,page1->kcfg_FileKey->text());
- if (opts->exec()==QDialog::Accepted) {
+ if (opts->exec()==TQDialog::Accepted) {
page1->kcfg_FileKey->setText(opts->getkeyID());
} else {
delete opts;
@@ -170,11 +170,11 @@ void kgpgOptions::insertFileKey()
void kgpgOptions::insertAlwaysKey()
{
- QString signKeyID;
+ TQString signKeyID;
///// open key selection dialog
KgpgSelKey *opts=new KgpgSelKey(this,0,true,page1->alwaysKey->text());
- if (opts->exec()==QDialog::Accepted) {
+ if (opts->exec()==TQDialog::Accepted) {
page1->alwaysKey->setText(opts->getkeyID());
} else {
delete opts;
@@ -185,13 +185,13 @@ void kgpgOptions::insertAlwaysKey()
void kgpgOptions::slotChangeHome()
{
-QString gpgHome=KFileDialog::getExistingDirectory(page4->gpg_home_path->text(),this,i18n("New GnuPG Home Location"));
+TQString gpgHome=KFileDialog::getExistingDirectory(page4->gpg_home_path->text(),this,i18n("New GnuPG Home Location"));
if (gpgHome.isEmpty()) return;
if (!gpgHome.endsWith("/")) gpgHome.append("/");
- QString confPath="options";
- if (!QFile(gpgHome+confPath).exists()) {
+ TQString confPath="options";
+ if (!TQFile(gpgHome+confPath).exists()) {
confPath="gpg.conf";
- if (!QFile(gpgHome+confPath).exists())
+ if (!TQFile(gpgHome+confPath).exists())
{
if (KMessageBox::questionYesNo(this,i18n("No configuration file was found in the selected location.\nDo you want to create it now ?\n\nWithout configuration file, neither KGpg nor Gnupg will work properly."),i18n("No Configuration File Found"),i18n("Create"),i18n("Ignore"))==KMessageBox::Yes) ////////// Try to create config File by running gpg once
{
@@ -199,19 +199,19 @@ if (!gpgHome.endsWith("/")) gpgHome.append("/");
*p<<"gpg"<<"--homedir"<<gpgHome<<"--no-tty"<<"--list-secret-keys";
p->start(KProcess::Block); //// start gnupg so that it will create a config file
confPath="gpg.conf";
- QFile confFile(gpgHome+confPath);
+ TQFile confFile(gpgHome+confPath);
if (!confFile.open(IO_WriteOnly))
{KMessageBox::sorry(this,i18n("Cannot create configuration file. Please check if destination media is mounted and if you have write access"));
return;
}
else
{
- QTextStream stream( &confFile );
+ TQTextStream stream( &confFile );
stream<<"# Config file created by KGpg\n\n";
confFile.close();
}
}
- else confPath=QString::null;
+ else confPath=TQString::null;
}
}
page4->gpg_conf_path->setText(confPath);
@@ -220,7 +220,7 @@ if (!gpgHome.endsWith("/")) gpgHome.append("/");
void kgpgOptions::updateWidgets()
{
-QString pubKeyring,privKeyring;
+TQString pubKeyring,privKeyring;
gpgConfigPath = KGpgSettings::gpgConfigPath();
page4->gpg_conf_path->setText(KURL(gpgConfigPath).fileName());
@@ -278,15 +278,15 @@ void kgpgOptions::updateWidgetsDefault()
page4->gpg_conf_path->setText(defaultConfigPath);
page4->gpg_home_path->setText(defaultHomePath);
- page4->kcfg_PubKeyringUrl->setURL(QString::null);
+ page4->kcfg_PubKeyringUrl->setURL(TQString::null);
page4->kcfg_PubKeyring->setChecked(false);
- page4->kcfg_PrivKeyringUrl->setURL(QString::null);
+ page4->kcfg_PrivKeyringUrl->setURL(TQString::null);
page4->kcfg_PrivKeyring->setChecked(false);
page4->kcfg_OnlyAdditional->setChecked(false);
page6->ServerBox->clear();
- page6->ServerBox->insertStringList(QStringList::split(",",defaultServerList));
+ page6->ServerBox->insertStringList(TQStringList::split(",",defaultServerList));
kdDebug(2100)<<"Finishing default options"<<endl;
}
@@ -305,7 +305,7 @@ bool kgpgOptions::isDefault()
if (page4->use_agent->isChecked() != defaultUseAgent)
return false;
- QString currList;
+ TQString currList;
for (uint i=0;i<page6->ServerBox->count();i++)
currList+=page6->ServerBox->text(i)+",";
currList.truncate(currList.length()-1);
@@ -328,7 +328,7 @@ bool kgpgOptions::hasChanged()
if (page4->use_agent->isChecked() != useAgent)
return true;
- QStringList currList;
+ TQStringList currList;
for (uint i=0;i<page6->ServerBox->count();i++)
currList.append(page6->ServerBox->text(i));
if (currList!=serverList) return true;
@@ -345,7 +345,7 @@ void kgpgOptions::updateSettings()
if (page4->gpg_home_path->text()!=KURL(gpgConfigPath).directory(false))
{
if (page4->gpg_home_path->text()!=defaultHomePath)
- setenv("GNUPGHOME", QFile::encodeName(page4->gpg_home_path->text()), 1);
+ setenv("GNUPGHOME", TQFile::encodeName(page4->gpg_home_path->text()), 1);
else setenv("GNUPGHOME","",1);
emit homeChanged();
gpgConfigPath = KGpgSettings::gpgConfigPath();
@@ -364,7 +364,7 @@ void kgpgOptions::updateSettings()
else
{
if (KgpgInterface::getGpgSetting("keyring", gpgConfigPath)!="") emitReload=true;
- KgpgInterface::setGpgSetting("keyring",QString::null, gpgConfigPath);
+ KgpgInterface::setGpgSetting("keyring",TQString::null, gpgConfigPath);
}
if (page4->kcfg_PrivKeyring->isChecked())
@@ -375,7 +375,7 @@ void kgpgOptions::updateSettings()
else
{
if (KgpgInterface::getGpgSetting("secret-keyring", gpgConfigPath)!="") emitReload=true;
- KgpgInterface::setGpgSetting("secret-keyring",QString::null, gpgConfigPath);
+ KgpgInterface::setGpgSetting("secret-keyring",TQString::null, gpgConfigPath);
}
emit changeFont(kfc->font());
@@ -392,7 +392,7 @@ void kgpgOptions::updateSettings()
else
slotRemoveMenu("decryptfile.desktop");
- KgpgInterface::setGpgMultiSetting("encrypt-to",QStringList::split(" ",page1->alwaysKey->text()),KGpgSettings::gpgConfigPath());
+ KgpgInterface::setGpgMultiSetting("encrypt-to",TQStringList::split(" ",page1->alwaysKey->text()),KGpgSettings::gpgConfigPath());
alwaysKeyID = page1->alwaysKey->text();
useAgent = page4->use_agent->isChecked();
@@ -411,11 +411,11 @@ void kgpgOptions::updateSettings()
////////////////// save key servers
- QString currList;
- serverList=QStringList ();
+ TQString currList;
+ serverList=TQStringList ();
for (uint i=0;i<page6->ServerBox->count();i++)
{
- QString currItem=page6->ServerBox->text(i);
+ TQString currItem=page6->ServerBox->text(i);
if (currItem.find(" ")!=-1) // it is the default keyserver
keyServer=currItem.section(" ",0,0);
else
@@ -443,10 +443,10 @@ void kgpgOptions::updateSettings()
}
-void kgpgOptions::slotInstallSign(QString mimetype)
+void kgpgOptions::slotInstallSign(TQString mimetype)
{
- QString path=locateLocal("data","konqueror/servicemenus/signfile.desktop");
+ TQString path=locateLocal("data","konqueror/servicemenus/signfile.desktop");
KDesktopFile configl2(path, false);
if (configl2.isImmutable() ==false) {
configl2.setGroup("Desktop Entry");
@@ -460,10 +460,10 @@ void kgpgOptions::slotInstallSign(QString mimetype)
}
}
-void kgpgOptions::slotInstallDecrypt(QString mimetype)
+void kgpgOptions::slotInstallDecrypt(TQString mimetype)
{
- QString path=locateLocal("data","konqueror/servicemenus/decryptfile.desktop");
+ TQString path=locateLocal("data","konqueror/servicemenus/decryptfile.desktop");
KDesktopFile configl2(path, false);
if (configl2.isImmutable() ==false) {
configl2.setGroup("Desktop Entry");
@@ -478,11 +478,11 @@ void kgpgOptions::slotInstallDecrypt(QString mimetype)
}
-void kgpgOptions::slotRemoveMenu(QString menu)
+void kgpgOptions::slotRemoveMenu(TQString menu)
{
- QString path=locateLocal("data","konqueror/servicemenus/"+menu);
- QFile qfile(path);
+ TQString path=locateLocal("data","konqueror/servicemenus/"+menu);
+ TQFile qfile(path);
if (qfile.exists())
qfile.remove();
{
@@ -493,23 +493,23 @@ void kgpgOptions::slotRemoveMenu(QString menu)
}
-QString kgpgOptions::namecode(QString kid)
+TQString kgpgOptions::namecode(TQString kid)
{
for ( uint counter = 0; counter<names.count(); counter++ )
- if (QString(ids[counter].right(8))==kid)
+ if (TQString(ids[counter].right(8))==kid)
return names[counter];
- return QString::null;
+ return TQString::null;
}
-QString kgpgOptions::idcode(QString kname)
+TQString kgpgOptions::idcode(TQString kname)
{
for ( uint counter = 0; counter<names.count(); counter++ )
if (names[counter]==kname)
- return QString(ids[counter].right(8));
- return QString::null;
+ return TQString(ids[counter].right(8));
+ return TQString::null;
}
@@ -518,7 +518,7 @@ void kgpgOptions::listkey()
//////// update display of keys in main management window
FILE *fp;
- QString tst,name,trustedvals="idre-",issec;
+ TQString tst,name,trustedvals="idre-",issec;
int counter=0;
char line[300];
@@ -526,7 +526,7 @@ void kgpgOptions::listkey()
fp2 = popen("gpg --no-secmem-warning --no-tty --with-colon --list-secret-keys", "r");
while ( fgets( line, sizeof(line), fp2)) {
- QString lineRead=line;
+ TQString lineRead=line;
if (lineRead.startsWith("sec"))
issec+=lineRead.section(':',4,4);
}
@@ -569,7 +569,7 @@ void kgpgOptions::listkey()
void kgpgOptions::slotAddKeyServer()
{
-QString newServer=KInputDialog::getText(i18n("Add New Key Server"),i18n("Server URL:"));
+TQString newServer=KInputDialog::getText(i18n("Add New Key Server"),i18n("Server URL:"));
if (!newServer.isEmpty())
page6->ServerBox->insertItem(newServer.stripWhiteSpace());
page6->ServerBox->setSelected(page6->ServerBox->findItem(newServer.stripWhiteSpace()),true);