casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes
casa::TBBrowser Class Reference

Browser widget for managing opened tables. More...

#include <TBBrowser.qo.h>

List of all members.

Public Slots

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

Signals

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

Public Member Functions

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

Private Slots

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

Private Member Functions

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

Private Attributes

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

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 66 of file TBBrowser.qo.h.


Constructor & Destructor Documentation

Default Constructor.

Sets up GUI with no tabs or opened tables.


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 ( 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 ( 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.

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

Clears the filter on the currently selected table.

Closes the currently selected table and returns its name.

Closes the table at the given tab index and returns its 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.

Returns the currently selected table.

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

Returns the currently selected table tab.

Hides the progress frame on the bottom of the browser.

void casa::TBBrowser::displayError ( String  message) [slot]

Displays the given error in a dialog to the user.

Does the specified action and returns the result.

See TBActionList::doAction().

void casa::TBBrowser::doCloseTable ( ) [private, slot]

Slot to close the currently opened table.

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

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

See TBTable::exportVOTable().

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.

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) [private, slot]

Slot for when the user has entered a filter rule.

Applies the given TBFilterRulesSequence to the currently selected table.

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.

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

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

void casa::TBBrowser::findRulesEntered ( TBFilterRuleSequence rules,
TBFilterRules rDialog 
) [private, slot]

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 ( String  subtable,
int  r 
) [slot]

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

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.

Returns the number of performed actions.

See TBActionList::size().

Returns the number of undone actions.

See TBActionList::undoneSize().

Returns the widget managing the tabs (QTabWidget).

void casa::TBBrowser::hideThread ( ) [private, slot]

Slot for hiding a task thread in the background.

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

Returns true if the browser is available, false otherwise.

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

See TBActionList::lastActionName().

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

See TBActionList::lastUndoneActionName().

Returns the names of all opened tables.

Returns the number of tables that are currently opened.

int casa::TBBrowser::openTable ( 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 ( 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 ( String  command) [slot]

Opens a TaQL table with the given command.

See openTable().

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.

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.

Shows the given view in the browser.

See TBView.

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

Sort the currently selected table by the indicated fields.

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

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) [private, slot]

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.

Returns the TBTableTabs for the table with the given name.

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

void casa::TBBrowser::tableClosed ( String  name) [signal]

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

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

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

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

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

void casa::TBBrowser::threadFinished ( ) [private, slot]

Slot for when a task thread has finished.

This signal is emitted whenever a task thread has completed.

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.

Returns the current view of the browser.

See TBView.

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


Member Data Documentation

Actions, both performed and undone.

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

Indicates whether the browser is available.

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

Indicates whether a background task is currently running or not.

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

Filters for all opened tables.

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

Find rules for all opened tables.

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

QErrorMessage* casa::TBBrowser::errorDialog [private]

Error dialog.

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

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

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

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

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

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

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

Holds the opened tables.

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


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