00001 //# PlotMSLoggerWidget.qo.h: Widget to set log events and priority filter. 00002 //# Copyright (C) 2009 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: $ 00027 #ifndef PLOTMSLOGGERWIDGET_QO_H_ 00028 #define PLOTMSLOGGERWIDGET_QO_H_ 00029 00030 #include <casa/Logging/LogMessage.h> 00031 #include <casaqt/QtUtilities/QtEditingWidget.qo.h> 00032 00033 #include <QComboBox> 00034 00035 namespace casa { 00036 00037 //# Forward declarations. 00038 class QtComboCheckBox; 00039 00040 00041 // Widget to set log events and priority filter. 00042 class PlotMSLoggerWidget : public QtEditingWidget { 00043 Q_OBJECT 00044 00045 public: 00046 // Constructor which takes the maximum width for the widget and an optional 00047 // parent. MUST be created after plotms' extended log types have already 00048 // been registered with PlotLogger. 00049 PlotMSLoggerWidget(const String& filename, int events, 00050 LogMessage::Priority priority, int maxWidth, 00051 bool editFilename = true, bool editPriority = true, 00052 QWidget* parent = NULL); 00053 00054 // Destructor. 00055 ~PlotMSLoggerWidget(); 00056 00057 // Gets/Sets the currently set filename. 00058 // <group> 00059 String filename() const; 00060 void setFilename(const String& filename); 00061 // </group> 00062 00063 // Gets/Sets the currently set events flag. 00064 // <group> 00065 int events() const; 00066 void setEvents(int events); 00067 // </group> 00068 00069 // Gets/Sets the currently set priority. 00070 // <group> 00071 LogMessage::Priority priority() const; 00072 void setPriority(LogMessage::Priority priority); 00073 // </group> 00074 00075 private: 00076 // Last set filename. 00077 String itsFilename_; 00078 00079 // Widget for editing filename. 00080 QtFileWidget* itsFilenameWidget_; 00081 00082 // Last set events flag. 00083 int itsEvents_; 00084 00085 // Combo check box for events. 00086 QtComboCheckBox* itsEventsBox_; 00087 00088 // Event values for the combo box indices. 00089 QList<int> itsEventsIndexValues_; 00090 00091 // Last set priority. 00092 LogMessage::Priority itsPriority_; 00093 00094 // Combo box. 00095 QComboBox* itsPriorityBox_; 00096 00097 private slots: 00098 // Slot for when the widget changes. 00099 void widgetChanged(); 00100 }; 00101 00102 } 00103 00104 #endif /* PLOTMSLOGGERWIDGET_QO_H_ */