GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4LogSettings.cpp
Go to the documentation of this file.
1 // $Id: TGo4LogSettings.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 "TGo4LogSettings.h"
15 #include <QFileDialog>
16 #include "TGo4Log.h"
17 
19  : QDialog( parent )
20 {
21  setObjectName("Go4LogSettings");
22  setupUi(this);
23  bool iswrite=TGo4Log::IsLogfileEnabled();
24 
25  IgnoreCombo->setCurrentIndex(TGo4Log::GetIgnoreLevel());
26  ModeCombo->setCurrentIndex(TGo4Log::IsAutoEnabled());
27  LogfilePrint->setChecked(TGo4Log::IsOutputEnabled());
28 
29  LogfileWrite->setChecked(iswrite);
30  LogfileName->setText(TGo4Log::GetLogname());
31  LogfileName->setEnabled(iswrite);
32  FileNameLog->setEnabled(iswrite);
33 }
34 
36 {
37  QFileDialog fd( this, "Set GUI logfile", "", "Log textfile (*.log)");
38  fd.setFileMode( QFileDialog::AnyFile );
39  if (fd.exec() != QDialog::Accepted) return;
40 
41  QStringList flst = fd.selectedFiles();
42  if (flst.isEmpty()) return;
43 
44  QString fileName = flst[0];
45  if(!fileName.endsWith(".log")) fileName.append(".log");
46  LogfileName->setText(fileName);
47 }
static const char * GetLogname()
Definition: TGo4Log.cxx:333
virtual void LogfileDialog()
static Bool_t IsOutputEnabled()
Definition: TGo4Log.cxx:364
TGo4LogSettings(QWidget *parent=0)
static Bool_t IsLogfileEnabled()
Definition: TGo4Log.cxx:375
static Int_t GetIgnoreLevel()
Definition: TGo4Log.cxx:328
static Bool_t IsAutoEnabled()
Definition: TGo4Log.cxx:386