00001 #ifndef ArcStorageWindow_H 00002 #define ArcStorageWindow_H 00003 00004 namespace Ui { 00005 class ArcStorageWindow; 00006 } 00007 00008 #include "dragdropabletreewidget.h" 00009 00010 #include <QMainWindow> 00011 #include <QTreeWidget> 00012 #include <QModelIndex> 00013 #include <arc/Logger.h> 00014 #include <QComboBox> 00015 #include <QStack> 00016 #include <QProcess> 00017 00018 #include "qdebugstream.h" 00019 #include "transferlistwindow.h" 00020 #include "filetransferlist.h" 00021 #include "srmfileserver.h" 00022 00023 #include "filepropertyinspector.h" 00024 00025 00026 00027 enum updateFileListsMode { CUFLM_noUpdate, 00028 CUFLM_syncBoth, 00029 CUFLM_clickedBrowse, 00030 CUFLM_clickedUp, 00031 CUFLM_expandedFolder, 00032 CUFLM_clickedFolder, 00033 CUFLM_doubleClickedFolder 00034 }; 00035 00036 class ArcStorageWindow : public QMainWindow 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 explicit ArcStorageWindow(QWidget *parent = 0, bool childWindow = false, QString Url=""); 00042 ~ArcStorageWindow(); 00043 00044 void onNewStatus(QString errorStr); 00045 00046 void setBusyUI(bool busy); 00047 void deleteSelectedFiles(); 00048 void createDir(); 00049 QString getCurrentURL(); 00050 QMenu* getWindowListMenu(); 00051 00052 void writeSettings(); 00053 void readSettings(); 00054 00055 void openUrl(QString url); 00056 void setWindowId(int id); 00057 int getWindowId(); 00058 00059 private: 00060 Ui::ArcStorageWindow *ui; 00061 DragDropableTreeWidget m_filesTreeWidget; 00062 QComboBox m_urlComboBox; 00063 00064 SRMFileServer *m_currentFileServer; 00065 QString m_folderListUrl; 00066 QString m_startUrl; 00067 00068 static const QString COPY_TO_TEXT; 00069 static const QString COPY_TEXT; 00070 static const QString DELETE_TEXT; 00071 static const QString CHANGE_OWNER_TEXT; 00072 static const QString MAKEDIR_TEXT; 00073 static const QString CHANGE_PERMISSIONS_TEXT; 00074 00075 enum updateFileListsMode m_currentUpdateFileListsMode; 00076 QTreeWidgetItem *m_folderWidgetBeingUpdated; 00077 00078 void updateFileTree(); 00079 void updateFoldersTree(); 00080 void updateFoldersTreeBelow(); 00081 void expandFolderTreeWidget(QTreeWidgetItem *folderWidget); 00082 QString getURLOfItem(QTreeWidgetItem *item); 00083 void setURLOfItem(QTreeWidgetItem *item, QString URL); 00084 00085 QString getCurrentComboBoxURL(); 00086 void setCurrentComboBoxURL(QString url); 00087 00088 QStringList fileTreeHeaderLabels; 00089 00090 QStringList m_breadCrumbItems; 00091 QStack<QString> m_backStack; 00092 00093 void pushUrl(QString url); 00094 QString popUrl(); 00095 00096 Arc::LogStream* m_logStream; 00097 QDebugStream* m_debugStream; 00098 QDebugStream* m_debugStream2; 00099 00100 bool m_childWindow; 00101 int m_windowId; 00102 00103 TransferListWindow* m_transferWindow; 00104 FilePropertyInspector* m_filePropertyInspector; 00105 00106 FileTransferProcessingThread* m_fileProcessingThread; 00107 00108 QProcess* m_tarProcess; 00109 QString m_tarFilename; 00110 QString m_tarDestDir; 00111 00112 protected: 00113 void showEvent(QShowEvent *e); 00114 void closeEvent( QCloseEvent *e ); 00115 00116 private Q_SLOTS: 00117 void onURLEditReturnPressed(); 00118 void onContextMenu(const QPoint& pos); 00119 void onUrlComboBoxCurrentIndexChanged(int index); 00120 void onBreadCrumbTriggered(); 00121 00122 void on_actionDelete_triggered(); 00123 void on_actionQuit_triggered(); 00124 void on_foldersTreeWidget_itemExpanded(QTreeWidgetItem* item); 00125 void on_foldersTreeWidget_clicked(QModelIndex index); 00126 void on_foldersTreeWidget_itemClicked(QTreeWidgetItem* item, int column); 00127 void on_foldersTreeWidget_expanded(QModelIndex index); 00128 void on_actionAbout_ARC_File_Navigator_triggered(); 00129 void on_actionUp_triggered(); 00130 void on_actionNewWindow_triggered(); 00131 void on_filesTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column); 00132 void on_actionClearSelection_triggered(); 00133 void on_actionSelectAllFiles_triggered(); 00134 void on_actionCreateDir_triggered(); 00135 void on_actionShowTransferList_triggered(); 00136 void on_actionOpenNewLocation_triggered(); 00137 void on_actionSRM_Preferences_triggered(); 00138 void on_actionReload_triggered(); 00139 00140 void on_actionCreateProxyCert_triggered(); 00141 00142 void on_actionConvertCertificates_triggered(); 00143 00144 void on_actionJobManager_triggered(); 00145 00146 void on_actionJobSubmissionTool_triggered(); 00147 00148 void on_actionStop_triggered(); 00149 00150 void on_actionSettings_triggered(); 00151 00152 void on_filesTreeWidget_customContextMenuRequested(const QPoint &pos); 00153 00154 void on_actionCopyURL_triggered(); 00155 00156 void on_filesTreeWidget_itemClicked(QTreeWidgetItem *item, int column); 00157 00158 void on_actionCopyURLFilename_triggered(); 00159 00160 void on_actionShowFileProperties_triggered(); 00161 00162 void on_actionBack_triggered(); 00163 00164 void on_actionHelpContents_triggered(); 00165 00166 void on_actionDownloadSelected_triggered(); 00167 00168 void on_actionUploadSelected_triggered(); 00169 00170 void on_actionUploadDirectory_triggered(); 00171 00172 void on_actionUploadDirAndArchive_triggered(); 00173 00174 void onTarErrorOutput(); 00175 void onTarStandardOutput(); 00176 void onTarFinished(int exitCode, QProcess::ExitStatus exitStatus); 00177 00178 public Q_SLOTS: 00179 void onFilesDroppedInFileListWidget(QList<QUrl> &urlList); 00180 void onFileListFinished(bool error, QString errorMsg); 00181 void onError(QString errorStr); 00182 void onCopyFromServerFinished(bool error); 00183 void onDeleteFinished(bool error); 00184 void onMakeDirFinished(bool error); 00185 void onCopyToServerFinished(bool error, QList<QString> &failedFiles); 00186 00187 }; 00188 00189 #endif // ArcStorageWindow_H