From: pavelpa Date: Wed, 27 Jan 2010 12:06:32 +0000 (+0000) Subject: refactored Event 'details' dialog X-Git-Tag: 0.5.0~177 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/1bcd66f3a4a3d201f3e45334affcc3b8a6c4b153?hp=ce590923dea8a02805b45b9a93852a0041d34ed1 refactored Event 'details' dialog - TODO: implement 'links' method(s) in Event and use it in the dialog --- diff --git a/src/gui/eventdialog.cpp b/src/gui/eventdialog.cpp index 5202663..6707101 100644 --- a/src/gui/eventdialog.cpp +++ b/src/gui/eventdialog.cpp @@ -7,48 +7,6 @@ #include #endif -DetailsContainer::DetailsContainer(QWidget *aParent) - : QWidget(aParent) -{ - mAbstract.setWordWrap(true); - mDescription.setWordWrap(true); - - QFont f = QLabel().font(); - f.setBold(true); - f.setItalic(true); - mMainLayout = new QVBoxLayout(this); - QLabel *persons = new QLabel("Persons:"); - persons->setFont(f); - mMainLayout->addWidget(persons); - mMainLayout->addWidget(&mPersons); - mMainLayout->addWidget(new QLabel("")); // spacer - QLabel *abstract = new QLabel("Abstract:"); - abstract->setFont(f); - mMainLayout->addWidget(abstract); - mMainLayout->addWidget(&mAbstract); - mMainLayout->addWidget(new QLabel("")); // spacer - QLabel *description = new QLabel("Description:"); - description->setFont(f); - mMainLayout->addWidget(description); - mMainLayout->addWidget(&mDescription); - setLayout(mMainLayout); -} - -void DetailsContainer::setPersons(const QStringList &aPersons) -{ - mPersons.setText(aPersons.join(" and ")); -} - -void DetailsContainer::setAbstract(const QString &aAbstract) -{ - mAbstract.setText(aAbstract); -} - -void DetailsContainer::setDescription(const QString &aDescription) -{ - mDescription.setText(aDescription); -} - EventDialog::EventDialog(const int &aEventId, QWidget *aParent) : QDialog(aParent) , mEventId(aEventId) @@ -62,10 +20,9 @@ EventDialog::EventDialog(const int &aEventId, QWidget *aParent) Event event = Event::getById(mEventId,AppSettings::confId()); title->setText(event.title()); - mDetails.setPersons(event.persons()); - mDetails.setAbstract(event.abstract()); - mDetails.setDescription(event.description()); - scrollArea->setWidget(&mDetails); + persons->setText(event.persons().join(" and ")); + abstract->setText(event.abstract()); + description->setText(event.description()); connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked())); connect(alarmButton, SIGNAL(clicked()), SLOT(alarmClicked())); diff --git a/src/gui/eventdialog.h b/src/gui/eventdialog.h index e9bb332..2f13f25 100644 --- a/src/gui/eventdialog.h +++ b/src/gui/eventdialog.h @@ -5,20 +5,6 @@ #include "ui_eventdialog.h" #include -class DetailsContainer : public QWidget -{ -public: - DetailsContainer(QWidget *aParent = NULL); - void setPersons(const QStringList &aPersons); - void setAbstract(const QString &aAbstract); - void setDescription(const QString &aDescription); -private: - QBoxLayout *mMainLayout; - QLabel mPersons; - QLabel mAbstract; - QLabel mDescription; -}; - class EventDialog : public QDialog, Ui::EventDialog { Q_OBJECT @@ -32,7 +18,6 @@ signals: void eventHasChanged(int aEventId); // emited when user changes some event details, eg. sets it Favourite private: int mEventId; - DetailsContainer mDetails; }; #endif /* EVENTDIALOG_H */ diff --git a/src/gui/eventdialog.ui b/src/gui/eventdialog.ui index fcc7f5c..5aceca0 100644 --- a/src/gui/eventdialog.ui +++ b/src/gui/eventdialog.ui @@ -6,7 +6,7 @@ 0 0 442 - 380 + 391 @@ -61,9 +61,159 @@ 0 0 418 - 294 + 305 + + + + + + + + + 75 + true + true + + + + Persons: + + + + + + + PERSONS + + + true + + + true + + + + + + + + + + + + + + + 75 + true + true + + + + Abstract: + + + + + + + ABSTRACT + + + true + + + true + + + + + + + + + + + + + + + 75 + true + true + + + + Description: + + + + + + + DESCRIPTION + + + true + + + true + + + + + + + + + + + + + + + 75 + true + true + + + + Links: + + + + + + + LINKS + + + true + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + +