[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));
}
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()));
}

@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Connect</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@ -143,17 +143,34 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Plugins:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listPlugins">
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
<widget class="QTabWidget" name="tabW">
<property name="currentIndex">
<number>0</number>
</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>
</item>
<item>

Loading…
Cancel
Save