casa
$Rev:20696$
|
00001 //# Copyright (C) 2005 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This library is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU Library General Public License as published by 00006 //# the Free Software Foundation; either version 2 of the License, or (at your 00007 //# option) any later version. 00008 //# 00009 //# This library is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 //# License for more details. 00013 //# 00014 //# You should have received a copy of the GNU Library General Public License 00015 //# along with this library; if not, write to the Free Software Foundation, 00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 //# $Id: $ 00026 00027 00028 #ifndef FILECATALOG_H 00029 #define FILECATALOG_H 00030 00031 #include <graphics/X11/X_enter.h> 00032 #include <QMainWindow> 00033 #include <QMap> 00034 #include <QModelIndex> 00035 #include <QPointer> 00036 00037 00038 class QAction; 00039 class QComboBox; 00040 class QLineEdit; 00041 class QTreeView; 00042 class QDir; 00043 class QMenu; 00044 class QFile; 00045 class QSortFilterProxyModel; 00046 class QComboBox; 00047 class QStringList; 00048 class QLabel; 00049 00050 #include <graphics/X11/X_exit.h> 00051 00052 namespace casa { 00053 00054 class DirModel; 00055 00056 class FileCatalog : public QMainWindow 00057 { 00058 Q_OBJECT 00059 00060 public: 00061 FileCatalog(QString logger = 0, QWidget *parent = 0); 00062 00063 protected: 00064 virtual void closeEvent(QCloseEvent *e); 00065 00066 private: 00067 void setupActions(); 00068 void updateMenus(); 00069 bool load(QDir *f); 00070 bool removeDir(const QString &); 00071 bool copyDir(QString &, QString &); 00072 bool maybeSave(); 00073 bool canDel; 00074 bool canNew; 00075 bool canOpen; 00076 bool canGo; 00077 bool hasSelected; 00078 00079 00080 private slots: 00081 void fileNew(); 00082 void dirNew(); 00083 void fileOpen(); 00084 00085 void search(); 00086 void remove(); 00087 void changeDir(); 00088 void changeDir(int); 00089 void changeDir(QString); 00090 void copy(); 00091 void paste(); 00092 void rename(); 00093 void insert(); 00094 void doFilter(); 00095 void filterChanged(QAction*); 00096 void clicked(const QModelIndex &index); 00097 private: 00098 00099 QAction *actionNew, 00100 *actionOpen, 00101 *actionCD, 00102 *actionSearch, 00103 *actionFilter, 00104 *actionInsert, 00105 *actionRename, 00106 *actionCopy, 00107 *actionPaste, 00108 *actionDelete; 00109 00110 QLineEdit *searchText; 00111 QLineEdit *insertText; 00112 00113 QComboBox *filterColumn; 00114 QStringList filterList; 00115 QComboBox *visitedDir; 00116 QStringList visitedList; 00117 00118 QToolBar *tb; 00119 QToolBar *tb2; 00120 QLabel *searchLabel; 00121 QLabel *insertLabel; 00122 00123 QString copyName; 00124 QModelIndex currentLogRow; 00125 QString currentSearch; 00126 00127 QString fileName; 00128 00129 QTreeView *dirView; 00130 DirModel *dirModel; 00131 QSortFilterProxyModel *proxyModel; 00132 QDir* dir; 00133 }; 00134 00135 } 00136 #endif