author | zcarsten <zcarsten> | 2003-08-06 20:15:19 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-08-06 20:15:19 (UTC) |
commit | e14f10f07d8477ee49cd487587732e27a3307878 (patch) (side-by-side diff) | |
tree | e46ff1986ce5c0cbba2283d80a878df432f874d8 | |
parent | ba25812361114b7cf059a3a1fb3aed42f8a7ebde (diff) | |
download | opie-e14f10f07d8477ee49cd487587732e27a3307878.zip opie-e14f10f07d8477ee49cd487587732e27a3307878.tar.gz opie-e14f10f07d8477ee49cd487587732e27a3307878.tar.bz2 |
addCategory corrected
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index ef16b46..e86b3d2 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -2599,2 +2599,3 @@ void ZSafe::addCategory() QString categ; + QString firstCategory; dialog->CategoryField->clear(); // remove all items @@ -2620,2 +2621,4 @@ void ZSafe::addCategory() dialog->CategoryField->insertItem (categ, -1); + if (firstCategory.isEmpty()) + firstCategory = categ; } @@ -2626,3 +2629,6 @@ void ZSafe::addCategory() + if (firstCategory.isEmpty()) setCategoryDialogFields(dialog); + else + setCategoryDialogFields(dialog, firstCategory); @@ -2788,2 +2794,8 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) { + if (!dialog) + return; + + QString icon; + if (selectedItem) + { dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name"))); @@ -2795,3 +2807,2 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) - QString icon; Category *cat= categories.find (selectedItem->text(0)); @@ -2801,2 +2812,12 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) } + } + else + { + dialog->Field1->setText(tr("Name")); + dialog->Field2->setText(tr("Username")); + dialog->Field3->setText(tr("Password")); + dialog->Field4->setText(tr("Comment")); + dialog->Field5->setText(tr("Field 4")); + dialog->Field6->setText(tr("Field 5")); + } @@ -2840,2 +2861,5 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category) { + if (!dialog) + return; + dialog->Field1->setText(getFieldLabel (category, "1", tr("Name"))); |