summaryrefslogtreecommitdiffstats
path: root/src/gui/connectionList.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/connectionList.h')
-rw-r--r--src/gui/connectionList.h134
1 files changed, 134 insertions, 0 deletions
diff --git a/src/gui/connectionList.h b/src/gui/connectionList.h
new file mode 100644
index 0000000..50d8924
--- /dev/null
+++ b/src/gui/connectionList.h
@@ -0,0 +1,134 @@
+#ifndef _CONNECTIONLIST_H_
+#define _CONNECTIONLIST_H_
+
+#include <QtGui>
+#include <src/core/pvsClient.h>
+#include <QTableView>
+#include <QObject>
+#include <QMap>
+#include <QItemSelection>
+#include <src/gui/mainWindow.h>
+#include <src/gui/dialog.h>
+#include <src/gui/projectionDialog.h>
+
+class PVSClient;
+
+//class QAbstractItemView;
+
+
+/**
+ * The Sidebar showing the connected servers
+ * also used to determine to which connection
+ * contextual actions should be applied
+ */
+
+class QVBoxLayout;
+class QSortFilterProxyModel;
+class QAbstractItemModel;
+class QAbstractItemView;
+class QItemSelectionModel;
+class MainWindow;
+class Dialog;
+class ProjectionDialog;
+//class ConnectionList;
+
+class ConnectionList: public QTableView
+{
+ Q_OBJECT
+
+public:
+ ConnectionList(QWidget *parent=0);
+ ~ ConnectionList();
+
+ void onAddClient(PVSClient* newConnection); // called if a new connection is added
+ void onUpdateClient(PVSClient* newConnection); // update the username*/
+ void addClientToList(QString clientname);
+ void onRemoveClient(PVSClient* newCon);
+ void removeClientToList(QString clientname);
+ QList<QString> getClientist()
+ {
+ return _clientNames;
+ };
+ // void updateAllClients();
+ bool useUserName();
+ bool useUserName(bool use);
+ QList<QString> projectList;
+ QList<QString> targetList;
+ QList<QString> displayList;
+ QList<QString> sourceList;
+ QMap<QString, QList<QString> > sourceMap;
+ QString projSourceName;
+ std::list<QString>* getSelectedClients(bool isClickOnWindow=false); // returns the currently selected clients
+ //void setTargetToDisplay(QString source); // return the list for the projection
+ void setProjectProporties(QString source);
+ QList<QString> getTargetToDisplay(QString source);
+ void addTargetToProjectList(QString name);
+ QList<QString> getTargetForTheProject(QString source);
+ QList<QString>getTargetToProject()
+ {
+ return projectList;
+ }
+ // void removeFromList(PVSConnection* newConnection); // called if a connection is removed
+ // void setMultipleSelection(bool on);
+
+ QAbstractItemModel *model;
+
+private:
+ QItemSelectionModel *_selectionModel;
+ QList<QString> _clientNames;
+
+ int clientindex; //Index of clientname in the list.
+
+ static bool isOnProjection;
+
+ QMenu *_popupMenu; // in der PopupMenu
+ /*Die Aktionen in der PopupMenu*/
+ /* QAction *a1 ;
+ QAction *a2 ;
+ QAction *a3 ;*/
+ QAction *_lockClient ;
+ QAction *_uLockClient ;
+ /*QAction *invertlockClient ;
+ QAction *LockAllClient ;
+ QAction *uLockAllClient ;*/
+ QAction *_msgLockClient ;
+ QAction *_msgLockAllClient ;
+ QAction *_msgClient ;
+ QAction *_project ;
+ QAction *_uproject ;
+ // QAction *rHelp ;
+
+ void preparePopup();
+ void unproject(QString source);
+ QAction* createToolbarButton(const QString &name, const char *slot);
+
+public slots:
+ //Signal handlers:
+
+ virtual void on_projection();
+ virtual void on_unprojection();
+ virtual void on_lock();
+ virtual void on_unlock();
+ virtual void on_message();
+ virtual void on_lock_with_message();
+ virtual void on_lock_all_with_message();
+ virtual void on_lock_all();
+ virtual void on_unlock_all();
+ virtual void on_unproject_all();
+ virtual void on_lock_invert();
+ virtual void on_remoteHelp();
+ void on_vnc_add();
+ void on_vnc_remove();
+ void on_removeClient();
+ void removeClient(QModelIndexList indexes);
+ /*virtual void on_menu_file_remove_connection();*/
+
+signals:
+ void selectionChanged (const QItemSelection &selected);
+
+protected:
+ bool _useUserName;
+ virtual void mouseReleaseEvent (QMouseEvent * e );
+};
+
+#endif