Ignore:
Timestamp:
05/05/10 15:56:14 (12 years ago)
Author:
kirilma <kirilma@…>
Branches:
master, qt5
Children:
58eb7cc
Parents:
3cdaf7d
Message:

store path to conference map in database

path stored as additional field in conference table
if it's null or empty, "Show map" button is not shown
if existing database does not have the field, it will be automatically added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/conferenceeditor.cpp

    r3cdaf7d rcec47c6  
    2222#include "urlinputdialog.h"
    2323#include "mapwindow.h"
     24#include "errormessage.h"
    2425
    2526#include <QInputDialog>
     
    9596                + ", " +
    9697                conf.end().toString("dd-MM-yyyy"));
     98
     99        QString map = conf.map();
     100        if (map.isEmpty()) {
     101            showMapButton->hide();
     102        } else {
     103            showMapButton->show();
     104        }
     105
    97106        conferenceInfo->setCurrentIndex(0);
    98107        removeBtn->show();
     
    213222void ConferenceEditor::conferenceMapClicked()
    214223{
    215     QString mapPath = QString(":/maps/campus.png");
    216     if(!QFile::exists(mapPath))
    217         mapPath = QString(":/maps/rooms/not-available.png");
     224    Conference conf = Conference::getById(selected_id);
     225    QString mapPath = conf.map();
     226    if(mapPath.isEmpty() or !QFile::exists(mapPath)) {
     227        error_message("Map is not available");
     228        return;
     229    }
    218230
    219231    QString roomName;
Note: See TracChangeset for help on using the changeset viewer.