/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2020 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. *
***************************************************************************/
-#ifndef TOOLBARACTIONPROVIDER_H_
-#define TOOLBARACTIONPROVIDER_H_
+#pragma once
+
+#include "uisupport-export.h"
#include "networkmodelcontroller.h"
class QToolBar;
-class ToolBarActionProvider : public NetworkModelController
+class UISUPPORT_EXPORT ToolBarActionProvider : public NetworkModelController
{
Q_OBJECT
public:
- ToolBarActionProvider(QObject *parent = 0);
- virtual ~ToolBarActionProvider();
+ ToolBarActionProvider(QObject* parent = nullptr);
- enum ToolBarType {
+ enum ToolBarType
+ {
MainToolBar,
ChatViewToolBar,
NickToolBar
};
- void addActions(QToolBar *, ToolBarType type);
+ void addActions(QToolBar*, ToolBarType type);
public slots:
- virtual void disconnectedFromCore();
+ void disconnectedFromCore() override;
+ void onCurrentBufferChanged(const QModelIndex&);
+ void onNickSelectionChanged(const QModelIndexList&);
protected:
- virtual void handleNetworkAction(ActionType, QAction *);
- virtual void handleBufferAction(ActionType, QAction *);
- virtual void handleNickAction(ActionType, QAction *);
- virtual void handleGeneralAction(ActionType, QAction *);
+ void handleNetworkAction(ActionType, QAction*) override;
+ void handleBufferAction(ActionType, QAction*) override;
+ void handleNickAction(ActionType, QAction*) override;
+ void handleGeneralAction(ActionType, QAction*) override;
private slots:
void networkCreated(NetworkId id);
void networkRemoved(NetworkId id);
- void networkUpdated(const Network *net = 0);
+ void networkUpdated(const Network* net = nullptr);
void connectOrDisconnectNet();
- void currentBufferChanged(const QModelIndex &);
- void nickSelectionChanged(const QModelIndexList &);
-
void updateStates();
private:
QMenu *_networksConnectMenu, *_networksDisconnectMenu;
- QHash<NetworkId, Action *> _networkActions;
+ QHash<NetworkId, Action*> _networkActions;
QModelIndex _currentBuffer;
QModelIndexList _selectedNicks;
};
-
-
-#endif