Changeset d12c1e0


Ignore:
Timestamp:
12/12/11 23:53:04 (11 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
e21d164
Parents:
167a532
Message:

When the search toolbox button is clicked when the search dialog is already open, it is closed.

Location:
src/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r167a532 rd12c1e0  
    162162
    163163void MainWindow::on_searchAction_triggered() {
    164     searchTabContainer->showSearchDialog();
    165     tabWidget->setCurrentWidget(searchTab);
     164    if (tabWidget->currentWidget() == searchTab)
     165        searchTabContainer->showSearchDialog(!searchTabContainer->searchDialogIsVisible());
     166    else {
     167        tabWidget->setCurrentWidget(searchTab);
     168        searchTabContainer->showSearchDialog();
     169    }
    166170}
    167171
  • src/gui/searchtabcontainer.cpp

    r167a532 rd12c1e0  
    4040
    4141
     42bool SearchTabContainer::searchDialogIsVisible() const {
     43    return header->isVisible();
     44}
     45
     46
    4247int SearchTabContainer::searchResultCount(const QDate& date) const {
    4348    int confId = Conference::activeConference();
     
    4752
    4853
    49 void SearchTabContainer::showSearchDialog() {
    50     header->show();
    51     treeView->hide();
     54void SearchTabContainer::showSearchDialog(bool show) {
     55    header->setVisible(show);
     56    treeView->setVisible(!show);
    5257}
    5358
  • src/gui/searchtabcontainer.h

    r167a532 rd12c1e0  
    3232    SearchTabContainer(QWidget *aParent);
    3333    virtual ~SearchTabContainer() {}
     34    bool searchDialogIsVisible() const;
    3435    int searchResultCount(const QDate& date) const; ///< returns the number of events found on that specific date
    3536
     
    4142
    4243public slots:
    43     void showSearchDialog();
     44    void showSearchDialog(bool show=true);
    4445
    4546private slots:
Note: See TracChangeset for help on using the changeset viewer.