GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4OpenRemoteDialog.cpp
Go to the documentation of this file.
1 // $Id: TGo4OpenRemoteDialog.cpp 478 2009-10-29 12:26:09Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4OpenRemoteDialog.h"
15 #include "TGo4QSettings.h"
16 
18  : QDialog( parent )
19 
20 {
21  setObjectName("Go4OpenRemoteDialog");
22  setupUi(this);
23  QString hostname, filename, protocol;
24  go4sett->getRemoteFileSett(hostname, filename, protocol);
25 
26  ServerEdit->setText(hostname);
27  fxServer=hostname;
28  FileNameEdit->setText(filename);
29  fxFile=filename;
30  fxType=protocol;
31  if(protocol.contains("root:"))
32  TypeSelectorBox->setCurrentIndex(0);
33  else
34  if (protocol.contains("rfio:"))
35  TypeSelectorBox->setCurrentIndex(1);
36  else
37  if (protocol.contains("http:"))
38  TypeSelectorBox->setCurrentIndex(2);
39  else
40  TypeSelectorBox->setCurrentIndex(3);
41  TypeSelectorBox_activated(protocol);
42 }
43 
45 {
46  QString server = GetServer();
47  QString fname = GetFileName();
48  QString protocol = GetFileType();
49  if(protocol.contains("root:"))
50  protocol="root:";
51  else
52  if (protocol.contains("rfio:"))
53  protocol="rfio:";
54  else
55  if (protocol.contains("http:"))
56  protocol="http:";
57  else
58  protocol="local:";
59  go4sett->setRemoteFileSett(server, fname, protocol);
60 }
61 
62 
63 
65 {
66  if(tname.contains("root:") || tname.contains("http:") || tname.contains("rfio:"))
67  ServerEdit->setEnabled(true);
68  else
69  ServerEdit->setEnabled(false);
70  fxType=tname;
71 }
72 
73 
75 {
76  return fxFile;
77 }
78 
80 {
81  return fxType;
82 }
83 
84 
86 {
87  return fxServer;
88 }
89 
91 {
92  fxServer=txt;
93 }
94 
95 
97 {
98  fxFile=txt;
99 }
const QString & GetServer()
void getRemoteFileSett(QString &hostname, QString &filename, QString &protocol)
virtual void ServerEdit_textChanged(const QString &txt)
const QString & GetFileName()
TGo4OpenRemoteDialog(QWidget *parent=0)
TGo4QSettings * go4sett
void setRemoteFileSett(const QString &hostname, const QString &filename, const QString &protocol)
virtual void TypeSelectorBox_activated(const QString &tname)
virtual void FileNameEdit_textChanged(const QString &txt)
const QString & GetFileType()