casa
5.7.0-16
|
Browser widget for managing opened tables. More...
#include <TBBrowser.qo.h>
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... | |
TBTable * | currentlySelectedTable () |
Returns the currently selected table. More... | |
TBTableTabs * | currentlySelectedTableTabs () |
Returns the currently selected table tab. More... | |
std::vector< casacore::String > | openedTableNames () |
Returns the names of all opened tables. More... | |
TBTableTabs * | table (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... | |
TBTableTabs * | tableAt (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... | |
TBFilterRuleSequence * | filterAt (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... | |
QProgressPanel * | 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. More... | |
void | removeProgressPanel (QProgressPanel *panel) |
Removes the given QProgressPanel from the browser and restores it to its fully-enabled state. More... | |
ProgressHelper * | enableProgressFrame (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... | |
TBView * | view () |
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... | |
QProgressPanel * | progressPanel |
The current progress panel, or NULL if there is none. More... | |
TBExportThread * | exportThread |
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... | |
Browser widget for managing opened tables.
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.
casa::TBBrowser::TBBrowser | ( | ) |
Default Constructor.
Sets up GUI with no tabs or opened tables.
casa::TBBrowser::~TBBrowser | ( | ) |
|
signal |
This signal is emitted whenever an action is performed.
The TBAction parameter points to the action that was performed.
|
signal |
This signal is emitted whenever the latest undone action was redone.
|
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.
|
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.
|
slot |
Displays the given error in a dialog to the user.
Does the specified action and returns the result.
|
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.
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.
|
signal |
This signal is emitted whenever the user enters a filter rule for the table with the given index.
|
signal |
This signal is emitted whenever the user clears the filter rule for the table with the given index.
|
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.
|
signal |
This signal is emitted whenever the user enters a find rule for the currently selected table.
|
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.
|
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.
QTabWidget* casa::TBBrowser::getTabWidget | ( | ) |
Returns the widget managing the tabs (QTabWidget).
|
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.
casacore::String casa::TBBrowser::lastUndoneActionName | ( | ) |
Returns the name of the last undone action, or blank if there is none.
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.
|
slot |
Opens a TaQL table with the given command.
See openTable().
Result casa::TBBrowser::redoAction | ( | ) |
Redoes the last undone action and returns the result.
|
slot |
Removes all actions associated with the given object.
|
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::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().
|
privateslot |
Slot for when the QTabWidget detects a change in tab.
Emits the tabChanged() signal.
|
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.
|
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.
|
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.
|
privateslot |
Slot for when a task thread has finished.
|
signal |
This signal is emitted whenever a task thread has completed.
Result casa::TBBrowser::undoAction | ( | ) |
Undoes the last performed action and returns the result.
|
private |
Enable or disable the widgets based upon availability.
void casa::TBBrowser::viewTableInfo | ( | ) |
Shows a table information panel in the side panel of the currently selected table.
|
private |
Actions, both performed and undone.
Definition at line 331 of file TBBrowser.qo.h.
|
private |
Indicates whether the browser is available.
Definition at line 322 of file TBBrowser.qo.h.
|
private |
Indicates whether a background task is currently running or not.
Definition at line 346 of file TBBrowser.qo.h.
|
private |
Filters for all opened tables.
Definition at line 343 of file TBBrowser.qo.h.
|
private |
Find rules for all opened tables.
Definition at line 340 of file TBBrowser.qo.h.
|
private |
Error dialog.
Definition at line 328 of file TBBrowser.qo.h.
|
private |
Indicates whether an export thread is both active and hidden or not.
Definition at line 349 of file TBBrowser.qo.h.
|
private |
The current export thread, or NULL if there is none.
Definition at line 337 of file TBBrowser.qo.h.
|
private |
The current progress panel, or NULL if there is none.
Definition at line 334 of file TBBrowser.qo.h.
|
private |
Holds the opened tables.
Definition at line 325 of file TBBrowser.qo.h.