1 /***************************************************************************
3 edit "additional" properties
5 -----------------------------------------------------------------------
7 begin : Thu Nov 25 17:29:44 1999
9 copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
10 (C) 2001 The KDE-EDU team
11 (C) 2005 Peter Hedlund <peter@peterandlinda.com>
13 -----------------------------------------------------------------------
15 ***************************************************************************/
17 /***************************************************************************
19 * This program is free software; you can redistribute it and/or modify *
20 * it under the terms of the GNU General Public License as published by *
21 * the Free Software Foundation; either version 2 of the License, or *
22 * (at your option) any later version. *
24 ***************************************************************************/
26 #include <qmultilineedit.h>
28 #include "AuxInfoEntryPage.h"
35 AuxInfoEntryPage::AuxInfoEntryPage
47 : AuxInfoEntryPageForm( parent
, name
), dlgbook(_dlgbook
)
50 QFontMetrics
fm (synonym_line
->font());
51 int sz
= fm
.lineSpacing();
53 synonym_line
->setMaximumHeight(sz
*3);
54 antonym_line
->setMaximumHeight(sz
*3);
55 para_line
->setMaximumHeight(sz
*3);
56 remark_line
->setMaximumHeight(sz
*3);
57 examp_line
->setMaximumHeight(sz
*3);
59 connect( para_line
, SIGNAL(textChanged()), SLOT(slotParaSelected()) );
60 connect( remark_line
, SIGNAL(textChanged()), SLOT(slotRemarkSelected()) );
61 connect( examp_line
, SIGNAL(textChanged()), SLOT(slotExampSelected()) );
62 connect( antonym_line
, SIGNAL(textChanged()), SLOT(slotAntonymSelected()) );
63 connect( synonym_line
, SIGNAL(textChanged()), SLOT(slotSynonymSelected()) );
65 setData(multi_sel
, syno
, anto
, exam
, rem
, para
);
69 void AuxInfoEntryPage::setData(bool multi_sel
, QString syno
, QString anto
, QString example
, QString remark
, QString para
)
71 synonym_line
->setText(syno
);
72 antonym_line
->setText(anto
);
73 examp_line
->setText(example
);
74 remark_line
->setText(remark
);
75 para_line
->setText(para
);
78 synonym_line
->setEnabled(false);
79 antonym_line
->setEnabled(false);
80 remark_line
->setEnabled(false);
81 examp_line
->setEnabled(false);
82 para_line
->setEnabled(false);
89 void AuxInfoEntryPage::slotSynonymSelected()
92 synonym
= synonym_line
->text();
96 void AuxInfoEntryPage::slotAntonymSelected()
99 antonym
= antonym_line
->text();
103 void AuxInfoEntryPage::slotRemarkSelected ()
106 remark
= remark_line
->text();
110 void AuxInfoEntryPage::slotExampSelected ()
113 example
= examp_line
->text();
117 void AuxInfoEntryPage::slotParaSelected ()
120 paraphrase
= para_line
->text();
124 QString
AuxInfoEntryPage::getSynonym ()
131 QString
AuxInfoEntryPage::getAntonym ()
138 QString
AuxInfoEntryPage::getExample ()
145 QString
AuxInfoEntryPage::getRemark ()
152 QString
AuxInfoEntryPage::getParaphrase ()
154 normalize(paraphrase
);
159 void AuxInfoEntryPage::normalize (QString
&str
)
167 bool AuxInfoEntryPage::isModified()
173 void AuxInfoEntryPage::setEnabled(int enable
)
175 bool ena
= enable
== EntryDlg::EnableAll
;
177 synonym_line
->setEnabled (ena
);
178 antonym_line
->setEnabled (ena
);
179 para_line
->setEnabled (ena
);
180 remark_line
->setEnabled (ena
);
181 examp_line
->setEnabled (ena
);
185 void AuxInfoEntryPage::setModified(bool mod
)
192 #include "AuxInfoEntryPage.moc"