search tab - header is hidden in case no conf exists in the DB
authorpavelpa <pavelpa@localhost>
Thu, 28 Jan 2010 08:50:52 +0000 (08:50 +0000)
committerpavelpa <pavelpa@localhost>
Thu, 28 Jan 2010 08:50:52 +0000 (08:50 +0000)
src/gui/mainwindow.cpp
src/gui/searchtabcontainer.cpp
src/gui/searchtabcontainer.h
src/gui/tabcontainer.cpp

index b5882d6..1d8bf0a 100644 (file)
@@ -135,8 +135,9 @@ void MainWindow::initTabs()
     dayTabContainer->setDates(startDate, endDate);
     tracksTabContainer->setDates(startDate, endDate);
     roomsTabContainer->setDates(startDate, endDate);
-    favsTabContainer->setDates(startDate, endDate);
-    searchTabContainer->setDates(startDate, endDate);
+    //favsTabContainer->setDates(startDate, endDate);
+    //searchTabContainer->setDates(startDate, endDate);
+    searchTabContainer->searchAgainClicked();
     nowTabContainer->updateTreeView(QDate::currentDate());
 }
 
index b69b664..310d692 100644 (file)
@@ -34,6 +34,11 @@ SearchTabContainer::SearchTabContainer(QWidget *aParent) : TabContainer( aParent
 
     searchAgainButton->hide();
     treeView->hide();
+    // do not show 'search' header if there are no conferences in the DB
+    if(Conference::getAll().count()==0)
+    {
+        header->hide();
+    }
 
     connect( header, SIGNAL(searchClicked()), SLOT(searchButtonClicked()));
     connect( searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked()));
index bcfdc7b..1eb56a4 100644 (file)
@@ -14,9 +14,10 @@ public:
     virtual ~SearchTabContainer();
 protected:
     virtual void loadEvents( const QDate &aDate, const int aConferenceId );
+public slots:
+    void searchAgainClicked(); // made it public - to show header when 1.st conf importing is done successfuly
 private slots:
     void searchButtonClicked();
-    void searchAgainClicked();
 
 private:
     SearchHead *header;
index 8f30a96..7a5da45 100644 (file)
@@ -31,16 +31,8 @@ TabContainer::TabContainer(QWidget *aParent)
     connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &)));
 
-    if(!Conference::getAll().count()) // no conference(s) in the DB
-    {
-        dayNavigator->hide();
-    }
-    else
-    {
-        QDate aStartDate = Conference::getById(Conference::activeConference()).start();
-        QDate aEndDate = Conference::getById(Conference::activeConference()).end();
-        dayNavigator->setDates(aStartDate, aEndDate);
-    }
+    // day navigator is hidden by default
+    dayNavigator->hide();
 }
 
 void TabContainer::updateTreeView(const QDate &aDate)