UI: StatisticsPage: Add "Refresh" button.

This commit is contained in:
Nodir Temirkhodjaev 2017-12-10 12:07:36 +05:00
parent 0f5f60e030
commit d050e5e7de
3 changed files with 15 additions and 3 deletions

View File

@ -56,6 +56,8 @@ signals:
public slots:
void clear();
void refresh() { beginResetModel(); endResetModel(); }
private:
void updateRowCache(int row) const;

View File

@ -9,6 +9,8 @@ BasePage {
readonly property LogManager logManager: fortManager.logManager
readonly property AppBlockedModel appBlockedModel: logManager.appBlockedModel
readonly property IpListModel ipListModel:
appBlockedModel.ipListModel(currentAppPath)
readonly property string currentAppPath:
(appListView.currentIndex >= 0 && appListView.currentItem)
@ -95,7 +97,7 @@ BasePage {
Layout.fillHeight: true
spacing: 4
model: appBlockedModel.ipListModel(currentAppPath)
model: ipListModel
delegate: Label {
width: ipListView.width

View File

@ -10,6 +10,8 @@ BasePage {
readonly property LogManager logManager: fortManager.logManager
readonly property AppStatModel appStatModel: logManager.appStatModel
readonly property TrafListModel trafListModel:
appStatModel.trafListModel(tabBar.currentIndex, appListView.currentIndex)
readonly property string currentAppPath:
(appListView.currentIndex >= 0 && appListView.currentItem)
@ -27,6 +29,13 @@ BasePage {
spacing: 10
RowLayout {
Button {
enabled: appListView.currentIndex >= 0
text: translationManager.dummyBool
&& qsTranslate("qml", "Refresh")
onClicked: trafListModel.refresh()
}
Item {
Layout.fillWidth: true
}
@ -137,8 +146,7 @@ BasePage {
spacing: 4
clip: true
model: appStatModel.trafListModel(
tabBar.currentIndex, appListView.currentIndex)
model: trafListModel
delegate: TrafRow {}
}