Skip to content

Commit

Permalink
add upload on create/update asset and view ipfs image file on view as…
Browse files Browse the repository at this point in the history
…sets
  • Loading branch information
npq7721 committed Aug 6, 2024
1 parent f877c16 commit 2226bb4
Show file tree
Hide file tree
Showing 17 changed files with 303 additions and 95 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install Required Packages
run: |
sudo apt-get update -y
sudo apt-get install curl build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
sudo apt-get install curl libcurl4-openssl-dev build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
- name: Build Depends
run: |
echo "building with $(nproc) threads"
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
- name: Install Required Packages
run: |
sudo apt-get update -y
sudo apt-get install curl build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
sudo apt-get install curl libcurl4-openssl-dev build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
- name: Build Depends
run: |
Expand Down Expand Up @@ -333,17 +333,17 @@ jobs:
report_paths: "unit_test_results.xml"

build-macos:
name: macOS 11 Build
name: macOS 12 Build
needs: get-version
runs-on: macos-11
runs-on: macos-12

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Required Packages
run: |
brew install automake libtool pkg-config librsvg libnatpmp python
brew install automake libtool pkg-config librsvg libnatpmp python curl
pip3 install ds_store mac_alias
pip3 install -U pip setuptools
Expand Down Expand Up @@ -601,7 +601,7 @@ jobs:
- name: Install Required Packages
run: |
sudo apt-get update -y
sudo apt-get install curl build-essential libtool g++-aarch64-linux-gnu autotools-dev automake pkg-config python3 bsdmainutils cmake -y
sudo apt-get install curl libcurl4-openssl-dev build-essential libtool g++-aarch64-linux-gnu autotools-dev automake pkg-config python3 bsdmainutils cmake -y
- name: Build Depends
run: |
Expand Down Expand Up @@ -728,7 +728,7 @@ jobs:
- name: Install Required Packages
run: |
sudo apt-get update -y
sudo apt-get install curl build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
sudo apt-get install curl libcurl4-openssl-dev build-essential libtool autotools-dev automake pkg-config python3 bsdmainutils cmake -y
sudo apt-get install -y g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 nsis
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,13 @@ dnl Check for gmp
AC_CHECK_HEADER([gmp.h])
AC_CHECK_LIB([gmp], [__gmpz_init], [GMP_LIBS=-lgmp], [AC_MSG_ERROR([libgmp missing])])

# Check for libcurl
AC_CHECK_LIB([curl], [curl_easy_init], [have_curl=yes], [have_curl=no])
if test "x$have_curl" = "xyes"; then
AC_DEFINE([HAVE_CURL], [1], [Define to 1 if you have the cURL library.])
LIBS="$LIBS -lcurl"
fi

dnl check for immer header
AC_CHECK_HEADER([immer/map.hpp],, [AC_MSG_ERROR([immer map header not found])])

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ LIBBITCOIN_CRYPTO=crypto/libraptoreum_crypto.a
LIBBITCOINQT=qt/libraptoreumqt.a
LIBDASHBLS=dashbls/libdashbls.la
LIBSECP256K1=secp256k1/libsecp256k1.la
LIBBITCOINQT+=-lcurl

if ENABLE_ZMQ
LIBBITCOIN_ZMQ=libraptoreum_zmq.a
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ BITCOIN_QT_H = \
qt/sendassetsdialog.h \
qt/sendassetsentry.h \
qt/createassetsdialog.h \
qt/upload_download.h \
qt/updateassetsdialog.h \
qt/signverifymessagedialog.h \
qt/smartnodelist.h \
Expand Down Expand Up @@ -290,6 +291,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/sendcoinsentry.cpp \
qt/sendassetsdialog.cpp \
qt/createassetsdialog.cpp \
qt/upload_download.cpp \
qt/updateassetsdialog.cpp \
qt/assetsdialog.cpp \
qt/sendassetsentry.cpp \
Expand Down
35 changes: 17 additions & 18 deletions src/dashbls/config.status.old
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ $config_commands
Report bugs to the package provider."

ac_cs_config="'--disable-option-checking' '--prefix=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu' '--disable-tests' '--disable-gui-tests' '--disable-bench' '--enable-stacktraces' '--disable-shared' '--with-pic' '--enable-benchmark=no' '--enable-module-recovery' '--enable-module-schnorrsig' '--cache-file=/dev/null' '--srcdir=.' 'PKG_CONFIG_PATH=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib/pkgconfig'"
ac_cs_config="'--disable-option-checking' '--prefix=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu' '--disable-tests' '--disable-shared' '--with-pic' '--enable-benchmark=no' '--enable-module-recovery' '--enable-module-schnorrsig' '--cache-file=/dev/null' '--srcdir=.' 'PKG_CONFIG_PATH=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig'"
ac_cs_version="\
libdashbls config.status 1.3.0
configured by ./configure, generated by GNU Autoconf 2.69,
Expand All @@ -437,7 +437,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='/home/nando/Downloads/rtm/rigged/src/dashbls'
ac_pwd='/home/tri/workspace/raptoreum/src/dashbls'
srcdir='.'
INSTALL='/usr/bin/install -c'
MKDIR_P='/usr/bin/mkdir -p'
Expand Down Expand Up @@ -519,7 +519,7 @@ if $ac_cs_silent; then
fi

if $ac_cs_recheck; then
set X /bin/bash './configure' '--disable-option-checking' '--prefix=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu' '--disable-tests' '--disable-gui-tests' '--disable-bench' '--enable-stacktraces' '--disable-shared' '--with-pic' '--enable-benchmark=no' '--enable-module-recovery' '--enable-module-schnorrsig' '--cache-file=/dev/null' '--srcdir=.' 'PKG_CONFIG_PATH=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib/pkgconfig' $ac_configure_extra_args --no-create --no-recursion
set X /bin/bash './configure' '--disable-option-checking' '--prefix=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu' '--disable-tests' '--disable-shared' '--with-pic' '--enable-benchmark=no' '--enable-module-recovery' '--enable-module-schnorrsig' '--cache-file=/dev/null' '--srcdir=.' 'PKG_CONFIG_PATH=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig' $ac_configure_extra_args --no-create --no-recursion
shift
$as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
CONFIG_SHELL='/bin/bash'
Expand Down Expand Up @@ -679,7 +679,7 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
finish_eval=''
hardcode_into_libs='yes'
sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/9 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib '
configure_time_dlsearch_path='/lib /usr/lib /usr/local/cuda/targets/x86_64-linux/lib /usr/local/cuda-11/targets/x86_64-linux/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/cuda-11.4/targets/x86_64-linux/lib /usr/local/lib/i386-linux-gnu /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /usr/local/lib/i686-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu '
configure_time_dlsearch_path='/lib /usr/lib /opt/amdgpu-pro/lib/i386-linux-gnu /opt/amdgpu-pro/lib/x86_64-linux-gnu /opt/amdgpu-pro/lib/x86_64-linux-gnu /opt/amdgpu-pro/lib/i386-linux-gnu /opt/amdgpu/lib/x86_64-linux-gnu /opt/amdgpu/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib/i386-linux-gnu /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /usr/local/lib/i686-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu '
configure_time_lt_sys_library_path=''
hardcode_action='immediate'
enable_dlopen='unknown'
Expand Down Expand Up @@ -898,8 +898,8 @@ S["ARITH_EASY_FALSE"]=""
S["ARITH_EASY_TRUE"]="#"
S["HARDEN_FALSE"]="#"
S["HARDEN_TRUE"]=""
S["USE_BENCH_FALSE"]=""
S["USE_BENCH_TRUE"]="#"
S["USE_BENCH_FALSE"]="#"
S["USE_BENCH_TRUE"]=""
S["USE_TESTS_FALSE"]=""
S["USE_TESTS_TRUE"]="#"
S["WITH_FBX_FALSE"]="#"
Expand Down Expand Up @@ -947,9 +947,8 @@ S["PTHREAD_LIBS"]="-lpthread"
S["PTHREAD_CXX"]="g++ -m64 -std=c++14"
S["PTHREAD_CC"]="gcc -m64"
S["ax_pthread_config"]=""
S["PKG_CONFIG_LIBDIR"]="/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib/pkgconfig"
S["PKG_CONFIG_PATH"]="/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-"\
"gnu/lib/pkgconfig"
S["PKG_CONFIG_LIBDIR"]="/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig"
S["PKG_CONFIG_PATH"]="/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/share/pkgconfig:/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib/pkgconfig"
S["PKG_CONFIG"]="/usr/bin/pkg-config --static"
S["PORT"]=""
S["BREW"]=""
Expand Down Expand Up @@ -1001,8 +1000,8 @@ S["DEPDIR"]=".deps"
S["OBJEXT"]="o"
S["EXEEXT"]=""
S["ac_ct_CXX"]=""
S["CPPFLAGS"]="-I/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/include/ "
S["LDFLAGS"]="-L/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu/lib "
S["CPPFLAGS"]="-I/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/include/ "
S["LDFLAGS"]="-L/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu/lib "
S["CXXFLAGS"]="-pipe -static-libstdc++ -O2 "
S["CXX"]="g++ -m64 -std=c++14"
S["MAINT"]=""
Expand All @@ -1022,12 +1021,12 @@ S["mkdir_p"]="$(MKDIR_P)"
S["MKDIR_P"]="/usr/bin/mkdir -p"
S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s"
S["STRIP"]="strip"
S["install_sh"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/install-sh"
S["MAKEINFO"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/missing automake-1.16"
S["AUTOCONF"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/nando/Downloads/rtm/rigged/src/dashbls/build-aux/missing aclocal-1.16"
S["install_sh"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/install-sh"
S["MAKEINFO"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/missing makeinfo"
S["AUTOHEADER"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/missing autoheader"
S["AUTOMAKE"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/missing automake-1.16"
S["AUTOCONF"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/missing autoconf"
S["ACLOCAL"]="${SHELL} /home/tri/workspace/raptoreum/src/dashbls/build-aux/missing aclocal-1.16"
S["VERSION"]="1.3.0"
S["PACKAGE"]="libdashbls"
S["CYGPATH_W"]="echo"
Expand Down Expand Up @@ -1073,7 +1072,7 @@ S["libexecdir"]="${exec_prefix}/libexec"
S["sbindir"]="${exec_prefix}/sbin"
S["bindir"]="${exec_prefix}/bin"
S["program_transform_name"]="s,x,x,"
S["prefix"]="/home/nando/Downloads/raptoreum2/rigged/depends/x86_64-pc-linux-gnu"
S["prefix"]="/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu"
S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]=""
Expand Down
74 changes: 71 additions & 3 deletions src/qt/assetsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <qt/assetsdialog.h>
#include <qt/forms/ui_assetsdialog.h>
#include <qt/upload_download.h>

#include <chainparams.h>
#include <qt/clientmodel.h>
Expand All @@ -24,6 +25,14 @@
#include <QPushButton>
#include <QTableWidgetItem>
#include <QtGui/QClipboard>
#include <QByteArray>
#include <QBuffer>
#include <QPixmap>
#include <QLabel>
#include <QScrollArea>
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>

template<typename T>
class CAssetListWidgetItem : public QTableWidgetItem {
Expand Down Expand Up @@ -78,7 +87,9 @@ AssetsDialog::AssetsDialog(QWidget *parent) :
connect(ui->tableWidgetAssets, &QTableWidget::doubleClicked, this, &AssetsDialog::Asset_details_clicked);
connect(sendAssetAction, &QAction::triggered, this, &AssetsDialog::SendAsset_clicked);
connect(detailsAction, &QAction::triggered, this, &AssetsDialog::Asset_details_clicked);

connect(ui->referenceDisplay, SIGNAL(clicked()), this, SLOT(showFulRefImage()));
connect(ui->referenceLabel, SIGNAL(clicked(const QString& text)), this, SLOT(showFulRefImage()));
//connect(ui->referenceDisplay, &QLabel::mouseReleaseEvent, this, &AssetsDialog::showFulRefImage());
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &AssetsDialog::updateAssetBalanceScheduled);
timer->start(1000);
Expand Down Expand Up @@ -240,14 +251,15 @@ void AssetsDialog::Asset_clicked() {
if (walletModel->wallet().isSpendable(asset.ownerAddress)){
ui->updateButton->setVisible(true);
ui->mintButton->setVisible(true);
ui->mintButton->setEnabled(asset.mintCount < asset.maxMintCount ? true : false);
ui->updateButton->setEnabled(asset.updatable ? true : false);
ui->mintButton->setEnabled(asset.mintCount < asset.maxMintCount);
ui->updateButton->setEnabled(asset.updatable);
} else {
ui->updateButton->setVisible(false);
ui->mintButton->setVisible(false);
ui->mintButton->setEnabled(false);
ui->updateButton->setEnabled(false);
}
displayImage(asset.referenceHash);
}

void AssetsDialog::Asset_details_clicked() {
Expand Down Expand Up @@ -300,6 +312,62 @@ void AssetsDialog::on_updateButton_clicked() {
Q_EMIT assetUpdateClicked(asset.name);
}

void AssetsDialog::displayImage(const std::string& cid) {
ui->referenceDisplay->clear();
if(cid.empty()) {
ui->referenceLabel->hide();
ui->referenceDisplay->hide();
} else {
ui->referenceLabel->show();
ui->referenceDisplay->show();
std::string response_data;
downloadFile(cid, response_data);
QByteArray imageData = QByteArray::fromRawData(response_data.data(), response_data.size());
QBuffer buffer(&imageData);
buffer.open(QIODevice::ReadOnly);
bool isLoaded = currentRefImage.load(&buffer, nullptr);
if(isLoaded) {
int displayWidth = ui->referenceDisplay->width() < currentRefImage.width() ? ui->referenceDisplay->width() : currentRefImage.width();
int displayHeight = currentRefImage.height() > 40 ? 40 : currentRefImage.height();
QPixmap pixmap = QPixmap::fromImage(currentRefImage.scaled(displayWidth, displayHeight, Qt::KeepAspectRatio));
ui->referenceDisplay->setPixmap(pixmap);
ui->referenceDisplay->setCursor(Qt::PointingHandCursor);
ui->referenceDisplay->setToolTip(QString::fromStdString(cid));
} else {
ui->referenceDisplay->setText(QString::fromStdString(cid));
ui->referenceDisplay->unsetCursor();
ui->referenceDisplay->setToolTip("");
}

}
}
//TODO: not yet working.
void AssetsDialog::showFulRefImage() {
printf("full image showing\n");
QDialog dialog(this);
dialog.setWindowTitle(ui->referenceDisplay->toolTip());

QVBoxLayout *dialogLayout = new QVBoxLayout(&dialog);

QLabel *fullImageLabel = new QLabel(&dialog);
fullImageLabel->setPixmap(QPixmap::fromImage(currentRefImage));

QScrollArea *scrollArea = new QScrollArea(&dialog);
scrollArea->setWidget(fullImageLabel);
scrollArea->setWidgetResizable(true);

dialogLayout->addWidget(scrollArea);

QScreen *currentScreen = this->screen();
QRect screenGeometry = currentScreen->geometry();
int displayWidth = currentRefImage.width() >= screenGeometry.width() ? screenGeometry.width() - 20 : screenGeometry.width();
int displayHeight = currentRefImage.height() >= screenGeometry.height() ? screenGeometry.height() - 20 : screenGeometry.height();

dialog.setLayout(dialogLayout);
dialog.resize(displayWidth, displayHeight); // Adjust the size of the dialog as needed
dialog.exec();
}

void AssetsDialog::mintAsset() {
if (getAssetsFees() == 0) {
QMessageBox msgBox;
Expand Down
5 changes: 5 additions & 0 deletions src/qt/assetsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <QTimer>
#include <QMessageBox>
#include <QDialog>
#include <QImage>

#define ASSETSDIALOG_UPDATE_SECONDS 3
#define ASSETSDIALOG_FILTER_COOLDOWN_SECONDS 3
Expand Down Expand Up @@ -57,6 +58,7 @@ class AssetsDialog : public QDialog {

private:
QMenu *contextMenuAsset;
QImage currentRefImage;

QTimer *timer;
Ui::AssetsDialog *ui;
Expand All @@ -69,6 +71,7 @@ class AssetsDialog : public QDialog {

std::string GetSelectedAsset();
void mintAsset();
void displayImage(const std::string& cid);

Q_SIGNALS:
void doubleClicked(const QModelIndex&);
Expand All @@ -90,6 +93,8 @@ private

void SendAsset_clicked();

void showFulRefImage();

};

class MintAssetConfirmationDialog : public QMessageBox {
Expand Down
11 changes: 9 additions & 2 deletions src/qt/createassetsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/sendassetsentry.h>
#include <qt/upload_download.h>

#include <chainparams.h>
#include <interfaces/node.h>
Expand All @@ -37,7 +38,7 @@
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QTextDocument>

#include <QFileDialog>

#define SEND_CONFIRM_DELAY 3

Expand Down Expand Up @@ -96,6 +97,7 @@ CreateAssetsDialog::CreateAssetsDialog(QWidget *parent) :
connect(ui->availabilityButton, SIGNAL(clicked()), this, SLOT(checkAvailabilityClicked()));
connect(ui->uniqueBox, SIGNAL(clicked()), this, SLOT(onUniqueChanged()));
connect(ui->AssetTypeBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(onAssetTypeSelected(QString)));
connect(ui->openIpfsButton, SIGNAL(clicked()), this, SLOT(openFilePicker()));

// Coin Control
connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(CoinControlButtonClicked()));
Expand Down Expand Up @@ -157,7 +159,7 @@ CreateAssetsDialog::CreateAssetsDialog(QWidget *parent) :
ui->IssueFrequencyBox->setToolTip(tr("Disabled. Not in use"));
ui->distributionBox->setEnabled(false);
ui->distributionBox->setToolTip(tr("Manual only until other types are developed"));
ui->openIpfsButton->hide();
//ui->openIpfsButton->hide();

ui->RootAssetLabel->setVisible(false);
ui->RootAssetBox->setVisible(false);
Expand Down Expand Up @@ -792,6 +794,11 @@ void CreateAssetsDialog::CoinControlUpdateLabels() {
}
}

void CreateAssetsDialog::openFilePicker() {
std::string cid = pickAndSendFileForIpfs(this);
ui->ipfsText->setText(QString::fromStdString(cid));
}

void CreateAssetsDialog::checkAvailabilityClicked()
{

Expand Down
2 changes: 2 additions & 0 deletions src/qt/createassetsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ private

void updateSmartFeeLabel();

void openFilePicker();

Q_SIGNALS:
// Fired when a message should be reported to the user
void message(
Expand Down
Loading

0 comments on commit 2226bb4

Please sign in to comment.