#ifndef _CONNECTIONLIST_H_ #define _CONNECTIONLIST_H_ #include #include #include #include #include #include #include #include #include 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 getClientist() { return _clientNames; }; // void updateAllClients(); bool useUserName(); bool useUserName(bool use); QList projectList; QList targetList; QList displayList; QList sourceList; QMap > sourceMap; QString projSourceName; std::list* getSelectedClients(bool isClickOnWindow=false); // returns the currently selected clients //void setTargetToDisplay(QString source); // return the list for the projection void setProjectProporties(QString source); QList getTargetToDisplay(QString source); void addTargetToProjectList(QString name); QList getTargetForTheProject(QString source); QListgetTargetToProject() { return projectList; } // void removeFromList(PVSConnection* newConnection); // called if a connection is removed // void setMultipleSelection(bool on); QAbstractItemModel *model; private: QItemSelectionModel *_selectionModel; QList _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