Changeset 0d4ecc2 in confclerk_git
- Timestamp:
- 01/25/10 09:02:15 (13 years ago)
- Branches:
- master, qt5
- Children:
- 6dc0dbc
- Parents:
- e7340e1
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
re7340e1 r0d4ecc2 122 122 // event search button clicked 123 123 connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked())); 124 connect(searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked())); 124 125 // event conference map button clicked 125 126 connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked())); … … 151 152 152 153 searchTreeView->hide(); 153 searchDayNavigator->hide(); 154 searchVerticalWidget->hide(); 155 searchHead->show(); 154 156 155 157 // open dialog for given Event ID … … 233 235 int eventsCount = static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(aDate,AppSettings::confId()); 234 236 if( eventsCount ){ 235 searchDayNavigator->show(); 237 searchVerticalWidget->show(); 238 searchAgainButton->show(); 236 239 searchTreeView->show(); 240 searchHead->hide(); 237 241 } 238 242 else{ 239 243 searchTreeView->hide(); 240 searchDayNavigator->hide(); 244 searchVerticalWidget->hide(); 245 searchHead->show(); 241 246 } 242 247 } … … 294 299 } 295 300 301 void MainWindow::searchAgainClicked() 302 { 303 searchHead->show(); 304 searchAgainButton->hide(); 305 } 306 296 307 void MainWindow::conferenceMapClicked() 297 308 { -
src/gui/mainwindow.h
re7340e1 r0d4ecc2 28 28 void displayWarning(const QModelIndex &aIndex); 29 29 void searchClicked(); 30 void searchAgainClicked(); 30 31 void conferenceMapClicked(); 31 32 void tabHasChanged(int aIndex); -
src/gui/mainwindow.ui
re7340e1 r0d4ecc2 119 119 </layout> 120 120 </widget> 121 <widget class="QWidget" name="searchTab" 122 <attribute name="title" 121 <widget class="QWidget" name="searchTab"> 122 <attribute name="title"> 123 123 <string>Search</string> 124 124 </attribute> 125 <layout class="Q VBoxLayout" name="verticalLayout_3">125 <layout class="QHBoxLayout" name="horizontalLayout_1"> 126 126 <item> 127 <layout class="QFormLayout" name="searchHeadLayout" > 128 <property name="fieldGrowthPolicy" > 129 <enum>QFormLayout::AllNonFixedFieldsGrow</enum> 130 </property> 131 <item row="0" column="0" > 132 <widget class="QCheckBox" name="searchTitle" > 133 <property name="text" > 134 <string>Title</string> 135 </property> 136 </widget> 137 </item> 138 <item row="0" column="1" > 139 <layout class="QHBoxLayout" name="horizontalLayout" > 140 <item> 141 <widget class="QLineEdit" name="searchEdit" > 142 <property name="enabled" > 143 <bool>true</bool> 144 </property> 145 <property name="toolTip" > 146 <string>type a keyword to search</string> 147 </property> 148 </widget> 149 </item> 150 <item> 151 <widget class="QPushButton" name="searchButton" > 152 <property name="text" > 153 <string>Search</string> 154 </property> 155 <property name="checkable" > 156 <bool>false</bool> 157 </property> 158 <property name="autoDefault" > 159 <bool>false</bool> 160 </property> 161 <property name="default" > 162 <bool>true</bool> 163 </property> 164 <property name="flat" > 165 <bool>false</bool> 166 </property> 167 </widget> 168 </item> 169 </layout> 170 </item> 171 <item row="1" column="0" > 172 <widget class="QCheckBox" name="searchAbstract" > 173 <property name="text" > 174 <string>Abstract</string> 175 </property> 176 </widget> 177 </item> 178 </layout> 127 <widget class="QWidget" name="searchVerticalWidget" native="true"> 128 <layout class="QVBoxLayout" name="searchDayNavigatorVerticalLayout"> 129 <item> 130 <widget class="QToolButton" name="searchAgainButton"> 131 <property name="text"> 132 <string>Search again</string> 133 </property> 134 <property name="toolButtonStyle"> 135 <enum>Qt::ToolButtonTextOnly</enum> 136 </property> 137 </widget> 138 </item> 139 <item> 140 <widget class="DayNavigatorWidget" name="searchDayNavigator" native="true"> 141 <property name="maximumSize"> 142 <size> 143 <width>16777215</width> 144 <height>16777215</height> 145 </size> 146 </property> 147 </widget> 148 </item> 149 </layout> 150 </widget> 179 151 </item> 180 152 <item> 181 <layout class="QHBoxLayout" name="searchDayNavigatorHorizontalLayout" > 182 <item> 183 <spacer name="horizontalSpacer_2" > 184 <property name="orientation" > 185 <enum>Qt::Horizontal</enum> 186 </property> 187 <property name="sizeHint" stdset="0" > 188 <size> 189 <width>40</width> 190 <height>20</height> 191 </size> 192 </property> 193 </spacer> 194 </item> 195 <item> 196 <widget class="DayNavigatorWidget" native="1" name="searchDayNavigator" > 197 <property name="maximumSize" > 153 <layout class="QVBoxLayout" name="verticalLayout_3"> 154 <item> 155 <widget class="QWidget" name="searchHead" native="true"> 156 <layout class="QFormLayout" name="searchHeadLayout"> 157 <property name="fieldGrowthPolicy"> 158 <enum>QFormLayout::AllNonFixedFieldsGrow</enum> 159 </property> 160 <item row="0" column="0"> 161 <widget class="QCheckBox" name="searchTitle"> 162 <property name="text"> 163 <string>Title</string> 164 </property> 165 </widget> 166 </item> 167 <item row="0" column="1"> 168 <layout class="QHBoxLayout" name="horizontalLayout"> 169 <item> 170 <widget class="QLineEdit" name="searchEdit"> 171 <property name="enabled"> 172 <bool>true</bool> 173 </property> 174 <property name="toolTip"> 175 <string>type a keyword to search</string> 176 </property> 177 </widget> 178 </item> 179 <item> 180 <widget class="QPushButton" name="searchButton"> 181 <property name="text"> 182 <string>Search</string> 183 </property> 184 <property name="checkable"> 185 <bool>false</bool> 186 </property> 187 <property name="autoDefault"> 188 <bool>true</bool> 189 </property> 190 <property name="default"> 191 <bool>true</bool> 192 </property> 193 <property name="flat"> 194 <bool>false</bool> 195 </property> 196 </widget> 197 </item> 198 </layout> 199 </item> 200 <item row="1" column="0"> 201 <widget class="QCheckBox" name="searchAbstract"> 202 <property name="text"> 203 <string>Abstract</string> 204 </property> 205 </widget> 206 </item> 207 </layout> 208 </widget> 209 </item> 210 <item> 211 <widget class="TreeView" name="searchTreeView"> 212 <property name="maximumSize"> 198 213 <size> 199 214 <width>16777215</width> … … 203 218 </widget> 204 219 </item> 205 <item>206 <spacer name="horizontalSpacer" >207 <property name="orientation" >208 <enum>Qt::Horizontal</enum>209 </property>210 <property name="sizeHint" stdset="0" >211 <size>212 <width>40</width>213 <height>20</height>214 </size>215 </property>216 </spacer>217 </item>218 220 </layout> 219 </item>220 <item>221 <widget class="TreeView" name="searchTreeView" >222 <property name="maximumSize" >223 <size>224 <width>16777215</width>225 <height>16777215</height>226 </size>227 </property>228 </widget>229 221 </item> 230 222 </layout> -
src/mvc/event.cpp
re7340e1 r0d4ecc2 128 128 strQuery += QString("WHERE xid_conference = :conf AND start >= :start AND start < :end ORDER BY %1").arg(orderBy); 129 129 qDebug() << strQuery; 130 QList<Event> list; 130 131 QSqlQuery query; 131 query.prepare( strQuery ); 132 query.bindValue(":conf", conferenceId); 133 query.bindValue(":start", convertToDb(date, QVariant::DateTime)); 134 query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime)); 132 try{ 133 if( !query.prepare( strQuery ) ){ 134 qDebug() << "QSqlQuery.prepare error"; 135 throw OrmSqlException( query.lastError().text() ); 136 } 135 137 136 return load(query); 138 query.bindValue(":conf", conferenceId); 139 query.bindValue(":start", convertToDb(date, QVariant::DateTime)); 140 query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime)); 141 142 list = load(query); 143 } 144 catch(OrmException &e) 145 { 146 qDebug() << "getSearchResultByDate error: " << e.text(); 147 } 148 catch(...){ 149 qDebug() << "getSearchResultByDate failed ..."; 150 } 151 return list; 137 152 } 138 153 -
src/orm/ormrecord.h
re7340e1 r0d4ecc2 20 20 }; 21 21 22 class OrmNoObjectException : OrmException22 class OrmNoObjectException : public OrmException 23 23 { 24 24 public: … … 27 27 }; 28 28 29 class OrmSqlException : OrmException29 class OrmSqlException : public OrmException 30 30 { 31 31 public: -
src/sql/sqlengine.cpp
re7340e1 r0d4ecc2 233 233 query.exec("CREATE TABLE CONFERENCE ( \ 234 234 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , \ 235 title VARCHAR NOT NULL , \235 title VARCHAR UNIQUE NOT NULL , \ 236 236 subtitle VARCHAR, \ 237 237 venue VARCHAR, \ … … 249 249 query.exec("CREATE TABLE ROOM ( \ 250 250 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , \ 251 name VARCHAR NOT NULL , \251 name VARCHAR UNIQUE NOT NULL , \ 252 252 picture VARCHAR NOT NULL)"); 253 253 254 254 query.exec("CREATE TABLE PERSON ( \ 255 255 id INTEGER PRIMARY KEY NOT NULL , \ 256 name VARCHAR NOT NULL)");256 name VARCHAR UNIQUE NOT NULL)"); 257 257 258 258 query.exec("CREATE TABLE EVENT ( \ … … 278 278 xid_event INTEGER NOT NULL , \ 279 279 xid_person INTEGER NOT NULL, \ 280 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id), \ 280 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \ 281 FOREIGN KEY(xid_event) REFERENCES EVENT(id), \ 281 282 FOREIGN KEY(xid_person) REFERENCES PERSON(id))"); 282 283 … … 285 286 xid_event INTEGER NOT NULL , \ 286 287 xid_room INTEGER NOT NULL, \ 287 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id), \ 288 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \ 289 FOREIGN KEY(xid_event) REFERENCES EVENT(id), \ 288 290 FOREIGN KEY(xid_room) REFERENCES ROOM(id))"); 289 291 … … 294 296 name VARCHAR, \ 295 297 url VARCHAR NOT NULL, \ 296 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id))"); 298 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \ 299 FOREIGN KEY(xid_event) REFERENCES EVENT(id)"); 297 300 } 298 301 else … … 315 318 execQuery( db, "DROP TABLE IF EXISTS SEARCH_EVENT;"); 316 319 // CREATE 317 execQuery( db, "CREATE T ABLE SEARCH_EVENT ( xid_conference INTEGER NOT NULL, id INTEGER NOT NULL );");320 execQuery( db, "CREATE TEMP TABLE SEARCH_EVENT ( xid_conference INTEGER NOT NULL, id INTEGER NOT NULL );"); 318 321 // INSERT 319 322 QString query = QString("INSERT INTO SEARCH_EVENT ( xid_conference, id) "
Note: See TracChangeset
for help on using the changeset viewer.