00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 void TGo4OpenRemoteDialog::init()
00027 {
00028 TGo4QSettings settings;
00029 QString hostname = settings.readEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/Host", "machine.gsi.de");
00030 QString filename = settings.readEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/File", "tmp/hsimple.root");
00031 QString protocol = settings.readEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/Type", "root:");
00032 ServerEdit->setText(hostname);
00033 fxServer=hostname;
00034 FileNameEdit->setText(filename);
00035 fxFile=filename;
00036 fxType=protocol;
00037 if(protocol.contains("root:"))
00038 TypeSelectorBox->setCurrentItem(0);
00039 else if (protocol.contains("rfio:"))
00040 TypeSelectorBox->setCurrentItem(1);
00041 else if (protocol.contains("http:"))
00042 TypeSelectorBox->setCurrentItem(2);
00043 else
00044 TypeSelectorBox->setCurrentItem(3);
00045 TypeSelectorBox_activated(protocol);
00046 }
00047
00048 void TGo4OpenRemoteDialog::destroy()
00049 {
00050 TGo4QSettings settings;
00051 QString server=GetServer();
00052 QString fname=GetFileName();
00053 QString protocol=GetFileType();
00054 if(protocol.contains("root:"))
00055 protocol="root:";
00056 else if (protocol.contains("rfio:"))
00057 protocol="rfio:";
00058 else if (protocol.contains("http:"))
00059 protocol="http:";
00060 else
00061 protocol="local:";
00062 settings.writeEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/Host", server);
00063 settings.writeEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/File", fname);
00064 settings.writeEntry( TGo4QSettings::GetSettingsName()+"/OpenRemoteFile/Type", protocol);
00065 }
00066
00067
00068
00069 void TGo4OpenRemoteDialog::TypeSelectorBox_activated( const QString & tname)
00070 {
00071 if(tname.contains("root:") || tname.contains("http:") || tname.contains("rfio:"))
00072 ServerEdit->setEnabled(true);
00073 else
00074 ServerEdit->setEnabled(false);
00075 fxType=tname;
00076 }
00077
00078
00079 const QString& TGo4OpenRemoteDialog::GetFileName()
00080 {
00081
00082 return fxFile;
00083 }
00084
00085
00086 const QString& TGo4OpenRemoteDialog::GetFileType()
00087 {
00088
00089 return fxType;
00090 }
00091
00092
00093 const QString& TGo4OpenRemoteDialog::GetServer()
00094 {
00095
00096 return fxServer;
00097 }
00098
00099
00100
00101 void TGo4OpenRemoteDialog::ServerEdit_textChanged( const QString & txt)
00102 {
00103 fxServer=txt;
00104 }
00105
00106
00107 void TGo4OpenRemoteDialog::FileNameEdit_textChanged( const QString & txt)
00108 {
00109 fxFile=txt;
00110 }
00111
00112