Changeset 001c8cf in confclerk_git
- Timestamp:
- 01/27/10 09:07:41 (13 years ago)
- Branches:
- master, qt5
- Children:
- 6bc425e
- Parents:
- 9f367eb
- Location:
- src/gui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
r9f367eb r001c8cf 49 49 nowTabContainer->setType(TabContainer::EContainerTypeNow); 50 50 roomsTabContainer->setType(TabContainer::EContainerTypeRooms); 51 searchTabContainer->setType(TabContainer::EContainerTypeSearch); 51 52 52 53 connect(importScheduleWidget, SIGNAL(scheduleImported(int)), SLOT(scheduleImported(int))); 53 54 connect(searchDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateSearchView(const QDate &)));55 56 // SEARCH EVENTS View57 searchTreeView->setHeaderHidden(true);58 searchTreeView->setRootIsDecorated(false);59 searchTreeView->setIndentation(0);60 searchTreeView->setAnimated(true);61 searchTreeView->setModel(new EventModel());62 searchTreeView->setItemDelegate(new Delegate(searchTreeView));63 54 64 55 // event details have changed … … 68 59 connect(roomsTabContainer, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 69 60 connect(nowTabContainer, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 61 connect(searchTabContainer, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 70 62 71 connect(searchTreeView, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int)));72 73 // event clicked74 connect(searchTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));75 76 // event search button clicked77 connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));78 connect(searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked()));79 63 80 64 // event conference map button clicked 81 65 connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked())); 82 // 66 83 67 connect(tabWidget, SIGNAL(infoIconClicked()), SLOT(aboutApp())); 84 68 85 69 if(Conference::getAll().count()) // no conference(s) in the DB 86 70 { 87 QDate aStartDate = Conference::getById(AppSettings::confId()).start(); 88 QDate aEndDate = Conference::getById(AppSettings::confId()).end(); 89 searchDayNavigator->setDates(aStartDate, aEndDate); 71 QDate startDate = Conference::getById(AppSettings::confId()).start(); 72 QDate endDate = Conference::getById(AppSettings::confId()).end(); 90 73 // 91 dayTabContainer->setDates(aStartDate, aEndDate); 92 tracksTabContainer->setDates(aStartDate, aEndDate); 93 roomsTabContainer->setDates(aStartDate, aEndDate); 94 favsTabContainer->setDates(aStartDate, aEndDate); 74 dayTabContainer->setDates(startDate, endDate); 75 tracksTabContainer->setDates(startDate, endDate); 76 roomsTabContainer->setDates(startDate, endDate); 77 favsTabContainer->setDates(startDate, endDate); 78 searchTabContainer->setDates(startDate, endDate); 95 79 // 96 80 conferenceTitle->setText(Conference::getById(AppSettings::confId()).title()); … … 102 86 Conference::getById(AppSettings::confId()).end().toString("dd-MM-yyyy")); 103 87 } 104 105 searchTreeView->hide();106 searchVerticalWidget->hide();107 searchHead->show();108 88 109 89 // open dialog for given Event ID … … 153 133 } 154 134 155 void MainWindow::updateSearchView(const QDate &aDate)156 {157 qDebug() << "MainWindow::updateSearchView(), aDate: " << aDate.toString() ;158 searchTreeView->reset();159 int eventsCount = static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(aDate,AppSettings::confId());160 if( eventsCount ||161 searchDayNavigator->getCurrentDate() != Conference::getById(AppSettings::confId()).start() ){162 searchVerticalWidget->show();163 //searchAgainButton->show();164 searchTreeView->show();165 searchHead->hide();166 }167 else{168 searchTreeView->hide();169 searchVerticalWidget->hide();170 searchHead->show();171 }172 }173 174 void MainWindow::searchClicked()175 {176 QHash<QString,QString> columns;177 178 if( searchTitle->isChecked() )179 columns.insertMulti("EVENT", "title");180 if( searchAbstract->isChecked() )181 columns.insertMulti("EVENT", "abstract");182 if( searchTag->isChecked() )183 columns.insertMulti("EVENT", "tag");184 if( searchSpeaker->isChecked() )185 columns["PERSON"] = "name";186 if( searchRoom->isChecked() )187 columns["ROOM"] = "name";188 189 QString keyword = searchEdit->text().replace( QString("%"), QString("\\%") );190 qDebug() << "\nKeyword to search: " << keyword;191 SqlEngine::searchEvent( AppSettings::confId(), columns, keyword );192 193 QDate aStartDate = Conference::getById(AppSettings::confId()).start();194 QDate aEndDate = Conference::getById(AppSettings::confId()).end();195 searchDayNavigator->setDates(aStartDate, aEndDate);196 updateSearchView( Conference::getById(AppSettings::confId()).start() );197 }198 199 void MainWindow::searchAgainClicked()200 {201 searchHead->show();202 //searchAgainButton->hide();203 searchVerticalWidget->hide();204 searchTreeView->hide();205 }206 207 135 void MainWindow::conferenceMapClicked() 208 136 { … … 225 153 nowTabContainer->updateTreeViewModel(aEventId); 226 154 roomsTabContainer->updateTreeViewModel(aEventId); 227 228 static_cast<EventModel*>(searchTreeView->model())->updateModel(aEventId); 155 searchTabContainer->updateTreeViewModel(aEventId); 229 156 } 230 157 -
src/gui/mainwindow.h
r9f367eb r001c8cf 17 17 void scheduleImported(int aConfId); 18 18 void aboutApp(); 19 void updateSearchView(const QDate &aDate);20 void searchClicked();21 void searchAgainClicked();22 19 void conferenceMapClicked(); 23 20 void eventHasChanged(int aEventId); 24 21 }; 25 22 26 #endif / / MAINWINDOW_H23 #endif /* MAINWINDOW_H */ 27 24 -
src/gui/mainwindow.ui
r9f367eb r001c8cf 62 62 <layout class="QHBoxLayout" name="horizontalLayout_1" > 63 63 <item> 64 <widget class="QWidget" native="1" name="searchVerticalWidget" > 65 <property name="enabled" > 66 <bool>true</bool> 67 </property> 68 <property name="sizePolicy" > 69 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > 70 <horstretch>0</horstretch> 71 <verstretch>0</verstretch> 72 </sizepolicy> 73 </property> 74 <layout class="QVBoxLayout" name="searchDayNavigatorVerticalLayout" > 75 <property name="margin" > 76 <number>0</number> 77 </property> 78 <item> 79 <widget class="QToolButton" name="searchAgainButton" > 80 <property name="sizePolicy" > 81 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > 82 <horstretch>0</horstretch> 83 <verstretch>0</verstretch> 84 </sizepolicy> 85 </property> 86 <property name="toolTip" > 87 <string>Search again</string> 88 </property> 89 <property name="text" > 90 <string>S</string> 91 </property> 92 <property name="icon" > 93 <iconset resource="../icons.qrc" > 94 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 95 </property> 96 <property name="iconSize" > 97 <size> 98 <width>24</width> 99 <height>24</height> 100 </size> 101 </property> 102 <property name="toolButtonStyle" > 103 <enum>Qt::ToolButtonIconOnly</enum> 104 </property> 105 </widget> 106 </item> 107 <item> 108 <widget class="DayNavigatorWidget" native="1" name="searchDayNavigator" > 109 <property name="sizePolicy" > 110 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > 111 <horstretch>0</horstretch> 112 <verstretch>0</verstretch> 113 </sizepolicy> 114 </property> 115 <property name="maximumSize" > 116 <size> 117 <width>16777215</width> 118 <height>16777215</height> 119 </size> 120 </property> 121 </widget> 122 </item> 123 </layout> 124 </widget> 125 </item> 126 <item> 127 <layout class="QVBoxLayout" name="verticalLayout_3" > 128 <item> 129 <widget class="QWidget" native="1" name="searchHead" > 130 <property name="sizePolicy" > 131 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > 132 <horstretch>0</horstretch> 133 <verstretch>0</verstretch> 134 </sizepolicy> 135 </property> 136 <property name="maximumSize" > 137 <size> 138 <width>16777215</width> 139 <height>16777215</height> 140 </size> 141 </property> 142 <layout class="QGridLayout" name="searchHeadLayout" > 143 <property name="sizeConstraint" > 144 <enum>QLayout::SetDefaultConstraint</enum> 145 </property> 146 <item row="2" column="0" > 147 <layout class="QHBoxLayout" name="horizontalLayout" > 148 <item> 149 <widget class="QLineEdit" name="searchEdit" > 150 <property name="enabled" > 151 <bool>true</bool> 152 </property> 153 <property name="toolTip" > 154 <string>type a keyword to search</string> 155 </property> 156 </widget> 157 </item> 158 <item> 159 <widget class="QPushButton" name="searchButton" > 160 <property name="sizePolicy" > 161 <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > 162 <horstretch>0</horstretch> 163 <verstretch>0</verstretch> 164 </sizepolicy> 165 </property> 166 <property name="text" > 167 <string>Search</string> 168 </property> 169 <property name="icon" > 170 <iconset resource="../icons.qrc" > 171 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 172 </property> 173 <property name="checkable" > 174 <bool>false</bool> 175 </property> 176 <property name="autoDefault" > 177 <bool>true</bool> 178 </property> 179 <property name="default" > 180 <bool>true</bool> 181 </property> 182 <property name="flat" > 183 <bool>false</bool> 184 </property> 185 </widget> 186 </item> 187 </layout> 188 </item> 189 <item row="0" column="0" > 190 <layout class="QHBoxLayout" name="horizontalLayout_6" > 191 <item> 192 <widget class="QCheckBox" name="searchTitle" > 193 <property name="text" > 194 <string>Title</string> 195 </property> 196 <property name="checked" > 197 <bool>true</bool> 198 </property> 199 </widget> 200 </item> 201 <item> 202 <widget class="QCheckBox" name="searchAbstract" > 203 <property name="text" > 204 <string>Abstract</string> 205 </property> 206 </widget> 207 </item> 208 <item> 209 <widget class="QCheckBox" name="searchSpeaker" > 210 <property name="text" > 211 <string>Speaker</string> 212 </property> 213 </widget> 214 </item> 215 <item> 216 <widget class="QCheckBox" name="searchTag" > 217 <property name="text" > 218 <string>Tag</string> 219 </property> 220 </widget> 221 </item> 222 <item> 223 <widget class="QCheckBox" name="searchRoom" > 224 <property name="text" > 225 <string>Room</string> 226 </property> 227 </widget> 228 </item> 229 <item> 230 <spacer name="horizontalSpacer" > 231 <property name="orientation" > 232 <enum>Qt::Horizontal</enum> 233 </property> 234 <property name="sizeHint" stdset="0" > 235 <size> 236 <width>40</width> 237 <height>20</height> 238 </size> 239 </property> 240 </spacer> 241 </item> 242 </layout> 243 </item> 244 </layout> 245 </widget> 246 </item> 247 <item> 248 <widget class="TreeView" name="searchTreeView" > 249 <property name="sizePolicy" > 250 <sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" > 251 <horstretch>0</horstretch> 252 <verstretch>1</verstretch> 253 </sizepolicy> 254 </property> 255 <property name="minimumSize" > 256 <size> 257 <width>0</width> 258 <height>0</height> 259 </size> 260 </property> 261 <property name="maximumSize" > 262 <size> 263 <width>16777215</width> 264 <height>16777215</height> 265 </size> 266 </property> 267 </widget> 268 </item> 269 <item> 270 <spacer name="verticalSpacer_2" > 271 <property name="orientation" > 272 <enum>Qt::Vertical</enum> 273 </property> 274 <property name="sizeType" > 275 <enum>QSizePolicy::Expanding</enum> 276 </property> 277 <property name="sizeHint" stdset="0" > 278 <size> 279 <width>20</width> 280 <height>1</height> 281 </size> 282 </property> 283 </spacer> 284 </item> 285 </layout> 64 <widget class="TabContainer" native="1" name="searchTabContainer" /> 286 65 </item> 287 66 </layout> … … 474 253 </widget> 475 254 <customwidgets> 476 <customwidget>477 <class>DayNavigatorWidget</class>478 <extends>QWidget</extends>479 <header>daynavigatorwidget.h</header>480 <container>1</container>481 </customwidget>482 <customwidget>483 <class>TreeView</class>484 <extends>QTreeView</extends>485 <header>../mvc/treeview.h</header>486 </customwidget>487 255 <customwidget> 488 256 <class>TabWidget</class> -
src/gui/tabcontainer.cpp
r9f367eb r001c8cf 5 5 #include <QTimer> 6 6 7 #include <sqlengine.h> 7 8 #include <appsettings.h> 8 9 … … 23 24 24 25 searchAgainButton->hide(); 26 searchHead->hide(); 25 27 26 28 treeView->setHeaderHidden(true); … … 38 40 connect(treeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 39 41 42 connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked())); 43 connect(searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked())); 44 40 45 if(!Conference::getAll().count()) // no conference(s) in the DB 41 46 { … … 53 58 { 54 59 mType = aType; 60 55 61 if(aType == EContainerTypeNow) 56 62 { … … 59 65 timer->start( 30000); // 30 seconds timer 60 66 } 67 if(aType == EContainerTypeSearch) 68 { 69 searchHead->show(); 70 } 61 71 } 62 72 … … 89 99 static_cast<EventModel*>(treeView->model())->loadNowEvents(AppSettings::confId()); 90 100 treeView->setAllExpanded(true); 101 } 102 break; 103 case EContainerTypeSearch: 104 { 105 treeView->reset(); 106 int eventsCount = static_cast<EventModel*>(treeView->model())->loadSearchResultEvents(aDate,AppSettings::confId()); 107 if( eventsCount || 108 dayNavigator->getCurrentDate() != Conference::getById(AppSettings::confId()).start() ){ 109 searchAgainButton->show(); 110 dayNavigator->show(); 111 treeView->show(); 112 searchHead->hide(); 113 } 114 else{ 115 treeView->hide(); 116 searchAgainButton->hide(); 117 dayNavigator->hide(); 118 searchHead->show(); 119 } 91 120 } 92 121 break; … … 179 208 } 180 209 210 void TabContainer::searchClicked() 211 { 212 if(mType == EContainerTypeSearch) 213 { 214 QHash<QString,QString> columns; 215 216 if( searchTitle->isChecked() ) 217 columns.insertMulti("EVENT", "title"); 218 if( searchAbstract->isChecked() ) 219 columns.insertMulti("EVENT", "abstract"); 220 if( searchTag->isChecked() ) 221 columns.insertMulti("EVENT", "tag"); 222 if( searchSpeaker->isChecked() ) 223 columns["PERSON"] = "name"; 224 if( searchRoom->isChecked() ) 225 columns["ROOM"] = "name"; 226 227 QString keyword = searchEdit->text().replace( QString("%"), QString("\\%") ); 228 qDebug() << "\nKeyword to search: " << keyword; 229 SqlEngine::searchEvent( AppSettings::confId(), columns, keyword ); 230 231 QDate startDate = Conference::getById(AppSettings::confId()).start(); 232 QDate endDate = Conference::getById(AppSettings::confId()).end(); 233 dayNavigator->setDates(startDate, endDate); 234 updateTreeView( Conference::getById(AppSettings::confId()).start() ); 235 } 236 } 237 238 void TabContainer::searchAgainClicked() 239 { 240 if(mType == EContainerTypeSearch) 241 { 242 searchHead->show(); 243 searchAgainButton->hide(); 244 dayNavigator->hide(); 245 treeView->hide(); 246 } 247 } 248 -
src/gui/tabcontainer.h
r9f367eb r001c8cf 40 40 void displayMap(const QModelIndex &aIndex); 41 41 void displayWarning(const QModelIndex &aIndex); 42 void searchClicked(); 43 void searchAgainClicked(); 42 44 43 45 private: -
src/gui/tabcontainer.ui
r9f367eb r001c8cf 14 14 </property> 15 15 <layout class="QGridLayout" name="gridLayout" > 16 <item row="0" column="0" > 17 <widget class="QToolButton" name="searchAgainButton" > 18 <property name="enabled" > 19 <bool>true</bool> 20 </property> 21 <property name="sizePolicy" > 22 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > 23 <horstretch>0</horstretch> 24 <verstretch>0</verstretch> 25 </sizepolicy> 26 </property> 27 <property name="toolTip" > 28 <string>Search again</string> 29 </property> 30 <property name="text" > 31 <string>S</string> 32 </property> 33 <property name="icon" > 34 <iconset resource="../icons.qrc" > 35 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 36 </property> 37 <property name="iconSize" > 38 <size> 39 <width>24</width> 40 <height>24</height> 41 </size> 42 </property> 43 <property name="toolButtonStyle" > 44 <enum>Qt::ToolButtonIconOnly</enum> 45 </property> 46 </widget> 16 <item row="0" column="2" > 17 <layout class="QVBoxLayout" name="verticalLayout" > 18 <item> 19 <widget class="QWidget" native="1" name="searchHead" > 20 <property name="sizePolicy" > 21 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > 22 <horstretch>0</horstretch> 23 <verstretch>0</verstretch> 24 </sizepolicy> 25 </property> 26 <property name="maximumSize" > 27 <size> 28 <width>16777215</width> 29 <height>16777215</height> 30 </size> 31 </property> 32 <layout class="QGridLayout" name="searchHeadLayout_2" > 33 <property name="sizeConstraint" > 34 <enum>QLayout::SetDefaultConstraint</enum> 35 </property> 36 <item row="2" column="0" > 37 <layout class="QHBoxLayout" name="horizontalLayout_2" > 38 <item> 39 <widget class="QLineEdit" name="searchEdit" > 40 <property name="enabled" > 41 <bool>true</bool> 42 </property> 43 <property name="toolTip" > 44 <string>type a keyword to search</string> 45 </property> 46 </widget> 47 </item> 48 <item> 49 <widget class="QPushButton" name="searchButton" > 50 <property name="sizePolicy" > 51 <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > 52 <horstretch>0</horstretch> 53 <verstretch>0</verstretch> 54 </sizepolicy> 55 </property> 56 <property name="text" > 57 <string>Search</string> 58 </property> 59 <property name="icon" > 60 <iconset resource="../icons.qrc" > 61 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 62 </property> 63 <property name="checkable" > 64 <bool>false</bool> 65 </property> 66 <property name="autoDefault" > 67 <bool>true</bool> 68 </property> 69 <property name="default" > 70 <bool>true</bool> 71 </property> 72 <property name="flat" > 73 <bool>false</bool> 74 </property> 75 </widget> 76 </item> 77 </layout> 78 </item> 79 <item row="0" column="0" > 80 <layout class="QHBoxLayout" name="horizontalLayout_7" > 81 <item> 82 <widget class="QCheckBox" name="searchTitle" > 83 <property name="text" > 84 <string>Title</string> 85 </property> 86 <property name="checked" > 87 <bool>true</bool> 88 </property> 89 </widget> 90 </item> 91 <item> 92 <widget class="QCheckBox" name="searchAbstract" > 93 <property name="text" > 94 <string>Abstract</string> 95 </property> 96 </widget> 97 </item> 98 <item> 99 <widget class="QCheckBox" name="searchSpeaker" > 100 <property name="text" > 101 <string>Speaker</string> 102 </property> 103 </widget> 104 </item> 105 <item> 106 <widget class="QCheckBox" name="searchTag" > 107 <property name="text" > 108 <string>Tag</string> 109 </property> 110 </widget> 111 </item> 112 <item> 113 <widget class="QCheckBox" name="searchRoom" > 114 <property name="text" > 115 <string>Room</string> 116 </property> 117 </widget> 118 </item> 119 <item> 120 <spacer name="horizontalSpacer" > 121 <property name="orientation" > 122 <enum>Qt::Horizontal</enum> 123 </property> 124 <property name="sizeHint" stdset="0" > 125 <size> 126 <width>40</width> 127 <height>20</height> 128 </size> 129 </property> 130 </spacer> 131 </item> 132 </layout> 133 </item> 134 <item row="3" column="0" > 135 <spacer name="verticalSpacer" > 136 <property name="orientation" > 137 <enum>Qt::Vertical</enum> 138 </property> 139 <property name="sizeHint" stdset="0" > 140 <size> 141 <width>20</width> 142 <height>40</height> 143 </size> 144 </property> 145 </spacer> 146 </item> 147 </layout> 148 </widget> 149 </item> 150 <item> 151 <widget class="TreeView" name="treeView" /> 152 </item> 153 </layout> 47 154 </item> 48 <item rowspan="2" row="0" column="1" > 49 <widget class="TreeView" name="treeView" /> 50 </item> 51 <item row="1" column="0" > 52 <widget class="DayNavigatorWidget" native="1" name="dayNavigator" > 53 <property name="sizePolicy" > 54 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > 55 <horstretch>0</horstretch> 56 <verstretch>0</verstretch> 57 </sizepolicy> 58 </property> 59 </widget> 155 <item row="0" column="1" > 156 <layout class="QVBoxLayout" name="verticalLayout_2" > 157 <item> 158 <widget class="QToolButton" name="searchAgainButton" > 159 <property name="enabled" > 160 <bool>true</bool> 161 </property> 162 <property name="sizePolicy" > 163 <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > 164 <horstretch>0</horstretch> 165 <verstretch>0</verstretch> 166 </sizepolicy> 167 </property> 168 <property name="toolTip" > 169 <string>Search again</string> 170 </property> 171 <property name="text" > 172 <string>S</string> 173 </property> 174 <property name="icon" > 175 <iconset resource="../icons.qrc" > 176 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 177 </property> 178 <property name="iconSize" > 179 <size> 180 <width>24</width> 181 <height>24</height> 182 </size> 183 </property> 184 <property name="toolButtonStyle" > 185 <enum>Qt::ToolButtonIconOnly</enum> 186 </property> 187 </widget> 188 </item> 189 <item> 190 <widget class="DayNavigatorWidget" native="1" name="dayNavigator" > 191 <property name="sizePolicy" > 192 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > 193 <horstretch>0</horstretch> 194 <verstretch>0</verstretch> 195 </sizepolicy> 196 </property> 197 </widget> 198 </item> 199 </layout> 60 200 </item> 61 201 </layout>
Note: See TracChangeset
for help on using the changeset viewer.