00001 // $Id: TGo4OpenRemoteDialog.cpp 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TGo4OpenRemoteDialog.h" 00015 #include "TGo4QSettings.h" 00016 00017 TGo4OpenRemoteDialog::TGo4OpenRemoteDialog( QWidget* parent) 00018 : QDialog( parent ) 00019 00020 { 00021 setObjectName("Go4OpenRemoteDialog"); 00022 setupUi(this); 00023 QString hostname, filename, protocol; 00024 go4sett->getRemoteFileSett(hostname, filename, protocol); 00025 00026 ServerEdit->setText(hostname); 00027 fxServer=hostname; 00028 FileNameEdit->setText(filename); 00029 fxFile=filename; 00030 fxType=protocol; 00031 if(protocol.contains("root:")) 00032 TypeSelectorBox->setCurrentIndex(0); 00033 else 00034 if (protocol.contains("rfio:")) 00035 TypeSelectorBox->setCurrentIndex(1); 00036 else 00037 if (protocol.contains("http:")) 00038 TypeSelectorBox->setCurrentIndex(2); 00039 else 00040 TypeSelectorBox->setCurrentIndex(3); 00041 TypeSelectorBox_activated(protocol); 00042 } 00043 00044 TGo4OpenRemoteDialog::~TGo4OpenRemoteDialog() 00045 { 00046 QString server = GetServer(); 00047 QString fname = GetFileName(); 00048 QString protocol = GetFileType(); 00049 if(protocol.contains("root:")) 00050 protocol="root:"; 00051 else 00052 if (protocol.contains("rfio:")) 00053 protocol="rfio:"; 00054 else 00055 if (protocol.contains("http:")) 00056 protocol="http:"; 00057 else 00058 protocol="local:"; 00059 go4sett->setRemoteFileSett(server, fname, protocol); 00060 } 00061 00062 00063 00064 void TGo4OpenRemoteDialog::TypeSelectorBox_activated( const QString & tname) 00065 { 00066 if(tname.contains("root:") || tname.contains("http:") || tname.contains("rfio:")) 00067 ServerEdit->setEnabled(true); 00068 else 00069 ServerEdit->setEnabled(false); 00070 fxType=tname; 00071 } 00072 00073 00074 const QString& TGo4OpenRemoteDialog::GetFileName() 00075 { 00076 return fxFile; 00077 } 00078 00079 const QString& TGo4OpenRemoteDialog::GetFileType() 00080 { 00081 return fxType; 00082 } 00083 00084 00085 const QString& TGo4OpenRemoteDialog::GetServer() 00086 { 00087 return fxServer; 00088 } 00089 00090 void TGo4OpenRemoteDialog::ServerEdit_textChanged( const QString & txt) 00091 { 00092 fxServer=txt; 00093 } 00094 00095 00096 void TGo4OpenRemoteDialog::FileNameEdit_textChanged( const QString & txt) 00097 { 00098 fxFile=txt; 00099 }