remember lobby nick list sorting settings

This commit is contained in:
doitux
2010-08-30 10:41:56 +00:00
parent 35b3edfa12
commit 2d3e38f670
3 changed files with 11 additions and 99 deletions
+2 -1
View File
@@ -50,7 +50,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
myConfigState = OK; myConfigState = OK;
// !!!! Revisionsnummer der Configdefaults !!!!! // !!!! Revisionsnummer der Configdefaults !!!!!
configRev = 84; configRev = 85;
//standard defaults //standard defaults
logOnOffDefault = "1"; logOnOffDefault = "1";
@@ -266,6 +266,7 @@ ConfigFile::ConfigFile(char *argv0, bool readonly) : noWriteAccess(readonly)
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingSection", CONFIG_TYPE_INT, "2")); configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingSection", CONFIG_TYPE_INT, "2"));
configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingOrder", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("DlgGameLobbyGameListSortingOrder", CONFIG_TYPE_INT, "1"));
configList.push_back(ConfigInfo("DlgGameLobbyGameListFilterIndex", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("DlgGameLobbyGameListFilterIndex", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("DlgGameLobbyNickListSortFilterIndex", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("GameTableFullScreenSave", CONFIG_TYPE_INT, "0")); configList.push_back(ConfigInfo("GameTableFullScreenSave", CONFIG_TYPE_INT, "0"));
configList.push_back(ConfigInfo("GameTableHeightSave", CONFIG_TYPE_INT, "600")); configList.push_back(ConfigInfo("GameTableHeightSave", CONFIG_TYPE_INT, "600"));
configList.push_back(ConfigInfo("GameTableWidthSave", CONFIG_TYPE_INT, "1024")); configList.push_back(ConfigInfo("GameTableWidthSave", CONFIG_TYPE_INT, "1024"));
+2 -2
View File
@@ -851,12 +851,12 @@ p, li { white-space: pre-wrap; }
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Sort by flag</string> <string>Sort by country</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Filter idle players</string> <string>Display idle players</string>
</property> </property>
</item> </item>
</widget> </widget>
@@ -1271,9 +1271,6 @@ void gameLobbyDialogImpl::writeDialogSettings(int saveMode)
{ {
switch(saveMode) { switch(saveMode) {
case 0: { case 0: {
// myConfig->writeConfigInt("DlgGameLobbyGameListSortingSection", myGameListSortFilterProxyModel->sortColumn());
// myConfig->writeConfigInt("DldgGameLobbyGameListSortingOrder", myGameListSortFilterProxyModel->sortOrder());
// qt 4.4.* compatibility
QHeaderView *header = treeView_GameList->header(); QHeaderView *header = treeView_GameList->header();
myConfig->writeConfigInt("DlgGameLobbyGameListSortingSection", header->sortIndicatorSection()); myConfig->writeConfigInt("DlgGameLobbyGameListSortingSection", header->sortIndicatorSection());
myConfig->writeConfigInt("DlgGameLobbyGameListSortingOrder", header->sortIndicatorOrder()); myConfig->writeConfigInt("DlgGameLobbyGameListSortingOrder", header->sortIndicatorOrder());
@@ -1283,8 +1280,13 @@ void gameLobbyDialogImpl::writeDialogSettings(int saveMode)
myConfig->writeConfigInt("DlgGameLobbyGameListFilterIndex", comboBox_gameListFilter->currentIndex()); myConfig->writeConfigInt("DlgGameLobbyGameListFilterIndex", comboBox_gameListFilter->currentIndex());
} }
break; break;
case 2: {
myConfig->writeConfigInt("DlgGameLobbyNickListSortFilterIndex", comboBox_nickListFilter->currentIndex());
}
break;
default:; default:;
} }
myConfig->writeBuffer(); myConfig->writeBuffer();
} }
@@ -1292,6 +1294,7 @@ void gameLobbyDialogImpl::readDialogSettings()
{ {
comboBox_gameListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyGameListFilterIndex")); comboBox_gameListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyGameListFilterIndex"));
treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") ); treeView_GameList->sortByColumn(myConfig->readConfigInt("DlgGameLobbyGameListSortingSection"), (Qt::SortOrder)myConfig->readConfigInt("DlgGameLobbyGameListSortingOrder") );
comboBox_nickListFilter->setCurrentIndex(myConfig->readConfigInt("DlgGameLobbyNickListSortFilterIndex"));
} }
void gameLobbyDialogImpl::changeGameListFilter(int index) { void gameLobbyDialogImpl::changeGameListFilter(int index) {
@@ -1331,50 +1334,7 @@ void gameLobbyDialogImpl::changeGameListFilter(int index) {
myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp()); myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp());
myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString)); myGameListSortFilterProxyModel->setColumn4RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString));
} }
break; break;
// case 5: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString));
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("nonpriv", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
// case 6: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp("open", Qt::CaseInsensitive, QRegExp::FixedString));
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
// case 7: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString));
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp());
// }
// break;
// case 8: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString));
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("nonpriv", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
// case 9: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp("nonfull", Qt::CaseInsensitive, QRegExp::FixedString));
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
// case 10: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("nonpriv", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
// case 11: {
// myGameListSortFilterProxyModel->setColumn1RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn2RegExp(QRegExp());
// myGameListSortFilterProxyModel->setColumn3RegExp(QRegExp("private", Qt::CaseInsensitive, QRegExp::FixedString));
// }
// break;
default:; default:;
} }
myGameListSortFilterProxyModel->setFilterRegExp(QString()); myGameListSortFilterProxyModel->setFilterRegExp(QString());
@@ -1395,21 +1355,7 @@ void gameLobbyDialogImpl::changeNickListFilter(int state)
myNickListSortFilterProxyModel->setFilterRegExp(QString()); myNickListSortFilterProxyModel->setFilterRegExp(QString());
myNickListSortFilterProxyModel->setFilterKeyColumn(0); myNickListSortFilterProxyModel->setFilterKeyColumn(0);
// switch(state) { writeDialogSettings(2);
// case 0: {
//
// }
// break;
// case 1: {
//
// }
// break;
// case 2: {
//
// }
// break;
// }
} }
void gameLobbyDialogImpl::changeGameListSorting() { void gameLobbyDialogImpl::changeGameListSorting() {
@@ -1417,41 +1363,6 @@ void gameLobbyDialogImpl::changeGameListSorting() {
writeDialogSettings(0); writeDialogSettings(0);
} }
//<item>
// <property name="text">
// <string>5 - Show open &amp; non-private games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>6 - Show open &amp; private games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>7 - Show non-full games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>8 - Show non-full &amp; non-private games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>9 - Show non-full &amp; private games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>10 - Show non-private games</string>
// </property>
// </item>
// <item>
// <property name="text">
// <string>11 - Show private games</string>
// </property>
// </item>
void gameLobbyDialogImpl::registeredUserMode() void gameLobbyDialogImpl::registeredUserMode()
{ {