From 6ce7b92a92cc6785a2d155bb25024ffbd15958ae Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 1 Jan 2011 23:53:51 +0000 Subject: added tabs to editor, but VERY buggy till now git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@418 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'gpgwin.cpp') diff --git a/gpgwin.cpp b/gpgwin.cpp index b76b72f..d33b54c 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -437,16 +437,17 @@ void GpgWin::encrypt() QStringList *uidList = mKeyList->getChecked(); QByteArray *tmp = new QByteArray(); - if (mCtx->encrypt(uidList, edit->toPlainText().toUtf8(), tmp)) { +// if (mCtx->encrypt(uidList, edit.curTextPage.toPlainText().toUtf8(), tmp)) { + if (mCtx->encrypt(uidList, edit->curTextPage()->toPlainText().toUtf8(), tmp)) { QString *tmp2 = new QString(*tmp); - edit->setPlainText(*tmp2); + edit->curTextPage()->setPlainText(*tmp2); } } void GpgWin::decrypt() { QByteArray *decrypted = new QByteArray(); - QByteArray text = edit->toPlainText().toAscii(); // TODO: toUtf8() here? + QByteArray text = edit->curTextPage()->toPlainText().toAscii(); // TODO: toUtf8() here? preventNoDataErr(&text); mCtx->decrypt(text, decrypted); if (!decrypted->isEmpty()) { @@ -479,7 +480,7 @@ void GpgWin::decrypt() } } - edit->setPlainText(QString::fromUtf8(*decrypted)); + edit->curTextPage()->setPlainText(QString::fromUtf8(*decrypted)); //edit->setPlainText(*decrypted); } } @@ -566,7 +567,7 @@ void GpgWin::preventNoDataErr(QByteArray *in) void GpgWin::importKeyFromEdit() { - mCtx->importKey(edit->toPlainText().toAscii()); + mCtx->importKey(edit->curTextPage()->toPlainText().toAscii()); } void GpgWin::importKeyFromClipboard() @@ -613,15 +614,15 @@ void GpgWin::sign() { QStringList *uidList = mKeyList->getChecked(); QByteArray *tmp = new QByteArray(); - if (mCtx->sign(uidList, edit->toPlainText().toUtf8(), tmp)) { + if (mCtx->sign(uidList, edit->curTextPage()->toPlainText().toUtf8(), tmp)) { QString *tmp2 = new QString(*tmp); - edit->setPlainText(*tmp2); + edit->curTextPage()->setPlainText(*tmp2); } } void GpgWin::verify() { - mCtx->verify(edit->toPlainText().toUtf8()); + mCtx->verify(edit->curTextPage()->toPlainText().toUtf8()); } @@ -673,7 +674,7 @@ void GpgWin::appendSelectedKeys() QByteArray *keyArray = new QByteArray(); mCtx->exportKeys(mKeyList->getSelected(), keyArray); - edit->appendPlainText(*keyArray); + edit->curTextPage()->appendPlainText(*keyArray); } void GpgWin::fileEncryption() -- cgit v1.2.3