#include <fileObserver.h>
Public Slots |
|
void | updateFile () |
Look for updates in the
file. |
|
void | start () |
Start the observation. |
|
void | stop () |
Stop the observation. |
|
void | chooseFile () |
Choose a file and start the
observer. |
|
Public Member Functions |
|
FileObserver (QWidget *parent=0, const char *name=0) | |
virtual void | initializeWidget (MainControl &main_control) |
Initialize the widget. |
|
virtual void | checkMenu (MainControl &main_control) |
Menu checking method. |
|
void | setFileName (String filename) |
Set the name of the molecular file
to be observed. |
|
String | getFileName () const |
void | setUpdateInterval (Size msec) |
Set the update interval in milli
seconds. |
|
Protected Attributes |
|
QAction * | start_action_ |
QAction * | stop_action_ |
QTimer | timer_ |
String | file_name_ |
QDateTime | last_vis_time_ |
When the file changes, all current Systems are deleted and
the new content of the observed molecular file is shown.
Supported are all files from the MolecularFileDialog.
A MolecularFileDialog
must have been inserted into the
MainControl.
Usage: (in from
MainControl derived class)
FileObserver* fo = new FileObserver(this, "FileObserver"); fo->setFileName("foo.pdb"); fo->start();
virtual void BALL::VIEW::FileObserver::checkMenu | ( | MainControl & | main_control | ) | [virtual] |
Menu checking method.
This method is called MainControl::checkMenus before a popup menu is shown. It should be used to update the state of menu entries (e.g. disable or enable entries).
main_control | the MainControl object whose menus should be checked |
Reimplemented from BALL::VIEW::ModularWidget.
virtual void BALL::VIEW::FileObserver::initializeWidget | ( | MainControl & | main_control | ) | [virtual] |
Initialize the widget.
Reimplemented from BALL::VIEW::DockWidget.