QTfrontend/ui/page/pageroomslist.cpp
changeset 8183 9b1c206a6cf2
parent 8179 a1ffcb559f99
child 8453 06541556df53
equal deleted inserted replaced
8151:25b95d6224fc 8183:9b1c206a6cf2
    93     filterLayout->addWidget(searchText);
    93     filterLayout->addWidget(searchText);
    94     filterLayout->setStretchFactor(searchText, 2);
    94     filterLayout->setStretchFactor(searchText, 2);
    95 
    95 
    96     pageLayout->addLayout(filterLayout, 4, 0, 1, 2);
    96     pageLayout->addLayout(filterLayout, 4, 0, 1, 2);
    97 
    97 
    98     chatWidget = new HWChatWidget(this, m_gameSettings, false);
    98     chatWidget = new HWChatWidget(this, false);
    99     pageLayout->addWidget(chatWidget, 5, 0, 1, 3);
    99     pageLayout->addWidget(chatWidget, 5, 0, 1, 3);
   100     pageLayout->setRowStretch(5, 350);
   100     pageLayout->setRowStretch(5, 350);
   101 
   101 
   102     BtnCreate = addButton(tr("Create"), pageLayout, 0, 2);
   102     BtnCreate = addButton(tr("Create"), pageLayout, 0, 2);
   103     BtnJoin = addButton(tr("Join"), pageLayout, 1, 2);
   103     BtnJoin = addButton(tr("Join"), pageLayout, 1, 2);
   154     connect(roomsList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)),
   154     connect(roomsList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)),
   155             this, SLOT(onSortIndicatorChanged(int, Qt::SortOrder)));
   155             this, SLOT(onSortIndicatorChanged(int, Qt::SortOrder)));
   156 }
   156 }
   157 
   157 
   158 
   158 
   159 PageRoomsList::PageRoomsList(QWidget* parent, QSettings * gameSettings) :
   159 PageRoomsList::PageRoomsList(QWidget* parent) :
   160     AbstractPage(parent)
   160     AbstractPage(parent)
   161 {
   161 {
   162     m_gameSettings = gameSettings;
       
   163 
       
   164     roomsModel = NULL;
   162     roomsModel = NULL;
   165     stateFilteredModel = NULL;
   163     stateFilteredModel = NULL;
   166     schemeFilteredModel = NULL;
   164     schemeFilteredModel = NULL;
   167     weaponsFilteredModel = NULL;
   165     weaponsFilteredModel = NULL;
   168 
   166 
   610     else
   608     else
   611         weaponsFilteredModel->setFilterWildcard(
   609         weaponsFilteredModel->setFilterWildcard(
   612             QString("*%1*").arg(CBWeapons->currentText()));
   610             QString("*%1*").arg(CBWeapons->currentText()));
   613 }
   611 }
   614 
   612 
       
   613 void PageRoomsList::setSettings(QSettings *settings)
       
   614 {
       
   615     m_gameSettings = settings;
       
   616 }
   615 
   617 
   616 bool PageRoomsList::restoreHeaderState()
   618 bool PageRoomsList::restoreHeaderState()
   617 {
   619 {
   618     if (!m_gameSettings->contains("frontend/roomslist_header"))
   620     if (!m_gameSettings->contains("frontend/roomslist_header"))
   619         return false;
   621         return false;
   620     return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
   622     return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
   621         (m_gameSettings->value("frontend/roomslist_header").toString().toAscii())));
   623         (m_gameSettings->value("frontend/roomslist_header").toByteArray())));
   622 }
   624 }
   623 
   625 
   624 void PageRoomsList::saveHeaderState()
   626 void PageRoomsList::saveHeaderState()
   625 {
   627 {
   626     m_gameSettings->setValue("frontend/roomslist_header",
   628     m_gameSettings->setValue("frontend/roomslist_header",