summaryrefslogtreecommitdiffstats
path: root/kgpg/keyinfowidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kgpg/keyinfowidget.cpp')
-rw-r--r--kgpg/keyinfowidget.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/kgpg/keyinfowidget.cpp b/kgpg/keyinfowidget.cpp
index 4704eba..21dbb1c 100644
--- a/kgpg/keyinfowidget.cpp
+++ b/kgpg/keyinfowidget.cpp
@@ -17,21 +17,21 @@
#include <klocale.h>
#include <kprocess.h>
-#include <qdatetime.h>
-#include <qfile.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
#include <kprocio.h>
#include <kpassivepopup.h>
#include <kaction.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <ktempfile.h>
-#include <qimage.h>
+#include <tqimage.h>
#include <kdatepicker.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kcombobox.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include <kiconloader.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
#include <kactivelabel.h>
#include <klineedit.h>
#include <ktrader.h>
@@ -43,20 +43,20 @@
#include "kgpgsettings.h"
#include "kgpginterface.h"
-KgpgKeyInfo::KgpgKeyInfo(QWidget *parent, const char *name,QString sigkey):KDialogBase( Swallow, i18n("Key Properties"), Close, Close, parent, name,true)
+KgpgKeyInfo::KgpgKeyInfo(TQWidget *parent, const char *name,TQString sigkey):KDialogBase( Swallow, i18n("Key Properties"), Close, Close, parent, name,true)
{
FILE *pass;
char line[200]="";
- QString gpgOutput,fullID;
+ TQString gpgOutput,fullID;
hasPhoto=false;
bool isSecret=false;
keyWasChanged=false;
prop=new KeyProperties();
setMainWidget(prop);
- QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-secret-key "+KShellProcess::quote(sigkey);
- pass=popen(QFile::encodeName(gpgcmd),"r");
+ TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --list-secret-key "+KShellProcess::quote(sigkey);
+ pass=popen(TQFile::encodeName(gpgcmd),"r");
while ( fgets( line, sizeof(line), pass)) {
gpgOutput=line;
if (gpgOutput.startsWith("sec")) isSecret=true;
@@ -72,18 +72,18 @@ KgpgKeyInfo::KgpgKeyInfo(QWidget *parent, const char *name,QString sigkey):KDial
if (hasPhoto) {
KgpgInterface *photoProcess=new KgpgInterface();
photoProcess->KgpgGetPhotoList(displayedKeyID);
- connect(photoProcess,SIGNAL(signalPhotoList(QStringList)),this,SLOT(slotSetMainPhoto(QStringList)));
+ connect(photoProcess,TQT_SIGNAL(signalPhotoList(TQStringList)),this,TQT_SLOT(slotSetMainPhoto(TQStringList)));
}
else
prop->comboId->setEnabled(false);
- connect(prop->changeExp,SIGNAL(clicked()),this,SLOT(slotChangeExp()));
- connect(this,SIGNAL(closeClicked()),this,SLOT(slotPreOk()));
- connect(prop->changePass,SIGNAL(clicked()),this,SLOT(slotChangePass()));
- connect(prop->comboId,SIGNAL(activated (const QString &)),this,SLOT(reloadMainPhoto(const QString &)));
- connect(prop->cbDisabled,SIGNAL(toggled(bool)),this,SLOT(slotDisableKey(bool)));
- connect(prop->kCOwnerTrust,SIGNAL(activated (int)),this,SLOT(slotChangeTrust(int)));
- connect(this,SIGNAL(changeMainPhoto(const QPixmap&)),this,SLOT(slotSetPhoto(const QPixmap&)));
+ connect(prop->changeExp,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotChangeExp()));
+ connect(this,TQT_SIGNAL(closeClicked()),this,TQT_SLOT(slotPreOk()));
+ connect(prop->changePass,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotChangePass()));
+ connect(prop->comboId,TQT_SIGNAL(activated (const TQString &)),this,TQT_SLOT(reloadMainPhoto(const TQString &)));
+ connect(prop->cbDisabled,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotDisableKey(bool)));
+ connect(prop->kCOwnerTrust,TQT_SIGNAL(activated (int)),this,TQT_SLOT(slotChangeTrust(int)));
+ connect(this,TQT_SIGNAL(changeMainPhoto(const TQPixmap&)),this,TQT_SLOT(slotSetPhoto(const TQPixmap&)));
//prop->setMinimumSize(prop->sizeHint());
}
@@ -104,23 +104,23 @@ loadKey(displayedKeyID);
keyWasChanged=true;
}
-void KgpgKeyInfo::loadKey(QString Keyid)
+void KgpgKeyInfo::loadKey(TQString Keyid)
{
-QColor trustColor;
-QString fingervalue=QString::null;
+TQColor trustColor;
+TQString fingervalue=TQString::null;
FILE *pass;
char line[200]="";
-QString gpgOutput,fullID;
+TQString gpgOutput,fullID;
-QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint --list-key "+KShellProcess::quote(Keyid);
+TQString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint --list-key "+KShellProcess::quote(Keyid);
- pass=popen(QFile::encodeName(gpgcmd),"r");
+ pass=popen(TQFile::encodeName(gpgcmd),"r");
while ( fgets( line, sizeof(line), pass)) {
- gpgOutput=QString::fromUtf8(line);
+ gpgOutput=TQString::fromUtf8(line);
if (gpgOutput.startsWith("uat"))
hasPhoto=true;
if (gpgOutput.startsWith("pub")) {
- QString algo=gpgOutput.section(':',3,3);
+ TQString algo=gpgOutput.section(':',3,3);
switch( algo.toInt() ) {
case 1:
algo="RSA";
@@ -133,13 +133,13 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint
algo="DSA";
break;
default:
- algo=QString("#" + algo);
+ algo=TQString("#" + algo);
break;
}
prop->tLAlgo->setText(algo);
- const QString trust=gpgOutput.section(':',1,1);
- QString tr;
+ const TQString trust=gpgOutput.section(':',1,1);
+ TQString tr;
switch( trust[0] ) {
case 'o':
tr= i18n("Unknown");
@@ -202,22 +202,22 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint
displayedKeyID=fullID.right(8);
prop->tLID->setText(fullID);
- QString fullname=gpgOutput.section(':',9,9);
+ TQString fullname=gpgOutput.section(':',9,9);
- QDate date = QDate::fromString(gpgOutput.section(':',5,5), Qt::ISODate);
+ TQDate date = TQDate::fromString(gpgOutput.section(':',5,5), Qt::ISODate);
prop->tLCreation->setText(KGlobal::locale()->formatDate(date));
if (gpgOutput.section(':',6,6).isEmpty()) expirationDate=i18n("Unlimited");
else
{
- date = QDate::fromString(gpgOutput.section(':',6,6), Qt::ISODate);
+ date = TQDate::fromString(gpgOutput.section(':',6,6), Qt::ISODate);
expirationDate=KGlobal::locale()->formatDate(date);
}
prop->tLExpiration->setText(expirationDate);
prop->tLLength->setText(gpgOutput.section(':',2,2));
- const QString otrust=gpgOutput.section(':',8,8);
+ const TQString otrust=gpgOutput.section(':',8,8);
int ownerTrust=0;
/* Don't know=1; Do NOT trust=2; Marginally=3; Fully=4; Ultimately=5; */
@@ -242,7 +242,7 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint
prop->kCOwnerTrust->setCurrentItem(ownerTrust);
if (fullname.find("<")!=-1) {
- QString kmail=fullname;
+ TQString kmail=fullname;
if (fullname.find(")")!=-1)
kmail=kmail.section(')',1);
kmail=kmail.section('<',1);
@@ -256,16 +256,16 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint
} else
prop->tLMail->setText(i18n("none"));
- QString kname=fullname.section('<',0,0);
+ TQString kname=fullname.section('<',0,0);
if (fullname.find("(")!=-1) {
kname=kname.section('(',0,0);
- QString comment=fullname.section('(',1,1);
+ TQString comment=fullname.section('(',1,1);
comment=comment.section(')',0,0);
prop->tLComment->setText(KgpgInterface::checkForUtf8(comment));
} else
prop->tLComment->setText(i18n("none"));
- prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).replace(QRegExp("<"),"&lt;")+"</b></qt>");
+ prop->tLName->setText("<qt><b>"+KgpgInterface::checkForUtf8(kname).replace(TQRegExp("<"),"&lt;")+"</b></qt>");
}
if (gpgOutput.startsWith("fpr") && (fingervalue.isNull())) {
@@ -281,23 +281,23 @@ QString gpgcmd="gpg --no-tty --no-secmem-warning --with-colon --with-fingerprint
pclose(pass);
}
-void KgpgKeyInfo::slotSetMainPhoto(QStringList list)
+void KgpgKeyInfo::slotSetMainPhoto(TQStringList list)
{
prop->comboId->insertStringList(list);
reloadMainPhoto(prop->comboId->currentText());
}
-void KgpgKeyInfo::reloadMainPhoto(const QString &uid)
+void KgpgKeyInfo::reloadMainPhoto(const TQString &uid)
{
kgpginfotmp=new KTempFile();
kgpginfotmp->setAutoDelete(true);
- QString pgpgOutput="cp %i "+kgpginfotmp->name();
+ TQString pgpgOutput="cp %i "+kgpginfotmp->name();
KProcIO *p=new KProcIO();
- *p<<"gpg"<<"--no-tty"<<"--show-photos"<<"--photo-viewer"<<QFile::encodeName(pgpgOutput);
+ *p<<"gpg"<<"--no-tty"<<"--show-photos"<<"--photo-viewer"<<TQFile::encodeName(pgpgOutput);
*p<<"--edit-key"<<displayedKeyID<<"uid"<<uid<<"showphoto";
- QObject::connect(p, SIGNAL(readReady(KProcIO *)),this, SLOT(finishphotoreadprocess(KProcIO *)));
- QObject::connect(p, SIGNAL(processExited(KProcess *)),this, SLOT(slotMainImageRead(KProcess *)));
+ TQObject::connect(p, TQT_SIGNAL(readReady(KProcIO *)),this, TQT_SLOT(finishphotoreadprocess(KProcIO *)));
+ TQObject::connect(p, TQT_SIGNAL(processExited(KProcess *)),this, TQT_SLOT(slotMainImageRead(KProcess *)));
p->start(KProcess::NotifyOnExit,true);
}
@@ -306,7 +306,7 @@ void KgpgKeyInfo::reloadMainPhoto(const QString &uid)
void KgpgKeyInfo::slotMainImageRead(KProcess *p)
{
p->deleteLater();
- QPixmap pixmap;
+ TQPixmap pixmap;
pixmap.load(kgpginfotmp->name());
emit changeMainPhoto(pixmap);
kgpginfotmp->unlink();
@@ -317,11 +317,11 @@ KgpgKeyInfo::~KgpgKeyInfo()
{
}
-void KgpgKeyInfo::slotSetPhoto(const QPixmap &pix)
+void KgpgKeyInfo::slotSetPhoto(const TQPixmap &pix)
{
-QImage dup=pix.convertToImage();
-QPixmap dup2;
-dup2.convertFromImage(dup.scale(prop->pLPhoto->width(),prop->pLPhoto->height(),QImage::ScaleMin));
+TQImage dup=pix.convertToImage();
+TQPixmap dup2;
+dup2.convertFromImage(dup.scale(prop->pLPhoto->width(),prop->pLPhoto->height(),TQImage::ScaleMin));
prop->pLPhoto->setPixmap(dup2);
}
@@ -330,7 +330,7 @@ prop->pLPhoto->setPixmap(dup2);
void KgpgKeyInfo::finishphotoreadprocess(KProcIO *p)
{
- QString required=QString::null;
+ TQString required=TQString::null;
while (p->readln(required,true)!=-1)
if (required.find("keyedit.prompt")!=-1) {
p->writeStdin("quit");
@@ -346,15 +346,15 @@ void KgpgKeyInfo::openPhoto()
KService::Ptr ptr = offers.first();
//KMessageBox::sorry(0,ptr->desktopEntryName());
KProcIO *p=new KProcIO();
- *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<QFile::encodeName(ptr->desktopEntryName()+" %i")<<"--list-keys"<<displayedKeyID;
+ *p<<"gpg"<<"--show-photos"<<"--photo-viewer"<<TQFile::encodeName(ptr->desktopEntryName()+" %i")<<"--list-keys"<<displayedKeyID;
p->start(KProcess::DontCare,true);
}
void KgpgKeyInfo::slotChangeExp()
{
chdate=new KDialogBase( this, "choose_date", true,i18n("Choose New Expiration"),KDialogBase::Ok | KDialogBase::Cancel);
-QWidget *page = new QWidget(chdate);
-kb= new QCheckBox(i18n("Unlimited"),page );
+TQWidget *page = new TQWidget(chdate);
+kb= new TQCheckBox(i18n("Unlimited"),page );
if (prop->tLExpiration->text()==i18n("Unlimited"))
{
@@ -364,31 +364,31 @@ kdt->setEnabled(false);
}
else
kdt= new KDatePicker(page,KGlobal::locale()->readDate(prop->tLExpiration->text()));
-QVBoxLayout *vbox=new QVBoxLayout(page,3);
+TQVBoxLayout *vbox=new TQVBoxLayout(page,3);
vbox->addWidget(kdt);
vbox->addWidget(kb);
-connect(kb,SIGNAL(toggled(bool)),this,SLOT(slotEnableDate(bool)));
-connect(chdate,SIGNAL(okClicked()),this,SLOT(slotChangeDate()));
-connect(kdt,SIGNAL(dateChanged(QDate)),this,SLOT(slotCheckDate(QDate)));
-connect(kdt,SIGNAL(dateEntered(QDate)),this,SLOT(slotCheckDate(QDate)));
+connect(kb,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotEnableDate(bool)));
+connect(chdate,TQT_SIGNAL(okClicked()),this,TQT_SLOT(slotChangeDate()));
+connect(kdt,TQT_SIGNAL(dateChanged(TQDate)),this,TQT_SLOT(slotCheckDate(TQDate)));
+connect(kdt,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(slotCheckDate(TQDate)));
chdate->setMainWidget(page);
chdate->show();
}
-void KgpgKeyInfo::slotCheckDate(QDate date)
+void KgpgKeyInfo::slotCheckDate(TQDate date)
{
-chdate->enableButtonOK(date>=QDate::currentDate ());
+chdate->enableButtonOK(date>=TQDate::currentDate ());
}
void KgpgKeyInfo::slotChangeDate()
{
KgpgInterface *KeyExpirationProcess=new KgpgInterface();
if (kb->isChecked())
- KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,QDate::currentDate(),true);
+ KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,TQDate::currentDate(),true);
else
KeyExpirationProcess->KgpgKeyExpire(displayedKeyID,kdt->date(),false);
- connect(KeyExpirationProcess,SIGNAL(expirationFinished(int)),this,SLOT(slotInfoExpirationChanged(int)));
+ connect(KeyExpirationProcess,TQT_SIGNAL(expirationFinished(int)),this,TQT_SLOT(slotInfoExpirationChanged(int)));
}
void KgpgKeyInfo::slotEnableDate(bool isOn)
@@ -401,13 +401,13 @@ chdate->enableButtonOK(true);
else
{
kdt->setEnabled(true);
-chdate->enableButtonOK(kdt->date()>=QDate::currentDate ());
+chdate->enableButtonOK(kdt->date()>=TQDate::currentDate ());
}
}
void KgpgKeyInfo::slotinfoimgread(KProcess *)
{
- QPixmap pixmap;
+ TQPixmap pixmap;
pixmap.load(kgpginfotmp->name());
emit signalPhotoId(pixmap);
kgpginfotmp->unlink();
@@ -417,32 +417,32 @@ void KgpgKeyInfo::slotChangePass()
{
KgpgInterface *ChangeKeyPassProcess=new KgpgInterface();
ChangeKeyPassProcess->KgpgChangePass(displayedKeyID);
- connect(ChangeKeyPassProcess,SIGNAL(passwordChanged()),this,SLOT(slotInfoPasswordChanged()));
+ connect(ChangeKeyPassProcess,TQT_SIGNAL(passwordChanged()),this,TQT_SLOT(slotInfoPasswordChanged()));
}
void KgpgKeyInfo::slotChangeTrust(int newTrust)
{
KgpgInterface *KeyTrustProcess=new KgpgInterface();
KeyTrustProcess->KgpgTrustExpire(displayedKeyID,newTrust);
- connect(KeyTrustProcess,SIGNAL(trustfinished()),this,SLOT(slotInfoTrustChanged()));
+ connect(KeyTrustProcess,TQT_SIGNAL(trustfinished()),this,TQT_SLOT(slotInfoTrustChanged()));
}
void KgpgKeyInfo::slotInfoPasswordChanged()
{
-KPassivePopup::message(i18n("Passphrase for the key was changed"),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this);
+KPassivePopup::message(i18n("Passphrase for the key was changed"),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this);
}
void KgpgKeyInfo::slotInfoTrustChanged()
{
keyWasChanged=true;
loadKey(displayedKeyID);
-//KPassivePopup::message(i18n("Owner trust of the key was changed"),QString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this,0,600);
+//KPassivePopup::message(i18n("Owner trust of the key was changed"),TQString::null,KGlobal::iconLoader()->loadIcon("kgpg",KIcon::Desktop),this,0,600);
}
void KgpgKeyInfo::slotInfoExpirationChanged(int res)
{
-QString infoMessage,infoText;
+TQString infoMessage,infoText;
if (res==3)
{
keyWasChanged=true;