summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-15 17:08:58 (UTC)
committer zecke <zecke>2004-11-15 17:08:58 (UTC)
commit6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf (patch) (unidiff)
tree45e30376ec8035174fc5fd9154ed35b4d405d5ed
parent97fb9b69240d0daa5222fa9264587cde8b25c117 (diff)
downloadopie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.zip
opie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.tar.gz
opie-6d7b1a9a5f32a0b69c5ee9cc963e8a43a76327cf.tar.bz2
Remove many many many #ifdefs
"I always knew it would come like this" -Make it a QWidget instead of a QDialog -Introduce appName
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp691
-rw-r--r--noncore/apps/zsafe/zsafe.h10
2 files changed, 72 insertions, 629 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 1ae3b15..2b182f9 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -8,13 +8,6 @@
8** 8**
9** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html 9** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html
10** 10**
11** Compile Flags:
12** Zaurus arm : -DNO_OPIE
13** Zaurus Opie arm: none
14** Linux Desktop : -DDESKTOP -DNO_OPIE
15** Windows Desktop: -DDESKTOP -DNO_OPIE
16** use qmake
17** for japanese version additional use: -DJPATCH_HDE
18** 11**
19****************************************************************************/ 12****************************************************************************/
20#include "zsafe.h" 13#include "zsafe.h"
@@ -26,16 +19,10 @@
26#include "zlistview.h" 19#include "zlistview.h"
27#include "shadedlistitem.h" 20#include "shadedlistitem.h"
28 21
29#ifndef DESKTOP
30#ifndef NO_OPIE
31#include <opie2/ofiledialog.h> 22#include <opie2/ofiledialog.h>
32#include <opie2/odebug.h> 23#include <opie2/odebug.h>
33using namespace Opie::Core; 24using namespace Opie::Core;
34using namespace Opie::Ui; 25using namespace Opie::Ui;
35#else
36#include "scqtfileedit.h"
37#endif
38#endif
39 26
40#include <qclipboard.h> 27#include <qclipboard.h>
41 28
@@ -43,32 +30,19 @@ using namespace Opie::Ui;
43#include <sys/stat.h> 30#include <sys/stat.h>
44#include <fcntl.h> 31#include <fcntl.h>
45#include <stdlib.h> 32#include <stdlib.h>
46#ifndef Q_WS_WIN
47#include <unistd.h> 33#include <unistd.h>
48#endif
49#include <string.h> 34#include <string.h>
50#include <errno.h> 35#include <errno.h>
51 36
52#include <qmenubar.h> 37#include <qmenubar.h>
53#include <qpopupmenu.h> 38#include <qpopupmenu.h>
54 39
55#ifdef DESKTOP
56#include <qfiledialog.h>
57#include <qdragobject.h>
58#ifndef Q_WS_WIN
59#include <qsettings.h>
60#else
61#include "qsettings.h"
62#endif
63#include <qapplication.h>
64#else
65#include <qfile.h> 40#include <qfile.h>
66#include <qpe/fileselector.h> 41#include <qpe/fileselector.h>
67#include <qpe/global.h> 42#include <qpe/global.h>
68#include <qpe/qpeapplication.h> 43#include <qpe/qpeapplication.h>
69#include <qpe/resource.h> 44#include <qpe/resource.h>
70#include <qpe/config.h> 45#include <qpe/config.h>
71#endif
72 46
73#include <qtimer.h> 47#include <qtimer.h>
74#include <qlayout.h> 48#include <qlayout.h>
@@ -95,27 +69,11 @@ using namespace Opie::Ui;
95 69
96#include "wait.h" 70#include "wait.h"
97 71
98extern int DeskW, DeskH; 72int DeskW, DeskH;
99#ifdef DESKTOP 73QApplication *appl;
100extern QApplication *appl; 74ZSafe *zs;
101#else
102extern QPEApplication *appl;
103#endif
104
105#ifdef JPATCH_HDE
106#define tr(arg) arg
107#endif
108
109 75
110#ifdef DESKTOP 76const QString APP_KEY = "";
111#ifndef Q_WS_WIN
112const QString APP_KEY="/.zsafe/";
113#else
114const QString APP_KEY="";
115#endif
116#else
117const QString APP_KEY="";
118#endif
119 77
120// include xmp images 78// include xmp images
121#include "pics/zsafe/copy.xpm" 79#include "pics/zsafe/copy.xpm"
@@ -364,18 +322,8 @@ static const char* const general_data[] = {
364 { 322 {
365 delete conf; 323 delete conf;
366 324
367#ifdef DESKTOP 325 conf = new Config ("zsafe");
368#ifndef Q_WS_WIN 326 conf->setGroup ("zsafe");
369 conf = new QSettings();
370 conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath());
371#else
372 conf = new QSettings (cfgFile);
373 conf->insertSearchPath (QSettings::Unix, cfgFile);
374#endif
375#else
376 conf = new Config (cfgFile, Config::File);
377 conf->setGroup ("zsafePrefs");
378#endif
379 } 327 }
380 } 328 }
381 329
@@ -387,10 +335,15 @@ static const char* const general_data[] = {
387 * The dialog will by default be modeless, unless you set 'modal' to 335 * The dialog will by default be modeless, unless you set 'modal' to
388 * TRUE to construct a modal dialog. 336 * TRUE to construct a modal dialog.
389 */ 337 */
390ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) 338ZSafe::ZSafe( QWidget* parent, const char* name, WFlags fl )
391 : QDialog( parent, name, modal, fl ), 339 : QWidget( parent, name, fl),
392 Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l) 340 Edit(0l), Delete(0l), Find(0l), New(0l), ListView(0l)
393{ 341{
342 zs = this;
343 appl = qApp;
344 DeskW = qApp->desktop()->width();
345 DeskH = qApp->desktop()->height();
346
394 IsCut = false; 347 IsCut = false;
395 IsCopy = false; 348 IsCopy = false;
396 modified = false; 349 modified = false;
@@ -400,44 +353,14 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
400 cfgFile=QDir::homeDirPath(); 353 cfgFile=QDir::homeDirPath();
401 cfgFile += "/.zsafe.cfg"; 354 cfgFile += "/.zsafe.cfg";
402 // set the icon path 355 // set the icon path
403#ifdef NO_OPIE
404 QString qpedir ((const char *)getenv("QPEDIR"));
405#else
406 QString qpedir ((const char *)getenv("OPIEDIR"));
407#endif
408 356
409#ifdef DESKTOP 357 QString qpeDir = QPEApplication::qpeDir();
410 iconPath = QDir::homeDirPath() + "/pics/";
411#else
412 if (qpedir.isEmpty())
413 iconPath = "/home/QtPalmtop/pics/";
414 else
415 iconPath = qpedir + "/pics/";
416#endif
417 358
418 // create a zsafe configuration object 359 conf = new Config ("zsafe");
419#ifdef DESKTOP
420#ifndef Q_WS_WIN
421 conf = new QSettings ();
422 conf->insertSearchPath (QSettings::Unix, QDir::homeDirPath());
423#else
424 conf = new QSettings (cfgFile);
425 conf->insertSearchPath (QSettings::Unix, cfgFile);
426#endif
427#else
428 conf = new Config (cfgFile, Config::File);
429 conf->setGroup ("zsafePrefs"); 360 conf->setGroup ("zsafePrefs");
430#endif 361
431#ifdef DESKTOP
432// #ifndef Q_WS_WIN
433 expandTree = conf->readBoolEntry(APP_KEY+"expandTree", false);
434// #endif
435#else
436 expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0); 362 expandTree = conf->readNumEntry(APP_KEY+"expandTree", 0);
437#endif
438#ifndef DESKTOP
439 conf->setGroup ("zsafe"); 363 conf->setGroup ("zsafe");
440#endif
441 364
442 QPixmap copy_img((const char**) copy_xpm); 365 QPixmap copy_img((const char**) copy_xpm);
443 QPixmap cut_img((const char**) cut_xpm); 366 QPixmap cut_img((const char**) cut_xpm);
@@ -460,48 +383,19 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
460 QPixmap software( ( const char** ) software_data ); 383 QPixmap software( ( const char** ) software_data );
461 QPixmap general( ( const char** ) general_data ); 384 QPixmap general( ( const char** ) general_data );
462 QPixmap image0( ( const char** ) zsafe_xpm ); 385 QPixmap image0( ( const char** ) zsafe_xpm );
463 if ( !name )
464 setName( "ZSafe" );
465
466#ifdef DESKTOP
467#ifdef Q_WS_WIN
468 setGeometry(100, 150, DeskW, DeskH-30 );
469#else
470 resize( DeskW, DeskH-30 );
471#endif
472
473#else
474 386
475#ifdef JPATCH_HDE 387 if ( !name )
476 int DeskS; 388 setName( "ZSafe" );
477 if(DeskW > DeskH)
478 {
479 DeskS = DeskW;
480 }
481 else
482 {
483 DeskS = DeskH;
484 }
485 resize( DeskW, DeskH );
486 setMinimumSize( QSize( DeskS, DeskS ) );
487 setMaximumSize( QSize( DeskS, DeskS ) );
488#else
489 resize( DeskW, DeskH-30 );
490#endif
491 389
492#endif
493 setCaption( tr( "ZSafe" ) ); 390 setCaption( tr( "ZSafe" ) );
494 QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe"; 391 QString zsafeAppDirPath = QDir::homeDirPath() + "/Documents/application/zsafe";
392
495 filename = conf->readEntry(APP_KEY+"document"); 393 filename = conf->readEntry(APP_KEY+"document");
496 if ( !QFileInfo(filename).exists() || !QDir(zsafeAppDirPath).exists() ) 394 if ( !QFileInfo(filename).exists() || !QDir(zsafeAppDirPath).exists() )
497 { 395 {
498 // check if the directory application exists, if not 396 // check if the directory application exists, if not
499 // create it 397 // create it
500// #ifndef Q_WS_WIN
501 // QString d1("Documents/application");
502// #else
503 QString d1(QDir::homeDirPath() + "/Documents/application"); 398 QString d1(QDir::homeDirPath() + "/Documents/application");
504// #endif
505 QDir pd1(d1); 399 QDir pd1(d1);
506 if (!pd1.exists()) 400 if (!pd1.exists())
507 { 401 {
@@ -511,38 +405,26 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
511 if (!pd3.mkdir("Documents", FALSE)) { 405 if (!pd3.mkdir("Documents", FALSE)) {
512 } 406 }
513 } 407 }
514 408
515 if (!pd2.mkdir("application", FALSE)) 409 if (!pd2.mkdir("application", FALSE))
516 { 410 {
517 QMessageBox::critical( 0, tr("ZSafe"), 411 QMessageBox::critical( 0, tr("ZSafe"),
518#ifdef JPATCH_HDE
519 tr("<P>Can't create directory ..."+d1+"</P><P>ZSafe will now exit.</P>"));
520#else
521 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d1)); 412 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d1));
522#endif
523 exitZs (1); 413 exitZs (1);
524 } 414 }
525 } 415 }
526// #ifndef Q_WS_WIN
527 // QString d2("Documents/application/zsafe");
528// #else
529 QString d2(QDir::homeDirPath() + "/Documents/application/zsafe"); 416 QString d2(QDir::homeDirPath() + "/Documents/application/zsafe");
530// #endif
531 QDir pd2(d2); 417 QDir pd2(d2);
532 if (!pd2.exists()) 418 if (!pd2.exists())
533 { 419 {
534 if (!pd1.mkdir("zsafe", FALSE)) 420 if (!pd1.mkdir("zsafe", FALSE))
535 { 421 {
536 QMessageBox::critical( 0, tr("ZSafe"), 422 QMessageBox::critical( 0, tr("ZSafe"),
537#ifdef JPATCH_HDE
538 tr("<P>Can't create directory ...//Documents/application/zsafe</P><P>ZSafe will now exit.</P"));
539#else
540 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d2)); 423 tr("<P>Can't create directory %1</P><P>ZSafe will now exit.</P>").arg(d2));
541#endif
542 exitZs (1); 424 exitZs (1);
543 } 425 }
544 } 426 }
545 427
546 filename = zsafeAppDirPath + "/passwords.zsf"; 428 filename = zsafeAppDirPath + "/passwords.zsf";
547 429
548 // save the current filename to the config file 430 // save the current filename to the config file
@@ -553,11 +435,7 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
553 //filename = ""; 435 //filename = "";
554 436
555 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 437 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
556#ifdef Q_WS_WIN 438 this->setCaption(tr("ZSafe: ") + ti);
557 this->setCaption("Qt ZSafe: " + ti);
558#else
559 this->setCaption("ZSafe: " + ti);
560#endif
561 439
562 selectedItem = NULL; 440 selectedItem = NULL;
563 lastSearchedCategory = NULL; 441 lastSearchedCategory = NULL;
@@ -577,12 +455,10 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
577 // QPopupMenu *file = new QPopupMenu( this ); 455 // QPopupMenu *file = new QPopupMenu( this );
578 file = new QPopupMenu( this ); 456 file = new QPopupMenu( this );
579 457
580// #ifdef DESKTOP
581 file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) ); 458 file->insertItem( new_img, tr("&New document"), this, SLOT(newDocument()) );
582 file->insertItem( folder_open_img, tr("&Open document"), this, SLOT(loadDocument()) ); 459 file->insertItem( folder_open_img, tr("&Open document"), this, SLOT(loadDocument()) );
583 file->insertItem( save_img, tr("&Save document as .."), this, SLOT(saveDocumentAs()) ); 460 file->insertItem( save_img, tr("&Save document as .."), this, SLOT(saveDocumentAs()) );
584 file->insertSeparator(); 461 file->insertSeparator();
585// #endif
586 462
587 file->insertItem( save_img, tr("&Save document"), this, SLOT(saveDocumentWithoutPwd()) ); 463 file->insertItem( save_img, tr("&Save document"), this, SLOT(saveDocumentWithoutPwd()) );
588 file->insertItem( save_img, tr("S&ave document with new Password"), this, 464 file->insertItem( save_img, tr("S&ave document with new Password"), this,
@@ -665,31 +541,21 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
665 ListView->addColumn( tr( "Field 5" ) ); 541 ListView->addColumn( tr( "Field 5" ) );
666 ListView->setAllColumnsShowFocus(TRUE); 542 ListView->setAllColumnsShowFocus(TRUE);
667 543
668#ifdef DESKTOP
669 // ListView->setResizePolicy(QScrollView::AutoOneFit);
670 // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) );
671#else
672 ListView->setResizePolicy(QScrollView::AutoOneFit); 544 ListView->setResizePolicy(QScrollView::AutoOneFit);
673 // ListView->setGeometry( QRect( 0, 22, 545 // ListView->setGeometry( QRect( 0, 22,
674 // this->width(), this->height() - 30 ) ); 546 // this->width(), this->height() - 30 ) );
675 // ListView->setMaximumSize( QSize( 440, 290 ) ); 547 // ListView->setMaximumSize( QSize( 440, 290 ) );
676#endif
677 // ListView->setVScrollBarMode( QListView::Auto ); 548 // ListView->setVScrollBarMode( QListView::Auto );
678 549
679 QBoxLayout * l = new QVBoxLayout( this ); 550 QBoxLayout * l = new QVBoxLayout( this );
680 l->addWidget (menu); 551 l->addWidget (menu);
681 l->addWidget (ListView); 552 l->addWidget (ListView);
682 553
683#ifndef DESKTOP
684 // start a timer (100 ms) to load the default document 554 // start a timer (100 ms) to load the default document
685 docuTimer.start( 100, true ); 555 docuTimer.start( 100, true );
686 connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) ); 556 connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) );
687 raiseFlag = true; 557 raiseFlag = true;
688 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); 558 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) );
689#else
690 // open the default document
691 openDocument(filename);
692#endif
693 559
694 // signals and slots connections for QTollButton 560 // signals and slots connections for QTollButton
695 connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) ); 561 connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) );
@@ -704,17 +570,11 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
704 connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), 570 connect( ListView, SIGNAL( returnPressed(QListViewItem*) ),
705 this, SLOT( showInfo(QListViewItem*) ) ); 571 this, SLOT( showInfo(QListViewItem*) ) );
706 572
707 #ifndef DESKTOP 573 QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold);
708 QPEApplication::setStylusOperation( ListView->viewport(),QPEApplication::RightOnHold);
709#endif
710 connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 574 connect( ListView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
711 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 575 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) );
712 576
713 this->setIcon( image0); 577 this->setIcon( image0);
714#ifdef Q_WS_WIN
715 ListView->setSelected( ListView->firstChild() , true);
716 ListView->setSelected( ListView->firstChild() , false);
717#endif
718} 578}
719 579
720const QColor *ZSafe::evenRowColor = &Qt::white; 580const QColor *ZSafe::evenRowColor = &Qt::white;
@@ -772,10 +632,6 @@ void ZSafe::editPwd()
772 { 632 {
773 // open the 'New Entry' dialog 633 // open the 'New Entry' dialog
774 NewDialog *dialog = new NewDialog(this, "edit_entry", TRUE); 634 NewDialog *dialog = new NewDialog(this, "edit_entry", TRUE);
775#ifdef Q_WS_WIN
776 dialog->setCaption ("Qt " + tr("Edit Entry"));
777 dialog->setGeometry(200, 250, 220, 310 );
778#endif
779 635
780 // set the labels 636 // set the labels
781 dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); 637 dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name")));
@@ -796,22 +652,8 @@ void ZSafe::editPwd()
796 dialog->CommentField->insertLine(comment); 652 dialog->CommentField->insertLine(comment);
797 dialog->CommentField->setCursorPosition(0,0); 653 dialog->CommentField->setCursorPosition(0,0);
798 654
799#ifdef Q_WS_QWS 655 QDialog::DialogCode result = (QDialog::DialogCode) QPEApplication::execDialog( dialog );
800 DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); 656 if (result == QDialog::Accepted)
801#endif
802
803#ifdef DESKTOP
804#ifndef Q_QW_QWIN
805 dialog->show();
806#endif
807#else
808 dialog->showMaximized();
809#endif
810#ifdef DESKTOP
811 int result = dialog->exec();
812 result = QDialog::Accepted;
813#endif
814 if (result == Accepted)
815 { 657 {
816 modified = true; 658 modified = true;
817 // edit the selected item 659 // edit the selected item
@@ -852,10 +694,6 @@ void ZSafe::newPwd()
852 qWarning(cat); 694 qWarning(cat);
853 // open the 'New Entry' dialog 695 // open the 'New Entry' dialog
854 NewDialog *dialog = new NewDialog(this, "new_entry", TRUE); 696 NewDialog *dialog = new NewDialog(this, "new_entry", TRUE);
855#ifdef Q_WS_WIN
856 dialog->setCaption ("Qt " + tr("New Entry"));
857 dialog->setGeometry(200, 250, 220, 310 );
858#endif
859 // set the labels 697 // set the labels
860 dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name"))); 698 dialog->Name->setText(getFieldLabel (selectedItem, "1", tr("Name")));
861 dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username"))); 699 dialog->Username->setText(getFieldLabel (selectedItem, "2", tr("Username")));
@@ -866,22 +704,9 @@ void ZSafe::newPwd()
866retype: 704retype:
867 705
868#ifdef Q_WS_QWS 706#ifdef Q_WS_QWS
869 DialogCode result = (DialogCode) QPEApplication::execDialog( dialog ); 707 QDialog::DialogCode result = (QDialog::DialogCode) QPEApplication::execDialog( dialog );
870#endif
871
872#ifdef DESKTOP
873#ifndef Q_QW_QWIN
874 dialog->show();
875#endif
876#else
877 dialog->showMaximized();
878#endif
879#ifdef DESKTOP
880 int result = dialog->exec();
881 result = QDialog::Accepted;
882#endif 708#endif
883 709 if (result == QDialog::Accepted)
884 if (result == Accepted)
885 { 710 {
886 711
887 QString name = dialog->NameField->text(); 712 QString name = dialog->NameField->text();
@@ -920,12 +745,7 @@ void ZSafe::findPwd()
920 745
921 // open the 'Search' dialog 746 // open the 'Search' dialog
922 SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE); 747 SearchDialog *dialog = new SearchDialog(this, tr("Search"), TRUE);
923#ifdef Q_WS_WIN
924 dialog->setCaption ("Qt " + tr("Search"));
925#endif
926 748
927#ifdef DESKTOP
928#endif
929 if (lastSearchedName) 749 if (lastSearchedName)
930 dialog->NameField->setText(lastSearchedName); 750 dialog->NameField->setText(lastSearchedName);
931 else 751 else
@@ -938,24 +758,16 @@ void ZSafe::findPwd()
938 dialog->CommentField->setText(lastSearchedComment); 758 dialog->CommentField->setText(lastSearchedComment);
939 else 759 else
940 dialog->CommentField->setText(""); 760 dialog->CommentField->setText("");
941 DialogCode result = (DialogCode) dialog->exec(); 761 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
942#ifdef DESKTOP
943 result = Accepted;
944#endif
945 762
946 QString name; 763 QString name;
947 QString username; 764 QString username;
948 QString comment; 765 QString comment;
949 if (result == Accepted) 766 if (result == QDialog::Accepted)
950 { 767 {
951 name = dialog->NameField->text(); 768 name = dialog->NameField->text();
952 username = dialog->UsernameField->text(); 769 username = dialog->UsernameField->text();
953 comment = dialog->CommentField->text(); 770 comment = dialog->CommentField->text();
954#ifndef NO_OPIE
955 owarn << name << oendl;
956#else
957 qWarning (name);
958#endif
959 } 771 }
960 else 772 else
961 { 773 {
@@ -1001,9 +813,6 @@ void ZSafe::findPwd()
1001 i != NULL; 813 i != NULL;
1002 i = i->nextSibling()) 814 i = i->nextSibling())
1003 { 815 {
1004#ifndef NO_OPIE
1005 owarn << i->text(0) << oendl;
1006#endif
1007 i->setSelected(FALSE); 816 i->setSelected(FALSE);
1008 817
1009 // step through all subitems 818 // step through all subitems
@@ -1017,11 +826,6 @@ void ZSafe::findPwd()
1017 si != NULL; 826 si != NULL;
1018 si = si->nextSibling()) 827 si = si->nextSibling())
1019 { 828 {
1020#ifndef NO_OPIE
1021 owarn << si->text(0) << oendl;
1022#else
1023 qWarning (si->text(0));
1024#endif
1025 if (si->isSelected()) 829 if (si->isSelected())
1026 si->setSelected(FALSE); 830 si->setSelected(FALSE);
1027 // ListView->repaintItem(si); 831 // ListView->repaintItem(si);
@@ -1038,11 +842,6 @@ void ZSafe::findPwd()
1038 842
1039 if ((n && u && c ) && !found) 843 if ((n && u && c ) && !found)
1040 { 844 {
1041#ifndef NO_OPIE
1042 owarn << "Found" << oendl;
1043#else
1044 qWarning ("Found");
1045#endif
1046 selectedItem = si; 845 selectedItem = si;
1047 si->setSelected(TRUE); 846 si->setSelected(TRUE);
1048 ListView->setCurrentItem(si); 847 ListView->setCurrentItem(si);
@@ -1099,46 +898,24 @@ QString ZSafe::getFieldLabel (QListViewItem *_item, QString field, QString def)
1099 } 898 }
1100 899
1101 QString app_key = APP_KEY; 900 QString app_key = APP_KEY;
1102#ifndef DESKTOP
1103#ifndef Q_WS_WIN
1104 conf->setGroup ("fieldDefs");
1105#endif
1106#else
1107#ifndef Q_WS_WIN
1108 app_key += "/fieldDefs/";
1109#endif
1110#endif
1111// #ifndef Q_WS_WIN
1112 QString label = conf->readEntry(app_key+category+"-field"+field,def);
1113// #else
1114// QString label(def);
1115// #endif
1116 901
1117#ifndef DESKTOP 902 conf->setGroup( "fieldDefs" );
903 QString label = conf->readEntry(app_key+category+"-field"+field,def);
1118 conf->setGroup ("zsafe"); 904 conf->setGroup ("zsafe");
1119#endif
1120 return label; 905 return label;
1121} 906}
1122 907
1123QString ZSafe::getFieldLabel (QString category, QString field, QString def) 908QString ZSafe::getFieldLabel (QString category, QString field, QString def)
1124{ 909{
1125 QString app_key = APP_KEY; 910 QString app_key = APP_KEY;
1126#ifndef DESKTOP
1127 conf->setGroup ("fieldDefs");
1128#else
1129#ifndef Q_WS_WIN
1130 app_key += "/fieldDefs/";
1131#endif
1132#endif
1133// #ifndef Q_WS_WIN 911// #ifndef Q_WS_WIN
912 conf->setGroup( "fieldDefs" );
1134 QString label = conf->readEntry(app_key+category+"-field"+field, 913 QString label = conf->readEntry(app_key+category+"-field"+field,
1135 def); 914 def);
1136// #else 915// #else
1137 // QString label(def); 916 // QString label(def);
1138// #endif 917// #endif
1139#ifndef DESKTOP
1140 conf->setGroup ("zsafe"); 918 conf->setGroup ("zsafe");
1141#endif
1142 return label; 919 return label;
1143} 920}
1144 921
@@ -1235,9 +1012,6 @@ void ZSafe::showInfo( QListViewItem *_item)
1235 QPEApplication::showDialog( infoForm ); 1012 QPEApplication::showDialog( infoForm );
1236#endif 1013#endif
1237 1014
1238#ifdef DESKTOP
1239 infoForm->show();
1240 #endif
1241 } 1015 }
1242} 1016}
1243 1017
@@ -1250,16 +1024,6 @@ void ZSafe::listViewSelected( QListViewItem *_item)
1250 1024
1251 selectedItem = _item; 1025 selectedItem = _item;
1252 1026
1253#ifndef DESKTOP
1254 // set the column text dependent on the selected item
1255 ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name")));
1256 ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2")));
1257 ListView->setColumnText(2, getFieldLabel (selectedItem, "3", tr("Field 3")));
1258 ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment")));
1259 ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4")));
1260 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5")));
1261#endif
1262#ifdef Q_WS_WIN
1263 // set the column text dependent on the selected item 1027 // set the column text dependent on the selected item
1264 ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name"))); 1028 ListView->setColumnText(0, getFieldLabel (selectedItem, "1", tr("Name")));
1265 ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2"))); 1029 ListView->setColumnText(1, getFieldLabel (selectedItem, "2", tr("Field 2")));
@@ -1267,8 +1031,6 @@ void ZSafe::listViewSelected( QListViewItem *_item)
1267 ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment"))); 1031 ListView->setColumnText(3, getFieldLabel (selectedItem, "4", tr("Comment")));
1268 ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4"))); 1032 ListView->setColumnText(4, getFieldLabel (selectedItem, "5", tr("Field 4")));
1269 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5"))); 1033 ListView->setColumnText(5, getFieldLabel (selectedItem, "6", tr("Field 5")));
1270#endif
1271
1272} 1034}
1273 1035
1274bool ZSafe::isCategory(QListViewItem *_item) 1036bool ZSafe::isCategory(QListViewItem *_item)
@@ -1287,8 +1049,6 @@ void ZSafe::removeAsciiFile()
1287{ 1049{
1288 // QString fn = filename + ".txt"; 1050 // QString fn = filename + ".txt";
1289 // open the file dialog 1051 // open the file dialog
1290#ifndef DESKTOP
1291#ifndef NO_OPIE
1292 QMap<QString, QStringList> mimeTypes; 1052 QMap<QString, QStringList> mimeTypes;
1293 mimeTypes.insert(tr("All"), QStringList() ); 1053 mimeTypes.insert(tr("All"), QStringList() );
1294 mimeTypes.insert(tr("Text"), "text/*" ); 1054 mimeTypes.insert(tr("Text"), "text/*" );
@@ -1298,31 +1058,12 @@ void ZSafe::removeAsciiFile()
1298 mimeTypes, 1058 mimeTypes,
1299 this, 1059 this,
1300 tr ("Remove text file")); 1060 tr ("Remove text file"));
1301#else
1302 QString fn = ScQtFileEdit::getOpenFileName(this,
1303 tr ("Remove text file"),
1304 QDir::homeDirPath() + "/Documents/application/zsafe",
1305 "*.txt");
1306#endif
1307#else
1308 QString fn = QFileDialog::getOpenFileName(
1309 QDir::homeDirPath() + "/Documents/application/zsafe",
1310 "ZSafe (*.txt)",
1311 this,
1312 "ZSafe File Dialog"
1313 "Choose a text file" );
1314#endif
1315 1061
1316 if (fn && fn.length() > 0 ) 1062 if (fn && fn.length() > 0 )
1317 { 1063 {
1318 QFile f( fn ); 1064 QFile f( fn );
1319 if ( !f.remove() ) 1065 if ( !f.remove() )
1320 { 1066 {
1321#ifndef NO_OPIE
1322 owarn << "Could not remove file " << fn << oendl;
1323#else
1324 qWarning( QString("Could not remove file %1").arg(fn),2000 );
1325#endif
1326 QMessageBox::critical( 0, tr("ZSafe"), 1067 QMessageBox::critical( 0, tr("ZSafe"),
1327 tr("Could not remove text file.") ); 1068 tr("Could not remove text file.") );
1328 return; 1069 return;
@@ -1346,11 +1087,6 @@ void ZSafe::writeAllEntries()
1346 { 1087 {
1347 QFile f( fn ); 1088 QFile f( fn );
1348 if ( !f.open( IO_WriteOnly ) ) { 1089 if ( !f.open( IO_WriteOnly ) ) {
1349#ifndef NO_OPIE
1350 owarn << "Could not write to file " << fn << oendl;
1351#else
1352 qWarning( QString("Could not write to file %1").arg(fn),2000 );
1353#endif
1354 QMessageBox::critical( 0, "ZSafe", 1090 QMessageBox::critical( 0, "ZSafe",
1355 QString("Could not export to text file.") ); 1091 QString("Could not export to text file.") );
1356 return; 1092 return;
@@ -1413,8 +1149,6 @@ void ZSafe::readAllEntries()
1413 } 1149 }
1414 1150
1415 // open the file dialog 1151 // open the file dialog
1416#ifndef DESKTOP
1417#ifndef NO_OPIE
1418 QMap<QString, QStringList> mimeTypes; 1152 QMap<QString, QStringList> mimeTypes;
1419 mimeTypes.insert(tr("All"), QStringList() ); 1153 mimeTypes.insert(tr("All"), QStringList() );
1420 mimeTypes.insert(tr("Text"), "text/*" ); 1154 mimeTypes.insert(tr("Text"), "text/*" );
@@ -1424,31 +1158,12 @@ void ZSafe::readAllEntries()
1424 mimeTypes, 1158 mimeTypes,
1425 this, 1159 this,
1426 tr ("Import text file")); 1160 tr ("Import text file"));
1427#else
1428 QString fn = ScQtFileEdit::getOpenFileName(this,
1429 tr ("Import text file"),
1430 QDir::homeDirPath() + "/Documents/application/zsafe",
1431 "*.txt");
1432#endif
1433#else
1434 QString fn = QFileDialog::getOpenFileName(
1435 QDir::homeDirPath() + "/Documents/application/zsafe",
1436 "ZSafe (*.txt)",
1437 this,
1438 "ZSafe File Dialog"
1439 "Choose a text file" );
1440#endif
1441 1161
1442 if (fn && fn.length() > 0 ) 1162 if (fn && fn.length() > 0 )
1443 { 1163 {
1444 QFile f( fn ); 1164 QFile f( fn );
1445 if ( !f.open( IO_ReadOnly ) ) 1165 if ( !f.open( IO_ReadOnly ) )
1446 { 1166 {
1447#ifndef NO_OPIE
1448 owarn << "Could not read file " << fn << oendl;
1449#else
1450 qWarning( QString("Could not read file %1").arg(fn), 2000 );
1451#endif
1452 QMessageBox::critical( 0, "ZSafe", 1167 QMessageBox::critical( 0, "ZSafe",
1453 QString("Could not import text file.") ); 1168 QString("Could not import text file.") );
1454 return; 1169 return;
@@ -1477,23 +1192,13 @@ void ZSafe::readAllEntries()
1477 } 1192 }
1478 } 1193 }
1479 1194
1480#ifndef NO_OPIE
1481 owarn << "ReadAllEntries(): " << oendl;
1482#else
1483 qWarning ("ReadAllEntries(): ");
1484#endif
1485
1486 QTextStream t(&f); 1195 QTextStream t(&f);
1487 while ( !t.eof() ) 1196 while ( !t.eof() )
1488 { 1197 {
1489 QString s = t.readLine(); 1198 QString s = t.readLine();
1490 s.replace (QRegExp("\";\""), "\"|\""); 1199 s.replace (QRegExp("\";\""), "\"|\"");
1491 // char buffer[1024]; 1200 // char buffer[1024];
1492#ifndef Q_WS_WIN
1493 char buffer[s.length()+1]; 1201 char buffer[s.length()+1];
1494#else
1495 char buffer[4048];
1496#endif
1497 1202
1498 1203
1499 /* modify QString -> QCString::utf8 */ 1204 /* modify QString -> QCString::utf8 */
@@ -1639,11 +1344,6 @@ void ZSafe::writeAllEntries()
1639 QString fn = filename + ".txt"; 1344 QString fn = filename + ".txt";
1640 QFile f( fn ); 1345 QFile f( fn );
1641 if ( !f.open( IO_WriteOnly ) ) { 1346 if ( !f.open( IO_WriteOnly ) ) {
1642#ifndef NO_OPIE
1643 owarn << "Could not write to file " << fn << oendl;
1644#else
1645 qWarning( QString("Could not write to file %1").arg(fn), 2000 );
1646#endif
1647 QMessageBox::critical( 0, tr("ZSafe"), 1347 QMessageBox::critical( 0, tr("ZSafe"),
1648 tr("Could not export to text file.") ); 1348 tr("Could not export to text file.") );
1649 return; 1349 return;
@@ -1696,11 +1396,6 @@ void ZSafe::readAllEntries()
1696 QFile f( fn ); 1396 QFile f( fn );
1697 if ( !f.open( IO_ReadOnly ) ) 1397 if ( !f.open( IO_ReadOnly ) )
1698 { 1398 {
1699#ifndef NO_OPIE
1700 owarn << "Could not read file " << fn << oendl;
1701#else
1702 qWarning( QString("Could not read file %1").arg(fn), 2000 );
1703#endif
1704 QMessageBox::critical( 0, tr("ZSafe"), 1399 QMessageBox::critical( 0, tr("ZSafe"),
1705 tr("Could not import text file.") ); 1400 tr("Could not import text file.") );
1706 return; 1401 return;
@@ -1729,11 +1424,6 @@ void ZSafe::readAllEntries()
1729 } 1424 }
1730 } 1425 }
1731 1426
1732#ifndef NO_OPIE
1733 owarn << "ReadAllEntries(): " << oendl;
1734#else
1735 qWarning ("ReadAllEntries(): ");
1736#endif
1737 QTextStream t(&f); 1427 QTextStream t(&f);
1738 while ( !t.eof() ) 1428 while ( !t.eof() )
1739 { 1429 {
@@ -1741,11 +1431,7 @@ void ZSafe::readAllEntries()
1741 s.replace (QRegExp("\";\""), "\"|\""); 1431 s.replace (QRegExp("\";\""), "\"|\"");
1742 // char buffer[1024]; 1432 // char buffer[1024];
1743 int len=s.length()+1; 1433 int len=s.length()+1;
1744#ifdef Q_WS_WIN
1745 char buffer[512];
1746#else
1747 char buffer[len]; 1434 char buffer[len];
1748#endif
1749 strcpy (buffer, s); 1435 strcpy (buffer, s);
1750 1436
1751 QString name; 1437 QString name;
@@ -1856,9 +1542,6 @@ void ZSafe::readAllEntries()
1856 1542
1857void ZSafe::resume(int) 1543void ZSafe::resume(int)
1858{ 1544{
1859#ifndef NO_OPIE
1860 owarn << "Resume" << oendl;
1861#endif
1862 // hide the main window 1545 // hide the main window
1863 1546
1864 if ( !showpwd ) 1547 if ( !showpwd )
@@ -1919,11 +1602,6 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1919 getDocPassword(tr("Enter Password")); 1602 getDocPassword(tr("Enter Password"));
1920 if (m_password.isEmpty() && validationFlag == 0) 1603 if (m_password.isEmpty() && validationFlag == 0)
1921 { 1604 {
1922#ifndef NO_OPIE
1923 owarn << "Wrong password" << oendl;
1924#else
1925 qWarning ("Wrong password");
1926#endif
1927 QMessageBox::critical( 0, tr("ZSafe"), 1605 QMessageBox::critical( 0, tr("ZSafe"),
1928 tr("Wrong password.\n\nZSafe will now exit.") ); 1606 tr("Wrong password.\n\nZSafe will now exit.") );
1929 exitZs (1); 1607 exitZs (1);
@@ -1932,21 +1610,12 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1932 retval = loadInit(_filename, m_password); 1610 retval = loadInit(_filename, m_password);
1933 if (retval != PWERR_GOOD) 1611 if (retval != PWERR_GOOD)
1934 { 1612 {
1935#ifndef NO_OPIE
1936 owarn << "Error loading Document" << oendl;
1937#else
1938 qWarning ("Error loading Document");
1939#endif
1940 return false; 1613 return false;
1941 } 1614 }
1942 } 1615 }
1943 else 1616 else
1944 { 1617 {
1945#ifdef Q_WS_WIN 1618 this->setCaption(tr("ZSafe"));
1946 this->setCaption("Qt ZSafe");
1947#else
1948 this->setCaption("ZSafe");
1949#endif
1950 filename = ""; 1619 filename = "";
1951 switch( QMessageBox::warning( this, tr("ZSafe"), 1620 switch( QMessageBox::warning( this, tr("ZSafe"),
1952 tr("<P>You must create a new document first. Ok to create?</P>"), 1621 tr("<P>You must create a new document first. Ok to create?</P>"),
@@ -1962,7 +1631,7 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1962 return false; 1631 return false;
1963 break; 1632 break;
1964 } 1633 }
1965 1634
1966 } 1635 }
1967 1636
1968 1637
@@ -2436,9 +2105,6 @@ void ZSafe::setPasswordDialogDone()
2436 2105
2437void ZSafe::getDocPassword(QString title) 2106void ZSafe::getDocPassword(QString title)
2438{ 2107{
2439#ifndef NO_OPIE
2440 owarn << "getDocPassword" << oendl;
2441#endif
2442 // open the 'Password' dialog 2108 // open the 'Password' dialog
2443 PasswordForm *dialog = new PasswordForm(this, title, TRUE); 2109 PasswordForm *dialog = new PasswordForm(this, title, TRUE);
2444 newPwdDialog = dialog; 2110 newPwdDialog = dialog;
@@ -2453,21 +2119,14 @@ void ZSafe::getDocPassword(QString title)
2453 // CS: !!! 2119 // CS: !!!
2454 // int pos = filename.findRev ('/'); 2120 // int pos = filename.findRev ('/');
2455 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 2121 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
2456#ifdef Q_WS_WIN
2457 dialog->setCaption("Qt " + ti);
2458#else
2459 dialog->setCaption(ti); 2122 dialog->setCaption(ti);
2460#endif
2461 // dialog->setCaption(title); 2123 // dialog->setCaption(title);
2462 2124
2463 dialog->PasswordField->setFocus(); 2125 dialog->PasswordField->setFocus();
2464 DialogCode result = (DialogCode) dialog->exec(); 2126 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
2465#ifdef DESKTOP
2466 result = Accepted;
2467#endif
2468 2127
2469 QString password; 2128 QString password;
2470 if (result == Accepted || newPwdDialogResult) 2129 if (result == QDialog::Accepted || newPwdDialogResult)
2471 { 2130 {
2472 m_password = dialog->PasswordField->text(); 2131 m_password = dialog->PasswordField->text();
2473 } 2132 }
@@ -2620,10 +2279,6 @@ int ZSafe::saveFinalize(void)
2620 2279
2621void ZSafe::quitMe () 2280void ZSafe::quitMe ()
2622{ 2281{
2623#ifndef NO_OPIE
2624 owarn << "QUIT..." << oendl;
2625#endif
2626
2627 if (modified) 2282 if (modified)
2628 { 2283 {
2629 switch( QMessageBox::information( this, tr("ZSafe"), 2284 switch( QMessageBox::information( this, tr("ZSafe"),
@@ -2683,9 +2338,6 @@ void ZSafe::addCategory()
2683 else 2338 else
2684 { 2339 {
2685 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2340 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
2686#ifdef Q_WS_WIN
2687 categoryDialog->setCaption ("Qt " + tr("Category"));
2688#endif
2689 dialog = categoryDialog; 2341 dialog = categoryDialog;
2690 connect( dialog->CategoryField, 2342 connect( dialog->CategoryField,
2691 SIGNAL( activated(const QString&)), 2343 SIGNAL( activated(const QString&)),
@@ -2693,10 +2345,6 @@ void ZSafe::addCategory()
2693 initIcons = true; 2345 initIcons = true;
2694 } 2346 }
2695 2347
2696#ifdef DESKTOP
2697#ifndef Q_WS_WIN
2698 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
2699#else
2700 // read all categories from the config file and store 2348 // read all categories from the config file and store
2701 // into a list 2349 // into a list
2702 QFile f (cfgFile); 2350 QFile f (cfgFile);
@@ -2704,29 +2352,12 @@ void ZSafe::addCategory()
2704 if ( f.open(IO_ReadOnly) ) { // file opened successfully 2352 if ( f.open(IO_ReadOnly) ) { // file opened successfully
2705 QTextStream t( &f ); // use a text stream 2353 QTextStream t( &f ); // use a text stream
2706 QString s; 2354 QString s;
2707 int n = 1;
2708 while ( !t.eof() ) { // until end of file... 2355 while ( !t.eof() ) { // until end of file...
2709 s = t.readLine(); // line of text excluding '\n' 2356 s = t.readLine(); // line of text excluding '\n'
2710 list.append(s); 2357 list.append(s);
2711 } 2358 }
2712 f.close(); 2359 f.close();
2713 } 2360 }
2714#endif
2715#else
2716 // read all categories from the config file and store
2717 // into a list
2718 QFile f (cfgFile);
2719 QStringList list;
2720 if ( f.open(IO_ReadOnly) ) { // file opened successfully
2721 QTextStream t( &f ); // use a text stream
2722 QString s;
2723 while ( !t.eof() ) { // until end of file...
2724 s = t.readLine(); // line of text excluding '\n'
2725 list.append(s);
2726 }
2727 f.close();
2728 }
2729#endif
2730 QStringList::Iterator it = list.begin(); 2361 QStringList::Iterator it = list.begin();
2731 QString categ; 2362 QString categ;
2732 QString firstCategory; 2363 QString firstCategory;
@@ -2736,18 +2367,9 @@ void ZSafe::addCategory()
2736 QString *cat = new QString (*it); 2367 QString *cat = new QString (*it);
2737 if (cat->contains("-field1", FALSE)) 2368 if (cat->contains("-field1", FALSE))
2738 { 2369 {
2739#ifdef DESKTOP
2740#ifndef Q_WS_WIN
2741 categ = cat->section ("-field1", 0, 0);
2742#else
2743 int pos = cat->find ("-field1");
2744 categ = cat->left (pos);
2745#endif
2746#else
2747 int pos = cat->find ("-field1"); 2370 int pos = cat->find ("-field1");
2748 cat->truncate(pos); 2371 cat->truncate(pos);
2749 categ = *cat; 2372 categ = *cat;
2750#endif
2751 if (!categ.isEmpty()) 2373 if (!categ.isEmpty())
2752 { 2374 {
2753 dialog->CategoryField->insertItem (categ, -1); 2375 dialog->CategoryField->insertItem (categ, -1);
@@ -2773,11 +2395,7 @@ void ZSafe::addCategory()
2773 waitDialog.show(); 2395 waitDialog.show();
2774 qApp->processEvents(); 2396 qApp->processEvents();
2775 2397
2776#ifdef DESKTOP
2777 QDir d(iconPath);
2778#else
2779 QDir d(QPEApplication::qpeDir() + "pics/"); 2398 QDir d(QPEApplication::qpeDir() + "pics/");
2780#endif
2781 d.setFilter( QDir::Files); 2399 d.setFilter( QDir::Files);
2782 2400
2783 const QFileInfoList *list = d.entryInfoList(); 2401 const QFileInfoList *list = d.entryInfoList();
@@ -2789,12 +2407,7 @@ void ZSafe::addCategory()
2789 QString fileName = fi->fileName(); 2407 QString fileName = fi->fileName();
2790 if(fileName.right(4) == ".png"){ 2408 if(fileName.right(4) == ".png"){
2791 fileName = fileName.mid(0,fileName.length()-4); 2409 fileName = fileName.mid(0,fileName.length()-4);
2792#ifdef DESKTOP
2793 QPixmap imageOfFile;
2794 imageOfFile.load(iconPath + fi->fileName());
2795#else
2796 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 2410 QPixmap imageOfFile(Resource::loadPixmap(fileName));
2797#endif
2798 QImage foo = imageOfFile.convertToImage(); 2411 QImage foo = imageOfFile.convertToImage();
2799 foo = foo.smoothScale(16,16); 2412 foo = foo.smoothScale(16,16);
2800 imageOfFile.convertFromImage(foo); 2413 imageOfFile.convertFromImage(foo);
@@ -2805,31 +2418,17 @@ void ZSafe::addCategory()
2805 waitDialog.hide(); 2418 waitDialog.hide();
2806 } 2419 }
2807 2420
2808#ifndef Q_WS_WIN 2421 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
2809 dialog->show();
2810#endif
2811#ifndef DESKTOP
2812 // dialog->move (20, 100);
2813#endif
2814 DialogCode result = (DialogCode) dialog->exec();
2815#ifdef DESKTOP
2816 result = Accepted;
2817#endif
2818
2819 QString category; 2422 QString category;
2820 QString icon; 2423 QString icon;
2821 QString fullIconPath; 2424 QString fullIconPath;
2822 QPixmap *pix; 2425 QPixmap *pix;
2823 if (result == Accepted) 2426 if (result == QDialog::Accepted)
2824 { 2427 {
2825 modified = true; 2428 modified = true;
2826 category = dialog->CategoryField->currentText(); 2429 category = dialog->CategoryField->currentText();
2827 icon = dialog->IconField->currentText()+".png"; 2430 icon = dialog->IconField->currentText()+".png";
2828 2431
2829#ifndef NO_OPIE
2830 owarn << category << oendl;
2831#endif
2832
2833 QListViewItem *li = new ShadedListItem( 1, ListView ); 2432 QListViewItem *li = new ShadedListItem( 1, ListView );
2834 Category *c1 = new Category(); 2433 Category *c1 = new Category();
2835 c1->setCategoryName(category); 2434 c1->setCategoryName(category);
@@ -2957,11 +2556,7 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog)
2957 dialog->Field6->setText(tr("Field 5")); 2556 dialog->Field6->setText(tr("Field 5"));
2958 } 2557 }
2959 2558
2960#ifdef DESKTOP
2961 QDir d(iconPath);
2962#else
2963 QDir d(QPEApplication::qpeDir() + "pics/"); 2559 QDir d(QPEApplication::qpeDir() + "pics/");
2964#endif
2965 d.setFilter( QDir::Files); 2560 d.setFilter( QDir::Files);
2966 2561
2967 const QFileInfoList *list = d.entryInfoList(); 2562 const QFileInfoList *list = d.entryInfoList();
@@ -3014,11 +2609,7 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category)
3014 else 2609 else
3015 icon = conf->readEntry(APP_KEY+category); 2610 icon = conf->readEntry(APP_KEY+category);
3016 2611
3017#ifdef DESKTOP
3018 QDir d(iconPath);
3019#else
3020 QDir d(QPEApplication::qpeDir() + "pics/"); 2612 QDir d(QPEApplication::qpeDir() + "pics/");
3021#endif
3022 d.setFilter( QDir::Files); 2613 d.setFilter( QDir::Files);
3023 2614
3024 const QFileInfoList *list = d.entryInfoList(); 2615 const QFileInfoList *list = d.entryInfoList();
@@ -3053,13 +2644,7 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category)
3053void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog) 2644void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
3054{ 2645{
3055 QString app_key = APP_KEY; 2646 QString app_key = APP_KEY;
3056#ifndef DESKTOP 2647 conf->setGroup( "fieldDefs" );
3057 conf->setGroup ("fieldDefs");
3058#else
3059#ifndef Q_WS_WIN
3060 app_key += "/fieldDefs/";
3061#endif
3062#endif
3063 QString category = dialog->CategoryField->currentText(); 2648 QString category = dialog->CategoryField->currentText();
3064// #ifndef Q_WS_WIN 2649// #ifndef Q_WS_WIN
3065 conf->writeEntry(app_key+category+"-field1", dialog->Field1->text()); 2650 conf->writeEntry(app_key+category+"-field1", dialog->Field1->text());
@@ -3070,9 +2655,7 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
3070 conf->writeEntry(app_key+category+"-field6", dialog->Field6->text()); 2655 conf->writeEntry(app_key+category+"-field6", dialog->Field6->text());
3071// #endif 2656// #endif
3072 saveConf(); 2657 saveConf();
3073#ifndef DESKTOP
3074 conf->setGroup ("zsafe"); 2658 conf->setGroup ("zsafe");
3075#endif
3076} 2659}
3077 2660
3078void ZSafe::editCategory() 2661void ZSafe::editCategory()
@@ -3092,9 +2675,6 @@ void ZSafe::editCategory()
3092 else 2675 else
3093 { 2676 {
3094 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2677 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
3095#ifdef Q_WS_WIN
3096 categoryDialog->setCaption ("Qt " + tr("Category"));
3097#endif
3098 dialog = categoryDialog; 2678 dialog = categoryDialog;
3099 connect( dialog->CategoryField, 2679 connect( dialog->CategoryField,
3100 SIGNAL( activated(const QString&)), 2680 SIGNAL( activated(const QString&)),
@@ -3103,26 +2683,6 @@ void ZSafe::editCategory()
3103 } 2683 }
3104 setCategoryDialogFields(dialog); 2684 setCategoryDialogFields(dialog);
3105 2685
3106#ifdef DESKTOP
3107#ifndef Q_WS_WIN
3108 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
3109#else
3110 // read all categories from the config file and store
3111 // into a list
3112 QFile f (cfgFile);
3113 QStringList list;
3114 if ( f.open(IO_ReadOnly) ) { // file opened successfully
3115 QTextStream t( &f ); // use a text stream
3116 QString s;
3117 int n = 1;
3118 while ( !t.eof() ) { // until end of file...
3119 s = t.readLine(); // line of text excluding '\n'
3120 list.append(s);
3121 }
3122 f.close();
3123 }
3124#endif
3125#else
3126 // read all categories from the config file and store 2686 // read all categories from the config file and store
3127 // into a list 2687 // into a list
3128 QFile f (cfgFile); 2688 QFile f (cfgFile);
@@ -3136,7 +2696,6 @@ void ZSafe::editCategory()
3136 } 2696 }
3137 f.close(); 2697 f.close();
3138 } 2698 }
3139#endif
3140 QStringList::Iterator it = list.begin(); 2699 QStringList::Iterator it = list.begin();
3141 QString categ; 2700 QString categ;
3142 dialog->CategoryField->clear(); // remove all items 2701 dialog->CategoryField->clear(); // remove all items
@@ -3147,18 +2706,9 @@ void ZSafe::editCategory()
3147 QString *cat = new QString (*it); 2706 QString *cat = new QString (*it);
3148 if (cat->contains("-field1", FALSE)) 2707 if (cat->contains("-field1", FALSE))
3149 { 2708 {
3150#ifdef DESKTOP
3151#ifndef Q_WS_WIN
3152 categ = cat->section ("-field1", 0, 0);
3153#else
3154 int pos = cat->find ("-field1");
3155 categ = cat->left (pos);
3156#endif
3157#else
3158 int pos = cat->find ("-field1"); 2709 int pos = cat->find ("-field1");
3159 cat->truncate(pos); 2710 cat->truncate(pos);
3160 categ = *cat; 2711 categ = *cat;
3161#endif
3162 if (!categ.isEmpty()) 2712 if (!categ.isEmpty())
3163 { 2713 {
3164 dialog->CategoryField->insertItem (categ, i); 2714 dialog->CategoryField->insertItem (categ, i);
@@ -3193,11 +2743,7 @@ void ZSafe::editCategory()
3193 waitDialog.show(); 2743 waitDialog.show();
3194 qApp->processEvents(); 2744 qApp->processEvents();
3195 2745
3196#ifdef DESKTOP
3197 QDir d(iconPath);
3198#else
3199 QDir d(QPEApplication::qpeDir() + "pics/"); 2746 QDir d(QPEApplication::qpeDir() + "pics/");
3200#endif
3201 d.setFilter( QDir::Files); 2747 d.setFilter( QDir::Files);
3202 2748
3203 const QFileInfoList *list = d.entryInfoList(); 2749 const QFileInfoList *list = d.entryInfoList();
@@ -3215,12 +2761,7 @@ void ZSafe::editCategory()
3215 if(fileName.right(4) == ".png") 2761 if(fileName.right(4) == ".png")
3216 { 2762 {
3217 fileName = fileName.mid(0,fileName.length()-4); 2763 fileName = fileName.mid(0,fileName.length()-4);
3218#ifdef DESKTOP
3219 QPixmap imageOfFile;
3220 imageOfFile.load(iconPath + fi->fileName());
3221#else
3222 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 2764 QPixmap imageOfFile(Resource::loadPixmap(fileName));
3223#endif
3224 QImage foo = imageOfFile.convertToImage(); 2765 QImage foo = imageOfFile.convertToImage();
3225 foo = foo.smoothScale(16,16); 2766 foo = foo.smoothScale(16,16);
3226 imageOfFile.convertFromImage(foo); 2767 imageOfFile.convertFromImage(foo);
@@ -3235,12 +2776,7 @@ void ZSafe::editCategory()
3235 } 2776 }
3236 else 2777 else
3237 { 2778 {
3238#ifdef DESKTOP
3239 // QDir d(QDir::homeDirPath() + "/pics/");
3240 QDir d(iconPath);
3241#else
3242 QDir d(QPEApplication::qpeDir() + "pics/"); 2779 QDir d(QPEApplication::qpeDir() + "pics/");
3243#endif
3244 d.setFilter( QDir::Files); 2780 d.setFilter( QDir::Files);
3245 2781
3246 const QFileInfoList *list = d.entryInfoList(); 2782 const QFileInfoList *list = d.entryInfoList();
@@ -3275,17 +2811,11 @@ void ZSafe::editCategory()
3275 } 2811 }
3276 2812
3277 // dialog->show(); 2813 // dialog->show();
3278#ifndef DESKTOP 2814 QDialog::DialogCode result = (QDialog::DialogCode) dialog->exec();
3279 // dialog->move (20, 100);
3280#endif
3281 DialogCode result = (DialogCode) dialog->exec();
3282#ifdef DESKTOP
3283 result = Accepted;
3284#endif
3285 2815
3286 QString fullIconPath; 2816 QString fullIconPath;
3287 QPixmap *pix; 2817 QPixmap *pix;
3288 if (result == Accepted) 2818 if (result == QDialog::Accepted)
3289 { 2819 {
3290 modified = true; 2820 modified = true;
3291 if (category != dialog->CategoryField->currentText()) 2821 if (category != dialog->CategoryField->currentText())
@@ -3302,12 +2832,6 @@ void ZSafe::editCategory()
3302 2832
3303 if (cat) 2833 if (cat)
3304 { 2834 {
3305#ifndef NO_OPIE
3306 owarn << "Category found" << oendl;
3307#else
3308 qWarning("Category found");
3309#endif
3310
3311 // if (!icon.isEmpty() && !icon.isNull()) 2835 // if (!icon.isEmpty() && !icon.isNull())
3312 if (icon != "predefined.png") 2836 if (icon != "predefined.png")
3313 { 2837 {
@@ -3340,11 +2864,6 @@ void ZSafe::editCategory()
3340 QListViewItem *catItem = cat->getListItem(); 2864 QListViewItem *catItem = cat->getListItem();
3341 if (catItem) 2865 if (catItem)
3342 { 2866 {
3343#ifndef NO_OPIE
3344 owarn << category << oendl;
3345#else
3346 qWarning (category);
3347#endif
3348 catItem->setText( 0, tr( category ) ); 2867 catItem->setText( 0, tr( category ) );
3349 cat->setCategoryName (tr(category)); 2868 cat->setCategoryName (tr(category));
3350 2869
@@ -3481,14 +3000,11 @@ void ZSafe::newDocument()
3481 filename = newFile; 3000 filename = newFile;
3482 3001
3483 // save the current filename to the config file 3002 // save the current filename to the config file
3003 conf->setGroup("zsafe");
3484 conf->writeEntry(APP_KEY+"document", filename); 3004 conf->writeEntry(APP_KEY+"document", filename);
3485 saveConf(); 3005 saveConf();
3486 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3006 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3487#ifdef Q_WS_WIN 3007 this->setCaption(tr("ZSafe: ") + ti);
3488 this->setCaption("Qt ZSafe: " + ti);
3489#else
3490 this->setCaption("ZSafe: " + ti);
3491#endif
3492 3008
3493 // openDocument(filename); 3009 // openDocument(filename);
3494 3010
@@ -3503,8 +3019,6 @@ void ZSafe::loadDocument()
3503{ 3019{
3504 3020
3505 // open the file dialog 3021 // open the file dialog
3506#ifndef DESKTOP
3507#ifndef NO_OPIE
3508 QMap<QString, QStringList> mimeTypes; 3022 QMap<QString, QStringList> mimeTypes;
3509 mimeTypes.insert(tr("All"), QStringList() ); 3023 mimeTypes.insert(tr("All"), QStringList() );
3510 mimeTypes.insert(tr("ZSafe"), "zsafe/*" ); 3024 mimeTypes.insert(tr("ZSafe"), "zsafe/*" );
@@ -3514,20 +3028,6 @@ void ZSafe::loadDocument()
3514 mimeTypes, 3028 mimeTypes,
3515 this, 3029 this,
3516 tr ("Open ZSafe document")); 3030 tr ("Open ZSafe document"));
3517#else
3518 QString newFile = ScQtFileEdit::getOpenFileName(this,
3519 tr ("Open ZSafe document"),
3520 QDir::homeDirPath() + "/Documents/application/zsafe",
3521 "*.zsf");
3522#endif
3523#else
3524 QString newFile = QFileDialog::getOpenFileName(
3525 QDir::homeDirPath() + "/Documents/application/zsafe",
3526 "ZSafe (*.zsf)",
3527 this,
3528 "ZSafe File Dialog"
3529 "Choose a ZSafe file" );
3530#endif
3531 3031
3532 // open the new document 3032 // open the new document
3533 if (newFile && newFile.length() > 0 ) 3033 if (newFile && newFile.length() > 0 )
@@ -3565,14 +3065,11 @@ void ZSafe::loadDocument()
3565 filename = newFile; 3065 filename = newFile;
3566 3066
3567 // save the current filename to the config file 3067 // save the current filename to the config file
3068 conf->setGroup("zsafe");
3568 conf->writeEntry(APP_KEY+"document", filename); 3069 conf->writeEntry(APP_KEY+"document", filename);
3569 saveConf(); 3070 saveConf();
3570 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3071 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3571#ifdef Q_WS_WIN 3072 this->setCaption(tr("ZSafe: ") + ti);
3572 this->setCaption("Qt ZSafe: " + ti);
3573#else
3574 this->setCaption("ZSafe: " + ti);
3575#endif
3576 3073
3577 openDocument(filename); 3074 openDocument(filename);
3578 } 3075 }
@@ -3593,14 +3090,11 @@ QString newFile = zsaveDialog();
3593 filename = newFile; 3090 filename = newFile;
3594 3091
3595 // save the current filename to the config file 3092 // save the current filename to the config file
3093 conf->setGroup("zsafe");
3596 conf->writeEntry(APP_KEY+"document", filename); 3094 conf->writeEntry(APP_KEY+"document", filename);
3597 saveConf(); 3095 saveConf();
3598 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3096 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3599#ifdef Q_WS_WIN 3097 this->setCaption(tr("ZSafe: ") + ti);
3600 this->setCaption("Qt ZSafe: " + ti);
3601#else
3602 this->setCaption("ZSafe: " + ti);
3603#endif
3604 3098
3605 QMessageBox::information( this, tr("ZSafe"), 3099 QMessageBox::information( this, tr("ZSafe"),
3606 tr("Now you have to enter\na password twice for your\nnewly created document."), tr("&OK"), 0); 3100 tr("Now you have to enter\na password twice for your\nnewly created document."), tr("&OK"), 0);
@@ -3622,41 +3116,19 @@ void ZSafe::saveDocumentWithPwd()
3622void ZSafe::about() 3116void ZSafe::about()
3623{ 3117{
3624 QString info; 3118 QString info;
3625#ifdef JPATCH_HDE 3119 info = tr("<html><body><div align=""center"">"
3626 info = "<html><body><div align=""center"">"; 3120 "<b>"
3627 info += "<b>"; 3121 "Zaurus Password Manager<br>"
3628 info += tr("Zaurus Password Manager<br>"); 3122 "ZSafe version 2.1.2<br>"
3629 info += tr("ZSafe version 2.1.2-jv01b<br>"); 3123 "</b>"
3630 info += "</b>"; 3124 "by Carsten Schneider<br>"
3631 info += tr("by Carsten Schneider<br>"); 3125 "zcarsten@gmx.net<br>"
3632 info += "zcarsten@gmx.net<br>"; 3126 "http://z-soft.z-portal.info/zsafe"
3633 info += "http://z-soft.z-portal.info/zsafe"; 3127 "<br>"
3634 info += "<br>"; 3128 "Translations by Robert Ernst<br>"
3635 info += tr("Translations by Robert Ernst<br>"); 3129 "robert.ernst@linux-solutions.at<br>"
3636 info += "robert.ernst@linux-solutions.at<br>"; 3130 "<br></div>"
3637 3131 "</body></html>");
3638 info += "<br><br>";
3639 info += QString::fromUtf8("æ~W¥æ~\\¬èª~^/VGA Zaurus対å¿~\\ã~C~Qã~C~Cã~C~Aä½~\\æ ~H~P<br>");
3640 info += "HADECO R&D<br>";
3641 info += "r&d@hadeco.co.jp<br>";
3642 info += "http://www.hadeco.co.jp/r&d/<br>";
3643 info += "<br></div>";
3644 info += "</body></html>";
3645#else
3646 info = "<html><body><div align=""center"">";
3647 info += "<b>";
3648 info += tr("Zaurus Password Manager<br>");
3649 info += tr("ZSafe version 2.1.2<br>");
3650 info += "</b>";
3651 info += tr("by Carsten Schneider<br>");
3652 info += "zcarsten@gmx.net<br>";
3653 info += "http://z-soft.z-portal.info/zsafe";
3654 info += "<br>";
3655 info += tr("Translations by Robert Ernst<br>");
3656 info += "robert.ernst@linux-solutions.at<br>";
3657 info += "<br></div>";
3658 info += "</body></html>";
3659#endif
3660 3132
3661 // QMessageBox::information( this, tr("ZSafe"), info, tr("&OK"), 0); 3133 // QMessageBox::information( this, tr("ZSafe"), info, tr("&OK"), 0);
3662 3134
@@ -3672,9 +3144,7 @@ void ZSafe::setExpandFlag()
3672{ 3144{
3673 expandTree = !expandTree; 3145 expandTree = !expandTree;
3674 file->setItemChecked('o', expandTree); 3146 file->setItemChecked('o', expandTree);
3675#ifndef DESKTOP
3676 conf->setGroup ("zsafePrefs"); 3147 conf->setGroup ("zsafePrefs");
3677#endif
3678// #ifndef Q_WS_WIN 3148// #ifndef Q_WS_WIN
3679 conf->writeEntry (APP_KEY+"expandTree", expandTree); 3149 conf->writeEntry (APP_KEY+"expandTree", expandTree);
3680// #endif 3150// #endif
@@ -3696,13 +3166,8 @@ void ZSafe::paintEvent( QPaintEvent * )
3696void ZSafe::resizeEvent ( QResizeEvent * ) 3166void ZSafe::resizeEvent ( QResizeEvent * )
3697{ 3167{
3698 // owarn << "resizeEvent" << oendl; 3168 // owarn << "resizeEvent" << oendl;
3699#ifndef DESKTOP
3700 DeskW = appl->desktop()->width(); 3169 DeskW = appl->desktop()->width();
3701 DeskH = appl->desktop()->height(); 3170 DeskH = appl->desktop()->height();
3702#else
3703 DeskW = this->width();
3704 DeskH = this->height();
3705#endif
3706 3171
3707 if (New) 3172 if (New)
3708 New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); 3173 New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) );
@@ -3739,7 +3204,6 @@ QPixmap * ZSafe::getPredefinedIcon(QString category)
3739 3204
3740void ZSafe::setDocument(const QString& fileref) 3205void ZSafe::setDocument(const QString& fileref)
3741{ 3206{
3742#ifndef DESKTOP
3743 // stop the timer to prevent loading of the default document 3207 // stop the timer to prevent loading of the default document
3744 docuTimer.stop(); 3208 docuTimer.stop();
3745 3209
@@ -3757,14 +3221,11 @@ void ZSafe::setDocument(const QString& fileref)
3757 filename = fileref; 3221 filename = fileref;
3758 } 3222 }
3759 // save the current filename to the config file 3223 // save the current filename to the config file
3224 conf->setGroup("zsafe");
3760 conf->writeEntry(APP_KEY+"document", filename); 3225 conf->writeEntry(APP_KEY+"document", filename);
3761 saveConf(); 3226 saveConf();
3762 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 3227 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
3763#ifdef Q_WS_WIN 3228 this->setCaption(tr("ZSafe: ") + ti);
3764 this->setCaption("Qt ZSafe: " + ti);
3765#else
3766 this->setCaption("ZSafe: " + ti);
3767#endif
3768 3229
3769 // clear the password list 3230 // clear the password list
3770 QListViewItem *i; 3231 QListViewItem *i;
@@ -3795,9 +3256,6 @@ void ZSafe::setDocument(const QString& fileref)
3795 selectedItem = NULL; 3256 selectedItem = NULL;
3796 3257
3797 openDocument(filename); 3258 openDocument(filename);
3798#else
3799Q_UNUSED(fileref);
3800#endif
3801} 3259}
3802 3260
3803 3261
@@ -3805,12 +3263,6 @@ void ZSafe::ListPressed(int mouse, QListViewItem *item, const QPoint&, int colum
3805 if(item ==0) return; 3263 if(item ==0) return;
3806 switch (mouse) { 3264 switch (mouse) {
3807 case 1: 3265 case 1:
3808 {
3809#ifdef DESKTOP
3810 QDragObject *d = new QTextDrag( item->text(column) , this );
3811 d->dragCopy();
3812#endif
3813 }
3814 break; 3266 break;
3815 case 2: 3267 case 2:
3816 { 3268 {
@@ -3851,8 +3303,6 @@ void ZSafe::copyClip( const QString &text) {
3851QString ZSafe::zsaveDialog() { 3303QString ZSafe::zsaveDialog() {
3852 3304
3853 QString fn; 3305 QString fn;
3854#ifndef DESKTOP
3855#ifndef NO_OPIE
3856 QMap<QString, QStringList> mimeTypes; 3306 QMap<QString, QStringList> mimeTypes;
3857 mimeTypes.insert(tr("All"), QStringList() ); 3307 mimeTypes.insert(tr("All"), QStringList() );
3858 mimeTypes.insert(tr("Text"), "text/*" ); 3308 mimeTypes.insert(tr("Text"), "text/*" );
@@ -3862,18 +3312,5 @@ QString ZSafe::zsaveDialog() {
3862 mimeTypes, 3312 mimeTypes,
3863 this, 3313 this,
3864 tr ("Export text file")); 3314 tr ("Export text file"));
3865#else 3315 return fn;
3866 fn = ScQtFileEdit::getSaveAsFileName(this,
3867 tr ("Export text file"),
3868 QDir::homeDirPath() + "/Documents/application/zsafe",
3869 "*.txt");
3870#endif
3871#else
3872 fn = QFileDialog::getSaveFileName(
3873 QDir::homeDirPath() + "/Documents/application/zsafe",
3874 "ZSafe (*.txt)",
3875 this,
3876 "ZSafe");
3877#endif
3878 return fn;
3879} 3316}
diff --git a/noncore/apps/zsafe/zsafe.h b/noncore/apps/zsafe/zsafe.h
index 7419797..3d812f8 100644
--- a/noncore/apps/zsafe/zsafe.h
+++ b/noncore/apps/zsafe/zsafe.h
@@ -46,7 +46,7 @@ class QPixmap;
46// number of fields for one entry 46// number of fields for one entry
47#define FIELD_SIZE 7 47#define FIELD_SIZE 7
48 48
49class ZSafe : public QDialog 49class ZSafe : public QWidget
50{ 50{
51 Q_OBJECT 51 Q_OBJECT
52 52
@@ -58,8 +58,9 @@ protected:
58 QTimer raiseTimer; 58 QTimer raiseTimer;
59 59
60public: 60public:
61 ZSafe( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = WDestructiveClose ); 61 ZSafe( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
62 ~ZSafe(); 62 ~ZSafe();
63 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME ); }
63 64
64 static const QColor *evenRowColor; 65 static const QColor *evenRowColor;
65 static const QColor *oddRowColor; 66 static const QColor *oddRowColor;
@@ -195,4 +196,9 @@ private slots:
195 196
196}; 197};
197 198
199
200extern ZSafe *zs;
201extern QApplication *appl;
202extern int DeskW;
203extern int DeskH;
198#endif // ZSAFE_H 204#endif // ZSAFE_H