-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spats admin gui #1497
base: libspats-refactor
Are you sure you want to change the base?
Spats admin gui #1497
Changes from all commits
12a94c7
0e27e9d
bc06c8a
ca2610c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
#include "evo/deterministicmns.h" | ||
#include "masternode-sync.h" | ||
#include "masternodelist.h" | ||
#include "myownspats.h" | ||
#include <iostream> | ||
|
||
#include <QAction> | ||
|
@@ -122,6 +123,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle * | |
showHelpMessageAction(0), | ||
lelantusAction(0), | ||
masternodeAction(0), | ||
myownspatsAction(nullptr), | ||
logoAction(0), | ||
trayIcon(0), | ||
trayIconMenu(0), | ||
|
@@ -365,9 +367,18 @@ void BitcoinGUI::createActions() | |
tabGroup->addAction(masternodeAction); | ||
#endif | ||
|
||
myownspatsAction = new QAction(tr("M&y Own Spats"), this); | ||
myownspatsAction->setStatusTip(tr("Browse My Own Spats")); | ||
myownspatsAction->setToolTip(myownspatsAction->statusTip()); | ||
myownspatsAction->setCheckable(true); | ||
myownspatsAction->setShortcut(QKeySequence(Qt::ALT + key++)); | ||
tabGroup->addAction(myownspatsAction); | ||
|
||
#ifdef ENABLE_WALLET | ||
connect(masternodeAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); | ||
connect(masternodeAction, &QAction::triggered, this, &BitcoinGUI::gotoMasternodePage); | ||
connect(myownspatsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); | ||
connect(myownspatsAction, &QAction::triggered, this, &BitcoinGUI::gotoMyOwnSpatsPage); | ||
connect(overviewAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); | ||
connect(overviewAction, &QAction::triggered, this, &BitcoinGUI::gotoOverviewPage); | ||
connect(sendCoinsAction, &QAction::triggered, [this]{ showNormalIfMinimized(); }); | ||
|
@@ -522,6 +533,7 @@ void BitcoinGUI::createToolBars() | |
toolbar->addAction(historyAction); | ||
toolbar->addAction(lelantusAction); | ||
toolbar->addAction(masternodeAction); | ||
toolbar->addAction(myownspatsAction); | ||
|
||
logoLabel = new QLabel(); | ||
logoLabel->setObjectName("lblToolbarLogo"); | ||
|
@@ -648,6 +660,7 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled) | |
historyAction->setEnabled(enabled); | ||
lelantusAction->setEnabled(enabled); | ||
masternodeAction->setEnabled(enabled); | ||
myownspatsAction->setEnabled(enabled); | ||
encryptWalletAction->setEnabled(enabled); | ||
backupWalletAction->setEnabled(enabled); | ||
changePassphraseAction->setEnabled(enabled); | ||
|
@@ -790,6 +803,13 @@ void BitcoinGUI::gotoMasternodePage() | |
if (walletFrame) walletFrame->gotoMasternodePage(); | ||
} | ||
|
||
void BitcoinGUI::gotoMyOwnSpatsPage() | ||
{ | ||
QSettings settings; | ||
myownspatsAction->setChecked(true); | ||
if (walletFrame) walletFrame->gotoMyOwnSpatsPage(); | ||
} | ||
|
||
void BitcoinGUI::gotoReceiveCoinsPage() | ||
{ | ||
receiveCoinsAction->setChecked(true); | ||
|
@@ -1482,18 +1502,20 @@ void BitcoinGUI::resizeEvent(QResizeEvent* event) { | |
// Retrieve new dimensions from the resize event | ||
int newWidth = event->size().width(); | ||
int newHeight = event->size().height(); | ||
int actionWidth = newWidth / 6; | ||
int actionWidth = newWidth / 7; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adjusting the action width calculation. The current calculation Consider updating the width calculation to account for the new action: - int actionWidth = newWidth / 7;
+ int actionWidth = newWidth / 8; // Updated to account for the new action Also applies to: 1513-1513, 1520-1521 |
||
|
||
// Set widths for each action dynamically | ||
QWidget* overviewWidget = toolbar->widgetForAction(overviewAction); | ||
QWidget* receiveWidget = toolbar->widgetForAction(receiveCoinsAction); | ||
QWidget* historyWidget = toolbar->widgetForAction(historyAction); | ||
QWidget* sendCoinsWidget = toolbar->widgetForAction(sendCoinsAction); | ||
QWidget* masternodeWidget = toolbar->widgetForAction(masternodeAction); | ||
QWidget* myownspatsWidget = toolbar->widgetForAction(myownspatsAction); | ||
|
||
overviewWidget->setMinimumWidth(actionWidth); | ||
receiveWidget->setMinimumWidth(actionWidth); | ||
historyWidget->setMinimumWidth(actionWidth); | ||
sendCoinsWidget->setMinimumWidth(actionWidth); | ||
masternodeWidget->setMinimumWidth(actionWidth); | ||
} | ||
myownspatsWidget->setMinimumWidth(actionWidth); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,251 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>MyOwnSpats</class> | ||
<widget class="QWidget" name="MyOwnSpats"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>762</width> | ||
<height>535</height> | ||
</rect> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>190</width> | ||
<height>65</height> | ||
</size> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="topLayout"> | ||
<property name="leftMargin"> | ||
<number>20</number> | ||
</property> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="rightMargin"> | ||
<number>20</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<spacer name="horizontalSpacer0"> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<layout class="QGridLayout" name="gridLayout_3"> | ||
<item row="1" column="0"> | ||
<widget class="QTableWidget" name="tableWidgetMyOwnSpats"> | ||
<property name="editTriggers"> | ||
<set>QAbstractItemView::NoEditTriggers</set> | ||
</property> | ||
<property name="alternatingRowColors"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="selectionMode"> | ||
<enum>QAbstractItemView::NoSelection</enum> | ||
</property> | ||
<property name="selectionBehavior"> | ||
<enum>QAbstractItemView::SelectItems</enum> | ||
</property> | ||
<property name="sortingEnabled"> | ||
<bool>true</bool> | ||
</property> | ||
<attribute name="horizontalHeaderStretchLastSection"> | ||
<bool>true</bool> | ||
</attribute> | ||
<column> | ||
<property name="text"> | ||
<string>Asset Type</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Identifier</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Symbol</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Name</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Description</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Total Supply</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Fungible</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Resuppliable</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Precision</string> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string>Metadata</string> | ||
</property> | ||
</column> | ||
</widget> | ||
</item> | ||
<item row="0" column="0"> | ||
<layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QLabel" name="label_filter_2"> | ||
<property name="text"> | ||
<string>Filter List:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLineEdit" name="filterLineEdit"> | ||
<property name="toolTip"> | ||
<string>Filter assets list</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_4"> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>10</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_count_2"> | ||
<property name="text"> | ||
<string>Asset Count:</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="countLabel"> | ||
<property name="text"> | ||
<string>0</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item row="2" column="0"> | ||
<layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
<property name="bottomMargin"> | ||
<number>20</number> | ||
</property> | ||
<item> | ||
<widget class="QPushButton" name="create_spark_asset"> | ||
<property name="text"> | ||
<string>Create</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="mint_spark_asset"> | ||
<property name="text"> | ||
<string>Mint</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="modify_spark_asset"> | ||
<property name="text"> | ||
<string>Modify</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_3"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="unregister_spark_asset"> | ||
<property name="text"> | ||
<string>Unregister</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate source file inclusion.
The source file
qt/myownspats.cpp
is included in bothBITCOIN_QT_BASE_CPP
andBITCOIN_QT_WALLET_CPP
variables. This could lead to duplicate symbol errors during linking. It should only be included in one of these variables based on its functionality.If this is a wallet-related feature (which seems likely given it's a "My Own Spats" page), keep it only in
BITCOIN_QT_WALLET_CPP
. Apply this diff:BITCOIN_QT_BASE_CPP = \ qt/bantablemodel.cpp \ qt/bitcoinaddressvalidator.cpp \ ... - qt/myownspats.cpp \ qt/networkstyle.cpp \ ...
Also applies to: 456-456