don't show gap limit in GUI
[electrum-nvc.git] / gui / gui_classic / main_window.py
index 341c5eb..42c3391 100644 (file)
@@ -206,7 +206,7 @@ class ElectrumWindow(QMainWindow):
         QShortcut(QKeySequence("Ctrl+PgDown"), self, lambda: tabs.setCurrentIndex( (tabs.currentIndex() + 1 )%tabs.count() ))
         
         self.connect(self, QtCore.SIGNAL('update_status'), self.update_status)
-        self.connect(self, QtCore.SIGNAL('banner_signal'), lambda: self.console.showMessage(self.wallet.interface.banner) )
+        self.connect(self, QtCore.SIGNAL('banner_signal'), lambda: self.console.showMessage(self.network.banner) )
         self.connect(self, QtCore.SIGNAL('transaction_signal'), lambda: self.notify_transactions() )
 
         self.history_list.setFocus(True)
@@ -240,7 +240,7 @@ class ElectrumWindow(QMainWindow):
         self.setWindowTitle( title )
         self.update_wallet()
         # set initial message
-        self.console.showMessage(self.wallet.interface.banner)
+        self.console.showMessage(self.network.banner)
         # Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized
         self.notify_transactions()
 
@@ -281,13 +281,11 @@ class ElectrumWindow(QMainWindow):
             self.show_message("file not found "+ filename)
             return
 
-        interface = self.wallet.interface
-        blockchain = self.wallet.verifier.blockchain
         self.wallet.stop_threads()
         
         # create new wallet 
         wallet = Wallet(storage)
-        wallet.start_threads(interface, blockchain)
+        wallet.start_threads(network)
 
         self.load_wallet(wallet)
 
@@ -302,7 +300,7 @@ class ElectrumWindow(QMainWindow):
         storage = WalletStorage({'wallet_path': filename})
         assert not storage.file_exists
 
-        wizard = installwizard.InstallWizard(self.config, self.wallet.interface, self.wallet.verifier.blockchain, storage)
+        wizard = installwizard.InstallWizard(self.config, self.network, storage)
         wallet = wizard.run()
         if wallet: 
             self.load_wallet(wallet)
@@ -386,23 +384,36 @@ class ElectrumWindow(QMainWindow):
         ex_labels.triggered.connect(self.do_export_labels)
 
         help_menu = menubar.addMenu(_("&Help"))
-        doc_open = help_menu.addAction(_("&Documentation"))
-        doc_open.triggered.connect(lambda: webbrowser.open("http://electrum.org/documentation.html"))
+        show_about = help_menu.addAction(_("&About"))
+        show_about.triggered.connect(self.show_about)
         web_open = help_menu.addAction(_("&Official website")) 
         web_open.triggered.connect(lambda: webbrowser.open("http://electrum.org"))
 
+        help_menu.addSeparator()
+        doc_open = help_menu.addAction(_("&Documentation"))
+        doc_open.triggered.connect(lambda: webbrowser.open("http://electrum.org/documentation.html"))
+        report_bug = help_menu.addAction(_("&Report Bug"))
+        report_bug.triggered.connect(self.show_report_bug)
+
         self.setMenuBar(menubar)
 
+    def show_about(self):
+        QMessageBox.about(self, "Electrum",
+            _("Version")+" %s" % (self.wallet.electrum_version) + "\n\n" + _("Electrum's focus is speed, with low resource usage and simplifying Bitcoin. You do not need to perform regular backups, because your wallet can be recovered from a secret phrase that you can memorize or write on paper. Startup times are instant because it operates in conjunction with high-performance servers that handle the most complicated parts of the Bitcoin system."))
+
+    def show_report_bug(self):
+        QMessageBox.information(self, "Electrum - " + _("Reporting Bugs"),
+            _("Please report any bugs as issues on github:")+" <a href=\"https://github.com/spesmilo/electrum/issues\">https://github.com/spesmilo/electrum/issues</a>")
 
 
     def notify_transactions(self):
         print_error("Notifying GUI")
-        if len(self.wallet.interface.pending_transactions_for_notifications) > 0:
+        if len(self.network.interface.pending_transactions_for_notifications) > 0:
             # Combine the transactions if there are more then three
-            tx_amount = len(self.wallet.interface.pending_transactions_for_notifications)
+            tx_amount = len(self.network.interface.pending_transactions_for_notifications)
             if(tx_amount >= 3):
                 total_amount = 0
-                for tx in self.wallet.interface.pending_transactions_for_notifications:
+                for tx in self.network.interface.pending_transactions_for_notifications:
                     is_relevant, is_mine, v, fee = self.wallet.get_tx_value(tx)
                     if(v > 0):
                         total_amount += v
@@ -410,11 +421,11 @@ class ElectrumWindow(QMainWindow):
                 self.notify("%s new transactions received. Total amount received in the new transactions %s %s" \
                                 % (tx_amount, self.format_amount(total_amount), self.base_unit()))
 
-                self.wallet.interface.pending_transactions_for_notifications = []
+                self.network.interface.pending_transactions_for_notifications = []
             else:
-              for tx in self.wallet.interface.pending_transactions_for_notifications:
+              for tx in self.network.interface.pending_transactions_for_notifications:
                   if tx:
-                      self.wallet.interface.pending_transactions_for_notifications.remove(tx)
+                      self.network.interface.pending_transactions_for_notifications.remove(tx)
                       is_relevant, is_mine, v, fee = self.wallet.get_tx_value(tx)
                       if(v > 0):
                           self.notify("New transaction received. %s %s" % (self.format_amount(v), self.base_unit()))
@@ -522,7 +533,7 @@ class ElectrumWindow(QMainWindow):
         return "BTC" if self.decimal_point == 8 else "mBTC"
 
     def update_status(self):
-        if self.wallet.interface and self.wallet.interface.is_connected:
+        if self.network.interface and self.network.interface.is_connected:
             if not self.wallet.up_to_date:
                 text = _("Synchronizing...")
                 icon = QIcon(":icons/status_waiting.png")
@@ -542,7 +553,7 @@ class ElectrumWindow(QMainWindow):
 
     def update_wallet(self):
         self.update_status()
-        if self.wallet.up_to_date or not self.wallet.interface.is_connected:
+        if self.wallet.up_to_date or not self.network.interface.is_connected:
             self.update_history_tab()
             self.update_receive_tab()
             self.update_contacts_tab()
@@ -1295,7 +1306,7 @@ class ElectrumWindow(QMainWindow):
         console.updateNamespace({'wallet' : self.wallet, 'network' : self.network, 'gui':self})
         console.updateNamespace({'util' : util, 'bitcoin':bitcoin})
 
-        c = commands.Commands(self.wallet, self.wallet.interface, lambda: self.console.set_json(True))
+        c = commands.Commands(self.wallet, self.network.interface, lambda: self.console.set_json(True))
         methods = {}
         def mkfunc(f, method):
             return lambda *args: apply( f, (method, args, self.password_dialog ))
@@ -2008,22 +2019,6 @@ class ElectrumWindow(QMainWindow):
         grid_wallet.addWidget(HelpButton(_('Using change addresses makes it more difficult for other people to track your transactions.')+' '), 1, 3)
         if not self.config.is_modifiable('use_change'): usechange_cb.setEnabled(False)
 
-        gap_label = QLabel(_('Gap limit'))
-        grid_wallet.addWidget(gap_label, 2, 0)
-        gap_e = AmountEdit(None,True)
-        gap_e.setText("%d"% self.wallet.gap_limit)
-        grid_wallet.addWidget(gap_e, 2, 2)
-        msg =  _('The gap limit is the maximal number of contiguous unused addresses in your sequence of receiving addresses.') + '\n' \
-              + _('You may increase it if you need more receiving addresses.') + '\n\n' \
-              + _('Your current gap limit is') + ': %d'%self.wallet.gap_limit + '\n' \
-              + _('Given the current status of your address sequence, the minimum gap limit you can use is:')+' ' + '%d'%self.wallet.min_acceptable_gap() + '\n\n' \
-              + _('Warning') + ': ' \
-              + _('The gap limit parameter must be provided in order to recover your wallet from seed.') + ' ' \
-              + _('Do not modify it if you do not understand what you are doing, or if you expect to recover your wallet without knowing it!') + '\n\n' 
-        grid_wallet.addWidget(HelpButton(msg), 2, 3)
-        if not self.config.is_modifiable('gap_limit'):
-            for w in [gap_e, gap_label]: w.setEnabled(False)
-
         units = ['BTC', 'mBTC']
         unit_label = QLabel(_('Base unit'))
         grid_wallet.addWidget(unit_label, 3, 0)