QTfrontend/ui/page/pageroomslist.h
changeset 8453 06541556df53
parent 8179 a1ffcb559f99
child 8623 93645b4ba0de
equal deleted inserted replaced
8452:170afc3ac39f 8453:06541556df53
    17  */
    17  */
    18 
    18 
    19 #ifndef PAGE_ROOMLIST_H
    19 #ifndef PAGE_ROOMLIST_H
    20 #define PAGE_ROOMLIST_H
    20 #define PAGE_ROOMLIST_H
    21 
    21 
       
    22 #include <QTableView>
    22 #include "AbstractPage.h"
    23 #include "AbstractPage.h"
    23 
    24 
    24 class HWChatWidget;
    25 class HWChatWidget;
    25 class AmmoSchemeModel;
    26 class AmmoSchemeModel;
    26 class QTableView;
    27 class QTableView;
    27 class RoomsListModel;
    28 class RoomsListModel;
    28 class QSortFilterProxyModel;
    29 class QSortFilterProxyModel;
       
    30 
       
    31 class RoomTableView : public QTableView
       
    32 {
       
    33     friend class PageRoomsList;
       
    34 
       
    35     public:
       
    36         RoomTableView(QWidget* parent = 0) : QTableView(parent){}
       
    37 };
    29 
    38 
    30 class PageRoomsList : public AbstractPage
    39 class PageRoomsList : public AbstractPage
    31 {
    40 {
    32         Q_OBJECT
    41         Q_OBJECT
    33 
    42 
    36         void displayError(const QString & message);
    45         void displayError(const QString & message);
    37         void displayNotice(const QString & message);
    46         void displayNotice(const QString & message);
    38         void displayWarning(const QString & message);
    47         void displayWarning(const QString & message);
    39         void setSettings(QSettings * settings);
    48         void setSettings(QSettings * settings);
    40 
    49 
    41         QLineEdit * roomName;
       
    42         QLineEdit * searchText;
    50         QLineEdit * searchText;
    43         QTableView * roomsList;
    51         RoomTableView * roomsList;
    44         QPushButton * BtnCreate;
    52         QPushButton * BtnCreate;
    45         QPushButton * BtnJoin;
    53         QPushButton * BtnJoin;
    46         QPushButton * BtnAdmin;
    54         QPushButton * BtnAdmin;
    47         QPushButton * BtnClear;
    55         QPushButton * BtnClear;
    48         QComboBox * CBState;
    56         QComboBox * CBState;
    76         void onClearClick();
    84         void onClearClick();
    77         void onJoinConfirmation(const QString &);
    85         void onJoinConfirmation(const QString &);
    78         void onSortIndicatorChanged(int logicalIndex, Qt::SortOrder order);
    86         void onSortIndicatorChanged(int logicalIndex, Qt::SortOrder order);
    79         void onFilterChanged();
    87         void onFilterChanged();
    80         void saveHeaderState();
    88         void saveHeaderState();
       
    89         void onRoomNameChosen(const QString &);
       
    90         void roomSelectionChanged(const QModelIndex &, const QModelIndex &);
       
    91         void moveSelectionUp();
       
    92         void moveSelectionDown();
    81 
    93 
    82     private:
    94     private:
    83         QSettings * m_gameSettings;
    95         QSettings * m_gameSettings;
    84         QSortFilterProxyModel * roomsModel;
    96         QSortFilterProxyModel * roomsModel;
    85         QSortFilterProxyModel * stateFilteredModel;
    97         QSortFilterProxyModel * stateFilteredModel;
    86         QSortFilterProxyModel * schemeFilteredModel;
    98         QSortFilterProxyModel * schemeFilteredModel;
    87         QSortFilterProxyModel * weaponsFilteredModel;
    99         QSortFilterProxyModel * weaponsFilteredModel;
       
   100         QAction * showGamesInLobby;
       
   101         QAction * showGamesInProgress;
    88 
   102 
    89         AmmoSchemeModel * ammoSchemeModel;
   103         AmmoSchemeModel * ammoSchemeModel;
    90 
   104 
    91         bool restoreHeaderState();
   105         bool restoreHeaderState();
    92 };
   106 };