Ignore:
Timestamp:
01/20/10 20:29:00 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
4e071a3
Parents:
30cd9b6
Message:

alarm dialog changes

  • displayed additional Event's details
  • autoresizing title (if it doesn't fit in one line)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/alarmdialog.cpp

    r30cd9b6 r7ec8838  
    4141    database.open();
    4242
     43    QString titleStr;
     44    QString messageStr;
     45    QString timeStr;
     46    QString personsStr;
     47    QString roomStr;
    4348    try
    4449    {
    4550        Event event = Event::getById(mEventId,confId);
    46         message->setText(event.title());
    47         setWindowTitle(event.title());
     51        titleStr = "Event alarm";
     52        messageStr = event.title();
     53        timeStr = event.start().toString("hh:mm") + "-" + event.start().addSecs(event.duration()).toString("hh:mm");
     54        personsStr = event.persons().join(" and ");
     55        roomStr = event.room();
    4856    }
    4957    catch(OrmNoObjectException*)
    5058    {
    51         message->setText(QString("No such event in the DB: %1").arg(QString::number(mEventId)));
    52         setWindowTitle("ERROR");
     59        titleStr = QString("ERROR");
     60        messageStr = QString("No such event in the DB: %1").arg(QString::number(mEventId));
    5361    }
    5462    catch(...) {} // TODO: implement
     63    message->setText(messageStr);
     64    setWindowTitle(titleStr);
     65    time->setText(timeStr);
     66    persons->setText(personsStr);
     67    room->setText(roomStr);
    5568}
    5669
     
    5972    QString program = QDir::currentPath() + "/" + *qApp->argv();
    6073    QProcess::startDetached(program,QStringList()<<QString::number(mEventId));
    61     qApp->quit();
     74    closeDialog();
    6275}
    6376
Note: See TracChangeset for help on using the changeset viewer.