core: Allow clean shutdown of the core
[quassel.git] / src / qtui / settingsdlg.cpp
index 7b26e06..5e9ea6e 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
+#include "settingsdlg.h"
+
 #include <QMessageBox>
 #include <QPushButton>
 
-#include "settingsdlg.h"
-
 #include "client.h"
-#include "iconloader.h"
+#include "icon.h"
 
 SettingsDlg::SettingsDlg(QWidget *parent)
     : QDialog(parent),
@@ -33,7 +33,7 @@ SettingsDlg::SettingsDlg(QWidget *parent)
     ui.setupUi(this);
     setModal(true);
     setAttribute(Qt::WA_DeleteOnClose, true);
-    setWindowIcon(SmallIcon("configure"));
+    setWindowIcon(icon::get("configure"));
 
     updateGeometry();
 
@@ -65,7 +65,9 @@ void SettingsDlg::setItemState(QTreeWidgetItem *item)
 {
     SettingsPage *sp = qobject_cast<SettingsPage *>(item->data(0, SettingsPageRole).value<QObject *>());
     Q_ASSERT(sp);
-    item->setDisabled(!Client::isConnected() && sp->needsCoreConnection());
+    bool disabledDueToConnection = !Client::isConnected() && sp->needsCoreConnection();
+    bool disabledDueToOwnChoice = !sp->isSelectable();
+    item->setDisabled(disabledDueToConnection || disabledDueToOwnChoice);
 }
 
 
@@ -94,7 +96,6 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp)
         item = new QTreeWidgetItem(cat, QStringList(sp->title()));
 
     item->setData(0, SettingsPageRole, QVariant::fromValue<QObject *>(sp));
-    ui.settingsTree->setMinimumWidth(ui.settingsTree->header()->sectionSizeHint(0) + 5);
     pageIsLoaded[sp] = false;
     if (!ui.settingsTree->selectedItems().count())
         ui.settingsTree->setCurrentItem(item);