mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-07 12:47:26 -04:00
Merge pull request #128
689f041 Report when the GUI is connected to a daemon with mismatched version (moneromooo.monero)
This commit is contained in:
@@ -27,10 +27,35 @@
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import QtQuick 2.0
|
||||
import moneroComponents.Wallet 1.0
|
||||
|
||||
Row {
|
||||
id: item
|
||||
property bool connected: false
|
||||
property var connected: Wallet.ConnectionStatus_Disconnected
|
||||
|
||||
function getConnectionStatusImage(status) {
|
||||
if (status == Wallet.ConnectionStatus_Connected)
|
||||
return "../images/statusConnected.png"
|
||||
else
|
||||
return "../images/statusDisconnected.png"
|
||||
}
|
||||
|
||||
function getConnectionStatusColor(status) {
|
||||
if (status == Wallet.ConnectionStatus_Connected)
|
||||
return "#FF6C3B"
|
||||
else
|
||||
return "#AAAAAA"
|
||||
}
|
||||
|
||||
function getConnectionStatusString(status) {
|
||||
if (status == Wallet.ConnectionStatus_Connected)
|
||||
return qsTr("Connected")
|
||||
if (status == Wallet.ConnectionStatus_WrongVersion)
|
||||
return qsTr("Wrong version")
|
||||
if (status == Wallet.ConnectionStatus_Disconnected)
|
||||
return qsTr("Disconnected")
|
||||
return qsTr("Invalid connection status")
|
||||
}
|
||||
|
||||
Item {
|
||||
id: iconItem
|
||||
@@ -40,8 +65,7 @@ Row {
|
||||
|
||||
Image {
|
||||
anchors.centerIn: parent
|
||||
source: item.connected ? "../images/statusConnected.png" :
|
||||
"../images/statusDisconnected.png"
|
||||
source: getConnectionStatusImage(item.connected)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +86,8 @@ Row {
|
||||
anchors.left: parent.left
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 18
|
||||
color: item.connected ? "#FF6C3B" : "#AAAAAA"
|
||||
text: (item.connected ? qsTr("Connected") : qsTr("Disconnected")) + translationManager.emptyString
|
||||
color: getConnectionStatusColor(item.connected)
|
||||
text: getConnectionStatusString(item.connected) + translationManager.emptyString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user