Changeset 264f5e7
- Timestamp:
- 10/05/11 00:11:03 (11 years ago)
- Branches:
- master, qt5
- Children:
- dc66a91
- Parents:
- a9430aa
- Location:
- src/gui
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/conflictdialogcontainer.cpp
ra9430aa r264f5e7 31 31 32 32 static_cast<EventModel*>(treeView->model())->loadConflictEvents( mEventId, aConferenceId ); 33 dayNavigator->hide();34 33 } 35 34 -
src/gui/conflictsdialog.cpp
ra9430aa r264f5e7 28 28 29 29 container->setEventId(aEventId); 30 31 int confId = Conference::activeConference();32 QDate startDate = Conference::getById(confId).start();33 QDate endDate = Conference::getById(confId).end();34 container->setDates(startDate, endDate);35 30 } 36 31 -
src/gui/gui.pro
ra9430aa r264f5e7 50 50 51 51 HEADERS += roomstabcontainer.h \ 52 nowtabcontainer.h \53 52 trackstabcontainer.h \ 54 53 favtabcontainer.h \ … … 67 66 68 67 SOURCES += roomstabcontainer.cpp \ 69 nowtabcontainer.cpp \70 68 trackstabcontainer.cpp \ 71 69 favtabcontainer.cpp \ … … 94 92 # SOURCES += alarmdialog.cpp 95 93 #} 94 95 -
src/gui/mainwindow.cpp
ra9430aa r264f5e7 85 85 86 86 // event details have changed 87 connect(dayTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 88 connect(favsTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 89 connect(tracksTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 90 connect(roomsTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 91 connect(nowTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 92 connect(searchTabContainer, SIGNAL(eventHasChanged(int,bool)), SLOT(eventHasChanged(int,bool))); 87 connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); 88 connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); 89 connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); 90 connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); 91 connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); 93 92 94 93 // date has changed 95 connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(setCurDate(QDate))); 96 connect(dayNavigator, SIGNAL(dateChanged(QDate)), favsTabContainer, SLOT(setCurDate(QDate))); 97 connect(dayNavigator, SIGNAL(dateChanged(QDate)), tracksTabContainer, SLOT(setCurDate(QDate))); 98 connect(dayNavigator, SIGNAL(dateChanged(QDate)), roomsTabContainer, SLOT(setCurDate(QDate))); 99 connect(dayNavigator, SIGNAL(dateChanged(QDate)), nowTabContainer, SLOT(setCurDate(QDate))); 100 connect(dayNavigator, SIGNAL(dateChanged(QDate)), searchTabContainer, SLOT(setCurDate(QDate))); 101 102 connect(aboutAction, SIGNAL(triggered()), SLOT(aboutApp())); 103 connect(settingsAction, SIGNAL(triggered()), SLOT(setup())); 104 connect(conferencesAction, SIGNAL(triggered()), SLOT(showConferences())); 94 connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(redisplayDate(QDate))); 95 connect(dayNavigator, SIGNAL(dateChanged(QDate)), favsTabContainer, SLOT(redisplayDate(QDate))); 96 connect(dayNavigator, SIGNAL(dateChanged(QDate)), tracksTabContainer, SLOT(redisplayDate(QDate))); 97 connect(dayNavigator, SIGNAL(dateChanged(QDate)), roomsTabContainer, SLOT(redisplayDate(QDate))); 98 connect(dayNavigator, SIGNAL(dateChanged(QDate)), searchTabContainer, SLOT(redisplayDate(QDate))); 105 99 106 100 useConference(Conference::activeConference()); … … 132 126 } 133 127 134 void MainWindow:: aboutApp()128 void MainWindow::on_aboutAction_triggered() 135 129 { 136 130 QDialog dialog(this); … … 144 138 } 145 139 146 void MainWindow::eventHasChanged(int aEventId, bool aReloadModel) 147 { 148 dayTabContainer->updateTreeViewModel(aEventId); 149 favsTabContainer->updateTreeViewModel(aEventId,aReloadModel); 150 tracksTabContainer->updateTreeViewModel(aEventId); 151 nowTabContainer->updateTreeViewModel(aEventId); 152 roomsTabContainer->updateTreeViewModel(aEventId); 153 searchTabContainer->updateTreeViewModel(aEventId); 140 141 void MainWindow::on_reloadAction_triggered() { 142 143 } 144 145 146 void MainWindow::on_nowAction_triggered() { 147 148 } 149 150 151 void MainWindow::on_searchAction_triggered() { 152 searchTabContainer->showSearchDialog(); 153 tabWidget->setCurrentWidget(searchTab); 154 } 155 156 157 158 void MainWindow::redisplayEvent(int aEventId, bool aReloadModel) 159 { 160 dayTabContainer->redisplayEvent(aEventId); 161 favsTabContainer->redisplayEvent(aEventId,aReloadModel); 162 tracksTabContainer->redisplayEvent(aEventId); 163 roomsTabContainer->redisplayEvent(aEventId); 164 searchTabContainer->redisplayEvent(aEventId); 154 165 } 155 166 … … 201 212 202 213 // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates 203 dayTabContainer->setDates(startDate, endDate);204 tracksTabContainer->setDates(startDate, endDate);205 roomsTabContainer->setDates(startDate, endDate);206 favsTabContainer->setDates(startDate, endDate);207 searchTabContainer->setDates(startDate, endDate);208 searchTabContainer->searchAgainClicked();209 nowTabContainer->updateTreeView(QDate::currentDate());210 214 dayNavigator->setDates(startDate, endDate); 211 215 } … … 219 223 favsTabContainer->clearModel(); 220 224 searchTabContainer->clearModel(); 221 searchTabContainer->searchAgainClicked();222 nowTabContainer->clearModel();223 225 } 224 226 … … 230 232 } 231 233 232 void MainWindow:: setup()234 void MainWindow::on_settingsAction_triggered() 233 235 { 234 236 SettingsDialog dialog; … … 256 258 addition and refresh. 257 259 */ 258 void MainWindow:: showConferences()260 void MainWindow::on_conferencesAction_triggered() 259 261 { 260 262 ConferenceEditor dialog(conferenceModel, this); -
src/gui/mainwindow.h
ra9430aa r264f5e7 42 42 void conferenceRemoved(); 43 43 private slots: 44 void aboutApp(); 45 void eventHasChanged(int aEventId, bool aReloadModel); 46 void setup(); 44 void on_conferencesAction_triggered(); 45 void on_settingsAction_triggered(); 46 void on_aboutAction_triggered(); 47 void on_reloadAction_triggered(); 48 void on_nowAction_triggered(); 49 void on_searchAction_triggered(); 50 51 void redisplayEvent(int aEventId, bool aReloadModel); 47 52 // TODO: remove 48 void showConferences();49 53 void networkQueryFinished(QNetworkReply*); 50 54 void importFromNetwork(const QString&); -
src/gui/mainwindow.ui
ra9430aa r264f5e7 39 39 <widget class="QTabWidget" name="tabWidget"> 40 40 <property name="currentIndex"> 41 <number> 1</number>41 <number>0</number> 42 42 </property> 43 43 <property name="elideMode"> 44 44 <enum>Qt::ElideRight</enum> 45 45 </property> 46 <widget class="QWidget" name="nowTab">47 <attribute name="title">48 <string>Now</string>49 </attribute>50 <layout class="QGridLayout" name="gridLayout_7">51 <item row="0" column="0">52 <widget class="NowTabContainer" name="nowTabContainer" native="true"/>53 </item>54 </layout>55 </widget>56 46 <widget class="QWidget" name="favouritesTab"> 57 47 <attribute name="title"> 58 <string> Favourites</string>48 <string>&Favourites</string> 59 49 </attribute> 60 50 <layout class="QGridLayout" name="gridLayout_3"> … … 66 56 <widget class="QWidget" name="dayViewTab"> 67 57 <attribute name="title"> 68 <string> Day View</string>58 <string>&Days</string> 69 59 </attribute> 70 60 <layout class="QGridLayout" name="gridLayout"> … … 76 66 <widget class="QWidget" name="tracksTab"> 77 67 <attribute name="title"> 78 <string> Tracks</string>68 <string>&Tracks</string> 79 69 </attribute> 80 70 <layout class="QGridLayout" name="gridLayout_4"> … … 86 76 <widget class="QWidget" name="roomsTab"> 87 77 <attribute name="title"> 88 <string> Rooms</string>78 <string>&Rooms</string> 89 79 </attribute> 90 80 <layout class="QGridLayout" name="gridLayout_8"> … … 96 86 <widget class="QWidget" name="searchTab"> 97 87 <attribute name="title"> 98 <string> Search</string>88 <string>&Search</string> 99 89 </attribute> 100 90 <layout class="QHBoxLayout" name="horizontalLayout_1"> … … 143 133 </attribute> 144 134 <addaction name="reloadAction"/> 145 <addaction name="actionNow"/> 135 <addaction name="nowAction"/> 136 <addaction name="searchAction"/> 146 137 </widget> 147 138 <action name="conferencesAction"> 148 139 <property name="text"> 149 <string>Conferences</string> 140 <string>C&onferences</string> 141 </property> 142 <property name="shortcut"> 143 <string>Ctrl+O</string> 150 144 </property> 151 145 </action> 152 146 <action name="settingsAction"> 153 147 <property name="text"> 154 <string>Settings</string> 148 <string>S&ettings</string> 149 </property> 150 <property name="shortcut"> 151 <string>Ctrl+E</string> 155 152 </property> 156 153 </action> 157 154 <action name="aboutAction"> 158 155 <property name="text"> 159 <string> About</string>156 <string>&About</string> 160 157 </property> 161 158 </action> … … 163 160 <property name="text"> 164 161 <string>&Quit</string> 162 </property> 163 <property name="shortcut"> 164 <string>Ctrl+Q</string> 165 165 </property> 166 166 </action> … … 180 180 </property> 181 181 </action> 182 <action name=" actionNow">182 <action name="nowAction"> 183 183 <property name="icon"> 184 184 <iconset resource="../icons.qrc"> … … 192 192 </property> 193 193 </action> 194 <action name="searchAction"> 195 <property name="icon"> 196 <iconset resource="../icons.qrc"> 197 <normaloff>:/icons/search.png</normaloff>:/icons/search.png</iconset> 198 </property> 199 <property name="text"> 200 <string>&Search</string> 201 </property> 202 <property name="shortcut"> 203 <string>Ctrl+F</string> 204 </property> 205 </action> 194 206 </widget> 195 207 <customwidgets> … … 220 232 </customwidget> 221 233 <customwidget> 222 <class>NowTabContainer</class>223 <extends>QWidget</extends>224 <header>nowtabcontainer.h</header>225 </customwidget>226 <customwidget>227 234 <class>DayNavigatorWidget</class> 228 235 <extends>QWidget</extends> 229 236 <header>daynavigatorwidget.h</header> 237 <container>1</container> 230 238 </customwidget> 231 239 </customwidgets> -
src/gui/searchtabcontainer.cpp
ra9430aa r264f5e7 34 34 header->setSizePolicy(sizePolicy); 35 35 header->setMinimumSize(QSize(10, 10)); 36 37 36 verticalLayout->insertWidget(0,header); 38 39 header->show(); 40 41 searchAgainButton = new QToolButton(this); 42 searchAgainButton->setObjectName(QString::fromUtf8("button")); 43 QIcon icon; 44 icon.addPixmap(QPixmap(QString::fromUtf8(":/icons/search.png")), QIcon::Normal, QIcon::Off); 45 searchAgainButton->setIcon(icon); 46 QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Minimum); 47 sizePolicy1.setHorizontalStretch(0); 48 sizePolicy1.setVerticalStretch(0); 49 sizePolicy1.setHeightForWidth(searchAgainButton->sizePolicy().hasHeightForWidth()); 50 searchAgainButton->setSizePolicy(sizePolicy1); 51 52 verticalLayout_2->insertWidget(0,searchAgainButton); 53 54 searchAgainButton->hide(); 55 treeView->hide(); 56 // do not show 'search' header if there are no conferences in the DB 57 if(Conference::getAll().count()==0) 58 { 59 header->hide(); 60 } 61 62 connect( header, SIGNAL(searchClicked()), SLOT(searchButtonClicked())); 63 connect( searchAgainButton, SIGNAL(clicked()), SLOT(searchAgainClicked())); 37 connect(header, SIGNAL(searchClicked()), SLOT(searchButtonClicked())); 38 showSearchDialog(); 64 39 } 65 40 66 SearchTabContainer::~SearchTabContainer() 67 { 41 42 void SearchTabContainer::showSearchDialog() { 43 header->show(); 44 treeView->hide(); 68 45 } 69 46 70 void SearchTabContainer::searchButtonClicked() 71 {47 48 void SearchTabContainer::searchButtonClicked() { 72 49 QHash<QString,QString> columns; 73 50 … … 119 96 // TODO: display some message 120 97 treeView->hide(); 121 searchAgainButton->hide();122 dayNavigator->hide();123 98 header->show(); 124 99 QMessageBox::information( … … 130 105 else 131 106 { 132 searchAgainButton->show();133 dayNavigator->show();134 107 treeView->show(); 135 108 header->hide(); 136 109 137 110 updateTreeView( firstDateWithFounds ); 138 dayNavigator->setDates(firstDateWithFounds, lastDateWithFounds);139 111 } 140 112 } 141 113 142 void SearchTabContainer::searchAgainClicked()143 {144 header->show();145 searchAgainButton->hide();146 dayNavigator->hide();147 treeView->hide();148 }149 114 150 115 void SearchTabContainer::loadEvents( const QDate &aDate, const int aConferenceId ) -
src/gui/searchtabcontainer.h
ra9430aa r264f5e7 22 22 #define SEARCHTAB_H_ 23 23 24 #include <Q Widget>24 #include <QtGui> 25 25 26 26 #include "tabcontainer.h" … … 31 31 public: 32 32 SearchTabContainer(QWidget *aParent); 33 virtual ~SearchTabContainer() ;33 virtual ~SearchTabContainer() {} 34 34 protected: 35 35 virtual void loadEvents( const QDate &aDate, const int aConferenceId ); 36 36 37 public slots: 37 void searchAgainClicked(); // made it public - to show header when 1.st conf importing is done successfuly 38 void showSearchDialog(); 39 38 40 private slots: 39 41 void searchButtonClicked(); -
src/gui/tabcontainer.cpp
ra9430aa r264f5e7 45 45 treeView->setItemDelegate(new Delegate(treeView)); 46 46 47 // connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateTreeView(const QDate &))); 48 49 connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool))); 47 connect(treeView, SIGNAL(eventChanged(int,bool)), SIGNAL(eventChanged(int,bool))); 50 48 connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 51 49 connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &))); 52 53 // day navigator is hidden by default54 dayNavigator->hide();55 50 } 56 51 … … 58 53 { 59 54 int active_id = Conference::activeConference(); 60 dayNavigator->show();61 55 if (active_id > 0) { 62 56 loadEvents(aDate, active_id); … … 76 70 dialog.setFixedWidth(static_cast<QWidget*>(parent())->width()); 77 71 #endif 78 connect(&dialog, SIGNAL(event HasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));72 connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 79 73 dialog.exec(); 80 disconnect(&dialog, SIGNAL(event HasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));74 disconnect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 81 75 } 82 76 … … 87 81 dialog.setFixedWidth(static_cast<QWidget*>(parent())->width()); 88 82 #endif 89 connect(&dialog, SIGNAL(event HasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));83 connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 90 84 dialog.exec(); 91 disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); 92 } 93 94 void TabContainer::updateTreeViewModel(int aEventId, bool aReloadModel) 95 { 96 if(aReloadModel) 97 { 98 // requires special handling 99 // eg. in case of favourites - some favourites may have changed 100 // and so we need to reload them 101 int confId = Conference::activeConference(); 102 QDate startDate = Conference::getById(confId).start(); 103 QDate endDate = Conference::getById(confId).end(); 104 dayNavigator->setDates(startDate, endDate); 105 updateTreeView(dayNavigator->curDate()); 106 } 107 else 108 { 109 // just update event in the question 110 static_cast<EventModel*>(treeView->model())->updateModel(aEventId); 111 } 85 disconnect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 112 86 } 113 87 114 88 115 void TabContainer::setCurDate(const QDate& curDate) { 89 void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) { 90 /* if (aReloadModel) updateTreeView(dayNavigator->curDate()); 91 else */ static_cast<EventModel*>(treeView->model())->updateModel(aEventId); 92 } 93 94 95 void TabContainer::redisplayDate(const QDate& curDate) { 116 96 updateTreeView(curDate); 117 97 } 118 98 119 120 void TabContainer::setDates(const QDate &aStart, const QDate &aEnd)121 {122 dayNavigator->setDates(aStart, aEnd);123 }124 99 125 100 void TabContainer::clearModel() -
src/gui/tabcontainer.h
ra9430aa r264f5e7 42 42 43 43 signals: 44 void event HasChanged(int aEventId, bool aReloadModel);44 void eventChanged(int aEventId, bool aReloadModel); 45 45 46 46 public slots: 47 virtual void updateTreeViewModel(int aEventId, bool aReloadModel = false); 48 void setCurDate(const QDate& curDate); 49 void setDates(const QDate &aStart, const QDate &aEnd); 47 virtual void redisplayEvent(int aEventId, bool aReloadModel = false); 48 void redisplayDate(const QDate& curDate); 50 49 51 50 protected slots: -
src/gui/tabcontainer.ui
ra9430aa r264f5e7 24 24 <number>0</number> 25 25 </property> 26 <item row="0" column=" 2">26 <item row="0" column="1"> 27 27 <layout class="QVBoxLayout" name="verticalLayout"> 28 28 <item> … … 41 41 </layout> 42 42 </item> 43 <item row="0" column="1">44 <layout class="QVBoxLayout" name="verticalLayout_2">45 <item>46 <widget class="DayNavigatorWidget" name="dayNavigator" native="true">47 <property name="sizePolicy">48 <sizepolicy hsizetype="Minimum" vsizetype="Expanding">49 <horstretch>0</horstretch>50 <verstretch>0</verstretch>51 </sizepolicy>52 </property>53 <property name="minimumSize">54 <size>55 <width>10</width>56 <height>10</height>57 </size>58 </property>59 </widget>60 </item>61 </layout>62 </item>63 43 </layout> 64 44 </widget> 65 45 <customwidgets> 66 <customwidget>67 <class>DayNavigatorWidget</class>68 <extends>QWidget</extends>69 <header>daynavigatorwidget.h</header>70 <container>1</container>71 </customwidget>72 46 <customwidget> 73 47 <class>TreeView</class> … … 76 50 </customwidget> 77 51 </customwidgets> 78 <resources> 79 <include location="../icons.qrc"/> 80 </resources> 52 <resources/> 81 53 <connections/> 82 54 </ui>
Note: See TracChangeset
for help on using the changeset viewer.