Changeset 30e2bdf
- Timestamp:
- 01/21/10 19:23:23 (13 years ago)
- Branches:
- master, qt5
- Children:
- 1735f55
- Parents:
- 76cde75
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/app/app.pro
r76cde75 r30e2bdf 17 17 } 18 18 19 SOURCES += main.cpp 19 SOURCES += main.cpp \ 20 appsettings.cpp 21 22 HEADERS += appsettings.h 20 23 21 24 RESOURCES += ../icons.qrc \ -
src/gui/alarmdialog.cpp
r76cde75 r30e2bdf 1 1 #include "alarmdialog.h" 2 #include <appsettings.h> 2 3 3 4 #include <QApplication> … … 9 10 10 11 const int SNOOZE_TIME = 5; // in minutes 11 12 const int confId = 1;13 12 14 13 AlarmDialog::AlarmDialog(int argc, char *argv[], QWidget *aParent) … … 48 47 try 49 48 { 50 Event event = Event::getById(mEventId, confId);49 Event event = Event::getById(mEventId,AppSettings::confId()); 51 50 titleStr = "Event alarm"; 52 51 messageStr = event.title(); … … 90 89 try 91 90 { 92 Event event = Event::getById(mEventId, confId);91 Event event = Event::getById(mEventId,AppSettings::confId()); 93 92 event.setHasAlarm(false); 94 93 event.update("alarm"); -
src/gui/eventdialog.cpp
r76cde75 r30e2bdf 1 1 #include "eventdialog.h" 2 #include <appsettings.h> 2 3 3 4 #include <QScrollBar> … … 13 14 #endif 14 15 15 const int confId = 1; 16 Event event = Event::getById(aEventId,confId); 16 Event event = Event::getById(aEventId,AppSettings::confId()); 17 17 18 18 //abstract->setStyleSheet("background-color : transparent;"); -
src/gui/gui.pro
r76cde75 r30e2bdf 8 8 # module dependencies 9 9 LIBS += -L$$DESTDIR -lmvc -lorm -lsql 10 INCLUDEPATH += ../orm ../mvc ../sql 10 INCLUDEPATH += ../orm ../mvc ../sql ../app 11 11 DEPENDPATH += . ../orm ../mvc ../sql 12 12 TARGETDEPS += $$DESTDIR/liborm.a $$DESTDIR/libmvc.a $$DESTDIR/libsql.a -
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 -
src/gui/mainwindow.ui
r76cde75 r30e2bdf 24 24 <widget class="QTabWidget" name="tabWidget" > 25 25 <property name="currentIndex" > 26 <number> 0</number>26 <number>5</number> 27 27 </property> 28 28 <widget class="QWidget" name="dayViewTab" > … … 67 67 </layout> 68 68 </widget> 69 <widget class="QWidget" name=" activitiesTab" >69 <widget class="QWidget" name="tracksTab" > 70 70 <attribute name="title" > 71 71 <string>Tracks</string> … … 91 91 </layout> 92 92 </widget> 93 <widget class="QWidget" name="searchTab" >94 <attribute name="title" >93 <widget class="QWidget" name="searchTab" > 94 <attribute name="title" > 95 95 <string>Search</string> 96 96 </attribute> 97 <layout class="QVBoxLayout" name="verticalLayout_3" >97 <layout class="QVBoxLayout" name="verticalLayout_3" > 98 98 <item> 99 <layout class="QFormLayout" name="searchHeadLayout" >100 <property name="fieldGrowthPolicy" >99 <layout class="QFormLayout" name="searchHeadLayout" > 100 <property name="fieldGrowthPolicy" > 101 101 <enum>QFormLayout::AllNonFixedFieldsGrow</enum> 102 102 </property> 103 <item row="0" column="0" >104 <widget class="QCheckBox" name="searchTitle" >105 <property name="text" >103 <item row="0" column="0" > 104 <widget class="QCheckBox" name="searchTitle" > 105 <property name="text" > 106 106 <string>Title</string> 107 107 </property> 108 108 </widget> 109 109 </item> 110 <item row="0" column="1" >111 <layout class="QHBoxLayout" name="horizontalLayout" >110 <item row="0" column="1" > 111 <layout class="QHBoxLayout" name="horizontalLayout" > 112 112 <item> 113 <widget class="QLineEdit" name="searchEdit" >114 <property name="enabled" >113 <widget class="QLineEdit" name="searchEdit" > 114 <property name="enabled" > 115 115 <bool>true</bool> 116 116 </property> 117 <property name="toolTip" >117 <property name="toolTip" > 118 118 <string>type a keyword to search</string> 119 119 </property> … … 121 121 </item> 122 122 <item> 123 <widget class="QPushButton" name="searchButton" >124 <property name="text" >123 <widget class="QPushButton" name="searchButton" > 124 <property name="text" > 125 125 <string>Search</string> 126 126 </property> 127 <property name="checkable" >127 <property name="checkable" > 128 128 <bool>false</bool> 129 129 </property> 130 <property name="autoDefault" >130 <property name="autoDefault" > 131 131 <bool>false</bool> 132 132 </property> 133 <property name="default" >133 <property name="default" > 134 134 <bool>true</bool> 135 135 </property> 136 <property name="flat" >136 <property name="flat" > 137 137 <bool>false</bool> 138 138 </property> … … 141 141 </layout> 142 142 </item> 143 <item row="1" column="0" >144 <widget class="QCheckBox" name="searchAbstract" >145 <property name="text" >143 <item row="1" column="0" > 144 <widget class="QCheckBox" name="searchAbstract" > 145 <property name="text" > 146 146 <string>Abstract</string> 147 147 </property> … … 151 151 </item> 152 152 <item> 153 <layout class="QHBoxLayout" name="searchDayNavigatorHorizontalLayout" >154 <item> 155 <spacer name="horizontalSpacer_2" >156 <property name="orientation" >153 <layout class="QHBoxLayout" name="searchDayNavigatorHorizontalLayout" > 154 <item> 155 <spacer name="horizontalSpacer_2" > 156 <property name="orientation" > 157 157 <enum>Qt::Horizontal</enum> 158 158 </property> 159 <property name="sizeHint" stdset="0" >159 <property name="sizeHint" stdset="0" > 160 160 <size> 161 161 <width>40</width> … … 166 166 </item> 167 167 <item> 168 <widget class="DayNavigatorWidget" na me="searchDayNavigator" native="true">169 <property name="maximumSize" >168 <widget class="DayNavigatorWidget" native="1" name="searchDayNavigator" > 169 <property name="maximumSize" > 170 170 <size> 171 171 <width>16777215</width> … … 176 176 </item> 177 177 <item> 178 <spacer name="horizontalSpacer" >179 <property name="orientation" >178 <spacer name="horizontalSpacer" > 179 <property name="orientation" > 180 180 <enum>Qt::Horizontal</enum> 181 181 </property> 182 <property name="sizeHint" stdset="0" >182 <property name="sizeHint" stdset="0" > 183 183 <size> 184 184 <width>40</width> … … 191 191 </item> 192 192 <item> 193 <widget class="TreeView" name="searchTreeView" >194 <property name="maximumSize" >193 <widget class="TreeView" name="searchTreeView" > 194 <property name="maximumSize" > 195 195 <size> 196 196 <width>16777215</width> … … 206 206 <string>Map</string> 207 207 </attribute> 208 </widget> 209 <widget class="QWidget" name="conferenceTab" > 210 <attribute name="title" > 211 <string>Conference</string> 212 </attribute> 213 <layout class="QGridLayout" name="gridLayout_5" > 214 <item row="0" column="0" > 215 <layout class="QVBoxLayout" name="verticalLayout_4" > 216 <item> 217 <widget class="QLabel" name="conferenceTitle" > 218 <property name="font" > 219 <font> 220 <weight>75</weight> 221 <bold>true</bold> 222 </font> 223 </property> 224 <property name="text" > 225 <string>Conference Name</string> 226 </property> 227 <property name="alignment" > 228 <set>Qt::AlignCenter</set> 229 </property> 230 <property name="wordWrap" > 231 <bool>true</bool> 232 </property> 233 </widget> 234 </item> 235 <item> 236 <widget class="QLabel" name="conferenceSubtitle" > 237 <property name="text" > 238 <string>Conference Subtitle</string> 239 </property> 240 <property name="alignment" > 241 <set>Qt::AlignCenter</set> 242 </property> 243 <property name="wordWrap" > 244 <bool>true</bool> 245 </property> 246 </widget> 247 </item> 248 <item> 249 <widget class="Line" name="line" > 250 <property name="orientation" > 251 <enum>Qt::Horizontal</enum> 252 </property> 253 </widget> 254 </item> 255 <item> 256 <layout class="QGridLayout" name="gridLayout_6" > 257 <item row="0" column="0" > 258 <widget class="QLabel" name="label" > 259 <property name="text" > 260 <string>When:</string> 261 </property> 262 </widget> 263 </item> 264 <item row="1" column="0" > 265 <widget class="QLabel" name="label_2" > 266 <property name="text" > 267 <string>Where:</string> 268 </property> 269 </widget> 270 </item> 271 <item row="0" column="1" > 272 <widget class="QLabel" name="conferenceWhen" > 273 <property name="text" > 274 <string>DATE (FROM - TO)</string> 275 </property> 276 </widget> 277 </item> 278 <item row="1" column="1" > 279 <widget class="QLabel" name="conferenceWhere" > 280 <property name="text" > 281 <string>CITY, CAMPUS</string> 282 </property> 283 </widget> 284 </item> 285 <item row="1" column="2" > 286 <widget class="QPushButton" name="showMapButton" > 287 <property name="text" > 288 <string>MAP</string> 289 </property> 290 </widget> 291 </item> 292 <item row="1" column="3" > 293 <spacer name="horizontalSpacer_3" > 294 <property name="orientation" > 295 <enum>Qt::Horizontal</enum> 296 </property> 297 <property name="sizeHint" stdset="0" > 298 <size> 299 <width>40</width> 300 <height>20</height> 301 </size> 302 </property> 303 </spacer> 304 </item> 305 </layout> 306 </item> 307 <item> 308 <spacer name="verticalSpacer" > 309 <property name="orientation" > 310 <enum>Qt::Vertical</enum> 311 </property> 312 <property name="sizeHint" stdset="0" > 313 <size> 314 <width>20</width> 315 <height>40</height> 316 </size> 317 </property> 318 </spacer> 319 </item> 320 </layout> 321 </item> 322 </layout> 208 323 </widget> 209 324 </widget>
Note: See TracChangeset
for help on using the changeset viewer.