summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/addentrywndimpl.cpp
authorulf69 <ulf69>2004-09-29 23:57:50 (UTC)
committer ulf69 <ulf69>2004-09-29 23:57:50 (UTC)
commit1bcba53b99411b8af139c8c62d2a5b26ba4a4721 (patch) (side-by-side diff)
tree6bbe50d7df09e0da3cce98d34e0c2894155bf5a4 /pwmanager/pwmanager/addentrywndimpl.cpp
parent21e794339f8988d9c370bebec45f60f2918fb671 (diff)
downloadkdepimpi-1bcba53b99411b8af139c8c62d2a5b26ba4a4721.zip
kdepimpi-1bcba53b99411b8af139c8c62d2a5b26ba4a4721.tar.gz
kdepimpi-1bcba53b99411b8af139c8c62d2a5b26ba4a4721.tar.bz2
optimization of the commentview. Coordinates are now stored at programend
Diffstat (limited to 'pwmanager/pwmanager/addentrywndimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/addentrywndimpl.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp
index ffd301f..d47f32c 100644
--- a/pwmanager/pwmanager/addentrywndimpl.cpp
+++ b/pwmanager/pwmanager/addentrywndimpl.cpp
@@ -33,6 +33,8 @@
#include <qpushbutton.h>
#include <qlabel.h>
+#include <qlayout.h>
+
#ifndef PWM_EMBEDDED
AddEntryWndImpl::AddEntryWndImpl()
@@ -42,16 +44,20 @@ AddEntryWndImpl::AddEntryWndImpl( QWidget* parent, const char* name)
: addEntryWnd( parent, name)
#endif
{
+#ifndef PWM_EMBEDDED
editAdvCommentButton = 0;
commentTextEdit = 0;
+#endif
switchComment(false);
pwGen = new PwGenWndImpl(this);
}
AddEntryWndImpl::~AddEntryWndImpl()
{
+#ifndef PWM_EMBEDDED
delete_ifnot_null(editAdvCommentButton);
delete_ifnot_null(commentTextEdit);
+#endif
delete pwGen;
}
@@ -133,14 +139,17 @@ void AddEntryWndImpl::generateButton_slot()
QString AddEntryWndImpl::getComment()
{
+#ifndef PWM_EMBEDDED
if (isAdvancedComment()) {
return advCommentDta;
}
+#endif
return commentTextEdit->text();
}
void AddEntryWndImpl::setComment(const QString &comm)
{
+#ifndef PWM_EMBEDDED
if (HtmlGen::isHtml(comm)) {
advancedCommentButton->setOn(true);
advCommentDta = comm;
@@ -148,15 +157,22 @@ void AddEntryWndImpl::setComment(const QString &comm)
advancedCommentButton->setOn(false);
commentTextEdit->setText(comm);
}
+#else
+ commentTextEdit->setText(comm);
+#endif
}
void AddEntryWndImpl::advancedCommentButton_slot(bool on)
{
+#ifndef PWM_EMBEDDED
switchComment(on);
+#endif
}
void AddEntryWndImpl::switchComment(bool toAdvanced)
{
+#ifndef PWM_EMBEDDED
+
useAdvComment = toAdvanced;
if (toAdvanced) {
if (commentTextEdit) {
@@ -175,16 +191,14 @@ void AddEntryWndImpl::switchComment(bool toAdvanced)
delete_ifnot_null(editAdvCommentButton);
if (commentTextEdit)
return;
-#ifndef PWM_EMBEDDED
+
commentTextEdit = new QTextEdit(commentDummy);
commentTextEdit->setTextFormat(Qt::PlainText);
-#else
- commentTextEdit = new QMultiLineEdit(commentDummy);
-#endif
commentTextEdit->resize(commentDummy->size());
commentTextEdit->setText(savedCommentText);
commentTextEdit->show();
}
+#endif
}
void AddEntryWndImpl::editAdvCommentButton_slot()