summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore 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.cpp201
3 files changed, 171 insertions, 42 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
@@ -16,3 +16,3 @@ void CategoryList::insert (QString key, Category *category)
16{ 16{
17 categoryList.insert ((const char *) key, category); 17 categoryList.insert (key, category);
18} 18}
@@ -21,3 +21,3 @@ Category *CategoryList::find (QString key)
21{ 21{
22 return categoryList.find ((const char *) key); 22 return categoryList.find (key);
23} 23}
@@ -26,3 +26,3 @@ void CategoryList::remove (QString key)
26{ 26{
27 categoryList.remove ((const char *) key); 27 categoryList.remove (key);
28} 28}
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
@@ -7,3 +7,5 @@
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"
@@ -23,3 +25,3 @@ public:
23 25
24 QAsciiDict<Category> categoryList; 26 QDict<Category> categoryList;
25 27
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
@@ -16,2 +16,4 @@
16** 16**
17** for japanese version additional use: -DJPATCH_HDE
18**
17****************************************************************************/ 19****************************************************************************/
@@ -456,9 +458,22 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
456#endif 458#endif
457 // setMinimumSize( QSize( DeskW, DeskH-30 ) ); 459
458 // setMaximumSize( QSize( DeskW, DeskH-30 ) );
459#else 460#else
460 resize( DeskW, DeskH-30 ); 461
461 // setMinimumSize( QSize( DeskW, DeskH-30 ) ); 462#ifdef JPATCH_HDE
462 // setMaximumSize( QSize( 440, 290 ) ); 463 int DeskS;
463 // setMaximumSize( QSize( DeskW+400, DeskH+200 ) ); 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 ) );
475#else
476 resize( DeskW, DeskH-30 );
477#endif
478
464#endif 479#endif
@@ -762,2 +777,18 @@ void ZSafe::editPwd()
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;
@@ -777,2 +808,3 @@ void ZSafe::editPwd()
777 selectedItem->setText (5, tr (f6)); 808 selectedItem->setText (5, tr (f6));
809#endif
778 } 810 }
@@ -841,2 +873,16 @@ retype:
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));
@@ -853,2 +899,3 @@ retype:
853 i->setText (5, tr (f6)); 899 i->setText (5, tr (f6));
900#endif
854 } 901 }
@@ -1206,3 +1253,3 @@ bool ZSafe::isCategory(QListViewItem *_item)
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;
@@ -1435,3 +1482,7 @@ void ZSafe::readAllEntries()
1435#endif 1482#endif
1436 strcpy (buffer, s); 1483
1484
1485 /* modify QString -> QCString::utf8 */
1486
1487 strcpy (buffer, s.utf8());
1437 1488
@@ -1446,3 +1497,3 @@ void ZSafe::readAllEntries()
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);
@@ -1455,3 +1506,3 @@ void ZSafe::readAllEntries()
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);
@@ -1461,3 +1512,3 @@ void ZSafe::readAllEntries()
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);
@@ -1466,3 +1517,3 @@ void ZSafe::readAllEntries()
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);
@@ -1471,3 +1522,3 @@ void ZSafe::readAllEntries()
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);
@@ -1476,3 +1527,3 @@ void ZSafe::readAllEntries()
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);
@@ -1481,3 +1532,3 @@ void ZSafe::readAllEntries()
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);
@@ -1496,2 +1547,10 @@ void ZSafe::readAllEntries()
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 ) );
@@ -1503,2 +1562,3 @@ void ZSafe::readAllEntries()
1503 catItem->setOpen( TRUE ); 1562 catItem->setOpen( TRUE );
1563#endif
1504 } 1564 }
@@ -1510,2 +1570,10 @@ void ZSafe::readAllEntries()
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 ) );
@@ -1516,2 +1584,3 @@ void ZSafe::readAllEntries()
1516 item->setText( 5, tr( field6 ) ); 1584 item->setText( 5, tr( field6 ) );
1585#endif
1517 catI->setOpen( TRUE ); 1586 catI->setOpen( TRUE );
@@ -1715,2 +1784,8 @@ void ZSafe::readAllEntries()
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 ) );
@@ -1719,2 +1794,3 @@ void ZSafe::readAllEntries()
1719 item->setText( 3, tr( comment ) ); 1794 item->setText( 3, tr( comment ) );
1795#endif
1720 catItem->setOpen( TRUE ); 1796 catItem->setOpen( TRUE );
@@ -1727,2 +1803,8 @@ void ZSafe::readAllEntries()
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 ) );
@@ -1731,2 +1813,3 @@ void ZSafe::readAllEntries()
1731 item->setText( 3, tr( comment ) ); 1813 item->setText( 3, tr( comment ) );
1814#endif
1732 catI->setOpen( TRUE ); 1815 catI->setOpen( TRUE );
@@ -1911,9 +1994,9 @@ bool ZSafe::openDocument(const char* _filename, const char* )
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
@@ -1928,2 +2011,10 @@ bool ZSafe::openDocument(const char* _filename, const char* )
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 ) );
@@ -1934,2 +2025,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1934 item->setText( 5, tr( field6 ) ); 2025 item->setText( 5, tr( field6 ) );
2026#endif
1935 if (expandTree) 2027 if (expandTree)
@@ -1944,2 +2036,10 @@ bool ZSafe::openDocument(const char* _filename, const char* )
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 ) );
@@ -1950,2 +2050,3 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1950 item->setText( 5, tr( field6 ) ); 2050 item->setText( 5, tr( field6 ) );
2051#endif
1951 if (expandTree) 2052 if (expandTree)
@@ -2261,17 +2362,16 @@ bool ZSafe::saveDocument(const char* _filename,
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
@@ -3205,4 +3305,9 @@ void ZSafe::editCategory()
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();
@@ -3531,2 +3636,23 @@ void ZSafe::about()
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"">";
@@ -3544,2 +3670,3 @@ void ZSafe::about()
3544 info += "</body></html>"; 3670 info += "</body></html>";
3671#endif
3545 3672