Diffstat (limited to 'pwmanager/pwmanager/addentrywndimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.cpp | 22 |
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() |