diff --git a/src/ui/form/prog/programeditdialog.cpp b/src/ui/form/prog/programeditdialog.cpp index ee9da8e7..0d8ff569 100644 --- a/src/ui/form/prog/programeditdialog.cpp +++ b/src/ui/form/prog/programeditdialog.cpp @@ -126,7 +126,7 @@ void ProgramEditDialog::initializePathNameFields() const bool isPathEditable = isSingleSelection && (m_appRow.appId == 0 || isWildcard()); initializePathField(isSingleSelection, isPathEditable); - initializeNameField(isSingleSelection, isPathEditable); + initializeNameField(isSingleSelection); } void ProgramEditDialog::initializePathField(bool isSingleSelection, bool isPathEditable) @@ -143,7 +143,7 @@ void ProgramEditDialog::initializePathField(bool isSingleSelection, bool isPathE m_editWildcard->setVisible(isWildcard()); } -void ProgramEditDialog::initializeNameField(bool isSingleSelection, bool isPathEditable) +void ProgramEditDialog::initializeNameField(bool isSingleSelection) { m_btSelectFile->setEnabled(isSingleSelection); m_editName->setText(isSingleSelection ? m_appRow.appName : QString()); @@ -154,9 +154,7 @@ void ProgramEditDialog::initializeNameField(bool isSingleSelection, bool isPathE m_editNotes->setText(m_appRow.notes); m_editNotes->setEnabled(isSingleSelection); - m_labelEditNotes->setPixmap(isSingleSelection && !isPathEditable - ? IoC()->appPixmap(m_appRow.appPath) - : QPixmap()); + m_labelEditNotes->setPixmap(appIcon(isSingleSelection)); if (isSingleSelection) { if (m_appRow.appName.isEmpty()) { @@ -165,6 +163,17 @@ void ProgramEditDialog::initializeNameField(bool isSingleSelection, bool isPathE } } +QPixmap ProgramEditDialog::appIcon(bool isSingleSelection) const +{ + if (!isSingleSelection) + return {}; + + if (isWildcard()) + return IconCache::file(":/icons/asterisk_orange.png"); + + return IoC()->appPixmap(m_appRow.appPath); +} + void ProgramEditDialog::initializeFocus() { if (!isEmpty()) { diff --git a/src/ui/form/prog/programeditdialog.h b/src/ui/form/prog/programeditdialog.h index b3eac7af..1bbade3b 100644 --- a/src/ui/form/prog/programeditdialog.h +++ b/src/ui/form/prog/programeditdialog.h @@ -53,7 +53,9 @@ protected: private: void initializePathNameFields(); void initializePathField(bool isSingleSelection, bool isPathEditable); - void initializeNameField(bool isSingleSelection, bool isPathEditable); + void initializeNameField(bool isSingleSelection); + + QPixmap appIcon(bool isSingleSelection) const; void initializeFocus();