simple_config: factor out self.decimal_point and self.get_decimal_point() in favor of self.BTC_AMOUNTS_DECIMAL_POINT
This commit is contained in:
@@ -387,4 +387,4 @@ class QEConfig(AuthMixin, QObject):
|
||||
|
||||
@pyqtSlot('quint64', result=float)
|
||||
def satsToUnits(self, satoshis):
|
||||
return satoshis / pow(10, self.config.decimal_point)
|
||||
return satoshis / pow(10, self.config.BTC_AMOUNTS_DECIMAL_POINT)
|
||||
|
||||
@@ -1005,7 +1005,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
|
||||
return self.config.format_fee_rate(fee_rate)
|
||||
|
||||
def get_decimal_point(self):
|
||||
return self.config.get_decimal_point()
|
||||
return self.config.BTC_AMOUNTS_DECIMAL_POINT
|
||||
|
||||
def base_unit(self):
|
||||
return self.config.get_base_unit()
|
||||
|
||||
@@ -97,7 +97,7 @@ class SettingsDialog(QDialog, QtEventListener):
|
||||
nz_label = HelpLabel.from_configvar(self.config.cv.BTC_AMOUNTS_FORCE_NZEROS_AFTER_DECIMAL_POINT)
|
||||
nz = QSpinBox()
|
||||
nz.setMinimum(0)
|
||||
nz.setMaximum(self.config.decimal_point)
|
||||
nz.setMaximum(self.config.BTC_AMOUNTS_DECIMAL_POINT)
|
||||
nz.setValue(self.config.num_zeros)
|
||||
if not self.config.cv.BTC_AMOUNTS_FORCE_NZEROS_AFTER_DECIMAL_POINT.is_modifiable():
|
||||
for w in [nz, nz_label]: w.setEnabled(False)
|
||||
@@ -205,7 +205,7 @@ class SettingsDialog(QDialog, QtEventListener):
|
||||
if self.config.get_base_unit() == unit_result:
|
||||
return
|
||||
self.config.set_base_unit(unit_result)
|
||||
nz.setMaximum(self.config.decimal_point)
|
||||
nz.setMaximum(self.config.BTC_AMOUNTS_DECIMAL_POINT)
|
||||
self.app.refresh_tabs_signal.emit()
|
||||
self.app.update_status_signal.emit()
|
||||
self.app.refresh_amount_edits_signal.emit()
|
||||
|
||||
@@ -615,7 +615,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
||||
x = Decimal(text)
|
||||
except Exception:
|
||||
return None
|
||||
power = pow(10, self.config.get_decimal_point())
|
||||
power = pow(10, self.config.BTC_AMOUNTS_DECIMAL_POINT)
|
||||
return int(power * x)
|
||||
|
||||
def read_invoice(self):
|
||||
|
||||
Reference in New Issue
Block a user