mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
b3f8af8e06
Qml code referring to the old code base commented out, but not deleted, due to easier refactoring the rest of the app.
78 lines
2.4 KiB
QML
78 lines
2.4 KiB
QML
pragma Singleton
|
|
|
|
import QtQuick 2.13
|
|
|
|
import utils 1.0
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
// Not Refactored Yet
|
|
// property string activeChannelName: chatsModel.channelView.activeChannel.name
|
|
|
|
// Not Refactored Yet
|
|
// property var currentNetwork: profileModel.network.current
|
|
|
|
property bool currentTabConnected: false
|
|
|
|
function getUrlFromUserInput(input) {
|
|
// Not Refactored Yet
|
|
// return utilsModel.urlFromUserInput(input)
|
|
}
|
|
|
|
function getAscii2Hex(input) {
|
|
// Not Refactored Yet
|
|
// return utilsModel.ascii2Hex(input)
|
|
}
|
|
|
|
function getHex2Ascii(input) {
|
|
// Not Refactored Yet
|
|
// return utilsModel.hex2Ascii(input)
|
|
}
|
|
|
|
function getWei2Eth(wei,decimals) {
|
|
// Not Refactored Yet
|
|
// return utilsModel.wei2Eth(wei,decimals)
|
|
}
|
|
|
|
function generateIdenticon(pk) {
|
|
// Not Refactored Yet
|
|
// return utilsModel.generateIdenticon(pk)
|
|
}
|
|
|
|
function get0xFormedUrl(browserExplorer, url) {
|
|
var tempUrl = ""
|
|
switch (browserExplorer) {
|
|
case Constants.browserEthereumExplorerEtherscan:
|
|
if (url.length > 42) {
|
|
tempUrl = "https://etherscan.io/tx/" + url; break;
|
|
} else {
|
|
tempUrl = "https://etherscan.io/address/" + url; break;
|
|
}
|
|
case Constants.browserEthereumExplorerEthplorer:
|
|
if (url.length > 42) {
|
|
tempUrl = "https://ethplorer.io/tx/" + url; break;
|
|
} else {
|
|
tempUrl = "https://ethplorer.io/address/" + url; break;
|
|
}
|
|
case Constants.browserEthereumExplorerBlockchair:
|
|
if (url.length > 42) {
|
|
tempUrl = "https://blockchair.com/ethereum/transaction/" + url; break;
|
|
} else {
|
|
tempUrl = "https://blockchair.com/ethereum/address/" + url; break;
|
|
}
|
|
}
|
|
return tempUrl
|
|
}
|
|
|
|
function getFormedUrl(shouldShowBrowserSearchEngine, url) {
|
|
var tempUrl = ""
|
|
switch (localAccountSensitiveSettings.shouldShowBrowserSearchEngine) {
|
|
case Constants.browserSearchEngineGoogle: tempUrl = "https://www.google.com/search?q=" + url; break;
|
|
case Constants.browserSearchEngineYahoo: tempUrl = "https://search.yahoo.com/search?p=" + url; break;
|
|
case Constants.browserSearchEngineDuckDuckGo: tempUrl = "https://duckduckgo.com/?q=" + url; break;
|
|
}
|
|
return tempUrl
|
|
}
|
|
}
|