Skip to content

Commit

Permalink
gui: create assets, add identifier chars automatically to qualifiers …
Browse files Browse the repository at this point in the history
…and sub-qualifiers

    * Add identifier chars automatically to qualifier assets and sub-qualifier assets. Fixes RavenProject#1152
    * Increase size of dropdown boxes with asset names.
  • Loading branch information
fdoving committed Dec 11, 2021
1 parent 3fee4bb commit 3a92458
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/qt/createassetdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
}
Expand All @@ -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 "";
}

Expand Down
18 changes: 16 additions & 2 deletions src/qt/forms/createassetdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,24 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="assetType"/>
<widget class="QComboBox" name="assetType">
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="assetList"/>
<widget class="QComboBox" name="assetList">
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
Expand Down

0 comments on commit 3a92458

Please sign in to comment.