const int confId = 1;
-MainWindow::MainWindow(QWidget *parent)
- : QMainWindow(parent)
+MainWindow::MainWindow(int aEventId, QWidget *aParent)
+ : QMainWindow(aParent)
{
setupUi(this);
actTreeView->setModel(new EventModel());
actTreeView->setItemDelegate(new Delegate(actTreeView));
+ // DAY EVENTS View
+ searchTreeView->setHeaderHidden(true);
+ searchTreeView->setRootIsDecorated(false);
+ searchTreeView->setIndentation(0);
+ searchTreeView->setAnimated(true);
+ searchTreeView->setModel(new EventModel());
+ searchTreeView->setItemDelegate(new Delegate(searchTreeView));
+ searchTreeView->setVisible(false);
+ searchDayNavigator->setVisible(false);
// event clicked
connect(dayTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
connect(favTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
connect(actTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
+ connect(searchTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
// request for map to be displayed
connect(dayTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
connect(favTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
connect(actTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
-
+ connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
+ // event search button clicked
+ connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));
// TESTING: load some 'fav' data
if(Conference::getAll().count()) // no conference(s) in the DB
connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTab(int)));
+ // open dialog for given Event ID
+ // this is used in case Alarm Dialog request application to start
+ if(aEventId)
+ {
+ try
+ {
+ EventDialog dialog(aEventId,this);
+ dialog.exec();
+ }
+ catch(OrmNoObjectException*) {} // just start application
+ catch(...) {} // just start application
+ }
}
MainWindow::~MainWindow()
if(!aIndex.parent().isValid()) // time-group
return;
- EventDialog dialog(aIndex,this);
+ EventDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this);
dialog.exec();
}
MapWindow window(map,roomName,this);
window.exec();
}
+
+void MainWindow::searchClicked()
+{
+ QList<QString> columns;
+
+ if( searchTitle->isChecked() )
+ columns.append( "title" );
+ if( searchAbstract->isChecked() )
+ columns.append( "abstract" );
+
+ if( mSqlEngine->searchEvent( confId, columns, searchEdit->text() ) > 0 ){
+ searchTreeView->setVisible(true);
+ searchDayNavigator->setVisible(true);
+ }
+}
+