diff --git a/electrum/gui/icons/pen.png b/electrum/gui/icons/pen.png index 74b9468e5..40e73a305 100644 Binary files a/electrum/gui/icons/pen.png and b/electrum/gui/icons/pen.png differ diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 68c84f1ec..9426d74df 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -210,6 +210,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): self.addresses_tab = self.create_addresses_tab() self.utxo_tab = self.create_utxo_tab() self.console_tab = self.create_console_tab() + self.notes_tab = self.create_notes_tab() self.contacts_tab = self.create_contacts_tab() self.channels_tab = self.create_channels_tab() tabs.addTab(self.create_history_tab(), read_QIcon("tab_history.png"), _('History')) @@ -228,6 +229,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): add_optional_tab(tabs, self.utxo_tab, read_QIcon("tab_coins.png"), _("Co&ins")) add_optional_tab(tabs, self.contacts_tab, read_QIcon("tab_contacts.png"), _("Con&tacts")) add_optional_tab(tabs, self.console_tab, read_QIcon("tab_console.png"), _("Con&sole")) + add_optional_tab(tabs, self.notes_tab, read_QIcon("pen.png"), _("&Notes")) tabs.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) @@ -738,6 +740,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): add_toggle_action(view_menu, self.channels_tab) add_toggle_action(view_menu, self.contacts_tab) add_toggle_action(view_menu, self.console_tab) + add_toggle_action(view_menu, self.notes_tab) tools_menu = menubar.addMenu(_("&Tools")) # type: QMenu preferences_action = tools_menu.addAction(_("Preferences"), self.settings_dialog) # type: QAction @@ -1562,6 +1565,15 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): console.is_shown_cv = self.config.cv.GUI_QT_SHOW_TAB_CONSOLE return console + def create_notes_tab(self): + from PyQt5 import QtGui, QtWidgets + notes_tab = QtWidgets.QPlainTextEdit() + notes_tab.setWordWrapMode(QtGui.QTextOption.WrapAnywhere) + notes_tab.setFont(QtGui.QFont(MONOSPACE_FONT, 10, QtGui.QFont.Normal)) + notes_tab.setPlainText(self.wallet.db.get('notes_text', '')) + notes_tab.is_shown_cv = self.config.cv.GUI_QT_SHOW_TAB_NOTES + return notes_tab + def update_console(self): console = self.console console.history = self.wallet.db.get_stored_item("qt-console-history", []) @@ -2507,6 +2519,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): fut.cancel() self.unregister_callbacks() self.config.GUI_QT_WINDOW_IS_MAXIMIZED = self.isMaximized() + self.wallet.db.put('notes_text', self.notes_tab.toPlainText()) if not self.isMaximized(): g = self.geometry() self.wallet.db.put("winpos-qt", [g.left(),g.top(), diff --git a/electrum/simple_config.py b/electrum/simple_config.py index c803f0de2..9396aa468 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -1099,6 +1099,7 @@ This will result in longer routes; it might increase your fees and decrease the GUI_QT_SHOW_TAB_UTXO = ConfigVar('show_utxo_tab', default=False, type_=bool) GUI_QT_SHOW_TAB_CONTACTS = ConfigVar('show_contacts_tab', default=False, type_=bool) GUI_QT_SHOW_TAB_CONSOLE = ConfigVar('show_console_tab', default=False, type_=bool) + GUI_QT_SHOW_TAB_NOTES = ConfigVar('show_notes_tab', default=False, type_=bool) GUI_QML_PREFERRED_REQUEST_TYPE = ConfigVar('preferred_request_type', default='bolt11', type_=str) GUI_QML_USER_KNOWS_PRESS_AND_HOLD = ConfigVar('user_knows_press_and_hold', default=False, type_=bool)