GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4OpenRemoteDialog.cpp
Go to the documentation of this file.
1 // $Id: TGo4OpenRemoteDialog.cpp 3127 2021-03-30 09:23:27Z 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 fuer 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  setObjectName("Go4OpenRemoteDialog");
21  setupUi(this);
22  QObject::connect(TypeSelectorBox, SIGNAL(activated(QString)), this, SLOT(TypeSelectorBox_activated(QString)));
23  QObject::connect(ServerEdit, SIGNAL(textChanged(QString)), this, SLOT(ServerEdit_textChanged(QString)));
24  QObject::connect(FileNameEdit, SIGNAL(textChanged(QString)), this, SLOT(FileNameEdit_textChanged(QString)));
25 
26  QString hostname, filename, protocol;
27  go4sett->getRemoteFileSett(hostname, filename, protocol);
28 
29  ServerEdit->setText(hostname);
30  fxServer=hostname;
31  FileNameEdit->setText(filename);
32  fxFile=filename;
33  fxType=protocol;
34  if(protocol.contains("root:"))
35  TypeSelectorBox->setCurrentIndex(0);
36  else
37  if (protocol.contains("rfio:"))
38  TypeSelectorBox->setCurrentIndex(1);
39  else
40  if (protocol.contains("http:"))
41  TypeSelectorBox->setCurrentIndex(2);
42  else
43  TypeSelectorBox->setCurrentIndex(3);
44  TypeSelectorBox_activated(protocol);
45 }
46 
48 {
49  QString server = GetServer();
50  QString fname = GetFileName();
51  QString protocol = GetFileType();
52  if(protocol.contains("root:"))
53  protocol="root:";
54  else
55  if (protocol.contains("rfio:"))
56  protocol="rfio:";
57  else
58  if (protocol.contains("http:"))
59  protocol="http:";
60  else
61  protocol="local:";
62  go4sett->setRemoteFileSett(server, fname, protocol);
63 }
64 
65 
66 
68 {
69  if(tname.contains("root:") || tname.contains("http:") || tname.contains("rfio:"))
70  ServerEdit->setEnabled(true);
71  else
72  ServerEdit->setEnabled(false);
73  fxType=tname;
74 }
75 
76 
78 {
79  return fxFile;
80 }
81 
83 {
84  return fxType;
85 }
86 
87 
89 {
90  return fxServer;
91 }
92 
94 {
95  fxServer=txt;
96 }
97 
98 
100 {
101  fxFile=txt;
102 }
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()