-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 104 |
1 files changed, 94 insertions, 10 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 5cad7cb..824b841 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -931,3 +931,7 @@ void ZSafe::findPwd() comment = dialog->CommentField->text(); - owarn << name << oendl; +#ifndef NO_OPIE + owarn << name << oendl; +#else + qWarning (name); +#endif } @@ -977,3 +981,5 @@ void ZSafe::findPwd() { +#ifndef NO_OPIE owarn << i->text(0) << oendl; +#endif i->setSelected(FALSE); @@ -991,3 +997,7 @@ void ZSafe::findPwd() { +#ifndef NO_OPIE owarn << si->text(0) << oendl; +#else + qWarning (si->text(0)); +#endif if (si->isSelected()) @@ -1008,3 +1018,7 @@ void ZSafe::findPwd() { +#ifndef NO_OPIE owarn << "Found" << oendl; +#else + qWarning ("Found"); +#endif selectedItem = si; @@ -1278,3 +1292,7 @@ void ZSafe::removeAsciiFile() { +#ifndef NO_OPIE owarn << "Could not remove file " << fn << oendl; +#else + qWarning( QString("Could not remove file %1").arg(fn),2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), @@ -1327,3 +1345,7 @@ void ZSafe::writeAllEntries() if ( !f.open( IO_WriteOnly ) ) { +#ifndef NO_OPIE owarn << "Could not write to file " << fn << oendl; +#else + qWarning( QString("Could not write to file %1").arg(fn),2000 ); +#endif QMessageBox::critical( 0, "ZSafe", @@ -1421,3 +1443,7 @@ void ZSafe::readAllEntries() { +#ifndef NO_OPIE owarn << "Could not read file " << fn << oendl; +#else + qWarning( QString("Could not read file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, "ZSafe", @@ -1450,4 +1476,8 @@ void ZSafe::readAllEntries() +#ifndef NO_OPIE owarn << "ReadAllEntries(): " << oendl; - +#else + qWarning ("ReadAllEntries(): "); +#endif + QTextStream t(&f); @@ -1597,2 +1627,9 @@ void ZSafe::writeAllEntries() { + if (filename.isEmpty()) + { + QMessageBox::critical( 0, tr("ZSafe"), + tr("<P>No document defined. You have to create a new document</P>")); + return; + } + // open the file for writing @@ -1601,3 +1638,7 @@ void ZSafe::writeAllEntries() if ( !f.open( IO_WriteOnly ) ) { +#ifndef NO_OPIE owarn << "Could not write to file " << fn << oendl; +#else + qWarning( QString("Could not write to file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), @@ -1654,3 +1695,7 @@ void ZSafe::readAllEntries() { +#ifndef NO_OPIE owarn << "Could not read file " << fn << oendl; +#else + qWarning( QString("Could not read file %1").arg(fn), 2000 ); +#endif QMessageBox::critical( 0, tr("ZSafe"), @@ -1683,4 +1728,7 @@ void ZSafe::readAllEntries() +#ifndef NO_OPIE owarn << "ReadAllEntries(): " << oendl; - +#else + qWarning ("ReadAllEntries(): "); +#endif QTextStream t(&f); @@ -1807,4 +1855,6 @@ void ZSafe::resume(int) { +#ifndef NO_OPIE owarn << "Resume" << oendl; - // hide the main window +#endif + // hide the main window @@ -1866,3 +1916,7 @@ bool ZSafe::openDocument(const char* _filename, const char* ) { +#ifndef NO_OPIE owarn << "Wrong password" << oendl; +#else + qWarning ("Wrong password"); +#endif QMessageBox::critical( 0, tr("ZSafe"), @@ -1875,4 +1929,8 @@ bool ZSafe::openDocument(const char* _filename, const char* ) { +#ifndef NO_OPIE owarn << "Error loading Document" << oendl; - return false; +#lese + qWarning ("Error loading Document"); +#endif + return false; } @@ -2275,3 +2333,7 @@ bool ZSafe::saveDocument(const char* _filename, if (retval == PWERR_DATA) { +#ifndef NO_OPIE owarn << "1: Error writing file, contents not saved" << oendl; +#else + qWarning("1: Error writing file, contents not saved"); +#endif saveFinalize(); @@ -2319,3 +2381,7 @@ bool ZSafe::saveDocument(const char* _filename, if (retval == PWERR_DATA) { +#ifndef NO_OPIE owarn << "1: Error writing file, contents not saved" << oendl; +#else + qWarning("1: Error writing file, contents not saved"); +#endif saveFinalize(); @@ -2328,4 +2394,8 @@ bool ZSafe::saveDocument(const char* _filename, if (saveFinalize() == PWERR_DATA) { +#ifndef NO_OPIE owarn << "2: Error writing file, contents not saved" << oendl; - return false; +#else + qWarning("2: Error writing file, contents not saved"); +#endif + return false; } else { @@ -2349,4 +2419,6 @@ void ZSafe::getDocPassword(QString title) { +#ifndef NO_OPIE owarn << "getDocPassword" << oendl; - // open the 'Password' dialog +#endif + // open the 'Password' dialog PasswordForm *dialog = new PasswordForm(this, title, TRUE); @@ -2531,4 +2603,6 @@ void ZSafe::quitMe () { +#ifndef NO_OPIE owarn << "QUIT..." << oendl; - +#endif + if (modified) @@ -2735,4 +2809,6 @@ void ZSafe::addCategory() +#ifndef NO_OPIE owarn << category << oendl; - +#endif + QListViewItem *li = new ShadedListItem( 1, ListView ); @@ -3209,4 +3285,8 @@ void ZSafe::editCategory() { +#ifndef NO_OPIE owarn << "Category found" << oendl; - +#else + qWarning("Category found"); +#endif + // if (!icon.isEmpty() && !icon.isNull()) @@ -3243,3 +3323,7 @@ void ZSafe::editCategory() { +#ifndef NO_OPIE owarn << category << oendl; +#else + qWarning (category); +#endif catItem->setText( 0, tr( category ) ); |