casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PlotMSLoggerWidget.qo.h
Go to the documentation of this file.
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 #include <casa/namespace.h>
00036 using namespace std;
00037 
00038 namespace casa {
00039 
00040 //# Forward declarations.
00041 class QtComboCheckBox;
00042 
00043 
00044 // Widget to set log events and priority filter.
00045 class PlotMSLoggerWidget : public QtEditingWidget {
00046     Q_OBJECT
00047     
00048 public:
00049     // Constructor which takes the maximum width for the widget and an optional
00050     // parent.  MUST be created after plotms' extended log types have already
00051     // been registered with PlotLogger.
00052     PlotMSLoggerWidget(const String& filename, int events,
00053             LogMessage::Priority priority, int maxWidth,
00054             bool editFilename = true, bool editPriority = true,
00055             QWidget* parent = NULL);
00056     
00057     // Destructor.
00058     ~PlotMSLoggerWidget();
00059     
00060     // Gets/Sets the currently set filename.
00061     // <group>
00062     String filename() const;
00063     void setFilename(const String& filename);
00064     // </group>
00065     
00066     // Gets/Sets the currently set events flag.
00067     // <group>
00068     int events() const;
00069     void setEvents(int events);
00070     // </group>
00071     
00072     // Gets/Sets the currently set priority.
00073     // <group>
00074     LogMessage::Priority priority() const;
00075     void setPriority(LogMessage::Priority priority);
00076     // </group>
00077     
00078 private:
00079     // Last set filename.
00080     String itsFilename_;
00081     
00082     // Widget for editing filename.
00083     QtFileWidget* itsFilenameWidget_;
00084     
00085     // Last set events flag.
00086     int itsEvents_;
00087     
00088     // Combo check box for events.
00089     QtComboCheckBox* itsEventsBox_;
00090     
00091     // Event values for the combo box indices.
00092     QList<int> itsEventsIndexValues_;
00093     
00094     // Last set priority.
00095     LogMessage::Priority itsPriority_;
00096     
00097     // Combo box.
00098     QComboBox* itsPriorityBox_;
00099     
00100 private slots:
00101     // Slot for when the widget changes.
00102     void widgetChanged();
00103 };
00104 
00105 }
00106 
00107 #endif /* PLOTMSLOGGERWIDGET_QO_H_ */