Skip to content

Commit

Permalink
Merge pull request #235 from BlockMechanic/segwit
Browse files Browse the repository at this point in the history
More/Less
  • Loading branch information
BlockMechanic authored Nov 29, 2022
2 parents ed47362 + 484d855 commit a06d67d
Show file tree
Hide file tree
Showing 12 changed files with 276 additions and 81 deletions.
10 changes: 8 additions & 2 deletions src/qt/assetmanagerpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@ void AssetManagerPage::setWalletModel(WalletModel *_walletModel, ClientModel *_c

contractFilter = new ContractFilterProxy(this);
contractFilter->setSourceModel(walletModel->getContractTableModel());
contractFilter->setSortRole(ContractTableModel::NameRole);
contractFilter->setOnlyMine(false);
contractFilter->setSortRole(ContractTableModel::NameRole);
contractFilter->sort(ContractTableModel::Name, Qt::AscendingOrder);

mycontractFilter = new ContractFilterProxy(this);
mycontractFilter->setSourceModel(walletModel->getContractTableModel());
mycontractFilter->setOnlyMine(true);
mycontractFilter->setSortRole(ContractTableModel::NameRole);
mycontractFilter->sort(ContractTableModel::Name, Qt::AscendingOrder);

assetFilter = new AssetFilterProxy(this);
assetFilter->setSourceModel(walletModel->getAssetTableModel());
assetFilter->setDynamicSortFilter(true);
Expand Down Expand Up @@ -114,7 +120,7 @@ void AssetManagerPage::on_CreateNewAsset_clicked()
NewAssetPage dialog(this);
dialog.setWindowModality(Qt::ApplicationModal);
dialog.setWindowTitle("Create a New Asset");
dialog.setWalletModel(walletModel);
dialog.setWalletModel(walletModel, mycontractFilter);
if(dialog.exec())
update();
}
Expand Down
1 change: 1 addition & 0 deletions src/qt/assetmanagerpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class AssetManagerPage : public QWidget
AssetFilterProxy *assetFilter = nullptr;
ContractFilterProxy *contractFilter = nullptr;
CoinControlFilterProxy *coincontrolfilter = nullptr;
ContractFilterProxy *mycontractFilter = nullptr;

void updateAssetList();
void updateContractList();
Expand Down
8 changes: 8 additions & 0 deletions src/qt/assettablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <interfaces/node.h>
#include <qt/clientmodel.h>

#include <masternode/masternode-sync.h>
#include <systemnode/systemnode-sync.h>

#include <key_io.h>
#include <qt/guiconstants.h>
#include <qt/guiutil.h>
Expand Down Expand Up @@ -256,6 +259,11 @@ void AssetTableModel::update()
{
if (walletModel->getClientModel()->node().isInitialBlockDownload())
return;

if (!masternodeSync.IsSynced() || !systemnodeSync.IsSynced()) {
return;
}

Q_EMIT layoutAboutToBeChanged();
beginResetModel();
endResetModel();
Expand Down
16 changes: 12 additions & 4 deletions src/qt/contracttablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <interfaces/node.h>
#include <qt/clientmodel.h>

#include <masternode/masternode-sync.h>
#include <systemnode/systemnode-sync.h>

#include <key_io.h>
#include <outputtype.h>
#include <qt/guiconstants.h>
Expand Down Expand Up @@ -223,10 +226,15 @@ void ContractTableModel::update()
{
if (walletModel->getClientModel()->node().isInitialBlockDownload())
return;
Q_EMIT layoutAboutToBeChanged();
beginResetModel();
endResetModel();

if (!masternodeSync.IsSynced() || !systemnodeSync.IsSynced()) {
return;
}

// Q_EMIT layoutAboutToBeChanged();
// beginResetModel();
// endResetModel();
priv->refreshWallet();
Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(priv->size(), columns.length()-1, QModelIndex()));
Q_EMIT layoutChanged();
// Q_EMIT layoutChanged();
}
5 changes: 4 additions & 1 deletion src/qt/forms/assetmanagerpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
Expand Down Expand Up @@ -163,6 +163,9 @@
</item>
<item>
<widget class="QPushButton" name="CreateNewContract">
<property name="toolTip">
<string extracomment="Create a new Contract"/>
</property>
<property name="text">
<string>New Contract</string>
</property>
Expand Down
42 changes: 41 additions & 1 deletion src/qt/forms/newassetpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="contractcomboBox"/>
<widget class="QComboBox" name="contractcomboBox">
<property name="toolTip">
<string/>
</property>
<property name="currentText">
<string/>
</property>
<property name="placeholderText">
<string>Select Contract</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="typecomboBox">
<property name="toolTip">
<string/>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
Expand Down Expand Up @@ -60,6 +73,9 @@
</item>
<item>
<widget class="QDateTimeEdit" name="expiry">
<property name="toolTip">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -74,6 +90,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLineEdit" name="inputAmount">
<property name="toolTip">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -84,6 +103,9 @@
</item>
<item>
<widget class="QLineEdit" name="outputAmount">
<property name="toolTip">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -98,34 +120,49 @@
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="convertcheckBox">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Convertable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="transfercheckBox">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Transferable</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="restrictedcheckBox">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Restricted</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="limitedcheckBox">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Limited</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="divisiblecheckBox">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Divisible</string>
</property>
Expand Down Expand Up @@ -165,6 +202,9 @@
</item>
<item>
<widget class="QPushButton" name="Create">
<property name="toolTip">
<string extracomment="Create the Asset"/>
</property>
<property name="text">
<string>Create</string>
</property>
Expand Down
18 changes: 18 additions & 0 deletions src/qt/forms/newcontractpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="contractName">
<property name="toolTip">
<string extracomment="Name of contract"/>
</property>
<property name="text">
<string/>
</property>
Expand All @@ -51,6 +54,9 @@
</item>
<item>
<widget class="QLineEdit" name="contractSymbol">
<property name="toolTip">
<string extracomment="Symbol for contract"/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -65,6 +71,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="websiteURL">
<property name="toolTip">
<string extracomment="website"/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -75,6 +84,9 @@
</item>
<item>
<widget class="QLineEdit" name="contractURL">
<property name="toolTip">
<string extracomment="contract URL"/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -91,13 +103,19 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTextEdit" name="contractScript">
<property name="toolTip">
<string extracomment="Script code for contract"/>
</property>
<property name="placeholderText">
<string>Enter Contract Script</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="contractDescription">
<property name="toolTip">
<string extracomment="Contract Description"/>
</property>
<property name="placeholderText">
<string>Enter Contract Description</string>
</property>
Expand Down
Loading

0 comments on commit a06d67d

Please sign in to comment.