From 7e5d69572620f8a6aa1d07377aa6e64f61af823e Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 5 Jun 2018 09:41:06 +1000 Subject: [PATCH] Make sure to update profile information box when auto loading a profile --- sleepyhead/profileselector.cpp | 28 ++-------------------------- sleepyhead/profileselector.ui | 2 +- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/sleepyhead/profileselector.cpp b/sleepyhead/profileselector.cpp index 79b6921d..50b4e430 100644 --- a/sleepyhead/profileselector.cpp +++ b/sleepyhead/profileselector.cpp @@ -195,35 +195,11 @@ void ProfileSelector::updateProfileHighlight(QString name) proxy->setData(proxy->index(row, i, QModelIndex()), bg, Qt::ForegroundRole); // proxy->setData(model->index(row, i, QModelIndex()), font, Qt::FontRole); } + on_selectionChanged(proxy->index(row, 0, QModelIndex()), QModelIndex()); break; } + } - /*if (p_profile) { - QString html = QString(); - - if (!p_profile->user->lastName().isEmpty() && !p_profile->user->firstName().isEmpty()) { - html += tr("Name: %1, %2").arg(p_profile->user->lastName()).arg(p_profile->user->firstName())+"
"; - } - if (!p_profile->user->phone().isEmpty()) { - html += tr("Phone: %1").arg(p_profile->user->phone())+"
"; - } - if (!p_profile->user->email().isEmpty()) { - html += tr("Email: %1").arg(p_profile->user->email())+"
"; - } - if (!p_profile->user->address().isEmpty()) { - html += "
"+tr("Address:")+"
"+p_profile->user->address().trimmed().replace("\n","
")+"
"; - } - - if (html.isEmpty()) { - html += tr("No profile information given")+"
"; - } - ui->diskSpaceInfo->setVisible(true); - ui->profileInfoGroupBox->setTitle(tr("Current Profile: %1").arg(name)); - ui->profileInfoLabel->setText(html); - } else { - ui->diskSpaceInfo->setVisible(false); - } */ - } void ProfileSelector::SelectProfile(QString profname) diff --git a/sleepyhead/profileselector.ui b/sleepyhead/profileselector.ui index 370983ff..12395b0b 100644 --- a/sleepyhead/profileselector.ui +++ b/sleepyhead/profileselector.ui @@ -265,7 +265,7 @@ - Please open or create a profile... + Please select or create a profile... Qt::AutoText