-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 106 |
1 files changed, 19 insertions, 87 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index d55624b..43565ee 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -101,6 +101,10 @@ extern QApplication *appl; | |||
101 | extern QPEApplication *appl; | 101 | extern QPEApplication *appl; |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #ifdef JPATCH_HDE | ||
105 | #define tr(arg) arg | ||
106 | #endif | ||
107 | |||
104 | 108 | ||
105 | #ifdef DESKTOP | 109 | #ifdef DESKTOP |
106 | #ifndef WIN32 | 110 | #ifndef WIN32 |
@@ -497,7 +501,11 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
497 | if (!pd1.mkdir("application", FALSE)) | 501 | if (!pd1.mkdir("application", FALSE)) |
498 | { | 502 | { |
499 | QMessageBox::critical( 0, tr("ZSafe"), | 503 | QMessageBox::critical( 0, tr("ZSafe"), |
504 | #ifdef JPATCH_HDE | ||
505 | tr("Can't create directory\n.../Documents/application\n\nZSafe will now exit.")); | ||
506 | #else | ||
500 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); | 507 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d1)); |
508 | #endif | ||
501 | exitZs (1); | 509 | exitZs (1); |
502 | } | 510 | } |
503 | } | 511 | } |
@@ -513,7 +521,11 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
513 | if (!pd2.mkdir("zsafe", FALSE)) | 521 | if (!pd2.mkdir("zsafe", FALSE)) |
514 | { | 522 | { |
515 | QMessageBox::critical( 0, tr("ZSafe"), | 523 | QMessageBox::critical( 0, tr("ZSafe"), |
524 | #ifdef JPATCH_HDE | ||
525 | tr("Can't create directory\n...//Documents/application/zsafe\n\nZSafe will now exit.")); | ||
526 | #else | ||
516 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); | 527 | tr("Can't create directory\n%1\n\nZSafe will now exit.").arg(d2)); |
528 | #endif | ||
517 | exitZs (1); | 529 | exitZs (1); |
518 | } | 530 | } |
519 | } | 531 | } |
@@ -775,22 +787,6 @@ void ZSafe::editPwd() | |||
775 | #endif | 787 | #endif |
776 | if (result == Accepted) | 788 | if (result == Accepted) |
777 | { | 789 | { |
778 | #ifdef JPATCH_HDE | ||
779 | // edit the selected item | ||
780 | QString name = dialog->NameField->text(); | ||
781 | selectedItem->setText (0, name); | ||
782 | QString user = dialog->UsernameField->text(); | ||
783 | selectedItem->setText (1, user); | ||
784 | QString pwd = dialog->PasswordField->text(); | ||
785 | selectedItem->setText (2, pwd); | ||
786 | QString comment = dialog->CommentField->text(); | ||
787 | comment.replace (QRegExp("\n"), "<br>"); | ||
788 | selectedItem->setText (3, comment); | ||
789 | QString f5 = dialog->Field5->text(); | ||
790 | selectedItem->setText (4, f5); | ||
791 | QString f6 = dialog->Field6->text(); | ||
792 | selectedItem->setText (5, f6); | ||
793 | #else | ||
794 | modified = true; | 790 | modified = true; |
795 | // edit the selected item | 791 | // edit the selected item |
796 | QString name = dialog->NameField->text(); | 792 | QString name = dialog->NameField->text(); |
@@ -806,7 +802,6 @@ void ZSafe::editPwd() | |||
806 | selectedItem->setText (4, tr (f5)); | 802 | selectedItem->setText (4, tr (f5)); |
807 | QString f6 = dialog->Field6->text(); | 803 | QString f6 = dialog->Field6->text(); |
808 | selectedItem->setText (5, tr (f6)); | 804 | selectedItem->setText (5, tr (f6)); |
809 | #endif | ||
810 | } | 805 | } |
811 | 806 | ||
812 | delete dialog; | 807 | delete dialog; |
@@ -871,20 +866,6 @@ retype: | |||
871 | QListViewItem *i = new ShadedListItem (0, selectedItem); | 866 | QListViewItem *i = new ShadedListItem (0, selectedItem); |
872 | i->setOpen (TRUE); | 867 | i->setOpen (TRUE); |
873 | 868 | ||
874 | #ifdef JPATCH_HDE | ||
875 | i->setText (0, name); | ||
876 | QString user = dialog->UsernameField->text(); | ||
877 | i->setText (1, user); | ||
878 | QString pwd = dialog->PasswordField->text(); | ||
879 | i->setText (2, pwd); | ||
880 | QString comment = dialog->CommentField->text(); | ||
881 | comment.replace (QRegExp("\n"), "<br>"); | ||
882 | i->setText (3, comment); | ||
883 | QString f5 = dialog->Field5->text(); | ||
884 | i->setText (4, f5); | ||
885 | QString f6 = dialog->Field6->text(); | ||
886 | i->setText (5, f6); | ||
887 | #else | ||
888 | i->setText (0, tr (name)); | 869 | i->setText (0, tr (name)); |
889 | QString user = dialog->UsernameField->text(); | 870 | QString user = dialog->UsernameField->text(); |
890 | i->setText (1, tr (user)); | 871 | i->setText (1, tr (user)); |
@@ -897,7 +878,6 @@ retype: | |||
897 | i->setText (4, tr (f5)); | 878 | i->setText (4, tr (f5)); |
898 | QString f6 = dialog->Field6->text(); | 879 | QString f6 = dialog->Field6->text(); |
899 | i->setText (5, tr (f6)); | 880 | i->setText (5, tr (f6)); |
900 | #endif | ||
901 | } | 881 | } |
902 | 882 | ||
903 | delete dialog; | 883 | delete dialog; |
@@ -1545,14 +1525,6 @@ void ZSafe::readAllEntries() | |||
1545 | if (catItem) | 1525 | if (catItem) |
1546 | { | 1526 | { |
1547 | QListViewItem * item = new ShadedListItem( 0, catItem ); | 1527 | QListViewItem * item = new ShadedListItem( 0, catItem ); |
1548 | #ifdef JPATCH_HDE | ||
1549 | item->setText( 0, name ); | ||
1550 | item->setText( 1, user ); | ||
1551 | item->setText( 2, password ); | ||
1552 | item->setText( 3, comment ); | ||
1553 | item->setText( 4, field5 ); | ||
1554 | item->setText( 5, field6 ); | ||
1555 | #else | ||
1556 | item->setText( 0, tr( name ) ); | 1528 | item->setText( 0, tr( name ) ); |
1557 | item->setText( 1, tr( user ) ); | 1529 | item->setText( 1, tr( user ) ); |
1558 | item->setText( 2, tr( password ) ); | 1530 | item->setText( 2, tr( password ) ); |
@@ -1560,7 +1532,6 @@ void ZSafe::readAllEntries() | |||
1560 | item->setText( 4, tr( field5 ) ); | 1532 | item->setText( 4, tr( field5 ) ); |
1561 | item->setText( 5, tr( field6 ) ); | 1533 | item->setText( 5, tr( field6 ) ); |
1562 | catItem->setOpen( TRUE ); | 1534 | catItem->setOpen( TRUE ); |
1563 | #endif | ||
1564 | } | 1535 | } |
1565 | } | 1536 | } |
1566 | else | 1537 | else |
@@ -1568,21 +1539,13 @@ void ZSafe::readAllEntries() | |||
1568 | QListViewItem *catI = new ShadedListItem( 1, ListView ); | 1539 | QListViewItem *catI = new ShadedListItem( 1, ListView ); |
1569 | // create and insert a new item | 1540 | // create and insert a new item |
1570 | QListViewItem * item = new ShadedListItem( 0, catI ); | 1541 | QListViewItem * item = new ShadedListItem( 0, catI ); |
1571 | #ifdef JPATCH_HDE | ||
1572 | item->setText( 0, name ); | ||
1573 | item->setText( 1, user ); | ||
1574 | item->setText( 2, password ); | ||
1575 | item->setText( 3, comment ); | ||
1576 | item->setText( 4, field5 ); | ||
1577 | item->setText( 5, field6 ); | ||
1578 | #else | ||
1579 | item->setText( 0, tr( name ) ); | 1542 | item->setText( 0, tr( name ) ); |
1580 | item->setText( 1, tr( user ) ); | 1543 | item->setText( 1, tr( user ) ); |
1581 | item->setText( 2, tr( password ) ); | 1544 | item->setText( 2, tr( password ) ); |
1582 | item->setText( 3, tr( comment ) ); | 1545 | item->setText( 3, tr( comment ) ); |
1583 | item->setText( 4, tr( field5 ) ); | 1546 | item->setText( 4, tr( field5 ) ); |
1584 | item->setText( 5, tr( field6 ) ); | 1547 | item->setText( 5, tr( field6 ) ); |
1585 | #endif | 1548 | |
1586 | catI->setOpen( TRUE ); | 1549 | catI->setOpen( TRUE ); |
1587 | 1550 | ||
1588 | Category *c1 = new Category(); | 1551 | Category *c1 = new Category(); |
@@ -1782,17 +1745,11 @@ void ZSafe::readAllEntries() | |||
1782 | if (catItem) | 1745 | if (catItem) |
1783 | { | 1746 | { |
1784 | QListViewItem * item = new ShadedListItem( 0, catItem ); | 1747 | QListViewItem * item = new ShadedListItem( 0, catItem ); |
1785 | #ifdef JPATCH_HDE | ||
1786 | item->setText( 0, name ); | ||
1787 | item->setText( 1, user ); | ||
1788 | item->setText( 2, password ); | ||
1789 | item->setText( 3, comment ); | ||
1790 | #else | ||
1791 | item->setText( 0, tr( name ) ); | 1748 | item->setText( 0, tr( name ) ); |
1792 | item->setText( 1, tr( user ) ); | 1749 | item->setText( 1, tr( user ) ); |
1793 | item->setText( 2, tr( password ) ); | 1750 | item->setText( 2, tr( password ) ); |
1794 | item->setText( 3, tr( comment ) ); | 1751 | item->setText( 3, tr( comment ) ); |
1795 | #endif | 1752 | |
1796 | catItem->setOpen( TRUE ); | 1753 | catItem->setOpen( TRUE ); |
1797 | } | 1754 | } |
1798 | } | 1755 | } |
@@ -1801,17 +1758,11 @@ void ZSafe::readAllEntries() | |||
1801 | QListViewItem *catI = new ShadedListItem( 1, ListView ); | 1758 | QListViewItem *catI = new ShadedListItem( 1, ListView ); |
1802 | // create and insert a new item | 1759 | // create and insert a new item |
1803 | QListViewItem * item = new ShadedListItem( 0, catI ); | 1760 | QListViewItem * item = new ShadedListItem( 0, catI ); |
1804 | #ifdef JPATCH_HDE | ||
1805 | item->setText( 0, name ); | ||
1806 | item->setText( 1, user ); | ||
1807 | item->setText( 2, password ); | ||
1808 | item->setText( 3, comment ); | ||
1809 | #else | ||
1810 | item->setText( 0, tr( name ) ); | 1761 | item->setText( 0, tr( name ) ); |
1811 | item->setText( 1, tr( user ) ); | 1762 | item->setText( 1, tr( user ) ); |
1812 | item->setText( 2, tr( password ) ); | 1763 | item->setText( 2, tr( password ) ); |
1813 | item->setText( 3, tr( comment ) ); | 1764 | item->setText( 3, tr( comment ) ); |
1814 | #endif | 1765 | |
1815 | catI->setOpen( TRUE ); | 1766 | catI->setOpen( TRUE ); |
1816 | 1767 | ||
1817 | Category *c1 = new Category(); | 1768 | Category *c1 = new Category(); |
@@ -2009,21 +1960,13 @@ bool ZSafe::openDocument(const char* _filename, const char* ) | |||
2009 | if (catItem) | 1960 | if (catItem) |
2010 | { | 1961 | { |
2011 | QListViewItem * item = new ShadedListItem( 0, catItem ); | 1962 | QListViewItem * item = new ShadedListItem( 0, catItem ); |
2012 | #ifdef JPATCH_HDE | ||
2013 | item->setText( 0, name ); | ||
2014 | item->setText( 1, user ); | ||
2015 | item->setText( 2, password ); | ||
2016 | item->setText( 3, comment ); | ||
2017 | item->setText( 4, field5 ); | ||
2018 | item->setText( 5, field6 ); | ||
2019 | #else | ||
2020 | item->setText( 0, tr( name ) ); | 1963 | item->setText( 0, tr( name ) ); |
2021 | item->setText( 1, tr( user ) ); | 1964 | item->setText( 1, tr( user ) ); |
2022 | item->setText( 2, tr( password ) ); | 1965 | item->setText( 2, tr( password ) ); |
2023 | item->setText( 3, tr( comment ) ); | 1966 | item->setText( 3, tr( comment ) ); |
2024 | item->setText( 4, tr( field5 ) ); | 1967 | item->setText( 4, tr( field5 ) ); |
2025 | item->setText( 5, tr( field6 ) ); | 1968 | item->setText( 5, tr( field6 ) ); |
2026 | #endif | 1969 | |
2027 | if (expandTree) | 1970 | if (expandTree) |
2028 | catItem->setOpen( TRUE ); | 1971 | catItem->setOpen( TRUE ); |
2029 | numberOfEntries++; | 1972 | numberOfEntries++; |
@@ -2034,21 +1977,14 @@ bool ZSafe::openDocument(const char* _filename, const char* ) | |||
2034 | QListViewItem *catI = new ShadedListItem( 1, ListView ); | 1977 | QListViewItem *catI = new ShadedListItem( 1, ListView ); |
2035 | // create and insert a new item | 1978 | // create and insert a new item |
2036 | QListViewItem * item = new ShadedListItem( 0, catI ); | 1979 | QListViewItem * item = new ShadedListItem( 0, catI ); |
2037 | #ifdef JPATCH_HDE | 1980 | |
2038 | item->setText( 0, name ); | ||
2039 | item->setText( 1, user ); | ||
2040 | item->setText( 2, password ); | ||
2041 | item->setText( 3, comment ); | ||
2042 | item->setText( 4, field5 ); | ||
2043 | item->setText( 5, field6 ); | ||
2044 | #else | ||
2045 | item->setText( 0, tr( name ) ); | 1981 | item->setText( 0, tr( name ) ); |
2046 | item->setText( 1, tr( user ) ); | 1982 | item->setText( 1, tr( user ) ); |
2047 | item->setText( 2, tr( password ) ); | 1983 | item->setText( 2, tr( password ) ); |
2048 | item->setText( 3, tr( comment ) ); | 1984 | item->setText( 3, tr( comment ) ); |
2049 | item->setText( 4, tr( field5 ) ); | 1985 | item->setText( 4, tr( field5 ) ); |
2050 | item->setText( 5, tr( field6 ) ); | 1986 | item->setText( 5, tr( field6 ) ); |
2051 | #endif | 1987 | |
2052 | if (expandTree) | 1988 | if (expandTree) |
2053 | catI->setOpen( TRUE ); | 1989 | catI->setOpen( TRUE ); |
2054 | 1990 | ||
@@ -3303,13 +3239,9 @@ void ZSafe::editCategory() | |||
3303 | if (catItem) | 3239 | if (catItem) |
3304 | { | 3240 | { |
3305 | qWarning (category); | 3241 | qWarning (category); |
3306 | #ifdef JPATCH_HDE | ||
3307 | catItem->setText( 0, category ); | ||
3308 | cat->setCategoryName (category); | ||
3309 | #else | ||
3310 | catItem->setText( 0, tr( category ) ); | 3242 | catItem->setText( 0, tr( category ) ); |
3311 | cat->setCategoryName (tr(category)); | 3243 | cat->setCategoryName (tr(category)); |
3312 | #endif | 3244 | |
3313 | cat->initListItem(); | 3245 | cat->initListItem(); |
3314 | categories.insert (category, cat); | 3246 | categories.insert (category, cat); |
3315 | } | 3247 | } |