fix PageSites table error

This commit is contained in:
Ngoc Diep 2021-08-09 01:34:25 +07:00
parent d1a3545912
commit c687bb39ef
5 changed files with 55 additions and 27 deletions

View file

@ -120,45 +120,73 @@ Item {
UiLogic.onPushButtonSitesImportClicked(fileUrl)
}
}
TableView {
ListView {
id: tb
x: 20
y: 200
width: 341
height: 371
rowSpacing: 1
spacing: 1
clip: true
property int currentRow: -1
columnSpacing: 0
model: UiLogic.tableViewSitesModel
delegate: Item {
implicitWidth: 170
implicitWidth: 170 * 2
implicitHeight: 30
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: row !== tb.currentRow
}
Rectangle {
anchors.fill: parent
color: "#63B4FB"
visible: row === tb.currentRow
Item {
width: 170
height: 30
anchors.left: parent.left
id: c1
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index !== tb.currentRow
}
Rectangle {
anchors.fill: parent
color: "#63B4FB"
visible: index === tb.currentRow
}
Text {
text: url_path
anchors.fill: parent
leftPadding: 10
verticalAlignment: Text.AlignVCenter
}
}
Item {
anchors.left: c1.right
width: 170
height: 30
Rectangle {
anchors.top: parent.top
width: parent.width
height: 1
color: "lightgray"
visible: index !== tb.currentRow
}
Rectangle {
anchors.fill: parent
color: "#63B4FB"
visible: index === tb.currentRow
Text {
text: display
anchors.fill: parent
leftPadding: 10
verticalAlignment: Text.AlignVCenter
}
Text {
text: ip
anchors.fill: parent
leftPadding: 10
verticalAlignment: Text.AlignVCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
tb.currentRow = row
tb.currentRow = index
}
}
}

View file

@ -70,7 +70,7 @@ Item {
checked: UiLogic.pushButtonConnectChecked
onCheckedChanged: {
UiLogic.pushButtonConnectChecked = checked
UiLogic.onPushButtonConnectClicked()
UiLogic.onPushButtonConnectClicked(checked)
}
background: Image {
anchors.fill: parent

View file

@ -15,7 +15,7 @@ Window {
UiLogic.onCloseWindow()
}
// flags: Qt.FramelessWindowHint
flags: Qt.FramelessWindowHint
title: "AmneziaVPN"
function getPageComponent(page) {
switch (page) {

View file

@ -171,7 +171,7 @@ UiLogic::UiLogic(QObject *parent) :
m_pushButtonNewServerConnectEnabled{},
m_pushButtonNewServerConnectText{tr("Connect")},
m_dialogConnectErrorText{},
m_pageServerSettingsEnabled{false},
m_pageServerSettingsEnabled{true},
m_pushButtonServerSettingsClearText{tr("Clear server from Amnezia software")},
m_pageShareAmneziaVisible{true},
m_pageShareOpenvpnVisible{true},

View file

@ -651,6 +651,9 @@ public:
Q_INVOKABLE void onPushButtonForgetServer();
Q_INVOKABLE void onPushButtonServerSettingsClearClientCacheClicked();
Q_INVOKABLE void onLineEditServerSettingsDescriptionEditingFinished();
Q_INVOKABLE void updateSitesPage();
Q_INVOKABLE void updateServersListPage();
Q_INVOKABLE void updateProtocolsPage();
signals:
void frameWireguardSettingsVisibleChanged();
@ -1094,9 +1097,6 @@ private:
void setupSitesPageConnections();
void setupProtocolsPageConnections();
void updateSitesPage();
void updateServersListPage();
void updateProtocolsPage();
void updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData);
void updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData);
void updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData);