Changeset 001c8cf for src/gui/tabcontainer.cpp
- Timestamp:
- 01/27/10 09:07:41 (13 years ago)
- Branches:
- master, qt5
- Children:
- 6bc425e
- Parents:
- 9f367eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.