Ignore:
Timestamp:
01/19/10 10:09:41 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
c5324ca
Parents:
b1fc17a
Message:

set MapDialog? title

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    rb1fc17a r9afc0ee  
    200200{
    201201    Event *event = static_cast<Event*>(aIndex.internalPointer());
    202     QString mapPath = QString(":/maps/rooms/%1.png").arg(event->room());
     202
     203    // room names are stored in lower-case format
     204    // room names are stored without dots in the name, eg. "aw.1124.png" -> "aw1124.png"
     205    QString mapPath = QString(":/maps/rooms/%1.png").arg(event->room().toLower().remove("."));
    203206    if(!QFile::exists(mapPath))
    204207        mapPath = QString(":/maps/rooms/not-available.png");
     208
     209    QString roomName;
     210    if(mapPath.contains("not-available", Qt::CaseInsensitive))
     211        roomName = QString("Map is not available: %1").arg(event->room());
     212    else
     213        roomName = event->room();
     214
    205215    QPixmap map(mapPath);
    206     MapWindow window(map,this);
     216    MapWindow window(map,roomName,this);
    207217    window.exec();
    208218}
Note: See TracChangeset for help on using the changeset viewer.