Changeset 30e2bdf in confclerk_git for src/gui/mainwindow.cpp
- Timestamp:
- 01/21/10 19:23:23 (13 years ago)
- Branches:
- master, qt5
- Children:
- 1735f55
- Parents:
- 76cde75
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
r76cde75 r30e2bdf 1 1 #include "mainwindow.h" 2 #include <appsettings.h> 2 3 3 4 #include <QTreeView> … … 20 21 #include "mapwindow.h" 21 22 22 23 const int confId = 1;24 25 23 MainWindow::MainWindow(int aEventId, QWidget *aParent) 26 24 : QMainWindow(aParent) 27 25 { 28 26 setupUi(this); 27 28 // TODO: conference ID should be assigned based on actual data in the DB 29 // for testing only 30 AppSettings::setConfId(1); 29 31 30 32 // connect Menu actions … … 62 64 favTreeView->setItemDelegate(new Delegate(favTreeView)); 63 65 64 // ACTIVITIES View66 // TRACKS View 65 67 trackTreeView->setHeaderHidden(true); 66 68 trackTreeView->setRootIsDecorated(false); … … 99 101 if(Conference::getAll().count()) // no conference(s) in the DB 100 102 { 101 static_cast<EventModel*>(favTreeView->model())->loadFavEvents(Conference::getById( confId).start(),confId);103 static_cast<EventModel*>(favTreeView->model())->loadFavEvents(Conference::getById(AppSettings::confId()).start(),AppSettings::confId()); 102 104 favTreeView->reset(); 103 105 } … … 110 112 else 111 113 { 112 QDate aStartDate = Conference::getById( confId).start();113 QDate aEndDate = Conference::getById( confId).end();114 QDate aStartDate = Conference::getById(AppSettings::confId()).start(); 115 QDate aEndDate = Conference::getById(AppSettings::confId()).end(); 114 116 dayNavigator->setDates(aStartDate, aEndDate); 115 117 trackDayNavigator->setDates(aStartDate, aEndDate); 116 118 favouriteDayNavigator->setDates(aStartDate, aEndDate); 117 119 searchDayNavigator->setDates(aStartDate, aEndDate); 120 // 121 conferenceTitle->setText(Conference::getById(AppSettings::confId()).title()); 122 conferenceSubtitle->setText(Conference::getById(AppSettings::confId()).subtitle()); 123 conferenceWhere->setText(Conference::getById(AppSettings::confId()).city() + ", " + Conference::getById(AppSettings::confId()).venue()); 124 conferenceWhen->setText( 125 Conference::getById(AppSettings::confId()).start().toString("dd-MM-yyyy") 126 + ", " + 127 Conference::getById(AppSettings::confId()).end().toString("dd-MM-yyyy")); 118 128 } 119 129 … … 154 164 { 155 165 // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates 156 QDate aStartDate = Conference::getById( confId).start();157 QDate aEndDate = Conference::getById( confId).end();166 QDate aStartDate = Conference::getById(AppSettings::confId()).start(); 167 QDate aEndDate = Conference::getById(AppSettings::confId()).end(); 158 168 dayNavigator->setDates(aStartDate, aEndDate); 159 169 //update activity map … … 173 183 void MainWindow::updateDayView(const QDate &aDate) 174 184 { 175 static_cast<EventModel*>(dayTreeView->model())->loadEvents(aDate, confId);185 static_cast<EventModel*>(dayTreeView->model())->loadEvents(aDate,AppSettings::confId()); 176 186 dayTreeView->reset(); 177 187 dayNavigator->show(); … … 211 221 void MainWindow::updateTracksView(const QDate &aDate) 212 222 { 213 static_cast<EventModel*>(trackTreeView->model())->loadEventsByTrack(aDate, confId);223 static_cast<EventModel*>(trackTreeView->model())->loadEventsByTrack(aDate, AppSettings::confId()); 214 224 trackTreeView->reset(); 215 225 trackDayNavigator->show(); … … 218 228 void MainWindow::updateFavouritesView(const QDate &aDate) 219 229 { 220 static_cast<EventModel*>(favTreeView->model())->loadFavEvents(aDate, confId);230 static_cast<EventModel*>(favTreeView->model())->loadFavEvents(aDate,AppSettings::confId()); 221 231 favTreeView->reset(); 222 232 favouriteDayNavigator->show(); … … 226 236 { 227 237 searchTreeView->reset(); 228 int eventsCount = static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(aDate, confId);238 int eventsCount = static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(aDate,AppSettings::confId()); 229 239 if( eventsCount ){ 230 240 searchDayNavigator->show(); … … 277 287 columns.append( "abstract" ); 278 288 279 mSqlEngine->searchEvent( confId, columns, searchEdit->text() );280 updateSearchView( Conference::getById( confId).start() );289 mSqlEngine->searchEvent( AppSettings::confId(), columns, searchEdit->text() ); 290 updateSearchView( Conference::getById(AppSettings::confId()).start() ); 281 291 } 282 292 283 293 void MainWindow::displayWarning(const QModelIndex &aIndex) 284 294 { 295 Q_UNUSED(aIndex); 296 285 297 QMessageBox::warning( 286 298 this, … … 288 300 tr("This event happens at the same time than another one of your favourites.") ); 289 301 } 302
Note: See TracChangeset
for help on using the changeset viewer.