summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/zsafe/categorylist.cpp6
-rw-r--r--noncore/apps/zsafe/categorylist.h6
-rw-r--r--noncore/apps/zsafe/zsafe.cpp199
3 files changed, 170 insertions, 41 deletions
diff --git a/noncore/apps/zsafe/categorylist.cpp b/noncore/apps/zsafe/categorylist.cpp
index 2fa59d2..c5e8d66 100644
--- a/noncore/apps/zsafe/categorylist.cpp
+++ b/noncore/apps/zsafe/categorylist.cpp
@@ -15,15 +15,15 @@ CategoryList::~CategoryList()
15void CategoryList::insert (QString key, Category *category) 15void CategoryList::insert (QString key, Category *category)
16{ 16{
17 categoryList.insert ((const char *) key, category); 17 categoryList.insert (key, category);
18} 18}
19 19
20Category *CategoryList::find (QString key) 20Category *CategoryList::find (QString key)
21{ 21{
22 return categoryList.find ((const char *) key); 22 return categoryList.find (key);
23} 23}
24 24
25void CategoryList::remove (QString key) 25void CategoryList::remove (QString key)
26{ 26{
27 categoryList.remove ((const char *) key); 27 categoryList.remove (key);
28} 28}
29 29
diff --git a/noncore/apps/zsafe/categorylist.h b/noncore/apps/zsafe/categorylist.h
index 96cf389..fc1c0a2 100644
--- a/noncore/apps/zsafe/categorylist.h
+++ b/noncore/apps/zsafe/categorylist.h
@@ -6,5 +6,7 @@
6 6
7#include <qstring.h> 7#include <qstring.h>
8#include <qasciidict.h> 8
9#include <qdict.h>
10
9#include "category.h" 11#include "category.h"
10 12
@@ -22,5 +24,5 @@ public:
22 void clear(); 24 void clear();
23 25
24 QAsciiDict<Category> categoryList; 26 QDict<Category> categoryList;
25 27
26private: 28private:
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 9341425..d55624b 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -15,4 +15,6 @@
15** Windows Desktop: -DDESKTOP -DWIN32 15** Windows Desktop: -DDESKTOP -DWIN32
16** 16**
17** for japanese version additional use: -DJPATCH_HDE
18**
17****************************************************************************/ 19****************************************************************************/
18#include "zsafe.h" 20#include "zsafe.h"
@@ -455,11 +457,24 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
455 resize( DeskW, DeskH-30 ); 457 resize( DeskW, DeskH-30 );
456#endif 458#endif
457 // setMinimumSize( QSize( DeskW, DeskH-30 ) ); 459
458 // setMaximumSize( QSize( DeskW, DeskH-30 ) ); 460#else
461
462#ifdef JPATCH_HDE
463 int DeskS;
464 if(DeskW > DeskH)
465 {
466 DeskS = DeskW;
467 }
468 else
469 {
470 DeskS = DeskH;
471 }
472 resize( DeskW, DeskH );
473 setMinimumSize( QSize( DeskS, DeskS ) );
474 setMaximumSize( QSize( DeskS, DeskS ) );
459#else 475#else
460 resize( DeskW, DeskH-30 ); 476 resize( DeskW, DeskH-30 );
461 // setMinimumSize( QSize( DeskW, DeskH-30 ) ); 477#endif
462 // setMaximumSize( QSize( 440, 290 ) ); 478
463 // setMaximumSize( QSize( DeskW+400, DeskH+200 ) );
464#endif 479#endif
465 // setCaption( tr( "ZSafe" ) ); 480 // setCaption( tr( "ZSafe" ) );
@@ -761,4 +776,20 @@ void ZSafe::editPwd()
761 if (result == Accepted) 776 if (result == Accepted)
762 { 777 {
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
763 modified = true; 794 modified = true;
764 // edit the selected item 795 // edit the selected item
@@ -776,4 +807,5 @@ void ZSafe::editPwd()
776 QString f6 = dialog->Field6->text(); 807 QString f6 = dialog->Field6->text();
777 selectedItem->setText (5, tr (f6)); 808 selectedItem->setText (5, tr (f6));
809#endif
778 } 810 }
779 811
@@ -840,4 +872,18 @@ retype:
840 i->setOpen (TRUE); 872 i->setOpen (TRUE);
841 873
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
842 i->setText (0, tr (name)); 888 i->setText (0, tr (name));
843 QString user = dialog->UsernameField->text(); 889 QString user = dialog->UsernameField->text();
@@ -852,4 +898,5 @@ retype:
852 QString f6 = dialog->Field6->text(); 898 QString f6 = dialog->Field6->text();
853 i->setText (5, tr (f6)); 899 i->setText (5, tr (f6));
900#endif
854 } 901 }
855 902
@@ -1205,5 +1252,5 @@ bool ZSafe::isCategory(QListViewItem *_item)
1205 1252
1206 QString categoryName = _item->text (0); 1253 QString categoryName = _item->text (0);
1207 if (categories.find ((const char *)categoryName)) 1254 if (categories.find (categoryName))
1208 return TRUE; 1255 return TRUE;
1209 else 1256 else
@@ -1434,5 +1481,9 @@ void ZSafe::readAllEntries()
1434 char buffer[4048]; 1481 char buffer[4048];
1435#endif 1482#endif
1436 strcpy (buffer, s); 1483
1484
1485 /* modify QString -> QCString::utf8 */
1486
1487 strcpy (buffer, s.utf8());
1437 1488
1438 QString name; 1489 QString name;
@@ -1445,5 +1496,5 @@ void ZSafe::readAllEntries()
1445 // separete the entries 1496 // separete the entries
1446 char *i = strtok (buffer, "|"); 1497 char *i = strtok (buffer, "|");
1447 QString category(&i[1]); 1498 QString category(QString::fromUtf8(&i[1]));
1448 category.truncate(category.length() -1); 1499 category.truncate(category.length() -1);
1449 1500
@@ -1454,5 +1505,5 @@ void ZSafe::readAllEntries()
1454 { 1505 {
1455 case 0: 1506 case 0:
1456 name = &i[1]; 1507 name = QString::fromUtf8(&i[1]);
1457 name.truncate(name.length() -1); 1508 name.truncate(name.length() -1);
1458 // name 1509 // name
@@ -1460,25 +1511,25 @@ void ZSafe::readAllEntries()
1460 case 1: 1511 case 1:
1461 // user 1512 // user
1462 user = &i[1]; 1513 user = QString::fromUtf8(&i[1]);
1463 user.truncate(user.length() -1); 1514 user.truncate(user.length() -1);
1464 break; 1515 break;
1465 case 2: 1516 case 2:
1466 // password 1517 // password
1467 password = &i[1]; 1518 password = QString::fromUtf8(&i[1]);
1468 password.truncate(password.length() -1); 1519 password.truncate(password.length() -1);
1469 break; 1520 break;
1470 case 3: 1521 case 3:
1471 // comment 1522 // comment
1472 comment = &i[1]; 1523 comment = QString::fromUtf8(&i[1]);
1473 comment.truncate(comment.length() -1); 1524 comment.truncate(comment.length() -1);
1474 break; 1525 break;
1475 case 4: 1526 case 4:
1476 // field5 1527 // field5
1477 field5 = &i[1]; 1528 field5 = QString::fromUtf8(&i[1]);
1478 field5.truncate(field5.length() -1); 1529 field5.truncate(field5.length() -1);
1479 break; 1530 break;
1480 case 5: 1531 case 5:
1481 // field6 1532 // field6
1482 field6 = &i[1]; 1533 field6 = QString::fromUtf8(&i[1]);
1483 field6.truncate(field6.length() -1); 1534 field6.truncate(field6.length() -1);
1484 break; 1535 break;
@@ -1495,4 +1546,12 @@ void ZSafe::readAllEntries()
1495 { 1546 {
1496 QListViewItem * item = new ShadedListItem( 0, catItem ); 1547 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
1497 item->setText( 0, tr( name ) ); 1556 item->setText( 0, tr( name ) );
1498 item->setText( 1, tr( user ) ); 1557 item->setText( 1, tr( user ) );
@@ -1502,4 +1561,5 @@ void ZSafe::readAllEntries()
1502 item->setText( 5, tr( field6 ) ); 1561 item->setText( 5, tr( field6 ) );
1503 catItem->setOpen( TRUE ); 1562 catItem->setOpen( TRUE );
1563#endif
1504 } 1564 }
1505 } 1565 }
@@ -1509,4 +1569,12 @@ void ZSafe::readAllEntries()
1509 // create and insert a new item 1569 // create and insert a new item
1510 QListViewItem * item = new ShadedListItem( 0, catI ); 1570 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
1511 item->setText( 0, tr( name ) ); 1579 item->setText( 0, tr( name ) );
1512 item->setText( 1, tr( user ) ); 1580 item->setText( 1, tr( user ) );
@@ -1515,4 +1583,5 @@ void ZSafe::readAllEntries()
1515 item->setText( 4, tr( field5 ) ); 1583 item->setText( 4, tr( field5 ) );
1516 item->setText( 5, tr( field6 ) ); 1584 item->setText( 5, tr( field6 ) );
1585#endif
1517 catI->setOpen( TRUE ); 1586 catI->setOpen( TRUE );
1518 1587
@@ -1714,8 +1783,15 @@ void ZSafe::readAllEntries()
1714 { 1783 {
1715 QListViewItem * item = new ShadedListItem( 0, catItem ); 1784 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
1716 item->setText( 0, tr( name ) ); 1791 item->setText( 0, tr( name ) );
1717 item->setText( 1, tr( user ) ); 1792 item->setText( 1, tr( user ) );
1718 item->setText( 2, tr( password ) ); 1793 item->setText( 2, tr( password ) );
1719 item->setText( 3, tr( comment ) ); 1794 item->setText( 3, tr( comment ) );
1795#endif
1720 catItem->setOpen( TRUE ); 1796 catItem->setOpen( TRUE );
1721 } 1797 }
@@ -1726,8 +1802,15 @@ void ZSafe::readAllEntries()
1726 // create and insert a new item 1802 // create and insert a new item
1727 QListViewItem * item = new ShadedListItem( 0, catI ); 1803 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
1728 item->setText( 0, tr( name ) ); 1810 item->setText( 0, tr( name ) );
1729 item->setText( 1, tr( user ) ); 1811 item->setText( 1, tr( user ) );
1730 item->setText( 2, tr( password ) ); 1812 item->setText( 2, tr( password ) );
1731 item->setText( 3, tr( comment ) ); 1813 item->setText( 3, tr( comment ) );
1814#endif
1732 catI->setOpen( TRUE ); 1815 catI->setOpen( TRUE );
1733 1816
@@ -1910,11 +1993,11 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1910 while (retval == 1) { 1993 while (retval == 1) {
1911 1994
1912 QString category(entry[0]); 1995 QString category( QString::fromUtf8(entry[0]) );
1913 QString name(entry[1]); 1996 QString name( QString::fromUtf8(entry[1]) );
1914 QString user(entry[2]); 1997 QString user( QString::fromUtf8(entry[2]) );
1915 QString password(entry[3]); 1998 QString password( QString::fromUtf8(entry[3]) );
1916 QString comment(entry[4]); 1999 QString comment( QString::fromUtf8(entry[4]) );
1917 QString field5(entry[5]); 2000 QString field5( QString::fromUtf8(entry[5]) );
1918 QString field6(entry[6]); 2001 QString field6( QString::fromUtf8(entry[6]) );
1919 // add the subitems to the categories 2002 // add the subitems to the categories
1920 2003
@@ -1927,4 +2010,12 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1927 { 2010 {
1928 QListViewItem * item = new ShadedListItem( 0, catItem ); 2011 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
1929 item->setText( 0, tr( name ) ); 2020 item->setText( 0, tr( name ) );
1930 item->setText( 1, tr( user ) ); 2021 item->setText( 1, tr( user ) );
@@ -1933,4 +2024,5 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1933 item->setText( 4, tr( field5 ) ); 2024 item->setText( 4, tr( field5 ) );
1934 item->setText( 5, tr( field6 ) ); 2025 item->setText( 5, tr( field6 ) );
2026#endif
1935 if (expandTree) 2027 if (expandTree)
1936 catItem->setOpen( TRUE ); 2028 catItem->setOpen( TRUE );
@@ -1943,4 +2035,12 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1943 // create and insert a new item 2035 // create and insert a new item
1944 QListViewItem * item = new ShadedListItem( 0, catI ); 2036 QListViewItem * item = new ShadedListItem( 0, catI );
2037#ifdef JPATCH_HDE
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
1945 item->setText( 0, tr( name ) ); 2045 item->setText( 0, tr( name ) );
1946 item->setText( 1, tr( user ) ); 2046 item->setText( 1, tr( user ) );
@@ -1949,4 +2049,5 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1949 item->setText( 4, tr( field5 ) ); 2049 item->setText( 4, tr( field5 ) );
1950 item->setText( 5, tr( field6 ) ); 2050 item->setText( 5, tr( field6 ) );
2051#endif
1951 if (expandTree) 2052 if (expandTree)
1952 catI->setOpen( TRUE ); 2053 catI->setOpen( TRUE );
@@ -2260,19 +2361,18 @@ bool ZSafe::saveDocument(const char* _filename,
2260 { 2361 {
2261 int j=0; 2362 int j=0;
2262 entry[j] = (char*)malloc(strlen(i->text(0))+1); 2363 entry[j] = (char*)malloc(strlen(i->text(0).utf8())+1);
2263 strcpy(entry[j++], i->text(0)); 2364 strcpy(entry[j++], i->text(0).utf8());
2264 entry[j] = (char*)malloc(strlen(si->text(0))+1); 2365 entry[j] = (char*)malloc(strlen(si->text(0).utf8())+1);
2265 strcpy(entry[j++], si->text(0)); 2366 strcpy(entry[j++], si->text(0).utf8());
2266 entry[j] = (char*)malloc(strlen(si->text(1))+1); 2367 entry[j] = (char*)malloc(strlen(si->text(1).utf8())+1);
2267 strcpy(entry[j++], si->text(1)); 2368 strcpy(entry[j++], si->text(1).utf8());
2268 entry[j] = (char*)malloc(strlen(si->text(2))+1); 2369 entry[j] = (char*)malloc(strlen(si->text(2).utf8())+1);
2269 strcpy(entry[j++], si->text(2)); 2370 strcpy(entry[j++], si->text(2).utf8());
2270 entry[j] = (char*)malloc(strlen(si->text(3))+1); 2371 entry[j] = (char*)malloc(strlen(si->text(3).utf8())+1);
2271 strcpy(entry[j++], si->text(3)); 2372 strcpy(entry[j++], si->text(3).utf8());
2272 2373 entry[j] = (char*)malloc(strlen(si->text(4).utf8())+1);
2273 entry[j] = (char*)malloc(strlen(si->text(4))+1); 2374 strcpy(entry[j++], si->text(4).utf8());
2274 strcpy(entry[j++], si->text(4)); 2375 entry[j] = (char*)malloc(strlen(si->text(5).utf8())+1);
2275 entry[j] = (char*)malloc(strlen(si->text(5))+1); 2376 strcpy(entry[j++], si->text(5).utf8());
2276 strcpy(entry[j++], si->text(5));
2277 2377
2278 retval = saveEntry(entry); 2378 retval = saveEntry(entry);
@@ -3204,6 +3304,11 @@ void ZSafe::editCategory()
3204 { 3304 {
3205 qWarning (category); 3305 qWarning (category);
3306#ifdef JPATCH_HDE
3307 catItem->setText( 0, category );
3308 cat->setCategoryName (category);
3309#else
3206 catItem->setText( 0, tr( category ) ); 3310 catItem->setText( 0, tr( category ) );
3207 cat->setCategoryName (tr(category)); 3311 cat->setCategoryName (tr(category));
3312#endif
3208 cat->initListItem(); 3313 cat->initListItem();
3209 categories.insert (category, cat); 3314 categories.insert (category, cat);
@@ -3530,4 +3635,25 @@ void ZSafe::about()
3530{ 3635{
3531 QString info; 3636 QString info;
3637#ifdef JPATCH_HDE
3638 info = "<html><body><div align=""center"">";
3639 info += "<b>";
3640 info += tr("Zaurus Password Manager<br>");
3641 info += tr("ZSafe version 2.1.2-jv01b<br>");
3642 info += "</b>";
3643 info += tr("by Carsten Schneider<br>");
3644 info += "zcarsten@gmx.net<br>";
3645 info += "http://z-soft.z-portal.info/zsafe";
3646 info += "<br>";
3647 info += tr("Translations by Robert Ernst<br>");
3648 info += "robert.ernst@linux-solutions.at<br>";
3649
3650 info += "<br><br>";
3651 info += QString::fromUtf8("æ~W¥æ~\\¬èª~^/VGA Zaurus対å¿~\\ã~C~Qã~C~Cã~C~Aä½~\\æ ~H~P<br>");
3652 info += "HADECO R&D<br>";
3653 info += "r&d@hadeco.co.jp<br>";
3654 info += "http://www.hadeco.co.jp/r&d/<br>";
3655 info += "<br></div>";
3656 info += "</body></html>";
3657#else
3532 info = "<html><body><div align=""center"">"; 3658 info = "<html><body><div align=""center"">";
3533 info += "<b>"; 3659 info += "<b>";
@@ -3543,4 +3669,5 @@ void ZSafe::about()
3543 info += "<br></div>"; 3669 info += "<br></div>";
3544 info += "</body></html>"; 3670 info += "</body></html>";
3671#endif
3545 3672
3546 // QMessageBox::information( this, tr("ZSafe"), info, tr("&OK"), 0); 3673 // QMessageBox::information( this, tr("ZSafe"), info, tr("&OK"), 0);