From 16af804a22ca67447c38e939f0b7774b3647d4c4 Mon Sep 17 00:00:00 2001 From: tri Date: Wed, 14 Aug 2024 22:03:21 -0700 Subject: [PATCH] remove recent tx for asset tab, make reference image bigger, link undisplayable image to gateway --- .gitignore | 1 + src/dashbls/config.status.old | 5 +++-- src/qt/assetsdialog.cpp | 29 +++++++++++------------------ src/qt/createassetsdialog.cpp | 2 -- src/qt/forms/assetsdialog.ui | 32 +++++--------------------------- src/qt/updateassetsdialog.cpp | 1 - src/qt/uploaddownload.h | 1 + 7 files changed, 21 insertions(+), 50 deletions(-) diff --git a/.gitignore b/.gitignore index d371ab7d7..5a1551353 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ build-aux/compile build-aux/test-driver config.log config.status +config.status.old configure libtool src/config/raptoreum-config.h diff --git a/src/dashbls/config.status.old b/src/dashbls/config.status.old index c07c3aa0d..819492a83 100755 --- a/src/dashbls/config.status.old +++ b/src/dashbls/config.status.old @@ -427,7 +427,7 @@ $config_commands Report bugs to the package provider." -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_config="'--disable-option-checking' '--prefix=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu' '--disable-tests' '--enable-debug' '--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, @@ -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/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 + set X /bin/bash './configure' '--disable-option-checking' '--prefix=/home/tri/workspace/raptoreum/depends/x86_64-pc-linux-gnu' '--disable-tests' '--enable-debug' '--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' @@ -1227,6 +1227,7 @@ D["LWREG"]=" 5" D["BRUCH"]=" 6" D["CTAIA"]=" 7" D["LOWER"]=" 8" +D["DEBUG"]=" 1" D["QUIET"]=" 1" D["COLOR"]=" 1" D["ARCH"]=" X64" diff --git a/src/qt/assetsdialog.cpp b/src/qt/assetsdialog.cpp index 4660e6ada..c2acf602c 100644 --- a/src/qt/assetsdialog.cpp +++ b/src/qt/assetsdialog.cpp @@ -3,9 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include -//#include #include -//#include #include #include @@ -56,8 +54,8 @@ AssetsDialog::AssetsDialog(QWidget *parent) : ui(new Ui::AssetsDialog) { ui->setupUi(this); - GUIUtil::setFont({ui->label_filter_2, ui->assetinfolabel, ui->recentlabel}, GUIUtil::FontWeight::Bold, 16); - GUIUtil::setFont({ui->label_6, ui->label_4, ui->label_3, ui->label_4, ui->label_5, + GUIUtil::setFont({ui->label_filter_2, ui->assetinfolabel}, GUIUtil::FontWeight::Bold, 16); + GUIUtil::setFont({ui->label_6, ui->label_4, ui->label_3, ui->label_4, ui->label_5, ui->referenceLabel, ui->errorLabel}, GUIUtil::FontWeight::Bold, 14); GUIUtil::setFont({ui->idTextLablel, ui->nameTextLabel, ui->typeLabel, ui->suplyTextLabel}, GUIUtil::FontWeight::Normal, 14); @@ -89,9 +87,6 @@ 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); @@ -101,6 +96,7 @@ AssetsDialog::AssetsDialog(QWidget *parent) : ui->errorLabel->setVisible(false); ui->errorTextLabel->setVisible(false); ui->errorTextLabel->setStyleSheet(GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_INVALID)); + ui->referenceDisplay->setCursor(Qt::PointingHandCursor); GUIUtil::updateFonts(); } @@ -316,35 +312,32 @@ void AssetsDialog::on_updateButton_clicked() { void AssetsDialog::displayImage(const std::string& cid) { ui->referenceDisplay->clear(); - if(cid.empty()) { + if(cid.empty() || cid.length() < 46 || cid.compare(0, 2, "Qm")) { ui->referenceLabel->hide(); ui->referenceDisplay->hide(); } else { ui->referenceLabel->show(); ui->referenceDisplay->show(); -// HttpClient httpClient; -// httpClient.sendGetRequest(cid, [this, cid](const QByteArray& data) { -// printf("data size %d\n", data.size()); -// }); std::string response_data; - //downloadFile(cid, response_data); download(cid, response_data); - printf("size %ld\n", response_data.size()); 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(); + int displayHeight = currentRefImage.height() > 260 ? 260 : 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)); + ui->referenceDisplay->setOpenExternalLinks(false); } else { - ui->referenceDisplay->setText(QString::fromStdString(cid)); - ui->referenceDisplay->unsetCursor(); + std::string displayUrl = "" + cid + ""; + ui->referenceDisplay->setText(QString::fromStdString(displayUrl)); ui->referenceDisplay->setToolTip(""); + ui->referenceDisplay->setOpenExternalLinks(true); + } } diff --git a/src/qt/createassetsdialog.cpp b/src/qt/createassetsdialog.cpp index 4fe26823a..f778cf023 100644 --- a/src/qt/createassetsdialog.cpp +++ b/src/qt/createassetsdialog.cpp @@ -15,7 +15,6 @@ #include #include #include -//#include #include #include @@ -800,7 +799,6 @@ void CreateAssetsDialog::CoinControlUpdateLabels() { } void CreateAssetsDialog::openFilePicker() { - //std::string cid = pickAndSendFileForIpfs(this); std::string cid; pickAndUploadFileForIpfs(this, cid); ui->ipfsText->setText(QString::fromStdString(cid)); diff --git a/src/qt/forms/assetsdialog.ui b/src/qt/forms/assetsdialog.ui index 28a469fc3..148433d6f 100644 --- a/src/qt/forms/assetsdialog.ui +++ b/src/qt/forms/assetsdialog.ui @@ -120,14 +120,14 @@ - + true - + 0 0 @@ -339,6 +339,9 @@ + + Qt::AlignCenter + @@ -375,31 +378,6 @@ - - - - - 16777215 - 16777215 - - - - - 14 - true - - - - Qt::RightToLeft - - - Recent transactions - - - Qt::AlignCenter - - - diff --git a/src/qt/updateassetsdialog.cpp b/src/qt/updateassetsdialog.cpp index edfa79c91..0b88b48cf 100644 --- a/src/qt/updateassetsdialog.cpp +++ b/src/qt/updateassetsdialog.cpp @@ -15,7 +15,6 @@ #include #include #include -//#include #include #include diff --git a/src/qt/uploaddownload.h b/src/qt/uploaddownload.h index 3c4119f51..693d36eea 100644 --- a/src/qt/uploaddownload.h +++ b/src/qt/uploaddownload.h @@ -15,6 +15,7 @@ static std::string GET_URI = "/get/"; static std::string UPLOAD_URI = "/upload"; static std::string IPFS_SERVICE_HOST = gArgs.GetArg("-ipfsservice", "ipfsm.raptoreum.com"); +static std::string IPFS_GATEWAY_URL = gArgs.GetArg("-ipfsgateway", "https://ipfsweb.raptoreum.com/ipfs/") void download(const std::string cid, std::string& response_data); void upload(const std::string& file_path, std::string& response_data);