/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "ui_bufferviewsettingspage.h"
#include "ui_buffervieweditdlg.h"
+#include <QItemSelection>
+
class BufferViewConfig;
-class BufferViewSettingsPage : public SettingsPage {
- Q_OBJECT
+class BufferViewSettingsPage : public SettingsPage
+{
+ Q_OBJECT
public:
- BufferViewSettingsPage(QWidget *parent = 0);
- ~BufferViewSettingsPage();
+ BufferViewSettingsPage(QWidget *parent = 0);
+ ~BufferViewSettingsPage();
public slots:
- void save();
- void load();
- void reset();
+ void save();
+ void load();
+ void reset();
private slots:
- void coreConnectionStateChanged(bool state);
+ void coreConnectionStateChanged(bool state);
+
+ void addBufferView(BufferViewConfig *config);
+ void addBufferView(int bufferViewId);
+ void bufferViewDeleted();
+ void newBufferView(const QString &bufferViewName);
+ void updateBufferView();
+
+ void enableStatusBuffers(int networkIdx);
+
+ void on_addBufferView_clicked();
+ void on_renameBufferView_clicked();
+ void on_deleteBufferView_clicked();
+ void bufferViewSelectionChanged(const QItemSelection ¤t, const QItemSelection &previous);
- void addBufferView(BufferViewConfig *config);
- void addBufferView(int bufferViewId);
- void newBufferView(const QString &bufferViewName);
- void updateBufferView();
+ void widgetHasChanged();
- void on_addBufferView_clicked();
- void on_renameBufferView_clicked();
-
private:
- Ui::BufferViewSettingsPage ui;
+ Ui::BufferViewSettingsPage ui;
+ bool _ignoreWidgetChanges;
+ bool _useBufferViewHint;
+ int _bufferViewHint;
- // mappings for bufferViewId to position in the list and vice versa
- QHash<int, int> _viewToListPos;
- QHash<int, int> _listPosToView;
+ // list of bufferviews to create
+ QList<BufferViewConfig *> _newBufferViews;
- // list of bufferviews to create
- QList<BufferViewConfig *> _newBufferViews;
+ // list of buferViews to delete
+ QList<int> _deleteBufferViews;
- // Hash of pointers to cloned bufferViewConfigs holding the changes
- QHash<BufferViewConfig *, BufferViewConfig *> _changedBufferViews;
+ // Hash of pointers to cloned bufferViewConfigs holding the changes
+ QHash<BufferViewConfig *, BufferViewConfig *> _changedBufferViews;
- int listPos(BufferViewConfig *config);
- int bufferViewId(int listPos);
- BufferViewConfig *cloneConfig(BufferViewConfig *config);
- BufferViewConfig *configForDisplay(BufferViewConfig *config);
+ int listPos(BufferViewConfig *config);
+ BufferViewConfig *bufferView(int listPos);
+ bool selectBufferViewById(int bufferViewId);
+ BufferViewConfig *cloneConfig(BufferViewConfig *config);
+ BufferViewConfig *configForDisplay(BufferViewConfig *config);
+
+ void loadConfig(BufferViewConfig *config);
+ void saveConfig(BufferViewConfig *config);
+ bool testHasChanged();
};
/**************************************************************************
* BufferViewEditDlg
*************************************************************************/
-class BufferViewEditDlg : public QDialog {
- Q_OBJECT
+class BufferViewEditDlg : public QDialog
+{
+ Q_OBJECT
public:
- BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0);
+ BufferViewEditDlg(const QString &old, const QStringList &existing = QStringList(), QWidget *parent = 0);
- inline QString bufferViewName() const { return ui.bufferViewEdit->text(); }
+ inline QString bufferViewName() const { return ui.bufferViewEdit->text(); }
private slots:
- void on_bufferViewEdit_textChanged(const QString &);
-
+ void on_bufferViewEdit_textChanged(const QString &);
+
private:
- Ui::BufferViewEditDlg ui;
+ Ui::BufferViewEditDlg ui;
- QStringList existing;
+ QStringList existing;
};
-
#endif // BUFFERVIEWSETTINGSPAGE_H