From 3a92458ec395a1e1ca2b08ba3bf0d953bed6d67a Mon Sep 17 00:00:00 2001 From: fdov Date: Sat, 11 Dec 2021 23:17:02 +0100 Subject: [PATCH] gui: create assets, add identifier chars automatically to qualifiers and sub-qualifiers * Add identifier chars automatically to qualifier assets and sub-qualifier assets. Fixes #1152 * Increase size of dropdown boxes with asset names. --- src/qt/createassetdialog.cpp | 10 +++++++--- src/qt/forms/createassetdialog.ui | 18 ++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/qt/createassetdialog.cpp b/src/qt/createassetdialog.cpp index bf7a8bb894..c906a0de5a 100644 --- a/src/qt/createassetdialog.cpp +++ b/src/qt/createassetdialog.cpp @@ -1021,12 +1021,16 @@ void CreateAssetDialog::updatePresentedAssetName(QString name) QString CreateAssetDialog::GetSpecialCharacter() { - if (type == IntFromAssetType(AssetType::SUB) || type == IntFromAssetType(AssetType::SUB_QUALIFIER)) + if (type == IntFromAssetType(AssetType::SUB)) return "/"; else if (type == IntFromAssetType(AssetType::UNIQUE)) return "#"; else if (type == IntFromAssetType(AssetType::MSGCHANNEL)) return "~"; + else if (type == IntFromAssetType(AssetType::SUB_QUALIFIER)) + return "/#"; + else if (type == IntFromAssetType(AssetType::QUALIFIER)) + return "#"; return ""; } @@ -1044,9 +1048,9 @@ QString CreateAssetDialog::GetAssetName() else if (type == IntFromAssetType(AssetType::RESTRICTED)) return ui->nameText->text(); else if (type == IntFromAssetType(AssetType::QUALIFIER)) - return ui->nameText->text(); + return ui->assetList->currentText() + "#" + ui->nameText->text(); else if (type == IntFromAssetType(AssetType::SUB_QUALIFIER)) - return ui->assetList->currentText() + "/" + ui->nameText->text(); + return ui->assetList->currentText() + "/#" + ui->nameText->text(); return ""; } diff --git a/src/qt/forms/createassetdialog.ui b/src/qt/forms/createassetdialog.ui index 69c30dfcc1..b519415487 100644 --- a/src/qt/forms/createassetdialog.ui +++ b/src/qt/forms/createassetdialog.ui @@ -612,10 +612,24 @@ - + + + + 250 + 0 + + + - + + + + 250 + 0 + + +