<commit_before>import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0

import "utils.js" as Utils
import org.BitShares.Types 1.0

import Material 0.1

Window {
   id: window
   visible: true

   property alias pageStack: __pageStack
   property alias lockAction: __lockAction
   property alias payAction: __payAction

   Component.onCompleted: {
      if( wallet.walletExists )
         wallet.openWallet()
      if( !( wallet.accountNames.length && wallet.accounts[wallet.accountNames[0]].isRegistered ) )
         onboardLoader.sourceComponent = onboardingUi
      else
         pageStack.push({item: assetsUi, properties: {accountName: wallet.accountNames[0]}})

      window.connectToServer()
   }

   function showError(error, buttonName, buttonCallback) {
      snack.text = error
      if( buttonName && buttonCallback ) {
         snack.buttonText = buttonName
         snack.onClick.connect(buttonCallback)
         snack.onDissapear.connect(function() {
            snack.onClick.disconnect(buttonCallback)
         })
      } else
         snack.buttonText = ""
      snack.open()
   }
   function deviceType() {
      switch(Device.type) {
      case Device.phone:
      case Device.phablet:
         return "phone"
      case Device.tablet:
         return "tablet"
      case Device.desktop:
      default:
         return "computer"
      }
   }
   function connectToServer() {
      if( !wallet.connected )
         wallet.connectToServer("localhost", 5657, "DVS8GV6nP15gBZQbuEGamH95gYR5EioxkUbEYjpDHMjPEeRWsvR63")
   }
   function openTransferPage() {
      //TODO: Add arguments which prefill items in transfer page
      if( wallet.accounts[wallet.accountNames[0]].availableAssets.length )
         window.pageStack.push({item: transferUi, properties: {accountName: wallet.accountNames[0]}})
      else
         showError(qsTr("You don't have any assets, so you cannot make a transfer."), qsTr("Refresh Balances"),
                   wallet.syncAllBalances)
   }


   AppTheme {
      id: theme
      primaryColor: "#2196F3"
      backgroundColor: "#BBDEFB"
      accentColor: "#80D8FF"
   }
   Action {
      id: __lockAction
      name: qsTr("Lock Wallet")
      iconName: "action/lock"
      onTriggered: wallet.lockWallet()
   }
   Action {
      id: __payAction
      name: qsTr("Send Payment")
      iconName: "action/payment"
      onTriggered: openTransferPage()
   }
   QtObject {<commit_msg>Point DVS LW at my server<commit_after>import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0

import "utils.js" as Utils
import org.BitShares.Types 1.0

import Material 0.1

Window {
   id: window
   visible: true

   property alias pageStack: __pageStack
   property alias lockAction: __lockAction
   property alias payAction: __payAction

   Component.onCompleted: {
      if( wallet.walletExists )
         wallet.openWallet()
      if( !( wallet.accountNames.length && wallet.accounts[wallet.accountNames[0]].isRegistered ) )
         onboardLoader.sourceComponent = onboardingUi
      else
         pageStack.push({item: assetsUi, properties: {accountName: wallet.accountNames[0]}})

      window.connectToServer()
   }

   function showError(error, buttonName, buttonCallback) {
      snack.text = error
      if( buttonName && buttonCallback ) {
         snack.buttonText = buttonName
         snack.onClick.connect(buttonCallback)
         snack.onDissapear.connect(function() {
            snack.onClick.disconnect(buttonCallback)
         })
      } else
         snack.buttonText = ""
      snack.open()
   }
   function deviceType() {
      switch(Device.type) {
      case Device.phone:
      case Device.phablet:
         return "phone"
      case Device.tablet:
         return "tablet"
      case Device.desktop:
      default:
         return "computer"
      }
   }
   function connectToServer() {
      if( !wallet.connected )
         wallet.connectToServer("nathanhourt.com", 5657, "DVS8GV6nP15gBZQbuEGamH95gYR5EioxkUbEYjpDHMjPEeRWsvR63")
   }
   function openTransferPage() {
      //TODO: Add arguments which prefill items in transfer page
      if( wallet.accounts[wallet.accountNames[0]].availableAssets.length )
         window.pageStack.push({item: transferUi, properties: {accountName: wallet.accountNames[0]}})
      else
         showError(qsTr("You don't have any assets, so you cannot make a transfer."), qsTr("Refresh Balances"),
                   wallet.syncAllBalances)
   }


   AppTheme {
      id: theme
      primaryColor: "#2196F3"
      backgroundColor: "#BBDEFB"
      accentColor: "#80D8FF"
   }
   Action {
      id: __lockAction
      name: qsTr("Lock Wallet")
      iconName: "action/lock"
      onTriggered: wallet.lockWallet()
   }
   Action {
      id: __payAction
      name: qsTr("Send Payment")
      iconName: "action/payment"
      onTriggered: openTransferPage()
   }
   QtObject {
{'fraction_non_alphanumeric': 0.09794022617124394, 'fraction_numerical': 0.01494345718901454, 'mean_word_length': 2.682527881040892, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7371972', 'n_tokens_mistral': 1565, 'n_tokens_neox': 1527, 'n_words': 327}