]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
add notes tab
authortobtoht <tob@featherwallet.org>
Wed, 26 Mar 2025 09:06:48 +0000 (10:06 +0100)
committertobtoht <tob@featherwallet.org>
Wed, 26 Mar 2025 09:06:48 +0000 (10:06 +0100)
src/MainWindow.cpp
src/MainWindow.ui
src/assets.qrc
src/assets/images/tab_notes.png [new file with mode: 0644]

index e9b03725b2098b8ccc3cb261b126a5859296f92e..84eba76dcf654afd75801a91804aa88e36d88a44 100644 (file)
@@ -251,6 +251,12 @@ void MainWindow::initWidgets() {
         ui->tabWidget->setCurrentIndex(this->findTab("Send"));
     });
 
+    // [Notes]
+    ui->notes->setPlainText(m_wallet->getCacheAttribute("wallet.notes"));
+    connect(ui->notes, &QPlainTextEdit::textChanged, [this] {
+       m_wallet->setCacheAttribute("wallet.notes", ui->notes->toPlainText());
+    });
+
     // [Plugins..]
     for (auto* plugin : m_plugins) {
         if (!plugin->hasParent()) {
@@ -339,6 +345,11 @@ void MainWindow::initMenu() {
     m_tabShowHideMapper["Contacts"] = new ToggleTab(ui->tabContacts, "Contacts", "Contacts", ui->actionShow_Contacts, this);
     m_tabShowHideSignalMapper->setMapping(ui->actionShow_Contacts, "Contacts");
 
+    // Show/Hide Notes
+    connect(ui->actionShow_Notes, &QAction::triggered, m_tabShowHideSignalMapper, QOverload<>::of(&QSignalMapper::map));
+    m_tabShowHideMapper["Notes"] = new ToggleTab(ui->tabNotes, "Notes", "Notes", ui->actionShow_Notes, this);
+    m_tabShowHideSignalMapper->setMapping(ui->actionShow_Notes, "Notes");
+
     // Show/Hide Plugins..
     for (const auto &plugin : m_plugins) {
         if (plugin->parent() != "") {
index f7c27dc825f44493c2f12c7d68997b2124f30ac9..89b539d7e51a11e00f29081edb1017cc0f2606c3 100644 (file)
             </item>
            </layout>
           </widget>
+          <widget class="QWidget" name="tabNotes">
+           <attribute name="icon">
+            <iconset resource="assets.qrc">
+             <normaloff>:/assets/images/tab_notes.png</normaloff>:/assets/images/tab_notes.png</iconset>
+           </attribute>
+           <attribute name="title">
+            <string>Notes</string>
+           </attribute>
+           <layout class="QVBoxLayout" name="verticalLayout_3">
+            <property name="leftMargin">
+             <number>0</number>
+            </property>
+            <property name="topMargin">
+             <number>0</number>
+            </property>
+            <property name="rightMargin">
+             <number>0</number>
+            </property>
+            <property name="bottomMargin">
+             <number>0</number>
+            </property>
+            <item>
+             <widget class="QPlainTextEdit" name="notes"/>
+            </item>
+           </layout>
+          </widget>
          </widget>
         </item>
         <item>
     <addaction name="actionPlaceholderBegin"/>
     <addaction name="actionShow_Coins"/>
     <addaction name="actionShow_Contacts"/>
+    <addaction name="actionShow_Notes"/>
     <addaction name="actionPlaceholderEnd"/>
     <addaction name="separator"/>
     <addaction name="actionShow_Searchbar"/>
     <string>Show Contacts</string>
    </property>
   </action>
+  <action name="actionShow_Notes">
+   <property name="text">
+    <string>Show Notes</string>
+   </property>
+  </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <customwidgets>
index 9f9152405bbe4b029e0c39fc9cbf3d7f712ec4a0..b69574ca88b3e51968bd2e42b8a9373d48d3090f 100644 (file)
@@ -88,6 +88,7 @@
     <file>assets/images/tab_contacts.png</file>
     <file>assets/images/tab_history.png</file>
     <file>assets/images/tab_home.png</file>
+    <file>assets/images/tab_notes.png</file>
     <file>assets/images/tab_party.png</file>
     <file>assets/images/tab_receive.png</file>
     <file>assets/images/tab_send.png</file>
diff --git a/src/assets/images/tab_notes.png b/src/assets/images/tab_notes.png
new file mode 100644 (file)
index 0000000..40e73a3
Binary files /dev/null and b/src/assets/images/tab_notes.png differ