aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-06-01 20:11:07 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-06-01 20:11:07 +0200
commitb60555997cd355a1e44ca357b2b3da71de8909c7 (patch)
tree66a65940c3494b56e48872d8407e5d5fce8963c2 /src/forms
parentProfiles dialog (diff)
downloadsmolbote-b60555997cd355a1e44ca357b2b3da71de8909c7.tar.xz
Hiding ProfileView until a profile is selected
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/profilesdialog.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/forms/profilesdialog.cpp b/src/forms/profilesdialog.cpp
index cf6791c..ed4c871 100644
--- a/src/forms/profilesdialog.cpp
+++ b/src/forms/profilesdialog.cpp
@@ -32,6 +32,16 @@ ProfilesDialog::ProfilesDialog(MainWindow *window, QWidget *parent) :
m_window = window;
m_view = new ProfileView(0, this);
+
+ // Hide the profile view because we're fancy
+ // Give focus to the widget because otherwise the listwidget gains focus
+ // this causes it to select the first item in it, which in turn triggers the signal
+ // and so the profile view gets shown even though the user hasn't selected anything
+ // and so we get to be less fancy, defeating the point of the exercise
+ // [on linux; other OS's not checked]
+ m_view->hide();
+ this->setFocus();
+
ui->setupUi(this);
ui->horizontalLayout->addWidget(m_view);
@@ -62,4 +72,5 @@ void ProfilesDialog::loadSelectedProfile()
void ProfilesDialog::viewProfile(int index)
{
m_view->setProfile(qApp->profile(ui->listWidget->item(index)->data(Qt::UserRole).toString()));
+ m_view->show();
}