itom 1.4.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef FILESYSTEMDOCKWIDGET_H 00024 #define FILESYSTEMDOCKWIDGET_H 00025 00026 #include "../helper/IOHelper.h" 00027 #include "abstractDockWidget.h" 00028 00029 #include "itomQWidgets.h" 00030 00031 #include <qwidget.h> 00032 #include <qaction.h> 00033 #include <qtoolbar.h> 00034 00035 #include <qtextbrowser.h> 00036 #include <qtreeview.h> 00037 #include <qlabel.h> 00038 #include <qfilesystemmodel.h> 00039 #include <qhash.h> 00040 #include <qmutex.h> 00041 #include <qmenu.h> 00042 #include <qcombobox.h> 00043 #include <qprocess.h> 00044 #include <qevent.h> 00045 #include <qurl.h> 00046 00047 #include <qsignalmapper.h> 00048 00049 00050 namespace ito 00051 { 00052 class FileSystemDockWidget : public AbstractDockWidget 00053 { 00054 Q_OBJECT 00055 00056 public: 00057 FileSystemDockWidget(const QString &title, const QString &objName, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled, const QString &baseDirectory = QDir::currentPath()); 00058 ~FileSystemDockWidget(); 00059 00060 protected: 00061 void createActions(); 00062 void createMenus(); 00063 void createToolBars(); 00064 void createStatusBar(){} 00065 void updateActions(); 00066 void updatePythonActions(){ updateActions(); } 00067 00068 QString getHtmlTag(const QString &tag); 00069 00070 bool eventFilter(QObject *obj, QEvent *event); 00071 00072 private: 00073 void fillFilterList(); 00074 void showInGraphicalShell(const QString &filePath); 00075 00076 QMenu* m_pShowDirListMenu; 00077 QMenu* m_pFileSystemSettingMenu; 00078 QMenu* m_pContextMenu; 00079 QTextBrowser* m_pPathEdit; 00080 QToolBar* m_pMainToolbar; 00081 QTreeViewItom* m_pTreeView; 00082 QLabel* m_pLblFilter; 00083 QComboBox* m_pCmbFilter; 00084 QFileSystemModel* m_pFileSystemModel; 00085 QSignalMapper *m_newDirSelectedMapper; 00086 QString baseDirectory; 00087 QHash<QString,QStringList> defaultFilterPatterns; 00088 QMutex baseDirChangeMutex; 00089 QList<QUrl> m_clipboardCutData; //this mime-data has recently be selected by a cut action and is no available in QClipboard 00090 int *m_pColumnWidth; 00091 00092 ShortcutAction* m_pActMoveCDUp; 00093 ShortcutAction* m_pActSelectCD; 00094 ShortcutAction* m_pActCopyDir; 00095 ShortcutAction* m_pActPasteDir; 00096 ShortcutAction* m_pActOpenFile; 00097 ShortcutAction* m_pActExecuteFile; 00098 ShortcutAction* m_pActLocateOnDisk; 00099 ShortcutAction* m_pActRenameItem; 00100 ShortcutAction* m_pActDeleteItems; 00101 ShortcutAction* m_pActCutItems; 00102 ShortcutAction* m_pActCopyItems; 00103 ShortcutAction* m_pActPasteItems; 00104 ShortcutAction* m_pActNewDir; 00105 ShortcutAction* m_pActNewPyFile; 00106 ShortcutAction* m_pViewList; 00107 ShortcutAction* m_pViewDetails; 00108 00109 QAction *m_lastMovedShowDirAction; 00110 00111 signals: 00112 void currentDirChanged(); 00113 00114 private slots: 00115 void mnuMoveCDUp(); 00116 void mnuSelectCD(); 00117 void mnuCopyDir(); 00118 void mnuPasteDir(); 00119 void mnuLocateOnDisk(); 00120 void mnuExecuteFile(); 00121 void mnuOpenFile(); 00122 void mnuRenameItem(); 00123 void mnuDeleteItems(); 00124 void mnuCutItems(); 00125 void mnuCopyItems(); 00126 void mnuPasteItems(); 00127 void mnuNewDir(); 00128 void mnuNewPyFile(); 00129 void showList(); 00130 void showDetails(); 00131 void mnuToggleView(); 00132 void newDirSelected(const QString& text); 00133 void cmbFilterEditTextChanged(const QString &text); 00134 void openFile(const QModelIndex& index); 00135 void treeViewContextMenuRequested(const QPoint &pos); 00136 void setTreeViewHideColumns(const bool &hide); 00137 void removeActionFromDirList(const int &pos); 00138 void changeDir(); 00139 00140 void pathAnchorClicked(const QUrl &link); 00141 00142 public slots: 00143 RetVal changeBaseDirectory(QString dir); 00144 void processError(QProcess::ProcessError error); 00145 }; 00146 00147 } //end namespace ito 00148 00149 #endif