PreferencesBase Class Reference

#include <preferencesbase.h>

List of all members.


Detailed Description

This class allows setup of the preferences.

It is instantiation during startup of the program and then reads the settings from an ini file or the registry, providing defaults if no settings can be found.

Definition at line 49 of file preferencesbase.h.

Public Slots

void loadSettings ()
 Loads the program settings from file.
void saveSettings ()
 Saves the program settings to file.
void updateVisuals ()
 Updates the background image & color of the mainwindow and sets the style.

Signals

void newPVMHosts (const QStringList &hosts)

Public Member Functions

 PreferencesBase (QWidget *parent=0, const char *name=0, bool modal=FALSE, WFlags fl=0)
 ~PreferencesBase ()
 The default destructor.
unsigned int preferredBasisset () const
 Returns the index of the basisset used as the preferred basisset.
bool useBinDirectory () const
 Returns true if the .11 should be written to a special directory (different from the calculation directory).
GLBaseParameters getGLBaseParameters () const
 Returns a struct containing all OpenGL parameters used in GLView.
GLMoleculeParameters getGLMoleculeParameters () const
 Returns a struct containing all OpenGL parameters used in GLSimpleMoleculeView.
QStringList getPVMHosts () const
 Returns the list of available PVM hosts.
void setToolbarsInfo (const QString &info, const bool status)
 Sets the info needed to restore the toolbars.
void getToolbarsInfo (bool &status, QString &info) const
 Returns the info needed to restore the toolbars.

Protected Slots

void accept ()
 Overridden version of PreferencesWidget::accept().
void reject ()
 Overridden version of PreferencesWidget::reject().

Private Types

enum  { SettingsVersion = 100 }

Private Slots

void changed ()
 Sets the 'changed' status of PreferencesBase.
void selectWidget (QIconViewItem *item)
 Shows a widget from WidgetStackCategory depending on the iconview item.
void changeExecutable ()
 Updates LabelProgram & LineEditExecutable with the currently selected item in ListViewExecutables.
void updateExecutable (const QString &text)
 Updates the current item of ListViewExecutables with text.
void updateAllExecutables ()
 Renames all items of ListViewExecutables according to the pattern path+name+extension.
void selectBinDir ()
 Selects a new directory for LineEditBin using a standard filedialog.
void selectExecutable ()
 Selects an executable for LineEditExecutable using a standard filedialog.
void selectBasisDir ()
 Selects a new directory for LineEditBasis using a standard filedialog.
void selectBackground ()
 Selects a background image for LineEditBackground using a standard filedialog.
void updateLineEditBondSizeLines ()
 Updates LineEditBondSizeLines according to SliderBondSizeLines.
void updateLineEditBondSizeTubes ()
 Updates LineEditBondSizeTubes according to SliderBondSizeTubes.
void updateSliderBondSizeTubes ()
 Updates SliderBondSizeTubes according to LineEditBondSizeTubes.
void updateLineEditForceSizeTubes ()
 Updates LineEditForceSizeTubes according to SliderForceSizeTubes.
void updateSliderForceSizeTubes ()
 Updates SliderForceSizeTubes according to LineEditForceSizeTubes.
void updateOpacitySelection ()
 Updates TextLabelSelection according to SliderSelectionOpacity.
void updateOpacityForces ()
 Updates TextLabelForces according to SliderForcesOpacity.
void updateColorButtonForce ()
 Enables/disables ColorButtonForce according to the selected colring type.
void changePVMHost ()
 Updates LineEditPVMHost with the selected item in ListViewPVMHosts.
void updatePVMHost (const QString &text)
 Updates the current item of ListViewPVMHosts with text.
void newPVMHost ()
 Adds a new host to ListViewPVMHosts with the name 'new host'.
void deletePVMHost ()
 Removes the currently selected host of ListViewPVMHosts.
void changedPVM ()
 Indicates that the PVM host list has changed.

Private Member Functions

void makeConnections ()
 Sets up all permanent coonections.
void init ()
 Initializes the widget. Called once from the constructor.
void initOpenGL ()
 Determines the capabilities of the current OpenGL implementation.
void saveWidgets ()
 Saves the status of the widgets to the struct data.
void restoreWidgets ()
 Restores the status of the widgets from the contents of the struct data.
void updateStyle ()
 Updates the style of the application according to the current item of ComboBoxStyle.
void updatePaths ()
 Updates the data of the class Paths.

Private Attributes

QString startupStyleName
 Contains the startup style name.
QextMdiMainFrm * mainWindow
 Contains a pointer to the main window.
WidgetData data
 Contains the status of all widgets.
bool widgetChanged
 = true if any of the widgets have changed.
bool pvmHostsChanged
 = true if the PVM host list has changed.
QString tempBondSizeBS
 Contains the bond size for ball&stick.
QString tempBondSizeL
 Contains the bond size for lines.
float minLineWidthGL
 Contains the minimum possible linewidth for a glLineWidth call.
float maxLineWidthGL
 Contains the maximum possible linewidth for a glLineWidth call.
float lineWidthGranularity
 Contains the granularity for OpenGL linewidths.
QString toolbarsInfo
 Contains the info needed to restore the toolbars.
bool toolbarsStatus
 Contains the visibility of the statusbar (not present in toolbarsInfo).

Classes

struct  WidgetData
 A struct for saving the status of all widgets of PreferencesWidget. More...


Member Enumeration Documentation

anonymous enum [private]
 

Enumerator:
SettingsVersion 

Definition at line 108 of file preferencesbase.h.


Constructor & Destructor Documentation

PreferencesBase::PreferencesBase QWidget *  parent = 0,
const char *  name = 0,
bool  modal = FALSE,
WFlags  fl = 0
 

Definition at line 87 of file preferencesbase.cpp.

PreferencesBase::~PreferencesBase  ) 
 

The default destructor.

Definition at line 103 of file preferencesbase.cpp.


Member Function Documentation

unsigned int PreferencesBase::preferredBasisset  )  const
 

Returns the index of the basisset used as the preferred basisset.

Definition at line 110 of file preferencesbase.cpp.

bool PreferencesBase::useBinDirectory  )  const
 

Returns true if the .11 should be written to a special directory (different from the calculation directory).

Definition at line 117 of file preferencesbase.cpp.

GLBaseParameters PreferencesBase::getGLBaseParameters  )  const
 

Returns a struct containing all OpenGL parameters used in GLView.

Definition at line 125 of file preferencesbase.cpp.

GLMoleculeParameters PreferencesBase::getGLMoleculeParameters  )  const
 

Returns a struct containing all OpenGL parameters used in GLSimpleMoleculeView.

Definition at line 173 of file preferencesbase.cpp.

QStringList PreferencesBase::getPVMHosts  )  const
 

Returns the list of available PVM hosts.

Definition at line 202 of file preferencesbase.cpp.

void PreferencesBase::setToolbarsInfo const QString &  info,
const bool  status
 

Sets the info needed to restore the toolbars.

Definition at line 209 of file preferencesbase.cpp.

void PreferencesBase::getToolbarsInfo bool &  status,
QString &  info
const
 

Returns the info needed to restore the toolbars.

Definition at line 217 of file preferencesbase.cpp.

void PreferencesBase::newPVMHosts const QStringList &  hosts  )  [signal]
 

void PreferencesBase::loadSettings  )  [slot]
 

Loads the program settings from file.

On linux, this file is $HOME/.qt/brabosphererc while on Windows they are read from the registry. It also sets up the geometry of the widgets.

Definition at line 230 of file preferencesbase.cpp.

void PreferencesBase::saveSettings  )  [slot]
 

Saves the program settings to file.

ATM only called from the destructor, but possibly useful as a public slot. The following stuff is or should be saved:

  • all PreferencesBase widgets
  • mainwindow geometry/mdimode/recent file list/
  • toolbar geometry/visibility/
  • statusbar geometry/visibility/
  • taskbar geometry/visibility/

Definition at line 324 of file preferencesbase.cpp.

void PreferencesBase::updateVisuals  )  [slot]
 

Updates the background image & color of the mainwindow and sets the style.

Definition at line 404 of file preferencesbase.cpp.

void PreferencesBase::accept  )  [protected, slot]
 

Overridden version of PreferencesWidget::accept().

Sets the accept/reject status of the widget depending on whether any actual changes have been made.

Definition at line 435 of file preferencesbase.cpp.

void PreferencesBase::reject  )  [protected, slot]
 

Overridden version of PreferencesWidget::reject().

Rejects any possible changes made.

Definition at line 459 of file preferencesbase.cpp.

void PreferencesBase::changed  )  [private, slot]
 

Sets the 'changed' status of PreferencesBase.

Definition at line 477 of file preferencesbase.cpp.

void PreferencesBase::selectWidget QIconViewItem *  item  )  [private, slot]
 

Shows a widget from WidgetStackCategory depending on the iconview item.

Definition at line 484 of file preferencesbase.cpp.

void PreferencesBase::changeExecutable  )  [private, slot]
 

Updates LabelProgram & LineEditExecutable with the currently selected item in ListViewExecutables.

Definition at line 500 of file preferencesbase.cpp.

void PreferencesBase::updateExecutable const QString &  text  )  [private, slot]
 

Updates the current item of ListViewExecutables with text.

Definition at line 515 of file preferencesbase.cpp.

void PreferencesBase::updateAllExecutables  )  [private, slot]
 

Renames all items of ListViewExecutables according to the pattern path+name+extension.

Definition at line 526 of file preferencesbase.cpp.

void PreferencesBase::selectBinDir  )  [private, slot]
 

Selects a new directory for LineEditBin using a standard filedialog.

Definition at line 574 of file preferencesbase.cpp.

void PreferencesBase::selectExecutable  )  [private, slot]
 

Selects an executable for LineEditExecutable using a standard filedialog.

Definition at line 583 of file preferencesbase.cpp.

void PreferencesBase::selectBasisDir  )  [private, slot]
 

Selects a new directory for LineEditBasis using a standard filedialog.

Definition at line 592 of file preferencesbase.cpp.

void PreferencesBase::selectBackground  )  [private, slot]
 

Selects a background image for LineEditBackground using a standard filedialog.

Definition at line 601 of file preferencesbase.cpp.

void PreferencesBase::updateLineEditBondSizeLines  )  [private, slot]
 

Updates LineEditBondSizeLines according to SliderBondSizeLines.

Definition at line 610 of file preferencesbase.cpp.

void PreferencesBase::updateLineEditBondSizeTubes  )  [private, slot]
 

Updates LineEditBondSizeTubes according to SliderBondSizeTubes.

Definition at line 617 of file preferencesbase.cpp.

void PreferencesBase::updateSliderBondSizeTubes  )  [private, slot]
 

Updates SliderBondSizeTubes according to LineEditBondSizeTubes.

Definition at line 626 of file preferencesbase.cpp.

void PreferencesBase::updateLineEditForceSizeTubes  )  [private, slot]
 

Updates LineEditForceSizeTubes according to SliderForceSizeTubes.

Definition at line 635 of file preferencesbase.cpp.

void PreferencesBase::updateSliderForceSizeTubes  )  [private, slot]
 

Updates SliderForceSizeTubes according to LineEditForceSizeTubes.

Definition at line 644 of file preferencesbase.cpp.

void PreferencesBase::updateOpacitySelection  )  [private, slot]
 

Updates TextLabelSelection according to SliderSelectionOpacity.

Definition at line 653 of file preferencesbase.cpp.

void PreferencesBase::updateOpacityForces  )  [private, slot]
 

Updates TextLabelForces according to SliderForcesOpacity.

Definition at line 663 of file preferencesbase.cpp.

void PreferencesBase::updateColorButtonForce  )  [private, slot]
 

Enables/disables ColorButtonForce according to the selected colring type.

Definition at line 673 of file preferencesbase.cpp.

void PreferencesBase::changePVMHost  )  [private, slot]
 

Updates LineEditPVMHost with the selected item in ListViewPVMHosts.

Definition at line 680 of file preferencesbase.cpp.

void PreferencesBase::updatePVMHost const QString &  text  )  [private, slot]
 

Updates the current item of ListViewPVMHosts with text.

Definition at line 700 of file preferencesbase.cpp.

void PreferencesBase::newPVMHost  )  [private, slot]
 

Adds a new host to ListViewPVMHosts with the name 'new host'.

Definition at line 711 of file preferencesbase.cpp.

void PreferencesBase::deletePVMHost  )  [private, slot]
 

Removes the currently selected host of ListViewPVMHosts.

Definition at line 719 of file preferencesbase.cpp.

void PreferencesBase::changedPVM  )  [private, slot]
 

Indicates that the PVM host list has changed.

Definition at line 733 of file preferencesbase.cpp.

void PreferencesBase::makeConnections  )  [private]
 

Sets up all permanent coonections.

Definition at line 745 of file preferencesbase.cpp.

void PreferencesBase::init  )  [private]
 

Initializes the widget. Called once from the constructor.

Definition at line 832 of file preferencesbase.cpp.

void PreferencesBase::initOpenGL  )  [private]
 

Determines the capabilities of the current OpenGL implementation.

ATM: minimum/maximum linewidth, linewidth granularity in the future: stereo mode, etc. Called once from the constructor.

Definition at line 905 of file preferencesbase.cpp.

void PreferencesBase::saveWidgets  )  [private]
 

Saves the status of the widgets to the struct data.

Definition at line 937 of file preferencesbase.cpp.

void PreferencesBase::restoreWidgets  )  [private]
 

Restores the status of the widgets from the contents of the struct data.

Definition at line 1010 of file preferencesbase.cpp.

void PreferencesBase::updateStyle  )  [private]
 

Updates the style of the application according to the current item of ComboBoxStyle.

Definition at line 1080 of file preferencesbase.cpp.

void PreferencesBase::updatePaths  )  [private]
 

Updates the data of the class Paths.

Definition at line 1102 of file preferencesbase.cpp.


Member Data Documentation

QString PreferencesBase::startupStyleName [private]
 

Contains the startup style name.

Definition at line 173 of file preferencesbase.h.

QextMdiMainFrm* PreferencesBase::mainWindow [private]
 

Contains a pointer to the main window.

Definition at line 174 of file preferencesbase.h.

WidgetData PreferencesBase::data [private]
 

Contains the status of all widgets.

Definition at line 176 of file preferencesbase.h.

bool PreferencesBase::widgetChanged [private]
 

= true if any of the widgets have changed.

Definition at line 177 of file preferencesbase.h.

bool PreferencesBase::pvmHostsChanged [private]
 

= true if the PVM host list has changed.

Definition at line 178 of file preferencesbase.h.

QString PreferencesBase::tempBondSizeBS [private]
 

Contains the bond size for ball&stick.

Definition at line 179 of file preferencesbase.h.

QString PreferencesBase::tempBondSizeL [private]
 

Contains the bond size for lines.

Definition at line 180 of file preferencesbase.h.

float PreferencesBase::minLineWidthGL [private]
 

Contains the minimum possible linewidth for a glLineWidth call.

Definition at line 181 of file preferencesbase.h.

float PreferencesBase::maxLineWidthGL [private]
 

Contains the maximum possible linewidth for a glLineWidth call.

Definition at line 182 of file preferencesbase.h.

float PreferencesBase::lineWidthGranularity [private]
 

Contains the granularity for OpenGL linewidths.

Definition at line 183 of file preferencesbase.h.

QString PreferencesBase::toolbarsInfo [private]
 

Contains the info needed to restore the toolbars.

Definition at line 184 of file preferencesbase.h.

bool PreferencesBase::toolbarsStatus [private]
 

Contains the visibility of the statusbar (not present in toolbarsInfo).

Definition at line 185 of file preferencesbase.h.


Generated on Fri May 19 14:31:58 2006 for Brabosphere by  doxygen 1.4.6-NO