summaryrefslogtreecommitdiff
path: root/noncore/apps/zsafe/zsafe.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/zsafe/zsafe.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp147
1 files changed, 87 insertions, 60 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 0864293..f3d57f8 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -13,5 +13,5 @@
** Zaurus Opie arm: none
-** Linux Desktop : -DDESKTOP
-** Windows Desktop: -DDESKTOP -DWIN32
-**
+** Linux Desktop : -DDESKTOP -DNO_OPIE
+** Windows Desktop: -DDESKTOP -DNO_OPIE
+** use qmake
** for japanese version additional use: -DJPATCH_HDE
@@ -45,3 +45,3 @@ using namespace Opie::Ui;
#include <stdlib.h>
-#ifndef WIN32
+#ifndef Q_WS_WIN
#include <unistd.h>
@@ -57,3 +57,3 @@ using namespace Opie::Ui;
#include <qdragobject.h>
-#ifndef WIN32
+#ifndef Q_WS_WIN
#include <qsettings.h>
@@ -99,3 +99,3 @@ extern int DeskW, DeskH;
#ifdef DESKTOP
-extern QApplication *appl;
+extern QApplication *appl;
#else
@@ -110,3 +110,3 @@ extern QPEApplication *appl;
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
const QString APP_KEY="/.zsafe/";
@@ -367,3 +367,3 @@ static const char* const general_data[] = {
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
conf = new QSettings ();
@@ -419,3 +419,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
conf = new QSettings ();
@@ -431,3 +431,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
#ifdef DESKTOP
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
expandTree = conf->readBoolEntry(APP_KEY+"expandTree", false);
@@ -466,3 +466,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
#ifdef DESKTOP
-#ifdef WIN32
+#ifdef Q_WS_WIN
setGeometry(100, 150, DeskW, DeskH-30 );
@@ -500,3 +500,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
// create it
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
// QString d1("Documents/application");
@@ -527,3 +527,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
}
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
// QString d2("Documents/application/zsafe");
@@ -558,3 +558,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe: " + ti);
@@ -571,3 +571,3 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
- infoForm = new InfoForm();
+ infoForm = new InfoForm(this, "show_info", TRUE);
categoryDialog = NULL;
@@ -772,4 +772,4 @@ void ZSafe::editPwd()
// open the 'New Entry' dialog
- NewDialog *dialog = new NewDialog(this, tr("Edit Entry"), TRUE);
-#ifdef WIN32
+ NewDialog *dialog = new NewDialog(this, "edit_entry", TRUE);
+#ifdef Q_WS_WIN
dialog->setCaption ("Qt " + tr("Edit Entry"));
@@ -797,6 +797,16 @@ void ZSafe::editPwd()
+#ifdef Q_WS_QWS
DialogCode result = (DialogCode) QPEApplication::execDialog( dialog );
-
+#endif
+
#ifdef DESKTOP
- result = Accepted;
+#ifndef Q_QW_QWIN
+ dialog->show();
+#endif
+#else
+ dialog->showMaximized();
+#endif
+ int result = dialog->exec();
+#ifdef DESKTOP
+// result = QDialog::Accepted;
#endif
@@ -842,4 +852,4 @@ void ZSafe::newPwd()
// open the 'New Entry' dialog
- NewDialog *dialog = new NewDialog(this, tr("New Entry"), TRUE);
-#ifdef WIN32
+ NewDialog *dialog = new NewDialog(this, "new_entry", TRUE);
+#ifdef Q_WS_WIN
dialog->setCaption ("Qt " + tr("New Entry"));
@@ -856,5 +866,16 @@ retype:
+#ifdef Q_WS_QWS
DialogCode result = (DialogCode) QPEApplication::execDialog( dialog );
+#endif
+
#ifdef DESKTOP
- result = Accepted;
+#ifndef Q_QW_QWIN
+ dialog->show();
+#endif
+#else
+ dialog->showMaximized();
+#endif
+#ifdef DESKTOP
+ int result = dialog->exec();
+// result = QDialog::Accepted;
#endif
@@ -900,3 +921,3 @@ void ZSafe::findPwd()
SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE);
-#ifdef WIN32
+#ifdef Q_WS_WIN
dialog->setCaption ("Qt " + tr("Search"));
@@ -1080,3 +1101,3 @@ QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def)
#ifndef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
conf->setGroup ("fieldDefs");
@@ -1084,3 +1105,3 @@ QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def)
#else
-#ifndef WIN32
+#ifndef Q_WS_WIN
app_key += "/fieldDefs/";
@@ -1088,3 +1109,3 @@ QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def)
#endif
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
QString label = conf->readEntry(app_key+category+"-field"+field,def);
@@ -1106,3 +1127,3 @@ QString ZSafe::getFieldLabel (QString category, QString field, QString def)
#else
-#ifndef WIN32
+#ifndef Q_WS_WIN
app_key += "/fieldDefs/";
@@ -1110,3 +1131,3 @@ QString ZSafe::getFieldLabel (QString category, QString field, QString def)
#endif
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
QString label = conf->readEntry(app_key+category+"-field"+field,
@@ -1210,4 +1231,10 @@ void ZSafe::showInfo( QListViewItem *_item)
infoForm->InfoText->setText(text);
- infoForm->hide();
+// infoForm->hide();
+#ifdef Q_WS_QWS
QPEApplication::showDialog( infoForm );
+#endif
+
+#ifdef DESKTOP
+ infoForm->show();
+#endif
}
@@ -1233,3 +1260,3 @@ void ZSafe::listViewSelected( QListViewItem *_item)
#endif
-#ifdef WIN32
+#ifdef Q_WS_WIN
// set the column text dependent on the selected item
@@ -1488,3 +1515,3 @@ void ZSafe::readAllEntries()
// char buffer[1024];
-#ifndef WIN32
+#ifndef Q_WS_WIN
char buffer[s.length()+1];
@@ -1587,3 +1614,3 @@ void ZSafe::readAllEntries()
QPixmap *pix;
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
icon = conf->readEntry(APP_KEY+category);
@@ -1740,3 +1767,3 @@ void ZSafe::readAllEntries()
int len=s.length()+1;
-#ifdef WIN32
+#ifdef Q_WS_WIN
char buffer[512];
@@ -1820,3 +1847,3 @@ void ZSafe::readAllEntries()
QPixmap *pix;
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
icon = conf->readEntry(APP_KEY+category);
@@ -1898,3 +1925,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
char* entry[FIELD_SIZE];
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
int validationFlag = conf->readNumEntry(APP_KEY+"valzsafe", 1);
@@ -1939,3 +1966,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
{
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe");
@@ -2056,3 +2083,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
QPixmap *pix;
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
icon = conf->readEntry(APP_KEY+category);
@@ -2142,3 +2169,3 @@ int ZSafe::loadInit(const char* _filename, const char *password)
-#ifndef WIN32
+#ifndef Q_WS_WIN
size = read(fileno (fd), (unsigned char *) (charbuf + count), 8);
@@ -2159,3 +2186,3 @@ int ZSafe::loadInit(const char* _filename, const char *password)
bufferIndex = 0;
-#ifndef WIN32
+#ifndef Q_WS_WIN
while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) {
@@ -2341,3 +2368,3 @@ bool ZSafe::saveDocument(const char* _filename,
}
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->writeEntry(APP_KEY+"valzsafe", 1);
@@ -2436,3 +2463,3 @@ void ZSafe::getDocPassword(QString title)
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
dialog->setCaption("Qt " + ti);
@@ -2666,3 +2693,3 @@ void ZSafe::addCategory()
categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
-#ifdef WIN32
+#ifdef Q_WS_WIN
categoryDialog->setCaption ("Qt " + tr("Category"));
@@ -2677,3 +2704,3 @@ void ZSafe::addCategory()
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
@@ -2720,3 +2747,3 @@ void ZSafe::addCategory()
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
categ = cat->section ("-field1", 0, 0);
@@ -2788,3 +2815,3 @@ void ZSafe::addCategory()
-#ifndef WIN32
+#ifndef Q_WS_WIN
dialog->show();
@@ -2827,3 +2854,3 @@ void ZSafe::addCategory()
// save the full pixmap name into the config file
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->writeEntry(APP_KEY+category, icon);
@@ -2879,3 +2906,3 @@ void ZSafe::delCategory()
categories.remove (selectedItem->text(0));
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->removeEntry (selectedItem->text(0));
@@ -3039,3 +3066,3 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
#else
-#ifndef WIN32
+#ifndef Q_WS_WIN
app_key += "/fieldDefs/";
@@ -3044,3 +3071,3 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
QString category = dialog->CategoryField->currentText();
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->writeEntry(app_key+category+"-field1", dialog->Field1->text());
@@ -3075,3 +3102,3 @@ void ZSafe::editCategory()
categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
-#ifdef WIN32
+#ifdef Q_WS_WIN
categoryDialog->setCaption ("Qt " + tr("Category"));
@@ -3087,3 +3114,3 @@ void ZSafe::editCategory()
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
@@ -3131,3 +3158,3 @@ void ZSafe::editCategory()
#ifdef DESKTOP
-#ifndef WIN32
+#ifndef Q_WS_WIN
categ = cat->section ("-field1", 0, 0);
@@ -3274,3 +3301,3 @@ void ZSafe::editCategory()
categories.remove (category);
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->removeEntry(category);
@@ -3300,3 +3327,3 @@ void ZSafe::editCategory()
// save the full pixmap name into the config file
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->writeEntry(APP_KEY+category, icon);
@@ -3312,3 +3339,3 @@ void ZSafe::editCategory()
{
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->removeEntry (category);
@@ -3491,3 +3518,3 @@ void ZSafe::newDocument()
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe: " + ti);
@@ -3575,3 +3602,3 @@ void ZSafe::loadDocument()
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe: " + ti);
@@ -3629,3 +3656,3 @@ void ZSafe::saveDocumentAs()
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe: " + ti);
@@ -3708,3 +3735,3 @@ void ZSafe::setExpandFlag()
#endif
-// #ifndef WIN32
+// #ifndef Q_WS_WIN
conf->writeEntry (APP_KEY+"expandTree", expandTree);
@@ -3793,3 +3820,3 @@ void ZSafe::setDocument(const QString& fileref)
QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
-#ifdef WIN32
+#ifdef Q_WS_WIN
this->setCaption("Qt ZSafe: " + ti);