From: Philipp Spitzer Date: Tue, 4 Oct 2011 22:11:03 +0000 (+0000) Subject: Removed the "Now" tab. X-Git-Tag: 0.5.5~45 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/264f5e7c10f4122bf10c126e00d7ef39f03515eb Removed the "Now" tab. Removed the day navigator inside tabs. Added a search button in the button bar. Right now, at least the following does not work: * update of favorites * conflict editor * setting favorite in the event dialog --- diff --git a/src/gui/conflictdialogcontainer.cpp b/src/gui/conflictdialogcontainer.cpp index 8e3e00b..2149c6b 100644 --- a/src/gui/conflictdialogcontainer.cpp +++ b/src/gui/conflictdialogcontainer.cpp @@ -30,7 +30,6 @@ void ConflictDialogContainer::loadEvents( const QDate &aDate, const int aConfere Q_UNUSED(aDate); static_cast(treeView->model())->loadConflictEvents( mEventId, aConferenceId ); - dayNavigator->hide(); } void ConflictDialogContainer::updateTreeView(const QDate &aDate) diff --git a/src/gui/conflictsdialog.cpp b/src/gui/conflictsdialog.cpp index 11fed30..b4832f7 100644 --- a/src/gui/conflictsdialog.cpp +++ b/src/gui/conflictsdialog.cpp @@ -27,11 +27,6 @@ ConflictsDialog::ConflictsDialog(int aEventId, QWidget *aParent) connect(container, SIGNAL(eventHasChanged(int,bool)), container, SLOT(updateTreeViewModel(int,bool))); container->setEventId(aEventId); - - int confId = Conference::activeConference(); - QDate startDate = Conference::getById(confId).start(); - QDate endDate = Conference::getById(confId).end(); - container->setDates(startDate, endDate); } ConflictsDialog::~ConflictsDialog() diff --git a/src/gui/gui.pro b/src/gui/gui.pro index b6898f7..cdea671 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -49,7 +49,6 @@ FORMS += searchhead.ui \ urlinputdialog.ui HEADERS += roomstabcontainer.h \ - nowtabcontainer.h \ trackstabcontainer.h \ favtabcontainer.h \ searchtabcontainer.h \ @@ -66,7 +65,6 @@ HEADERS += roomstabcontainer.h \ urlinputdialog.h SOURCES += roomstabcontainer.cpp \ - nowtabcontainer.cpp \ trackstabcontainer.cpp \ favtabcontainer.cpp \ searchtabcontainer.cpp \ @@ -93,3 +91,5 @@ CONFIG(maemo5) { # HEADERS += alarmdialog.h # SOURCES += alarmdialog.cpp #} + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 76e69ae..730755d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -84,24 +84,18 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) QNetworkProxy::setApplicationProxy(proxy); // event details have changed - connect(dayTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); - connect(favsTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); - connect(tracksTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); - connect(roomsTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); - connect(nowTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); - connect(searchTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); + connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); + connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); + connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); + connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); + connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); // date has changed - connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(setCurDate(QDate))); - connect(dayNavigator, SIGNAL(dateChanged(QDate)), favsTabContainer, SLOT(setCurDate(QDate))); - connect(dayNavigator, SIGNAL(dateChanged(QDate)), tracksTabContainer, SLOT(setCurDate(QDate))); - connect(dayNavigator, SIGNAL(dateChanged(QDate)), roomsTabContainer, SLOT(setCurDate(QDate))); - connect(dayNavigator, SIGNAL(dateChanged(QDate)), nowTabContainer, SLOT(setCurDate(QDate))); - connect(dayNavigator, SIGNAL(dateChanged(QDate)), searchTabContainer, SLOT(setCurDate(QDate))); - - connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp())); - connect(settingsAction, SIGNAL(triggered()), SLOT(setup())); - connect(conferencesAction, SIGNAL(triggered()), SLOT(showConferences())); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(redisplayDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), favsTabContainer, SLOT(redisplayDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), tracksTabContainer, SLOT(redisplayDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), roomsTabContainer, SLOT(redisplayDate(QDate))); + connect(dayNavigator, SIGNAL(dateChanged(QDate)), searchTabContainer, SLOT(redisplayDate(QDate))); useConference(Conference::activeConference()); // optimization, see useConference() code @@ -131,7 +125,7 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) connect(mXmlParser, SIGNAL(parsingScheduleEnd(const QString&)), conferenceModel, SLOT(newConferenceEnd(const QString&))); } -void MainWindow::aboutApp() +void MainWindow::on_aboutAction_triggered() { QDialog dialog(this); Ui::AboutDialog ui; @@ -143,14 +137,31 @@ void MainWindow::aboutApp() dialog.exec(); } -void MainWindow::eventHasChanged(int aEventId, bool aReloadModel) + +void MainWindow::on_reloadAction_triggered() { + +} + + +void MainWindow::on_nowAction_triggered() { + +} + + +void MainWindow::on_searchAction_triggered() { + searchTabContainer->showSearchDialog(); + tabWidget->setCurrentWidget(searchTab); +} + + + +void MainWindow::redisplayEvent(int aEventId, bool aReloadModel) { - dayTabContainer->updateTreeViewModel(aEventId); - favsTabContainer->updateTreeViewModel(aEventId,aReloadModel); - tracksTabContainer->updateTreeViewModel(aEventId); - nowTabContainer->updateTreeViewModel(aEventId); - roomsTabContainer->updateTreeViewModel(aEventId); - searchTabContainer->updateTreeViewModel(aEventId); + dayTabContainer->redisplayEvent(aEventId); + favsTabContainer->redisplayEvent(aEventId,aReloadModel); + tracksTabContainer->redisplayEvent(aEventId); + roomsTabContainer->redisplayEvent(aEventId); + searchTabContainer->redisplayEvent(aEventId); } void MainWindow::useConference(int id) @@ -200,13 +211,6 @@ void MainWindow::initTabs() QDate endDate = active.end(); // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates - dayTabContainer->setDates(startDate, endDate); - tracksTabContainer->setDates(startDate, endDate); - roomsTabContainer->setDates(startDate, endDate); - favsTabContainer->setDates(startDate, endDate); - searchTabContainer->setDates(startDate, endDate); - searchTabContainer->searchAgainClicked(); - nowTabContainer->updateTreeView(QDate::currentDate()); dayNavigator->setDates(startDate, endDate); } } @@ -218,8 +222,6 @@ void MainWindow::clearTabs() roomsTabContainer->clearModel(); favsTabContainer->clearModel(); searchTabContainer->clearModel(); - searchTabContainer->searchAgainClicked(); - nowTabContainer->clearModel(); } void MainWindow::unsetConference() @@ -229,7 +231,7 @@ void MainWindow::unsetConference() setWindowTitle(saved_title); } -void MainWindow::setup() +void MainWindow::on_settingsAction_triggered() { SettingsDialog dialog; dialog.loadDialogData(); @@ -255,7 +257,7 @@ this: this, mXmlParser and mNetworkAccessManager: addition and refresh. */ -void MainWindow::showConferences() +void MainWindow::on_conferencesAction_triggered() { ConferenceEditor dialog(conferenceModel, this); diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 2ce3b4f..1d38333 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -41,11 +41,15 @@ public: signals: void conferenceRemoved(); private slots: - void aboutApp(); - void eventHasChanged(int aEventId, bool aReloadModel); - void setup(); + void on_conferencesAction_triggered(); + void on_settingsAction_triggered(); + void on_aboutAction_triggered(); + void on_reloadAction_triggered(); + void on_nowAction_triggered(); + void on_searchAction_triggered(); + + void redisplayEvent(int aEventId, bool aReloadModel); // TODO: remove - void showConferences(); void networkQueryFinished(QNetworkReply*); void importFromNetwork(const QString&); void importFromFile(const QString&); diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index 4056039..49eacca 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -38,24 +38,14 @@ - 1 + 0 Qt::ElideRight - - - Now - - - - - - - - Favourites + &Favourites @@ -65,7 +55,7 @@ - Day View + &Days @@ -75,7 +65,7 @@ - Tracks + &Tracks @@ -85,7 +75,7 @@ - Rooms + &Rooms @@ -95,7 +85,7 @@ - Search + &Search @@ -142,27 +132,37 @@ false - + + - Conferences + C&onferences + + + Ctrl+O - Settings + S&ettings + + + Ctrl+E - About + &About &Quit + + Ctrl+Q + @@ -179,7 +179,7 @@ Ctrl+R - + :/icons/today.png:/icons/today.png @@ -191,6 +191,18 @@ Ctrl+N + + + + :/icons/search.png:/icons/search.png + + + &Search + + + Ctrl+F + + @@ -218,15 +230,11 @@ QWidget
roomstabcontainer.h
- - NowTabContainer - QWidget -
nowtabcontainer.h
-
DayNavigatorWidget QWidget
daynavigatorwidget.h
+ 1
diff --git a/src/gui/nowtabcontainer.cpp b/src/gui/nowtabcontainer.cpp deleted file mode 100644 index f19c2a6..0000000 --- a/src/gui/nowtabcontainer.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ - -#include -#include "nowtabcontainer.h" - -NowTabContainer::NowTabContainer( QWidget *aParent ) : TabContainer( aParent ) -{ - QTimer *timer = new QTimer( this ); - connect( timer, SIGNAL(timeout()), SLOT(timerUpdateTreeView()) ); - timer->start( 30000); // 30 seconds timer -} - -void NowTabContainer::loadEvents( const QDate &aDate, const int aConferenceId ) -{ - Q_UNUSED( aDate ); - - static_cast(treeView->model())->loadNowEvents( aConferenceId ); - dayNavigator->hide(); -} - -void NowTabContainer::timerUpdateTreeView() -{ - updateTreeView( QDate() ); -} - -void NowTabContainer::updateTreeView(const QDate &aDate) -{ - TabContainer::updateTreeView(aDate); - treeView->setAllExpanded(true); -} - diff --git a/src/gui/nowtabcontainer.h b/src/gui/nowtabcontainer.h deleted file mode 100644 index a5650e1..0000000 --- a/src/gui/nowtabcontainer.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann - * - * This file is part of ConfClerk. - * - * ConfClerk is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your option) - * any later version. - * - * ConfClerk is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * ConfClerk. If not, see . - */ - -#ifndef NOWTABCONTAINER_H_ -#define NOWTABCONTAINER_H_ - -#include "tabcontainer.h" - -class NowTabContainer: public TabContainer -{ - Q_OBJECT -public: - NowTabContainer( QWidget *aParent ); - virtual ~NowTabContainer() { } - -protected: - virtual void loadEvents( const QDate &aDate, const int aConferenceId ); - -public slots: - virtual void updateTreeView(const QDate &aDate); - -private slots: - void timerUpdateTreeView(); -}; - -#endif /* NOWTABCONTAINER_H_ */ diff --git a/src/gui/searchtabcontainer.cpp b/src/gui/searchtabcontainer.cpp index fa5f22d..9ba4965 100644 --- a/src/gui/searchtabcontainer.cpp +++ b/src/gui/searchtabcontainer.cpp @@ -33,42 +33,19 @@ SearchTabContainer::SearchTabContainer(QWidget *aParent) : TabContainer( aParent sizePolicy.setHeightForWidth(header->sizePolicy().hasHeightForWidth()); header->setSizePolicy(sizePolicy); header->setMinimumSize(QSize(10, 10)); - verticalLayout->insertWidget(0,header); + connect(header, SIGNAL(searchClicked()), SLOT(searchButtonClicked())); + showSearchDialog(); +} - header->show(); - - searchAgainButton = new QToolButton(this); - searchAgainButton->setObjectName(QString::fromUtf8("button")); - QIcon icon; - icon.addPixmap(QPixmap(QString::fromUtf8(":/icons/search.png")), QIcon::Normal, QIcon::Off); - searchAgainButton->setIcon(icon); - QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(searchAgainButton->sizePolicy().hasHeightForWidth()); - searchAgainButton->setSizePolicy(sizePolicy1); - - verticalLayout_2->insertWidget(0,searchAgainButton); - searchAgainButton->hide(); +void SearchTabContainer::showSearchDialog() { + header->show(); 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())); } -SearchTabContainer::~SearchTabContainer() -{ -} -void SearchTabContainer::searchButtonClicked() -{ +void SearchTabContainer::searchButtonClicked() { QHash columns; SearchHead *searchHeader = static_cast(header); @@ -118,8 +95,6 @@ void SearchTabContainer::searchButtonClicked() { // TODO: display some message treeView->hide(); - searchAgainButton->hide(); - dayNavigator->hide(); header->show(); QMessageBox::information( this, @@ -129,23 +104,13 @@ void SearchTabContainer::searchButtonClicked() } else { - searchAgainButton->show(); - dayNavigator->show(); treeView->show(); header->hide(); updateTreeView( firstDateWithFounds ); - dayNavigator->setDates(firstDateWithFounds, lastDateWithFounds); } } -void SearchTabContainer::searchAgainClicked() -{ - header->show(); - searchAgainButton->hide(); - dayNavigator->hide(); - treeView->hide(); -} void SearchTabContainer::loadEvents( const QDate &aDate, const int aConferenceId ) { diff --git a/src/gui/searchtabcontainer.h b/src/gui/searchtabcontainer.h index 458005f..fdb1bc3 100644 --- a/src/gui/searchtabcontainer.h +++ b/src/gui/searchtabcontainer.h @@ -21,7 +21,7 @@ #ifndef SEARCHTAB_H_ #define SEARCHTAB_H_ -#include +#include #include "tabcontainer.h" #include "searchhead.h" @@ -30,11 +30,13 @@ class SearchTabContainer: public TabContainer { Q_OBJECT public: SearchTabContainer(QWidget *aParent); - virtual ~SearchTabContainer(); + 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 + void showSearchDialog(); + private slots: void searchButtonClicked(); diff --git a/src/gui/tabcontainer.cpp b/src/gui/tabcontainer.cpp index da29115..694ce78 100644 --- a/src/gui/tabcontainer.cpp +++ b/src/gui/tabcontainer.cpp @@ -44,20 +44,14 @@ TabContainer::TabContainer(QWidget *aParent) treeView->setModel(new EventModel()); treeView->setItemDelegate(new Delegate(treeView)); - // connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateTreeView(const QDate &))); - - connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool))); + connect(treeView, SIGNAL(eventChanged(int,bool)), SIGNAL(eventChanged(int,bool))); connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &))); - - // day navigator is hidden by default - dayNavigator->hide(); } void TabContainer::updateTreeView(const QDate &aDate) { int active_id = Conference::activeConference(); - dayNavigator->show(); if (active_id > 0) { loadEvents(aDate, active_id); } else { @@ -75,9 +69,9 @@ void TabContainer::itemClicked(const QModelIndex &aIndex) #ifdef N810 dialog.setFixedWidth(static_cast(parent())->width()); #endif - connect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); + connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); dialog.exec(); - disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); + disconnect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); } void TabContainer::displayConflicts(const QModelIndex &aIndex) @@ -86,42 +80,23 @@ void TabContainer::displayConflicts(const QModelIndex &aIndex) #ifdef N810 dialog.setFixedWidth(static_cast(parent())->width()); #endif - connect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); + connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); dialog.exec(); - disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); + disconnect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); } -void TabContainer::updateTreeViewModel(int aEventId, bool aReloadModel) -{ - if(aReloadModel) - { - // requires special handling - // eg. in case of favourites - some favourites may have changed - // and so we need to reload them - int confId = Conference::activeConference(); - QDate startDate = Conference::getById(confId).start(); - QDate endDate = Conference::getById(confId).end(); - dayNavigator->setDates(startDate, endDate); - updateTreeView(dayNavigator->curDate()); - } - else - { - // just update event in the question - static_cast(treeView->model())->updateModel(aEventId); - } + +void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) { + /* if (aReloadModel) updateTreeView(dayNavigator->curDate()); + else */ static_cast(treeView->model())->updateModel(aEventId); } -void TabContainer::setCurDate(const QDate& curDate) { +void TabContainer::redisplayDate(const QDate& curDate) { updateTreeView(curDate); } -void TabContainer::setDates(const QDate &aStart, const QDate &aEnd) -{ - dayNavigator->setDates(aStart, aEnd); -} - void TabContainer::clearModel() { static_cast(treeView->model())->clearModel(); diff --git a/src/gui/tabcontainer.h b/src/gui/tabcontainer.h index dfbf653..fa85b73 100644 --- a/src/gui/tabcontainer.h +++ b/src/gui/tabcontainer.h @@ -41,12 +41,11 @@ protected: virtual void loadEvents( const QDate &aDate, const int aConferenceId ) = 0; signals: - void eventHasChanged(int aEventId, bool aReloadModel); + void eventChanged(int aEventId, bool aReloadModel); public slots: - virtual void updateTreeViewModel(int aEventId, bool aReloadModel = false); - void setCurDate(const QDate& curDate); - void setDates(const QDate &aStart, const QDate &aEnd); + virtual void redisplayEvent(int aEventId, bool aReloadModel = false); + void redisplayDate(const QDate& curDate); protected slots: virtual void updateTreeView(const QDate &aDate); diff --git a/src/gui/tabcontainer.ui b/src/gui/tabcontainer.ui index 56e6e10..77b1205 100644 --- a/src/gui/tabcontainer.ui +++ b/src/gui/tabcontainer.ui @@ -23,7 +23,7 @@ 0 - + @@ -40,43 +40,15 @@ - - - - - - - 0 - 0 - - - - - 10 - 10 - - - - - - - - DayNavigatorWidget - QWidget -
daynavigatorwidget.h
- 1 -
TreeView QTreeView
../mvc/treeview.h
- - - +