Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4LogSettings.h"
00015 #include <QFileDialog>
00016 #include "TGo4Log.h"
00017
00018 TGo4LogSettings::TGo4LogSettings( QWidget* parent )
00019 : QDialog( parent )
00020 {
00021 setObjectName("Go4LogSettings");
00022 setupUi(this);
00023 bool iswrite=TGo4Log::IsLogfileEnabled();
00024
00025 IgnoreCombo->setCurrentIndex(TGo4Log::GetIgnoreLevel());
00026 ModeCombo->setCurrentIndex(TGo4Log::IsAutoEnabled());
00027 LogfilePrint->setChecked(TGo4Log::IsOutputEnabled());
00028
00029 LogfileWrite->setChecked(iswrite);
00030 LogfileName->setText(TGo4Log::GetLogname());
00031 LogfileName->setEnabled(iswrite);
00032 FileNameLog->setEnabled(iswrite);
00033 }
00034
00035 void TGo4LogSettings::LogfileDialog()
00036 {
00037 QFileDialog fd( this, "Set GUI logfile", "", "Log textfile (*.log)");
00038 fd.setFileMode( QFileDialog::AnyFile );
00039 if (fd.exec() != QDialog::Accepted) return;
00040
00041 QStringList flst = fd.selectedFiles();
00042 if (flst.isEmpty()) return;
00043
00044 QString fileName = flst[0];
00045 if(!fileName.endsWith(".log")) fileName.append(".log");
00046 LogfileName->setText(fileName);
00047 }