buffersettings.cpp
client.cpp
clientbacklogmanager.cpp
+ clientbufferviewconfig.cpp
+ clientbufferviewmanager.cpp
clientidentity.cpp
clientirclisthelper.cpp
clientsettings.cpp
buffermodel.h
client.h
clientbacklogmanager.h
+ clientbufferviewconfig.h
+ clientbufferviewmanager.h
clientcoreinfo.h
clientidentity.h
clientirclisthelper.h
#include "buffersettings.h"
#include "buffersyncer.h"
#include "bufferviewconfig.h"
-#include "bufferviewmanager.h"
#include "clientbacklogmanager.h"
+#include "clientbufferviewmanager.h"
#include "clientirclisthelper.h"
#include "clientidentity.h"
#include "ircchannel.h"
// create a new BufferViewManager
Q_ASSERT(!_bufferViewManager);
- _bufferViewManager = new BufferViewManager(signalProxy(), this);
+ _bufferViewManager = new ClientBufferViewManager(signalProxy(), this);
connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
connect(bufferViewManager(), SIGNAL(initDone()), this, SLOT(createDefaultBufferView()));
class ClientBacklogManager;
class ClientIrcListHelper;
class ClientSyncer;
-class BufferViewManager;
+class ClientBufferViewManager;
class IrcUser;
class IrcChannel;
class SignalProxy;
static inline ClientBacklogManager *backlogManager() { return instance()->_backlogManager; }
static inline ClientIrcListHelper *ircListHelper() { return instance()->_ircListHelper; }
- static inline BufferViewManager *bufferViewManager() { return instance()->_bufferViewManager; }
+ static inline ClientBufferViewManager *bufferViewManager() { return instance()->_bufferViewManager; }
static AccountId currentCoreAccount();
BufferModel * _bufferModel;
BufferSyncer * _bufferSyncer;
ClientBacklogManager *_backlogManager;
- BufferViewManager *_bufferViewManager;
+ ClientBufferViewManager *_bufferViewManager;
ClientIrcListHelper *_ircListHelper;
MessageModel *_messageModel;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "clientbufferviewconfig.h"
+
+ClientBufferViewConfig::ClientBufferViewConfig(int bufferViewId, QObject *parent)
+ : BufferViewConfig(bufferViewId, parent),
+ _locked(false)
+{
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#ifndef CLIENTBUFFERVIEWCONFIG_H
+#define CLIENTBUFFERVIEWCONFIG_H
+
+#include "bufferviewconfig.h"
+
+class ClientBufferViewConfig : public BufferViewConfig {
+ Q_OBJECT
+
+public:
+ ClientBufferViewConfig(int bufferViewId, QObject *parent = 0);
+
+ inline bool isLocked() { return _locked || sortAlphabetically(); }
+ inline void setLocked(bool locked) { _locked = locked; }
+ inline void lock() { setLocked(true); };
+ inline void unlock() { setLocked(false); };
+
+private:
+ bool _locked;
+};
+
+#endif //CLIENTBUFFERVIEWCONFIG_H
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "clientbufferviewmanager.h"
+
+#include "clientbufferviewconfig.h"
+
+ClientBufferViewManager::ClientBufferViewManager(SignalProxy *proxy, QObject *parent)
+ : BufferViewManager(proxy, parent)
+{
+}
+
+BufferViewConfig *ClientBufferViewManager::bufferViewConfigFactory(int bufferViewConfigId) {
+ return new ClientBufferViewConfig(bufferViewConfigId, this);
+}
+
+QList<ClientBufferViewConfig *> ClientBufferViewManager::clientBufferViewConfigs() const {
+ QList<ClientBufferViewConfig *> clientConfigs;
+ foreach(BufferViewConfig *config, bufferViewConfigs()) {
+ clientConfigs << static_cast<ClientBufferViewConfig *>(config);
+ }
+ return clientConfigs;
+}
+
+ClientBufferViewConfig *ClientBufferViewManager::clientBufferViewConfig(int bufferViewId) const {
+ return static_cast<ClientBufferViewConfig *>(bufferViewConfig(bufferViewId));
+}
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#ifndef CLIENTBUFFERVIEWMANAGER_H
+#define CLIENTBUFFERVIEWMANAGER_H
+
+#include "bufferviewmanager.h"
+class ClientBufferViewConfig;
+
+class ClientBufferViewManager : public BufferViewManager {
+ Q_OBJECT
+
+public:
+ ClientBufferViewManager(SignalProxy *proxy, QObject *parent = 0);
+
+ QList<ClientBufferViewConfig *> clientBufferViewConfigs() const;
+ ClientBufferViewConfig *clientBufferViewConfig(int bufferViewId) const;
+
+protected:
+ virtual BufferViewConfig *bufferViewConfigFactory(int bufferViewConfigId);
+};
+
+#endif //CLIENTBUFFERVIEWMANAGER_H
BufferViewConfig(int bufferViewId, QObject *parent = 0);
BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0);
+ inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
public slots:
inline int bufferViewId() const { return _bufferViewId; }
return 0;
}
+BufferViewConfig *BufferViewManager::bufferViewConfigFactory(int bufferViewConfigId) {
+ return new BufferViewConfig(bufferViewConfigId, this);
+}
+
void BufferViewManager::addBufferViewConfig(BufferViewConfig *config) {
if(_bufferViewConfigs.contains(config->bufferViewId()))
return;
if(_bufferViewConfigs.contains(bufferViewConfigId))
return;
- addBufferViewConfig(new BufferViewConfig(bufferViewConfigId, this));
+ addBufferViewConfig(bufferViewConfigFactory(bufferViewConfigId));
}
void BufferViewManager::deleteBufferViewConfig(int bufferViewConfigId) {
public:
BufferViewManager(SignalProxy *proxy, QObject *parent = 0);
+ inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; }
+
inline QList<BufferViewConfig *> bufferViewConfigs() const { return _bufferViewConfigs.values(); }
BufferViewConfig *bufferViewConfig(int bufferViewId) const;
protected:
typedef QHash<int, BufferViewConfig *> BufferViewConfigHash;
inline const BufferViewConfigHash &bufferViewConfigHash() { return _bufferViewConfigs; }
+ virtual BufferViewConfig *bufferViewConfigFactory(int bufferViewConfigId);
private:
BufferViewConfigHash _bufferViewConfigs;
#include "actioncollection.h"
#include "buffermodel.h"
#include "bufferview.h"
-#include "bufferviewmanager.h"
#include "bufferwidget.h"
#include "channellistdlg.h"
#include "chatlinemodel.h"
#include "client.h"
#include "clientsyncer.h"
#include "clientbacklogmanager.h"
+#include "clientbufferviewconfig.h"
+#include "clientbufferviewmanager.h"
#include "coreinfodlg.h"
#include "coreconnectdlg.h"
#include "contextmenuactionprovider.h"
restoreState(s.value("MainWinState").toByteArray());
// restore locked state of docks
- QtUi::actionCollection("General")->action("LockDockPositions")->setChecked(s.value("LockDocks", false).toBool());
+ QtUi::actionCollection("General")->action("LockLayout")->setChecked(s.value("LockLayout", false).toBool());
setDisconnectedState(); // Disable menus and stuff
coll->addAction("ConfigureBufferViews", new Action(tr("&Configure Buffer Views..."), coll,
this, SLOT(on_actionConfigureViews_triggered())));
- QAction *lockAct = coll->addAction("LockDockPositions", new Action(tr("&Lock Dock Positions"), coll));
+ QAction *lockAct = coll->addAction("LockLayout", new Action(tr("&Lock Layout"), coll));
lockAct->setCheckable(true);
- connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockDockPositions_toggled(bool)));
+ connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
coll->addAction("ToggleSearchBar", new Action(SmallIcon("edit-find"), tr("Show &Search Bar"), coll,
0, 0, tr("Ctrl+F")))->setCheckable(true);
_viewMenu->addAction(coll->action("ToggleStatusBar"));
_viewMenu->addSeparator();
- _viewMenu->addAction(coll->action("LockDockPositions"));
+ _viewMenu->addAction(coll->action("LockLayout"));
_settingsMenu = menuBar()->addMenu(tr("&Settings"));
#ifdef HAVE_KDE
}
void MainWin::addBufferView(int bufferViewConfigId) {
- addBufferView(Client::bufferViewManager()->bufferViewConfig(bufferViewConfigId));
+ addBufferView(Client::bufferViewManager()->clientBufferViewConfig(bufferViewConfigId));
}
-void MainWin::addBufferView(BufferViewConfig *config) {
+void MainWin::addBufferView(ClientBufferViewConfig *config) {
if(!config)
return;
dlg.exec();
}
-void MainWin::on_actionLockDockPositions_toggled(bool lock) {
+void MainWin::on_actionLockLayout_toggled(bool lock) {
QList<VerticalDock *> docks = findChildren<VerticalDock *>();
foreach(VerticalDock *dock, docks) {
dock->showTitle(!lock);
}
- QtUiSettings().setValue("LockDocks", lock);
+ foreach(ClientBufferViewConfig *config, Client::bufferViewManager()->clientBufferViewConfigs()) {
+ config->setLocked(lock);
+ }
+ QtUiSettings().setValue("LockLayout", lock);
}
void MainWin::setupNickWidget() {
class ActionCollection;
class BufferView;
class BufferViewConfig;
+class ClientBufferViewConfig;
class BufferViewDock;
class BufferWidget;
class InputWidget;
void init();
- void addBufferView(BufferViewConfig *config);
+ void addBufferView(ClientBufferViewConfig *config);
BufferView *allBuffersView() const;
inline QSystemTrayIcon *systemTrayIcon() const;
#endif
void on_actionConfigureNetworks_triggered();
void on_actionConfigureViews_triggered();
- void on_actionLockDockPositions_toggled(bool lock);
+ void on_actionLockLayout_toggled(bool lock);
void on_actionDebugNetworkModel_triggered();
void on_actionDebugMessageModel_triggered();
void on_actionDebugLog_triggered();
#include "network.h"
#include "bufferviewconfig.h"
#include "bufferviewfilter.h"
-#include "bufferviewmanager.h"
#include "buffermodel.h"
+#include "clientbufferviewmanager.h"
#include "networkmodel.h"
BufferViewSettingsPage::BufferViewSettingsPage(QWidget *parent)
#include "buffermodel.h"
#include "buffersettings.h"
#include "client.h"
+#include "clientbufferviewconfig.h"
#include "iconloader.h"
#include "networkmodel.h"
Qt::ItemFlags BufferViewFilter::flags(const QModelIndex &index) const {
QModelIndex source_index = mapToSource(index);
Qt::ItemFlags flags = sourceModel()->flags(source_index);
- if(_config) {
+ if(config()) {
if(source_index == QModelIndex() || sourceModel()->data(source_index, NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType) {
flags |= Qt::ItemIsDropEnabled;
} else if(_editMode) {
flags |= Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
}
+ ClientBufferViewConfig *clientConf = qobject_cast<ClientBufferViewConfig *>(config());
+ if(clientConf && clientConf->isLocked()) {
+ flags &= ~(Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled);
+ }
}
return flags;
}