Get correct domain in address_dialog
Fixes #1509 Also clean up imports.
This commit is contained in:
@@ -16,23 +16,11 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys, time, datetime, re, threading
|
from electrum.i18n import _
|
||||||
from electrum.i18n import _, set_language
|
|
||||||
from electrum.util import print_error, print_msg
|
|
||||||
import os.path, json, ast, traceback
|
|
||||||
import shutil
|
|
||||||
import StringIO
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
import PyQt4
|
|
||||||
except Exception:
|
|
||||||
sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'")
|
|
||||||
|
|
||||||
|
import PyQt4
|
||||||
from PyQt4.QtGui import *
|
from PyQt4.QtGui import *
|
||||||
from PyQt4.QtCore import *
|
from PyQt4.QtCore import *
|
||||||
import PyQt4.QtCore as QtCore
|
|
||||||
|
|
||||||
|
|
||||||
from util import *
|
from util import *
|
||||||
from history_widget import HistoryWidget
|
from history_widget import HistoryWidget
|
||||||
@@ -63,16 +51,16 @@ class AddressDialog(QDialog):
|
|||||||
|
|
||||||
vbox.addWidget(QLabel(_("History")))
|
vbox.addWidget(QLabel(_("History")))
|
||||||
self.hw = HistoryWidget(self.parent)
|
self.hw = HistoryWidget(self.parent)
|
||||||
|
self.hw.get_domain = self.get_domain
|
||||||
vbox.addWidget(self.hw)
|
vbox.addWidget(self.hw)
|
||||||
|
|
||||||
vbox.addStretch(1)
|
vbox.addStretch(1)
|
||||||
vbox.addLayout(Buttons(CloseButton(self)))
|
vbox.addLayout(Buttons(CloseButton(self)))
|
||||||
self.format_amount = self.parent.format_amount
|
self.format_amount = self.parent.format_amount
|
||||||
|
self.hw.update()
|
||||||
|
|
||||||
h = self.wallet.get_history([self.address])
|
def get_domain(self):
|
||||||
self.hw.update(h)
|
return [self.address]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def show_qr(self):
|
def show_qr(self):
|
||||||
text = self.address
|
text = self.address
|
||||||
@@ -80,6 +68,3 @@ class AddressDialog(QDialog):
|
|||||||
self.parent.show_qrcode(text, 'Address')
|
self.parent.show_qrcode(text, 'Address')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.show_message(str(e))
|
self.show_message(str(e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,10 +55,13 @@ class HistoryWidget(MyTreeWidget):
|
|||||||
icon = QIcon(":icons/confirmed.png")
|
icon = QIcon(":icons/confirmed.png")
|
||||||
return icon, time_str
|
return icon, time_str
|
||||||
|
|
||||||
|
def get_domain(self):
|
||||||
|
'''Replaced in address_dialog.py'''
|
||||||
|
return self.wallet.get_account_addresses(self.parent.current_account)
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.wallet = self.parent.wallet
|
self.wallet = self.parent.wallet
|
||||||
domain = self.wallet.get_account_addresses(self.parent.current_account)
|
h = self.wallet.get_history(self.get_domain())
|
||||||
h = self.wallet.get_history(domain)
|
|
||||||
|
|
||||||
item = self.currentItem()
|
item = self.currentItem()
|
||||||
current_tx = item.data(0, Qt.UserRole).toString() if item else None
|
current_tx = item.data(0, Qt.UserRole).toString() if item else None
|
||||||
|
|||||||
Reference in New Issue
Block a user