casa
5.7.0-16
|
Current "view" or state of the browser that can be serialized. More...
#include <TBView.h>
Public Member Functions | |
TBView () | |
Default Constructor. More... | |
~TBView () | |
void | addTableView (TBTableView *view) |
Adds the given table view to this view. More... | |
std::vector< TBTableView * > * | getTableViews () |
Returns the list of table views in this view. More... | |
void | setLastOpenedDirectory (casacore::String str) |
Sets the last opened directory for this view. More... | |
casacore::String | getLastOpenedDirectory () |
Returns the last opened directory for this view. More... | |
int | chooserHistoryLimit () const |
Gets/Sets the file chooser history limit. More... | |
void | setChooserHistoryLimit (int histLimit) |
bool | saveToFile (casacore::String file) |
Saves this view in XML format to the given file. More... | |
bool | saveToDefaultFile () |
Equivalent to saveToFile(defaultFile()). More... | |
Static Public Member Functions | |
static TBView * | loadFromFile (casacore::String file) |
Loads the view saved in the given file and returns it. More... | |
static TBView * | loadFromDefaultFile () |
Equivalent to loadFromFile(defaultFile()). More... | |
static casacore::String | defaultFile () |
Returns the default location to save and load a view: TBConstants::dotCasapyDir() + TBConstants::VIEW_SAVE_LOC. More... | |
Static Private Member Functions | |
static void | fontElem (DOMElement *elem, QFontColor *font) |
Creates an XML element based upon the given QFontColor. More... | |
static QFontColor * | fontElem (DOMElement *elem) |
Creates a QFontColor based upon the given XML element. More... | |
Private Attributes | |
casacore::String | lastOpenedDir |
Last opened directory. More... | |
int | histLimit |
casacore::File chooser history limit. More... | |
std::vector< TBTableView * > | views |
casacore::Table views. More... | |
Current "view" or state of the browser that can be serialized.
The TBView defines the state of the browser and includes: the last opened directory, and the TBTableViews of all currently opened tables. TBView has methods to save to and load from a file on disk.
casa::TBView::TBView | ( | ) |
Default Constructor.
casa::TBView::~TBView | ( | ) |
void casa::TBView::addTableView | ( | TBTableView * | view | ) |
Adds the given table view to this view.
int casa::TBView::chooserHistoryLimit | ( | ) | const |
Gets/Sets the file chooser history limit.
|
static |
Returns the default location to save and load a view: TBConstants::dotCasapyDir() + TBConstants::VIEW_SAVE_LOC.
|
staticprivate |
Creates an XML element based upon the given QFontColor.
|
staticprivate |
Creates a QFontColor based upon the given XML element.
casacore::String casa::TBView::getLastOpenedDirectory | ( | ) |
Returns the last opened directory for this view.
std::vector<TBTableView*>* casa::TBView::getTableViews | ( | ) |
Returns the list of table views in this view.
|
static |
Equivalent to loadFromFile(defaultFile()).
|
static |
Loads the view saved in the given file and returns it.
If the file is invalid or there are other problems, NULL is returned.
bool casa::TBView::saveToDefaultFile | ( | ) |
Equivalent to saveToFile(defaultFile()).
bool casa::TBView::saveToFile | ( | casacore::String | file | ) |
Saves this view in XML format to the given file.
void casa::TBView::setChooserHistoryLimit | ( | int | histLimit | ) |
void casa::TBView::setLastOpenedDirectory | ( | casacore::String | str | ) |
Sets the last opened directory for this view.
|
private |
casacore::File chooser history limit.
|
private |
|
private |
casacore::Table views.