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 #ifndef FILELOADER_QO_H 00026 #define FILELOADER_QO_H 00027 00028 #include <QtGui/QDialog> 00029 #include <guitools/Feather/FileLoader.ui.h> 00030 00031 class QFileSystemModel; 00032 class QKeyEvent; 00033 00034 namespace casa { 00035 00036 class FileLoader : public QDialog 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 FileLoader(QWidget *parent = 0); 00042 ~FileLoader(); 00043 QString getFilePathLowResolution() const; 00044 QString getFilePathHighResolution() const; 00045 QString getFilePathOutput() const; 00046 QString getFileDirty() const; 00047 bool isOutputSaved() const; 00048 void updateOutput(const QString& directory, const QString& file ); 00049 00050 signals: 00051 void imageFilesChanged(); 00052 00053 public slots: 00054 void saveStateChanged( int checked ); 00055 00056 protected: 00057 void keyPressEvent( QKeyEvent* event ); 00058 00059 private slots: 00060 void filesChanged(); 00061 void filesReset(); 00062 void directoryChanged(const QModelIndex& modelIndex ); 00063 void fileLowResolutionChanged(); 00064 void fileHighResolutionChanged(); 00065 void outputDirectoryChanged(); 00066 void dirtyImageChanged(); 00067 void validateDirectory( const QString& str ); 00068 00069 private: 00070 bool validatePath( QLineEdit* lineEdit, const QString& errorPrefix, bool file, QString& destination ); 00071 void fileChanged( QLineEdit* destinationLineEdit, const QString& emptyWarning, bool directory ); 00072 QString lowResolutionImageFile; 00073 QString highResolutionImageFile; 00074 QString outputFile; 00075 QString outputDirectory; 00076 QString dirtyImageFile; 00077 QFileSystemModel* fileModel; 00078 bool saveOutput; 00079 Ui::FileLoaderClass ui; 00080 }; 00081 00082 } 00083 00084 #endif // FILELOADER_QO_H