Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Slots | Public Member Functions | Static Public Attributes | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TOPPASBase Class Reference

Main window of the TOPPAS tool. More...

#include <OpenMS/VISUAL/APPLICATIONS/TOPPASBase.h>

Inheritance diagram for TOPPASBase:
QMainWindow DefaultParamHandler

Public Slots

void addTOPPASFile (const String &file_name, bool in_new_window=true)
 opens the file in a new window More...
 
void openFileDialog ()
 shows the dialog for opening files More...
 
void openExampleDialog ()
 shows the dialog for opening example files More...
 
void newPipeline (const int id=-1)
 shows the dialog for creating a new file (pass IDINITIALUNTITLED as id if its the first call) More...
 
void includePipeline ()
 shows the dialog for including another workflow in the currently opened one More...
 
void saveCurrentPipelineAs ()
 shows the dialog for saving the current file and updates the current tab caption More...
 
void savePipeline ()
 saves the pipeline (determined by Qt's sender mechanism) More...
 
void exportAsImage ()
 exports the current pipeline as image More...
 
void loadPipelineResourceFile ()
 shows a file dialog for selecting the resource file to load More...
 
void savePipelineResourceFile ()
 shows a file dialog for selecting the resource file to write to More...
 
void openOnlinePipelineRepository ()
 opens the OpenMS Homepage to download example workflows More...
 
void preferencesDialog ()
 shows the preferences dialog More...
 
void updateCurrentPath ()
 changes the current path according to the currently active window/layer More...
 
void updateTabBar (QWidget *w)
 brings the tab corresponding to the active window in front More...
 
void showAboutDialog ()
 Shows the 'About' dialog. More...
 
void showURL ()
 shows the URL stored in the data of the sender QAction More...
 
void showStatusMessage (std::string msg, OpenMS::UInt time)
 Shows a status message in the status bar. More...
 
void showCursorStatus (double x, double y)
 shows x,y coordinates in the status bar More...
 
void closeFile ()
 closes the active window More...
 
void updateToolBar ()
 updates the toolbar More...
 
void runPipeline ()
 Runs the pipeline of the current window. More...
 
void abortPipeline ()
 Terminates the current pipeline. More...
 
void toolStarted ()
 Called when a tool is started. More...
 
void toolFinished ()
 Called when a tool is finished. More...
 
void toolCrashed ()
 Called when a tool crashes. More...
 
void toolFailed ()
 Called when a tool execution fails. More...
 
void outputVertexFinished (const String &file)
 Called when a file was successfully written to an output vertex. More...
 
void updateTOPPOutputLog (const QString &out)
 Called when a TOPP tool produces (error) output. More...
 
void showPipelineFinishedLogMessage ()
 Called by the scene if the pipeline execution finishes successfully. More...
 
void saveToClipboard (TOPPASScene *scene)
 Saves scene to the clipboard. More...
 
void sendClipboardContent ()
 Sends the clipboard content to the sender of the connected signal. More...
 
void refreshParameters ()
 Refreshes the parameters of the TOPP tools of the current workflow and stores an updated workflow including the current parameters. More...
 
void openFilesInTOPPView (QStringList all_files)
 Open files in a new TOPPView instance. More...
 
void openToppasFile (QString filename)
 Opens a toppas file. More...
 

Public Member Functions

 TOPPASBase (QWidget *parent=0)
 Constructor. More...
 
virtual ~TOPPASBase ()
 Destructor. More...
 
void loadPreferences (String filename="")
 Loads the preferences from the filename given. More...
 
void savePreferences ()
 stores the preferences (used when this window is closed) More...
 
void loadFiles (const StringList &list, QSplashScreen *splash_screen)
 loads the files and updates the splash screen More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Static Public Member Functions

common functions used in TOPPAS and TOPPView
static TOPPASTreeViewcreateTOPPToolsTreeWidget (QWidget *parent_widget=0)
 Creates and fills a tree widget with all available tools. More...
 
static QString savePipelineAs (TOPPASWidget *w, QString current_path)
 
static QString loadPipelineResourceFile (TOPPASWidget *w, QString current_path)
 Loads and sets the resources of the TOPPASWidget. More...
 
static QString savePipelineResourceFile (TOPPASWidget *w, QString current_path)
 Saves the resources of the TOPPASWidget. More...
 
static QString refreshPipelineParameters (TOPPASWidget *tw, QString current_path)
 Refreshes the TOPP tools parameters of the pipeline. More...
 

Static Public Attributes

static int const IDINITIALUNTITLED = 1000
 use this for the first call to newPipeline(), to ensure that the first empty (and unmodified) workspace is closed iff existing workflows are loaded More...
 

Protected Types

enum  LogState { LS_NOTICE, LS_WARNING, LS_ERROR }
 Log message states. More...
 

Protected Slots

void updateMenu ()
 enable/disable menu entries depending on the current state More...
 
void showAsWindow_ (TOPPASWidget *sw, const String &caption, const int special_id=-1)
 Shows the widget as window in the workspace (the special_id is only used for the first untitled widget (to be able to auto-close it later) More...
 
void insertNewVertex_ (double x, double y, QTreeWidgetItem *item=0)
 Inserts a new TOPP tool in the current window at (x,y) More...
 
void insertNewVertexInCenter_ (QTreeWidgetItem *item)
 Inserts the item in the middle of the current window. More...
 
void downloadTOPPASfromHomepage_ (const QUrl &url)
 triggered when user clicks a link - if it ends in .TOPPAS we're done More...
 
void toppasFileDownloaded_ (QNetworkReply *r)
 triggered when download of .toppas file is finished, so we can store & open it More...
 
void descriptionUpdated_ ()
 user edited the workflow description More...
 
Tab bar slots
void closeByTab (int id)
 Closes the window corresponding to the data of the tab with identifier id. More...
 
void focusByTab (int id)
 Raises the window corresponding to the data of the tab with identifier id. More...
 

Protected Member Functions

TOPPASWidgetwindow_ (int id) const
 returns the window with id id More...
 
TOPPASWidgetactiveWindow_ () const
 returns a pointer to the active TOPPASWidget (0 if none is active) More...
 
void showLogMessage_ (LogState state, const String &heading, const String &body)
 Shows a log message in the log_ window. More...
 
reimplemented Qt events
void closeEvent (QCloseEvent *event)
 
void keyPressEvent (QKeyEvent *e)
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

TOPPASLogWindowlog_
 Log output window. More...
 
QTextEditdesc_
 Workflow Description window. More...
 
QWorkspacews_
 Main workspace. More...
 
QWebView * webview_
 OpenMS homepage workflow browser. More...
 
QNetworkAccessManager * network_manager_
 download .toppas files from homepage More...
 
TOPPASTabBartab_bar_
 Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() More...
 
QTreeWidgettools_tree_view_
 Tree view of all available TOPP tools. More...
 
QListWidgetblocks_list_
 List of ready analysis pipelines. More...
 
String current_path_
 
String tmp_path_
 The path for temporary files. More...
 
TOPPASSceneclipboard_scene_
 The clipboard. More...
 
Toolbar
QToolBar * tool_bar_
 
Status bar
QLabel * message_label_
 Label for messages in the status bar. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Static Protected Attributes

static int node_offset_ = 0
 Offset counter for new inserted nodes (to avoid invisible stacking) More...
 
static qreal z_value_ = 42.0
 z-value counter for new inserted nodes (new nodes should be on top) More...
 

Detailed Description

Main window of the TOPPAS tool.

Member Enumeration Documentation

enum LogState
protected

Log message states.

Enumerator
LS_NOTICE 

Notice.

LS_WARNING 

Warning.

LS_ERROR 

Fatal error.

Constructor & Destructor Documentation

TOPPASBase ( QWidget parent = 0)
~TOPPASBase ( )
virtual

Member Function Documentation

void abortPipeline ( )
slot
TOPPASWidget * activeWindow_ ( ) const
protected
void addTOPPASFile ( const String file_name,
bool  in_new_window = true 
)
slot
void closeByTab ( int  id)
protectedslot

Closes the window corresponding to the data of the tab with identifier id.

References TOPPASTabBar::removeId(), TOPPASBase::tab_bar_, TOPPASBase::updateMenu(), and TOPPASBase::window_().

Referenced by TOPPASBase::addTOPPASFile(), and TOPPASBase::TOPPASBase().

void closeEvent ( QCloseEvent *  event)
protected

References TOPPASBase::ws_.

void closeFile ( )
slot

closes the active window

References TOPPASBase::updateMenu(), and TOPPASBase::ws_.

Referenced by TOPPASBase::TOPPASBase().

TOPPASTreeView * createTOPPToolsTreeWidget ( QWidget parent_widget = 0)
static

Creates and fills a tree widget with all available tools.

References ToolHandler::getTOPPToolList(), ToolHandler::getTypes(), ToolHandler::getUtilList(), and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

void descriptionUpdated_ ( )
protectedslot
void downloadTOPPASfromHomepage_ ( const QUrl &  url)
protectedslot

triggered when user clicks a link - if it ends in .TOPPAS we're done

References TOPPASBase::LS_NOTICE, TOPPASBase::network_manager_, TOPPASBase::showLogMessage_(), and TOPPASBase::webview_.

Referenced by TOPPASBase::TOPPASBase().

void exportAsImage ( )
slot
void focusByTab ( int  id)
protectedslot

Raises the window corresponding to the data of the tab with identifier id.

References TOPPASBase::desc_, TOPPASScene::getDescription(), TOPPASWidget::getScene(), and TOPPASBase::window_().

Referenced by TOPPASBase::TOPPASBase().

void includePipeline ( )
slot

shows the dialog for including another workflow in the currently opened one

References TOPPASBase::addTOPPASFile(), TOPPASBase::current_path_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

void insertNewVertex_ ( double  x,
double  y,
QTreeWidgetItem *  item = 0 
)
protectedslot
void insertNewVertexInCenter_ ( QTreeWidgetItem *  item)
protectedslot

Inserts the item in the middle of the current window.

References TOPPASBase::activeWindow_(), TOPPASBase::insertNewVertex_(), TOPPASBase::node_offset_, and TOPPASBase::tools_tree_view_.

Referenced by TOPPASBase::TOPPASBase().

void keyPressEvent ( QKeyEvent *  e)
protected
void loadFiles ( const StringList list,
QSplashScreen *  splash_screen 
)

loads the files and updates the splash screen

References TOPPASBase::addTOPPASFile().

Referenced by main().

void loadPipelineResourceFile ( )
slot

shows a file dialog for selecting the resource file to load

References TOPPASBase::activeWindow_(), TOPPASBase::current_path_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

QString loadPipelineResourceFile ( TOPPASWidget w,
QString  current_path 
)
static

Loads and sets the resources of the TOPPASWidget.

References TOPPASWidget::getScene(), TOPPASResources::load(), and TOPPASScene::loadResources().

void loadPreferences ( String  filename = "")

Loads the preferences from the filename given.

If the filename is empty, the application name + ".ini" is used as filename

References File::exists(), Param::exists(), Param::getValue(), VersionInfo::getVersion(), ParamXMLFile::load(), DefaultParamHandler::param_, DefaultParamHandler::setParameters(), Param::setValue(), and DataValue::toString().

Referenced by main(), and TOPPASBase::TOPPASBase().

void newPipeline ( const int  id = -1)
slot

shows the dialog for creating a new file (pass IDINITIALUNTITLED as id if its the first call)

References TOPPASBase::showAsWindow_(), TOPPASBase::tmp_path_, and TOPPASBase::ws_.

Referenced by main(), and TOPPASBase::TOPPASBase().

void openExampleDialog ( )
slot

shows the dialog for opening example files

References TOPPASBase::addTOPPASFile(), and File::getOpenMSDataPath().

Referenced by TOPPASBase::TOPPASBase().

void openFileDialog ( )
slot

shows the dialog for opening files

References TOPPASBase::addTOPPASFile(), TOPPASBase::current_path_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

void openFilesInTOPPView ( QStringList  all_files)
slot

Open files in a new TOPPView instance.

References File::exists(), File::findExecutable(), and File::getExecutablePath().

Referenced by TOPPASBase::showAsWindow_().

void openOnlinePipelineRepository ( )
slot

opens the OpenMS Homepage to download example workflows

References TOPPASBase::webview_.

Referenced by TOPPASBase::TOPPASBase().

void openToppasFile ( QString  filename)
slot

Opens a toppas file.

References TOPPASBase::addTOPPASFile().

void outputVertexFinished ( const String file)
slot

Called when a file was successfully written to an output vertex.

References TOPPASBase::LS_NOTICE, and TOPPASBase::showLogMessage_().

Referenced by TOPPASBase::addTOPPASFile(), and TOPPASBase::insertNewVertex_().

void preferencesDialog ( )
slot

shows the preferences dialog

References TOPPASBase::savePreferences().

void refreshParameters ( )
slot

Refreshes the parameters of the TOPP tools of the current workflow and stores an updated workflow including the current parameters.

References TOPPASBase::activeWindow_(), File::basename(), TOPPASBase::current_path_, TOPPASBase::refreshPipelineParameters(), TOPPASBase::tab_bar_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

QString refreshPipelineParameters ( TOPPASWidget tw,
QString  current_path 
)
static
void runPipeline ( )
slot

Runs the pipeline of the current window.

References TOPPASBase::activeWindow_(), TOPPASWidget::getScene(), and TOPPASScene::runPipeline().

Referenced by TOPPASBase::TOPPASBase().

void saveCurrentPipelineAs ( )
slot

shows the dialog for saving the current file and updates the current tab caption

References TOPPASBase::activeWindow_(), File::basename(), TOPPASBase::current_path_, TOPPASBase::savePipelineAs(), TOPPASBase::tab_bar_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

void savePipeline ( )
slot
QString savePipelineAs ( TOPPASWidget w,
QString  current_path 
)
static

Saves the workflow in the provided TOPPASWidget to a user defined location. Returns the full file name or "" if no valid one is selected.

References File::basename(), TOPPASWidget::getScene(), NULL, TOPPASScene::store(), and String::toQString().

Referenced by TOPPASBase::refreshPipelineParameters(), TOPPASBase::saveCurrentPipelineAs(), and TOPPASBase::savePipeline().

void savePipelineResourceFile ( )
slot

shows a file dialog for selecting the resource file to write to

References TOPPASBase::activeWindow_(), TOPPASBase::current_path_, and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

QString savePipelineResourceFile ( TOPPASWidget w,
QString  current_path 
)
static
void savePreferences ( )
void saveToClipboard ( TOPPASScene scene)
slot

Saves scene to the clipboard.

References TOPPASBase::clipboard_scene_.

Referenced by TOPPASBase::showAsWindow_().

void sendClipboardContent ( )
slot

Sends the clipboard content to the sender of the connected signal.

References TOPPASBase::clipboard_scene_, and TOPPASScene::setClipboard().

Referenced by TOPPASBase::showAsWindow_().

void showAboutDialog ( )
slot

Shows the 'About' dialog.

References VersionInfo::getVersion().

Referenced by TOPPASBase::TOPPASBase().

void showAsWindow_ ( TOPPASWidget sw,
const String caption,
const int  special_id = -1 
)
protectedslot
void showCursorStatus ( double  x,
double  y 
)
slot

shows x,y coordinates in the status bar

Referenced by TOPPASBase::showAsWindow_().

void showLogMessage_ ( TOPPASBase::LogState  state,
const String heading,
const String body 
)
protected
void showPipelineFinishedLogMessage ( )
slot

Called by the scene if the pipeline execution finishes successfully.

References TOPPASBase::LS_NOTICE, and TOPPASBase::showLogMessage_().

Referenced by TOPPASBase::showAsWindow_().

void showStatusMessage ( std::string  msg,
OpenMS::UInt  time 
)
slot

Shows a status message in the status bar.

If time is 0 the status message is displayed until showStatusMessage is called with an empty message or a new message. Otherwise the message is displayed for time ms.

References TOPPASBase::message_label_.

Referenced by TOPPASBase::showAsWindow_().

void showURL ( )
slot

shows the URL stored in the data of the sender QAction

References File::findDoc(), and String::toQString().

Referenced by TOPPASBase::TOPPASBase().

void toolCrashed ( )
slot
void toolFailed ( )
slot
void toolFinished ( )
slot
void toolStarted ( )
slot
void toppasFileDownloaded_ ( QNetworkReply *  r)
protectedslot

triggered when download of .toppas file is finished, so we can store & open it

References TOPPASBase::addTOPPASFile(), TOPPASBase::current_path_, LOG_WARN, TOPPASBase::LS_NOTICE, TOPPASBase::showLogMessage_(), String::toQString(), and String::trim().

Referenced by TOPPASBase::TOPPASBase().

void updateCurrentPath ( )
slot

changes the current path according to the currently active window/layer

References TOPPASBase::current_path_, Param::getValue(), and DefaultParamHandler::param_.

void updateMenu ( )
protectedslot
void updateTabBar ( QWidget w)
slot

brings the tab corresponding to the active window in front

References TOPPASTabBar::setCurrentId(), and TOPPASBase::tab_bar_.

Referenced by TOPPASBase::TOPPASBase().

void updateToolBar ( )
slot

updates the toolbar

void updateTOPPOutputLog ( const QString &  out)
slot

Called when a TOPP tool produces (error) output.

References TOPPASBase::log_.

Referenced by TOPPASBase::addTOPPASFile(), TOPPASBase::insertNewVertex_(), and TOPPASBase::showAsWindow_().

TOPPASWidget * window_ ( int  id) const
protected

Member Data Documentation

QListWidget* blocks_list_
protected

List of ready analysis pipelines.

TOPPASScene* clipboard_scene_
protected
String current_path_
protected
QTextEdit* desc_
protected
int const IDINITIALUNTITLED = 1000
static

use this for the first call to newPipeline(), to ensure that the first empty (and unmodified) workspace is closed iff existing workflows are loaded

Referenced by TOPPASBase::addTOPPASFile(), and main().

TOPPASLogWindow* log_
protected
QLabel* message_label_
protected

Label for messages in the status bar.

Referenced by TOPPASBase::showStatusMessage(), and TOPPASBase::TOPPASBase().

QNetworkAccessManager* network_manager_
protected

download .toppas files from homepage

Referenced by TOPPASBase::downloadTOPPASfromHomepage_(), and TOPPASBase::TOPPASBase().

int node_offset_ = 0
staticprotected

Offset counter for new inserted nodes (to avoid invisible stacking)

Referenced by TOPPASBase::insertNewVertexInCenter_().

TOPPASTabBar* tab_bar_
protected
String tmp_path_
protected
QToolBar* tool_bar_
protected
QTreeWidget* tools_tree_view_
protected

Tree view of all available TOPP tools.

Referenced by TOPPASBase::insertNewVertex_(), TOPPASBase::insertNewVertexInCenter_(), and TOPPASBase::TOPPASBase().

QWebView* webview_
protected
QWorkspace* ws_
protected
qreal z_value_ = 42.0
staticprotected

z-value counter for new inserted nodes (new nodes should be on top)

Referenced by TOPPASBase::insertNewVertex_().


OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:35 using doxygen 1.8.5