Changeset 1aede9a in confclerk_git for src/gui/eventdialog.cpp


Ignore:
Timestamp:
05/28/13 22:08:35 (9 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
055231b
Parents:
e84ed04
Message:

Changed the event dialog layout hoping to improve issue #48.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    re84ed04 r1aede9a  
    3737    Event event = Event::getById(mEventId, mConferenceId);
    3838
    39     title->setText(event.title());
    40     persons->setText(event.persons().join(" and "));
    41     abstract->setText(event.abstract());
    42     description->setText(event.description());
    43     QStringList linksText = static_cast<QStringList>(event.links().values());
    44     for (QStringList::iterator linkIterator = linksText.begin(); linkIterator != linksText.end(); ++linkIterator)
    45         *linkIterator = QString("<a href=\"%1\">%1</a>").arg(*linkIterator);
    46     links->setText(linksText.join("<br/>"));
     39    QString info;
     40    // title
     41    info.append(QString("<h1>%1</h1>\n").arg(event.title()));
     42
     43    // persons
     44    info += QString("<h2>%1</h2>\n").arg(tr("Persons"));
     45    info += QString("<p>%1</p>\n").arg(event.persons().join(", "));
     46
     47    // abstract
     48    info += QString("<h2>%1</h2>\n").arg(tr("Abstract"));
     49    info += QString("<p>%1</p>\n").arg(event.abstract());
     50
     51    // description
     52    info += QString("<h2>%1</h2>\n").arg(tr("Description"));
     53    info += QString("<p>%1</p>\n").arg(event.description());
     54
     55    // links
     56    info += QString("<h2>%1</h2>\n<ul>\n").arg(tr("Links"));
     57    QMapIterator<QString, QString> i(event.links());
     58    while (i.hasNext()) {
     59        i.next();
     60        QString url(i.value());
     61        QString name(i.key());
     62        if (url.isEmpty() || url == "http://") continue;
     63        if (name.isEmpty()) name = url;
     64        info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url, name);
     65    }
     66    info += QString("</ul>\n");
     67    eventInfoTextBrowser->setHtml(info);
    4768
    4869    connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
Note: See TracChangeset for help on using the changeset viewer.