[Browser] Add Rules tab to ServerInfo

pull/176/merge
Koncord 8 years ago
parent db2b53c1b8
commit e53916da10

@ -50,6 +50,18 @@ void ServerInfoDialog::refresh()
listPlugins->addItem(QString::fromStdString(plugin.name)); listPlugins->addItem(QString::fromStdString(plugin.name));
} }
auto iter = sd.second.rules.begin();
for (int i = 0; iter != sd.second.rules.end(); i++, iter++)
{
if(i < 6)
continue;
QString rule = QString::fromStdString(iter->first) + " : ";
if(iter->second.type == 's')
rule += QString::fromStdString(iter->second.str);
else
rule += QString::number(iter->second.val);
listRules->addItem(rule);
}
lblPlayers->setText(QString::number(sd.second.players.size()) + " / " + QString::number(sd.second.GetMaxPlayers())); lblPlayers->setText(QString::number(sd.second.players.size()) + " / " + QString::number(sd.second.GetMaxPlayers()));
} }

@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Connect</string> <string>Connect</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -143,17 +143,34 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QTabWidget" name="tabW">
<property name="text"> <property name="currentIndex">
<string>Plugins:</string> <number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listPlugins">
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property> </property>
<widget class="QWidget" name="PagePlugins">
<attribute name="title">
<string>Plugins</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="listPlugins">
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="PageRules">
<attribute name="title">
<string>Rules</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QListWidget" name="listRules"/>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>

Loading…
Cancel
Save