Changeset 264f5e7 in confclerk_git for src


Ignore:
Timestamp:
10/05/11 00:11:03 (11 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
dc66a91
Parents:
a9430aa
Message:

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
Location:
src/gui
Files:
2 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • src/gui/conflictdialogcontainer.cpp

    ra9430aa r264f5e7  
    3131
    3232    static_cast<EventModel*>(treeView->model())->loadConflictEvents( mEventId, aConferenceId );
    33     dayNavigator->hide();
    3433}
    3534
  • src/gui/conflictsdialog.cpp

    ra9430aa r264f5e7  
    2828
    2929    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);
    3530}
    3631
  • src/gui/gui.pro

    ra9430aa r264f5e7  
    5050
    5151HEADERS += roomstabcontainer.h \
    52     nowtabcontainer.h \
    5352    trackstabcontainer.h \
    5453    favtabcontainer.h \
     
    6766
    6867SOURCES += roomstabcontainer.cpp \
    69     nowtabcontainer.cpp \
    7068    trackstabcontainer.cpp \
    7169    favtabcontainer.cpp \
     
    9492#    SOURCES += alarmdialog.cpp
    9593#}
     94
     95
  • src/gui/mainwindow.cpp

    ra9430aa r264f5e7  
    8585
    8686    // 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)));
    9392
    9493    // 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)));
    10599
    106100    useConference(Conference::activeConference());
     
    132126}
    133127
    134 void MainWindow::aboutApp()
     128void MainWindow::on_aboutAction_triggered()
    135129{
    136130    QDialog dialog(this);
     
    144138}
    145139
    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
     141void MainWindow::on_reloadAction_triggered() {
     142
     143}
     144
     145
     146void MainWindow::on_nowAction_triggered() {
     147
     148}
     149
     150
     151void MainWindow::on_searchAction_triggered() {
     152    searchTabContainer->showSearchDialog();
     153    tabWidget->setCurrentWidget(searchTab);
     154}
     155
     156
     157
     158void 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);
    154165}
    155166
     
    201212
    202213        // '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());
    210214        dayNavigator->setDates(startDate, endDate);
    211215    }
     
    219223    favsTabContainer->clearModel();
    220224    searchTabContainer->clearModel();
    221     searchTabContainer->searchAgainClicked();
    222     nowTabContainer->clearModel();
    223225}
    224226
     
    230232}
    231233
    232 void MainWindow::setup()
     234void MainWindow::on_settingsAction_triggered()
    233235{
    234236    SettingsDialog dialog;
     
    256258 addition and refresh.
    257259*/
    258 void MainWindow::showConferences()
     260void MainWindow::on_conferencesAction_triggered()
    259261{
    260262    ConferenceEditor dialog(conferenceModel, this);
  • src/gui/mainwindow.h

    ra9430aa r264f5e7  
    4242    void conferenceRemoved();
    4343private 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);
    4752    // TODO: remove
    48     void showConferences();
    4953    void networkQueryFinished(QNetworkReply*);
    5054    void importFromNetwork(const QString&);
  • src/gui/mainwindow.ui

    ra9430aa r264f5e7  
    3939     <widget class="QTabWidget" name="tabWidget">
    4040      <property name="currentIndex">
    41        <number>1</number>
     41       <number>0</number>
    4242      </property>
    4343      <property name="elideMode">
    4444       <enum>Qt::ElideRight</enum>
    4545      </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>
    5646      <widget class="QWidget" name="favouritesTab">
    5747       <attribute name="title">
    58         <string>Favourites</string>
     48        <string>&amp;Favourites</string>
    5949       </attribute>
    6050       <layout class="QGridLayout" name="gridLayout_3">
     
    6656      <widget class="QWidget" name="dayViewTab">
    6757       <attribute name="title">
    68         <string>Day View</string>
     58        <string>&amp;Days</string>
    6959       </attribute>
    7060       <layout class="QGridLayout" name="gridLayout">
     
    7666      <widget class="QWidget" name="tracksTab">
    7767       <attribute name="title">
    78         <string>Tracks</string>
     68        <string>&amp;Tracks</string>
    7969       </attribute>
    8070       <layout class="QGridLayout" name="gridLayout_4">
     
    8676      <widget class="QWidget" name="roomsTab">
    8777       <attribute name="title">
    88         <string>Rooms</string>
     78        <string>&amp;Rooms</string>
    8979       </attribute>
    9080       <layout class="QGridLayout" name="gridLayout_8">
     
    9686      <widget class="QWidget" name="searchTab">
    9787       <attribute name="title">
    98         <string>Search</string>
     88        <string>&amp;Search</string>
    9989       </attribute>
    10090       <layout class="QHBoxLayout" name="horizontalLayout_1">
     
    143133   </attribute>
    144134   <addaction name="reloadAction"/>
    145    <addaction name="actionNow"/>
     135   <addaction name="nowAction"/>
     136   <addaction name="searchAction"/>
    146137  </widget>
    147138  <action name="conferencesAction">
    148139   <property name="text">
    149     <string>Conferences</string>
     140    <string>C&amp;onferences</string>
     141   </property>
     142   <property name="shortcut">
     143    <string>Ctrl+O</string>
    150144   </property>
    151145  </action>
    152146  <action name="settingsAction">
    153147   <property name="text">
    154     <string>Settings</string>
     148    <string>S&amp;ettings</string>
     149   </property>
     150   <property name="shortcut">
     151    <string>Ctrl+E</string>
    155152   </property>
    156153  </action>
    157154  <action name="aboutAction">
    158155   <property name="text">
    159     <string>About</string>
     156    <string>&amp;About</string>
    160157   </property>
    161158  </action>
     
    163160   <property name="text">
    164161    <string>&amp;Quit</string>
     162   </property>
     163   <property name="shortcut">
     164    <string>Ctrl+Q</string>
    165165   </property>
    166166  </action>
     
    180180   </property>
    181181  </action>
    182   <action name="actionNow">
     182  <action name="nowAction">
    183183   <property name="icon">
    184184    <iconset resource="../icons.qrc">
     
    192192   </property>
    193193  </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>&amp;Search</string>
     201   </property>
     202   <property name="shortcut">
     203    <string>Ctrl+F</string>
     204   </property>
     205  </action>
    194206 </widget>
    195207 <customwidgets>
     
    220232  </customwidget>
    221233  <customwidget>
    222    <class>NowTabContainer</class>
    223    <extends>QWidget</extends>
    224    <header>nowtabcontainer.h</header>
    225   </customwidget>
    226   <customwidget>
    227234   <class>DayNavigatorWidget</class>
    228235   <extends>QWidget</extends>
    229236   <header>daynavigatorwidget.h</header>
     237   <container>1</container>
    230238  </customwidget>
    231239 </customwidgets>
  • src/gui/searchtabcontainer.cpp

    ra9430aa r264f5e7  
    3434    header->setSizePolicy(sizePolicy);
    3535    header->setMinimumSize(QSize(10, 10));
    36 
    3736    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();
    6439}
    6540
    66 SearchTabContainer::~SearchTabContainer()
    67 {
     41
     42void SearchTabContainer::showSearchDialog() {
     43    header->show();
     44    treeView->hide();
    6845}
    6946
    70 void SearchTabContainer::searchButtonClicked()
    71 {
     47
     48void SearchTabContainer::searchButtonClicked() {
    7249    QHash<QString,QString> columns;
    7350
     
    11996        // TODO: display some message
    12097        treeView->hide();
    121         searchAgainButton->hide();
    122         dayNavigator->hide();
    12398        header->show();
    12499        QMessageBox::information(
     
    130105    else
    131106    {
    132         searchAgainButton->show();
    133         dayNavigator->show();
    134107        treeView->show();
    135108        header->hide();
    136109
    137110        updateTreeView( firstDateWithFounds );
    138         dayNavigator->setDates(firstDateWithFounds, lastDateWithFounds);
    139111    }
    140112}
    141113
    142 void SearchTabContainer::searchAgainClicked()
    143 {
    144     header->show();
    145     searchAgainButton->hide();
    146     dayNavigator->hide();
    147     treeView->hide();
    148 }
    149114
    150115void SearchTabContainer::loadEvents( const QDate &aDate, const int aConferenceId )
  • src/gui/searchtabcontainer.h

    ra9430aa r264f5e7  
    2222#define SEARCHTAB_H_
    2323
    24 #include <QWidget>
     24#include <QtGui>
    2525
    2626#include "tabcontainer.h"
     
    3131public:
    3232    SearchTabContainer(QWidget *aParent);
    33     virtual ~SearchTabContainer();
     33    virtual ~SearchTabContainer() {}
    3434protected:
    3535    virtual void loadEvents( const QDate &aDate, const int aConferenceId );
     36
    3637public slots:
    37     void searchAgainClicked(); // made it public - to show header when 1.st conf importing is done successfuly
     38    void showSearchDialog();
     39
    3840private slots:
    3941    void searchButtonClicked();
  • src/gui/tabcontainer.cpp

    ra9430aa r264f5e7  
    4545    treeView->setItemDelegate(new Delegate(treeView));
    4646
    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)));
    5048    connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    5149    connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &)));
    52 
    53     // day navigator is hidden by default
    54     dayNavigator->hide();
    5550}
    5651
     
    5853{
    5954    int active_id = Conference::activeConference();
    60     dayNavigator->show();
    6155    if (active_id > 0) {
    6256        loadEvents(aDate, active_id);
     
    7670    dialog.setFixedWidth(static_cast<QWidget*>(parent())->width());
    7771#endif
    78     connect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));
     72    connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool)));
    7973    dialog.exec();
    80     disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));
     74    disconnect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool)));
    8175}
    8276
     
    8781    dialog.setFixedWidth(static_cast<QWidget*>(parent())->width());
    8882#endif
    89     connect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));
     83    connect(&dialog, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool)));
    9084    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)));
    11286}
    11387
    11488
    115 void TabContainer::setCurDate(const QDate& curDate) {
     89void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) {
     90    /* if (aReloadModel) updateTreeView(dayNavigator->curDate());
     91    else */ static_cast<EventModel*>(treeView->model())->updateModel(aEventId);
     92}
     93
     94
     95void TabContainer::redisplayDate(const QDate& curDate) {
    11696    updateTreeView(curDate);
    11797}
    11898
    119 
    120 void TabContainer::setDates(const QDate &aStart, const QDate &aEnd)
    121 {
    122     dayNavigator->setDates(aStart, aEnd);
    123 }
    12499
    125100void TabContainer::clearModel()
  • src/gui/tabcontainer.h

    ra9430aa r264f5e7  
    4242
    4343signals:
    44     void eventHasChanged(int aEventId, bool aReloadModel);
     44    void eventChanged(int aEventId, bool aReloadModel);
    4545
    4646public 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);
    5049
    5150protected slots:
  • src/gui/tabcontainer.ui

    ra9430aa r264f5e7  
    2424    <number>0</number>
    2525   </property>
    26    <item row="0" column="2">
     26   <item row="0" column="1">
    2727    <layout class="QVBoxLayout" name="verticalLayout">
    2828     <item>
     
    4141    </layout>
    4242   </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>
    6343  </layout>
    6444 </widget>
    6545 <customwidgets>
    66   <customwidget>
    67    <class>DayNavigatorWidget</class>
    68    <extends>QWidget</extends>
    69    <header>daynavigatorwidget.h</header>
    70    <container>1</container>
    71   </customwidget>
    7246  <customwidget>
    7347   <class>TreeView</class>
     
    7650  </customwidget>
    7751 </customwidgets>
    78  <resources>
    79   <include location="../icons.qrc"/>
    80  </resources>
     52 <resources/>
    8153 <connections/>
    8254</ui>
Note: See TracChangeset for help on using the changeset viewer.