Ignore:
Timestamp:
01/28/10 08:29:29 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
cbbb443
Parents:
8e55f41
Message:

conference tab header is hidden if there isn't active conference

  • handled some warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r8e55f41 r885a3cc  
    2929    int confId = Conference::activeConference();
    3030
    31     QList<Conference> confs = Conference::getAll();
    32     if(confs.count())
    33     {
    34         setWindowTitle(confs[0].title());
    35     }
    36 
    3731    connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int)));
    3832
     
    4539    connect(searchTabContainer, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int)));
    4640
    47 
    4841    // event conference map button clicked
    4942    connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
     
    5144    connect(tabWidget, SIGNAL(infoIconClicked()), SLOT(aboutApp()));
    5245
    53     if(Conference::getAll().count()) // no conference(s) in the DB
     46    if(Conference::getAll().count())
    5447    {
    55         QDate startDate = Conference::getById(confId).start();
    56         QDate endDate = Conference::getById(confId).end();
    57         //
    58         dayTabContainer->setDates(startDate, endDate);
    59         tracksTabContainer->setDates(startDate, endDate);
    60         roomsTabContainer->setDates(startDate, endDate);
    61         favsTabContainer->setDates(startDate, endDate);
    62         searchTabContainer->setDates(startDate, endDate);
    63         nowTabContainer->updateTreeView(QDate::currentDate());
    64         //
    65         conferenceTitle->setText(Conference::getById(confId).title());
    66         conferenceSubtitle->setText(Conference::getById(confId).subtitle());
    67         conferenceWhere->setText(Conference::getById(confId).city() + ", " + Conference::getById(confId).venue());
    68         conferenceWhen->setText(
    69                 Conference::getById(confId).start().toString("dd-MM-yyyy")
    70                 + ", " +
    71                 Conference::getById(confId).end().toString("dd-MM-yyyy"));
     48        initTabs();
     49        fillAndShowConferenceHeader();
     50        setWindowTitle(Conference::getById(confId).title());
     51    }
     52    else
     53    {
     54        conferenceHeader->hide();
    7255    }
    7356
     
    9376    if(confs.count())
    9477    {
    95         // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
    96         QDate startDate = Conference::getById(Conference::activeConference()).start();
    97         QDate endDate = Conference::getById(Conference::activeConference()).end();
    98         dayTabContainer->setDates(startDate, endDate);
    99         tracksTabContainer->setDates(startDate, endDate);
    100         roomsTabContainer->setDates(startDate, endDate);
    101         favsTabContainer->setDates(startDate, endDate);
     78        initTabs();
     79        fillAndShowConferenceHeader();
     80        setWindowTitle(Conference::getById(Conference::activeConference()).title());
    10281    }
    10382}
     
    134113}
    135114
     115void MainWindow::fillAndShowConferenceHeader()
     116{
     117    int confId = Conference::activeConference();
     118    conferenceTitle->setText(Conference::getById(confId).title());
     119    conferenceSubtitle->setText(Conference::getById(confId).subtitle());
     120    conferenceWhere->setText(Conference::getById(confId).city() + ", " + Conference::getById(confId).venue());
     121    conferenceWhen->setText(
     122            Conference::getById(confId).start().toString("dd-MM-yyyy")
     123            + ", " +
     124            Conference::getById(confId).end().toString("dd-MM-yyyy"));
     125    conferenceHeader->show();
     126}
     127
     128void MainWindow::initTabs()
     129{
     130    int confId = Conference::activeConference();
     131    QDate startDate = Conference::getById(confId).start();
     132    QDate endDate = Conference::getById(confId).end();
     133
     134    // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
     135    dayTabContainer->setDates(startDate, endDate);
     136    tracksTabContainer->setDates(startDate, endDate);
     137    roomsTabContainer->setDates(startDate, endDate);
     138    favsTabContainer->setDates(startDate, endDate);
     139    searchTabContainer->setDates(startDate, endDate);
     140    nowTabContainer->updateTreeView(QDate::currentDate());
     141}
     142
Note: See TracChangeset for help on using the changeset viewer.