Skip to content

Commit

Permalink
Namecoin: Add menu item to create a subdomain
Browse files Browse the repository at this point in the history
It doesn't actually do anything yet.
  • Loading branch information
JeremyRand committed Dec 12, 2019
1 parent 281d0b7 commit a74b22c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions electrum_nmc/electrum/gui/qt/configure_dns_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class Columns(IntEnum):
Columns.DATA: _('Data'),
}

TEXT_ADD_SUBDOMAIN = "Add Subdomain..."

def __init__(self, value, parent):
# We want to be a top-level window
QDialog.__init__(self, parent=None)
Expand All @@ -91,6 +93,9 @@ def __init__(self, value, parent):
subdomains.update([record[0] for record in records])

self.ui.comboDomain.addItems(list(subdomains))
self.ui.comboDomain.addItem(_(self.__class__.TEXT_ADD_SUBDOMAIN))

self.ui.comboDomain.activated.connect(self.domain_changed)

self.ui.listDNSRecords.setModel(QStandardItemModel(self))
self.ui.listDNSRecords.setSelectionMode(QAbstractItemView.ExtendedSelection)
Expand Down Expand Up @@ -121,6 +126,10 @@ def __init__(self, value, parent):

self.accepted.connect(lambda: self.name_dialog.set_value(self.get_value()))

def domain_changed(self, index):
if self.ui.comboDomain.itemText(index) == _(self.__class__.TEXT_ADD_SUBDOMAIN):
self.show_error(_("Adding a subdomain is not yet implemented."))

def get_selected_domain(self):
return self.ui.comboDomain.currentText()

Expand Down

0 comments on commit a74b22c

Please sign in to comment.