From b60555997cd355a1e44ca357b2b3da71de8909c7 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 1 Jun 2017 20:11:07 +0200 Subject: Hiding ProfileView until a profile is selected --- src/forms/profilesdialog.cpp | 11 +++++++++++ src/widgets/mainwindowmenubar.cpp | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) 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(); } diff --git a/src/widgets/mainwindowmenubar.cpp b/src/widgets/mainwindowmenubar.cpp index a3ec497..0770a8d 100644 --- a/src/widgets/mainwindowmenubar.cpp +++ b/src/widgets/mainwindowmenubar.cpp @@ -58,7 +58,6 @@ MainWindowMenuBar::MainWindowMenuBar(MainWindow *parent) : profileMenu->addAction(tr("Profiles"), this, SLOT(handleLoadProfile())); profileMenu->addSeparator(); profileMenu->addAction(tr("View profile"), parent, SLOT(profileAction())); - profileMenu->addAction(tr("Settings")); profileMenu->addAction(tr("Cookies"), parent, SLOT(cookiesAction())); // Page menu -- cgit v1.2.1