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
Q_UNUSED(aDate);
static_cast<EventModel*>(treeView->model())->loadConflictEvents( mEventId, aConferenceId );
- dayNavigator->hide();
}
void ConflictDialogContainer::updateTreeView(const QDate &aDate)
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()
urlinputdialog.ui
HEADERS += roomstabcontainer.h \
- nowtabcontainer.h \
trackstabcontainer.h \
favtabcontainer.h \
searchtabcontainer.h \
urlinputdialog.h
SOURCES += roomstabcontainer.cpp \
- nowtabcontainer.cpp \
trackstabcontainer.cpp \
favtabcontainer.cpp \
searchtabcontainer.cpp \
# HEADERS += alarmdialog.h
# SOURCES += alarmdialog.cpp
#}
+
+
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
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;
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)
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);
}
}
roomsTabContainer->clearModel();
favsTabContainer->clearModel();
searchTabContainer->clearModel();
- searchTabContainer->searchAgainClicked();
- nowTabContainer->clearModel();
}
void MainWindow::unsetConference()
setWindowTitle(saved_title);
}
-void MainWindow::setup()
+void MainWindow::on_settingsAction_triggered()
{
SettingsDialog dialog;
dialog.loadDialogData();
this, mXmlParser and mNetworkAccessManager:
addition and refresh.
*/
-void MainWindow::showConferences()
+void MainWindow::on_conferencesAction_triggered()
{
ConferenceEditor dialog(conferenceModel, this);
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&);
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideRight</enum>
</property>
- <widget class="QWidget" name="nowTab">
- <attribute name="title">
- <string>Now</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_7">
- <item row="0" column="0">
- <widget class="NowTabContainer" name="nowTabContainer" native="true"/>
- </item>
- </layout>
- </widget>
<widget class="QWidget" name="favouritesTab">
<attribute name="title">
- <string>Favourites</string>
+ <string>&Favourites</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
</widget>
<widget class="QWidget" name="dayViewTab">
<attribute name="title">
- <string>Day View</string>
+ <string>&Days</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
</widget>
<widget class="QWidget" name="tracksTab">
<attribute name="title">
- <string>Tracks</string>
+ <string>&Tracks</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
</widget>
<widget class="QWidget" name="roomsTab">
<attribute name="title">
- <string>Rooms</string>
+ <string>&Rooms</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
</widget>
<widget class="QWidget" name="searchTab">
<attribute name="title">
- <string>Search</string>
+ <string>&Search</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<bool>false</bool>
</attribute>
<addaction name="reloadAction"/>
- <addaction name="actionNow"/>
+ <addaction name="nowAction"/>
+ <addaction name="searchAction"/>
</widget>
<action name="conferencesAction">
<property name="text">
- <string>Conferences</string>
+ <string>C&onferences</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+O</string>
</property>
</action>
<action name="settingsAction">
<property name="text">
- <string>Settings</string>
+ <string>S&ettings</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+E</string>
</property>
</action>
<action name="aboutAction">
<property name="text">
- <string>About</string>
+ <string>&About</string>
</property>
</action>
<action name="quitAction">
<property name="text">
<string>&Quit</string>
</property>
+ <property name="shortcut">
+ <string>Ctrl+Q</string>
+ </property>
</action>
<action name="reloadAction">
<property name="icon">
<string>Ctrl+R</string>
</property>
</action>
- <action name="actionNow">
+ <action name="nowAction">
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/today.png</normaloff>:/icons/today.png</iconset>
<string>Ctrl+N</string>
</property>
</action>
+ <action name="searchAction">
+ <property name="icon">
+ <iconset resource="../icons.qrc">
+ <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset>
+ </property>
+ <property name="text">
+ <string>&Search</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+F</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
<extends>QWidget</extends>
<header>roomstabcontainer.h</header>
</customwidget>
- <customwidget>
- <class>NowTabContainer</class>
- <extends>QWidget</extends>
- <header>nowtabcontainer.h</header>
- </customwidget>
<customwidget>
<class>DayNavigatorWidget</class>
<extends>QWidget</extends>
<header>daynavigatorwidget.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources>
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <QTimer>
-#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<EventModel*>(treeView->model())->loadNowEvents( aConferenceId );
- dayNavigator->hide();
-}
-
-void NowTabContainer::timerUpdateTreeView()
-{
- updateTreeView( QDate() );
-}
-
-void NowTabContainer::updateTreeView(const QDate &aDate)
-{
- TabContainer::updateTreeView(aDate);
- treeView->setAllExpanded(true);
-}
-
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-#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_ */
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<QString,QString> columns;
SearchHead *searchHeader = static_cast<SearchHead*>(header);
{
// TODO: display some message
treeView->hide();
- searchAgainButton->hide();
- dayNavigator->hide();
header->show();
QMessageBox::information(
this,
}
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 )
{
#ifndef SEARCHTAB_H_
#define SEARCHTAB_H_
-#include <QWidget>
+#include <QtGui>
#include "tabcontainer.h"
#include "searchhead.h"
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();
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 {
#ifdef N810
dialog.setFixedWidth(static_cast<QWidget*>(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)
#ifdef N810
dialog.setFixedWidth(static_cast<QWidget*>(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<EventModel*>(treeView->model())->updateModel(aEventId);
- }
+
+void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) {
+ /* if (aReloadModel) updateTreeView(dayNavigator->curDate());
+ else */ static_cast<EventModel*>(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<EventModel*>(treeView->model())->clearModel();
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);
<property name="margin">
<number>0</number>
</property>
- <item row="0" column="2">
+ <item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="TreeView" name="treeView">
</item>
</layout>
</item>
- <item row="0" column="1">
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="DayNavigatorWidget" name="dayNavigator" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>10</width>
- <height>10</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
</widget>
<customwidgets>
- <customwidget>
- <class>DayNavigatorWidget</class>
- <extends>QWidget</extends>
- <header>daynavigatorwidget.h</header>
- <container>1</container>
- </customwidget>
<customwidget>
<class>TreeView</class>
<extends>QTreeView</extends>
<header>../mvc/treeview.h</header>
</customwidget>
</customwidgets>
- <resources>
- <include location="../icons.qrc"/>
- </resources>
+ <resources/>
<connections/>
</ui>