casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TBOptions.qo.h
Go to the documentation of this file.
00001 //# TBOptions.qo.h: Widget to edit the browsing options.
00002 //# Copyright (C) 2005
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 TBOPTIONS_H_
00028 #define TBOPTIONS_H_
00029 
00030 #include <casaqt/QtBrowser/TBOptions.ui.h>
00031 
00032 #include <QtGui>
00033 
00034 #include <casa/BasicSL/String.h>
00035 #include <casa/namespace.h>
00036 
00037 namespace casa {
00038 
00039 // <summary>
00040 // Widget to edit the browsing options.
00041 // </summary>
00042 //
00043 // <synopsis>
00044 // TBOptions is used to display and edit any current browsing options.
00045 // Currently, the only available options are: save current view on save, and
00046 // setting the debug threshold.  Important: the parent/caller is responsible
00047 // for connecting the saveOptions() signal and actually setting the options as
00048 // requested.
00049 // </synopsis>
00050 
00051 class TBOptions : public QDialog, Ui::Options {
00052     Q_OBJECT
00053 
00054 public:
00055     // Default Constructor.
00056     TBOptions();
00057 
00058     ~TBOptions();
00059 
00060     
00061     // Returns true if the "save view on close" check box is checked, false
00062     // otherwise.
00063     bool saveView();
00064 
00065     // Sets the state on the "save view on close" check box.
00066     void setSaveView(bool saveView);
00067 
00068     // Returns the debug threshold as indicated by the QComboBox.
00069     int debugLevel();
00070 
00071     // Sets the debug threshold via the QComboBox.
00072     void setDebugLevel(int newLevel);
00073     
00074     // Gets/Sets the file chooser history limit.
00075     // <group>
00076     int chooserHistoryLimit() const;
00077     void setChooserHistoryLimit(int limit);
00078     // </group>
00079     
00080 signals:
00081     // saveOptions is emitted when the user has configured the options and
00082     // clicked the "Save" button.  A pointer to this TBOptions object is
00083     // included as the parent/caller should delete it.
00084     void saveOptions(TBOptions* opt);
00085 
00086 private slots:
00087     // Restores the default options to the dialog.
00088     void restoreDefaults();
00089 
00090     // Slot for the "Save" button.  Emits the saveOptions() signal.
00091     void save();
00092 
00093     // Slot for the "Cancel" button.  Closes and deletes the widget.
00094     void cancel();
00095 };
00096 
00097 }
00098 
00099 #endif /* TBOPTIONS_H_ */