casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
casa::TBBrowser Class Reference

Browser widget for managing opened tables. More...

#include <TBBrowser.qo.h>

Inheritance diagram for casa::TBBrowser:

Public Slots

void displayError (casacore::String message)
 Displays the given error in a dialog to the user. More...
 
void openTaQL (casacore::String command)
 Opens a TaQL table with the given command. More...
 
void followReference (casacore::String subtable, int r)
 Opens the subtable located at the given filename, and load the rows such that row r can be selected. More...
 
void removeActionsAssociatedWithWidget (QWidget *widget)
 Removes all actions associated with the given widget. More...
 
void removeActionsAssociatedWith (void *widget)
 Removes all actions associated with the given object. More...
 

Signals

void tableOpened (casacore::String name, casacore::String fullpath)
 This signal is emitted when a new table is opened and its tab added. More...
 
void tableClosed (casacore::String name)
 This signal is emitted when a table is closed and its tab removed. More...
 
void actionPerformed (TBAction *action)
 This signal is emitted whenever an action is performed. More...
 
void actionUndone ()
 This signal is emitted whenever the latest action was undone. More...
 
void actionRedone ()
 This signal is emitted whenever the latest undone action was redone. More...
 
void threadIsFinished ()
 This signal is emitted whenever a task thread has completed. More...
 
void findRuleAvailable ()
 This signal is emitted whenever the user enters a find rule for the currently selected table. More...
 
void filterRuleAvailable (int index)
 This signal is emitted whenever the user enters a filter rule for the table with the given index. More...
 
void filterRuleCleared (int index)
 This signal is emitted whenever the user clears the filter rule for the table with the given index. More...
 
void tabChanged (int tableIndex)
 This signal is emitted whenever the tab is changed. More...
 

Public Member Functions

 TBBrowser ()
 Default Constructor. More...
 
 ~TBBrowser ()
 
bool isAvailable ()
 Returns true if the browser is available, false otherwise. More...
 
int openedTables ()
 Returns the number of tables that are currently opened. More...
 
QTabWidget * getTabWidget ()
 Returns the widget managing the tabs (QTabWidget). More...
 
int getNumActions ()
 Returns the number of performed actions. More...
 
int getNumUndoneActions ()
 Returns the number of undone actions. More...
 
casacore::String lastActionName ()
 Returns the name of the last performed action, or blank if there is none. More...
 
casacore::String lastUndoneActionName ()
 Returns the name of the last undone action, or blank if there is none. More...
 
casacore::String currentlySelectedTableName ()
 Returns the name of the currently selected table, or blank if there is none. More...
 
TBTablecurrentlySelectedTable ()
 Returns the currently selected table. More...
 
TBTableTabscurrentlySelectedTableTabs ()
 Returns the currently selected table tab. More...
 
std::vector< casacore::StringopenedTableNames ()
 Returns the names of all opened tables. More...
 
TBTableTabstable (casacore::String name)
 Returns the TBTableTabs for the table with the given name. More...
 
int indexOf (TBTableTabs *tt)
 Returns the index of the indicated table tabs, or -1 if the pointer is invalid. More...
 
TBTableTabstableAt (int i)
 Return the table at index i, or NULL if the index is invalid. More...
 
int openTable (casacore::String filename, DriverParams *dp=NULL, int start=0, int num=TBConstants::DEFAULT_SELECT_NUM)
 Opens a table tab from the given file, with the given parameters. More...
 
int openTable (casacore::String filename, bool taql, DriverParams *dp=NULL, int start=0, int num=TBConstants::DEFAULT_SELECT_NUM)
 Opens a table tab from the given file, with the given parameters. More...
 
casacore::String closeTable ()
 Closes the currently selected table and returns its name. More...
 
casacore::String closeTable (int index)
 Closes the table at the given tab index and returns its name. More...
 
bool closeTable (casacore::String name)
 Closes the table with the given name and returns whether the close succeeded or not. More...
 
QStringList getColumnsAt (unsigned int index)
 Returns the column (field) names for the table at the given index. More...
 
bool columnIsHidden (unsigned int index, int col)
 Returns true if the indicated column on the indicated tab is hidden, false otherwise. More...
 
void setColumnHidden (int col, bool hidden)
 Sets whether the indicated column on the currently selected tab is hidden. More...
 
void setColumnHidden (unsigned int index, int col, bool hidden)
 Sets whether the indicated column on the indicated tab is hidden. More...
 
void exportVOTable (casacore::String file)
 Exports the currently selected table to VOTable XML format to the given filename. More...
 
bool findRuleAvailable (int index)
 Returns true if the table at the given index has a find rule entered, false otherwise. More...
 
void find ()
 Shows a find dialog, and connects the signal to run the find rules as indicated. More...
 
void findNext (bool second=false)
 If the currently selected table has a find rule, finds the next row that passes the rule. More...
 
void findPrev (bool second=false)
 If the currently selected table has a find rule, finds the previous row that passes the rule. More...
 
bool filterAvailable (int index)
 Returns true if the table at the given index has a filter, false otherwise. More...
 
void filterOnFields ()
 Shows a filter rules dialog in the side panel of the currently selected table and connects its signal such that when the user clicks the "Filter" button, the filter is run on the table. More...
 
void clearFilterOnFields ()
 Clears the filter on the currently selected table. More...
 
TBFilterRuleSequencefilterAt (int index)
 Returns the filter for the table at the indicated index, or NULL if there is none. More...
 
void formatDisplay (int i)
 Displays a format dialog for the currently selected table for the field at index i, and connects the signal to format the display accordingly. More...
 
void viewTableInfo ()
 Shows a table information panel in the side panel of the currently selected table. More...
 
void sort (std::vector< std::pair< casacore::String, bool > > &s)
 casacore::Sort the currently selected table by the indicated fields. More...
 
void sort (int i, std::vector< std::pair< casacore::String, bool > > &s)
 casacore::Sort the table at index i with the fields in s. More...
 
Result doAction (TBAction *action)
 Does the specified action and returns the result. More...
 
Result undoAction ()
 Undoes the last performed action and returns the result. More...
 
Result redoAction ()
 Redoes the last undone action and returns the result. More...
 
QProgressPaneladdProgressPanel (casacore::String label, bool hideable, bool cancelable)
 Adds a QProgressPanel to the front of the browser and dims the GUI behind the progress panel, then returns the QProgressPanel. More...
 
void removeProgressPanel (QProgressPanel *panel)
 Removes the given QProgressPanel from the browser and restores it to its fully-enabled state. More...
 
ProgressHelperenableProgressFrame (casacore::String label)
 Shows the progress frame on the bottom of the browser and returns a ProgressHelper encapsulating it. More...
 
void disableProgressFrame ()
 Hides the progress frame on the bottom of the browser. More...
 
bool bgTaskIsRunning ()
 Returns true if a background task is currently running, false otherwise. More...
 
TBViewview ()
 Returns the current view of the browser. More...
 
void showView (TBView *view)
 Shows the given view in the browser. More...
 

Private Slots

void doCloseTable ()
 Slot to close the currently opened table. More...
 
void threadFinished ()
 Slot for when a task thread has finished. More...
 
void hideThread ()
 Slot for hiding a task thread in the background. More...
 
void filterRulesEntered (TBFilterRuleSequence *rules)
 Slot for when the user has entered a filter rule. More...
 
void findRulesEntered (TBFilterRuleSequence *rules, TBFilterRules *rDialog)
 Slot for when the user has entered a search rule. More...
 
void tabChange (int index)
 Slot for when the QTabWidget detects a change in tab. More...
 

Private Member Functions

void updateEnabled ()
 Enable or disable the widgets based upon availability. More...
 
int addTable (casacore::String filename, bool taql, DriverParams *dp, int start, int num)
 Adds a table tab from the given file, with the given parameters. More...
 

Private Attributes

bool available
 Indicates whether the browser is available. More...
 
std::vector< TBTableTabs * > tables
 Holds the opened tables. More...
 
QErrorMessage * errorDialog
 Error dialog. More...
 
TBActionList actions
 Actions, both performed and undone. More...
 
QProgressPanelprogressPanel
 The current progress panel, or NULL if there is none. More...
 
TBExportThreadexportThread
 The current export thread, or NULL if there is none. More...
 
std::vector
< TBFilterRuleSequence * > 
currentFindRules
 Find rules for all opened tables. More...
 
std::vector
< TBFilterRuleSequence * > 
currentFilters
 Filters for all opened tables. More...
 
bool bgTaskRunning
 Indicates whether a background task is currently running or not. More...
 
bool exportHidden
 Indicates whether an export thread is both active and hidden or not. More...
 

Detailed Description

Browser widget for managing opened tables.

Synopsis

TBBrowser is a container for multiple TBTableTabs. Its main responsibility is to keep these tabs up-to-date and handle their opening and closing. TBBrowser is the main interface for the GUI of the table browser and thus also provides public methods to operate on opened tables.

Definition at line 63 of file TBBrowser.qo.h.

Constructor & Destructor Documentation

casa::TBBrowser::TBBrowser ( )

Default Constructor.

Sets up GUI with no tabs or opened tables.

casa::TBBrowser::~TBBrowser ( )

Member Function Documentation

void casa::TBBrowser::actionPerformed ( TBAction action)
signal

This signal is emitted whenever an action is performed.

The TBAction parameter points to the action that was performed.

void casa::TBBrowser::actionRedone ( )
signal

This signal is emitted whenever the latest undone action was redone.

void casa::TBBrowser::actionUndone ( )
signal

This signal is emitted whenever the latest action was undone.

QProgressPanel* casa::TBBrowser::addProgressPanel ( casacore::String  label,
bool  hideable,
bool  cancelable 
)

Adds a QProgressPanel to the front of the browser and dims the GUI behind the progress panel, then returns the QProgressPanel.

int casa::TBBrowser::addTable ( casacore::String  filename,
bool  taql,
DriverParams dp,
int  start,
int  num 
)
private

Adds a table tab from the given file, with the given parameters.

Loads rows from start to (start + num). If the DriverParameters are NULL, the default is used.

bool casa::TBBrowser::bgTaskIsRunning ( )

Returns true if a background task is currently running, false otherwise.

void casa::TBBrowser::clearFilterOnFields ( )

Clears the filter on the currently selected table.

casacore::String casa::TBBrowser::closeTable ( )

Closes the currently selected table and returns its name.

casacore::String casa::TBBrowser::closeTable ( int  index)

Closes the table at the given tab index and returns its name.

bool casa::TBBrowser::closeTable ( casacore::String  name)

Closes the table with the given name and returns whether the close succeeded or not.

bool casa::TBBrowser::columnIsHidden ( unsigned int  index,
int  col 
)

Returns true if the indicated column on the indicated tab is hidden, false otherwise.

TBTable* casa::TBBrowser::currentlySelectedTable ( )

Returns the currently selected table.

casacore::String casa::TBBrowser::currentlySelectedTableName ( )

Returns the name of the currently selected table, or blank if there is none.

TBTableTabs* casa::TBBrowser::currentlySelectedTableTabs ( )

Returns the currently selected table tab.

void casa::TBBrowser::disableProgressFrame ( )

Hides the progress frame on the bottom of the browser.

void casa::TBBrowser::displayError ( casacore::String  message)
slot

Displays the given error in a dialog to the user.

Result casa::TBBrowser::doAction ( TBAction action)

Does the specified action and returns the result.

See TBActionList::doAction().

void casa::TBBrowser::doCloseTable ( )
privateslot

Slot to close the currently opened table.

ProgressHelper* casa::TBBrowser::enableProgressFrame ( casacore::String  label)

Shows the progress frame on the bottom of the browser and returns a ProgressHelper encapsulating it.

void casa::TBBrowser::exportVOTable ( casacore::String  file)

Exports the currently selected table to VOTable XML format to the given filename.

See TBTable::exportVOTable().

TBFilterRuleSequence* casa::TBBrowser::filterAt ( int  index)

Returns the filter for the table at the indicated index, or NULL if there is none.

bool casa::TBBrowser::filterAvailable ( int  index)

Returns true if the table at the given index has a filter, false otherwise.

void casa::TBBrowser::filterOnFields ( )

Shows a filter rules dialog in the side panel of the currently selected table and connects its signal such that when the user clicks the "Filter" button, the filter is run on the table.

void casa::TBBrowser::filterRuleAvailable ( int  index)
signal

This signal is emitted whenever the user enters a filter rule for the table with the given index.

void casa::TBBrowser::filterRuleCleared ( int  index)
signal

This signal is emitted whenever the user clears the filter rule for the table with the given index.

void casa::TBBrowser::filterRulesEntered ( TBFilterRuleSequence rules)
privateslot

Slot for when the user has entered a filter rule.

Applies the given TBFilterRulesSequence to the currently selected table.

void casa::TBBrowser::find ( )

Shows a find dialog, and connects the signal to run the find rules as indicated.

void casa::TBBrowser::findNext ( bool  second = false)

If the currently selected table has a find rule, finds the next row that passes the rule.

The second parameter is used to control the wrap-around search such that the search will go through each row exactly once.

void casa::TBBrowser::findPrev ( bool  second = false)

If the currently selected table has a find rule, finds the previous row that passes the rule.

The second parameter is used to control the wrap-around search such that the search will go through each row exactly once.

bool casa::TBBrowser::findRuleAvailable ( int  index)

Returns true if the table at the given index has a find rule entered, false otherwise.

void casa::TBBrowser::findRuleAvailable ( )
signal

This signal is emitted whenever the user enters a find rule for the currently selected table.

void casa::TBBrowser::findRulesEntered ( TBFilterRuleSequence rules,
TBFilterRules rDialog 
)
privateslot

Slot for when the user has entered a search rule.

Searches the currently selected table for a row that passes and, if one is found on the currently loaded pages, selects that row.

void casa::TBBrowser::followReference ( casacore::String  subtable,
int  r 
)
slot

Opens the subtable located at the given filename, and load the rows such that row r can be selected.

void casa::TBBrowser::formatDisplay ( int  i)

Displays a format dialog for the currently selected table for the field at index i, and connects the signal to format the display accordingly.

QStringList casa::TBBrowser::getColumnsAt ( unsigned int  index)

Returns the column (field) names for the table at the given index.

int casa::TBBrowser::getNumActions ( )

Returns the number of performed actions.

See TBActionList::size().

int casa::TBBrowser::getNumUndoneActions ( )

Returns the number of undone actions.

See TBActionList::undoneSize().

QTabWidget* casa::TBBrowser::getTabWidget ( )

Returns the widget managing the tabs (QTabWidget).

void casa::TBBrowser::hideThread ( )
privateslot

Slot for hiding a task thread in the background.

int casa::TBBrowser::indexOf ( TBTableTabs tt)

Returns the index of the indicated table tabs, or -1 if the pointer is invalid.

bool casa::TBBrowser::isAvailable ( )

Returns true if the browser is available, false otherwise.

casacore::String casa::TBBrowser::lastActionName ( )

Returns the name of the last performed action, or blank if there is none.

See TBActionList::lastActionName().

casacore::String casa::TBBrowser::lastUndoneActionName ( )

Returns the name of the last undone action, or blank if there is none.

See TBActionList::lastUndoneActionName().

std::vector<casacore::String> casa::TBBrowser::openedTableNames ( )

Returns the names of all opened tables.

int casa::TBBrowser::openedTables ( )

Returns the number of tables that are currently opened.

int casa::TBBrowser::openTable ( casacore::String  filename,
DriverParams dp = NULL,
int  start = 0,
int  num = TBConstants::DEFAULT_SELECT_NUM 
)

Opens a table tab from the given file, with the given parameters.

Loads rows from start to (start + num). If the DriverParameters are NULL, the default is used.

int casa::TBBrowser::openTable ( casacore::String  filename,
bool  taql,
DriverParams dp = NULL,
int  start = 0,
int  num = TBConstants::DEFAULT_SELECT_NUM 
)

Opens a table tab from the given file, with the given parameters.

Loads rows from start to (start + num). If the DriverParameters are NULL, the default is used.

void casa::TBBrowser::openTaQL ( casacore::String  command)
slot

Opens a TaQL table with the given command.

See openTable().

Result casa::TBBrowser::redoAction ( )

Redoes the last undone action and returns the result.

See TBActionList::redoAction().

void casa::TBBrowser::removeActionsAssociatedWith ( void *  widget)
slot

Removes all actions associated with the given object.

void casa::TBBrowser::removeActionsAssociatedWithWidget ( QWidget *  widget)
slot

Removes all actions associated with the given widget.

void casa::TBBrowser::removeProgressPanel ( QProgressPanel panel)

Removes the given QProgressPanel from the browser and restores it to its fully-enabled state.

void casa::TBBrowser::setColumnHidden ( int  col,
bool  hidden 
)

Sets whether the indicated column on the currently selected tab is hidden.

void casa::TBBrowser::setColumnHidden ( unsigned int  index,
int  col,
bool  hidden 
)

Sets whether the indicated column on the indicated tab is hidden.

void casa::TBBrowser::showView ( TBView view)

Shows the given view in the browser.

See TBView.

void casa::TBBrowser::sort ( std::vector< std::pair< casacore::String, bool > > &  s)

casacore::Sort the currently selected table by the indicated fields.

void casa::TBBrowser::sort ( int  i,
std::vector< std::pair< casacore::String, bool > > &  s 
)

casacore::Sort the table at index i with the fields in s.

Each entry in s should be a field name paired with a bool indicating whether the sort order is ascending. See TBTableTabs::sort().

void casa::TBBrowser::tabChange ( int  index)
privateslot

Slot for when the QTabWidget detects a change in tab.

Emits the tabChanged() signal.

void casa::TBBrowser::tabChanged ( int  tableIndex)
signal

This signal is emitted whenever the tab is changed.

The int parameter indicates the new current tab index.

TBTableTabs* casa::TBBrowser::table ( casacore::String  name)

Returns the TBTableTabs for the table with the given name.

TBTableTabs* casa::TBBrowser::tableAt ( int  i)

Return the table at index i, or NULL if the index is invalid.

void casa::TBBrowser::tableClosed ( casacore::String  name)
signal

This signal is emitted when a table is closed and its tab removed.

The casacore::String parameter holds the name of the table that was closed.

void casa::TBBrowser::tableOpened ( casacore::String  name,
casacore::String  fullpath 
)
signal

This signal is emitted when a new table is opened and its tab added.

The casacore::String parameter holds the name of the newly opened table.

void casa::TBBrowser::threadFinished ( )
privateslot

Slot for when a task thread has finished.

void casa::TBBrowser::threadIsFinished ( )
signal

This signal is emitted whenever a task thread has completed.

Result casa::TBBrowser::undoAction ( )

Undoes the last performed action and returns the result.

See TBActionList::undoAction().

void casa::TBBrowser::updateEnabled ( )
private

Enable or disable the widgets based upon availability.

TBView* casa::TBBrowser::view ( )

Returns the current view of the browser.

See TBView.

void casa::TBBrowser::viewTableInfo ( )

Shows a table information panel in the side panel of the currently selected table.

Member Data Documentation

TBActionList casa::TBBrowser::actions
private

Actions, both performed and undone.

Definition at line 331 of file TBBrowser.qo.h.

bool casa::TBBrowser::available
private

Indicates whether the browser is available.

Definition at line 322 of file TBBrowser.qo.h.

bool casa::TBBrowser::bgTaskRunning
private

Indicates whether a background task is currently running or not.

Definition at line 346 of file TBBrowser.qo.h.

std::vector<TBFilterRuleSequence*> casa::TBBrowser::currentFilters
private

Filters for all opened tables.

Definition at line 343 of file TBBrowser.qo.h.

std::vector<TBFilterRuleSequence*> casa::TBBrowser::currentFindRules
private

Find rules for all opened tables.

Definition at line 340 of file TBBrowser.qo.h.

QErrorMessage* casa::TBBrowser::errorDialog
private

Error dialog.

Definition at line 328 of file TBBrowser.qo.h.

bool casa::TBBrowser::exportHidden
private

Indicates whether an export thread is both active and hidden or not.

Definition at line 349 of file TBBrowser.qo.h.

TBExportThread* casa::TBBrowser::exportThread
private

The current export thread, or NULL if there is none.

Definition at line 337 of file TBBrowser.qo.h.

QProgressPanel* casa::TBBrowser::progressPanel
private

The current progress panel, or NULL if there is none.

Definition at line 334 of file TBBrowser.qo.h.

std::vector<TBTableTabs*> casa::TBBrowser::tables
private

Holds the opened tables.

Definition at line 325 of file TBBrowser.qo.h.


The documentation for this class was generated from the following file: