mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:18:07 +00:00
UI: ProgramEdit: Show icon for wildcard too
This commit is contained in:
parent
96dae7f9d9
commit
8cc60c496c
@ -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<AppInfoCache>()->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<AppInfoCache>()->appPixmap(m_appRow.appPath);
|
||||
}
|
||||
|
||||
void ProgramEditDialog::initializeFocus()
|
||||
{
|
||||
if (!isEmpty()) {
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user