Vidalia 0.2.10
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Attributes

VidaliaWindow Class Reference

#include <VidaliaWindow.h>

Inheritance diagram for VidaliaWindow:
BandwidthGraph ConfigDialog HelpBrowser MainWindow MessageLog NetViewer

List of all members.

Public Slots

virtual void setVisible (bool visible)
virtual void showWindow ()

Signals

void helpRequested (const QString &topic)

Public Member Functions

 VidaliaWindow (const QString &name, QWidget *parent=0, Qt::WFlags flags=0)
 ~VidaliaWindow ()
void setShortcut (const QString &shortcut, const char *slot)
void saveWindowState ()
void restoreWindowState ()
QVariant getSetting (QString name, QVariant defaultValue)
void saveSetting (QString name, QVariant value)

Protected Member Functions

virtual void changeEvent (QEvent *e)
virtual void retranslateUi ()

Private Attributes

QString _name
VSettings_settings

Detailed Description

Definition at line 28 of file VidaliaWindow.h.


Constructor & Destructor Documentation

VidaliaWindow::VidaliaWindow ( const QString &  name,
QWidget *  parent = 0,
Qt::WFlags  flags = 0 
)

Default constructor.

Definition at line 29 of file VidaliaWindow.cpp.

References _name, and _settings.

VidaliaWindow::~VidaliaWindow ( )

Destructor.

Definition at line 38 of file VidaliaWindow.cpp.

References _settings, and saveWindowState().


Member Function Documentation

void VidaliaWindow::changeEvent ( QEvent *  e) [protected, virtual]

Reimplement the windows' changeEvent() method to check if the event is a QEvent::LanguageChange event. If so, call retranslateUi(), which subclasses of VidaliaWindow can reimplement to update their UI.

Definition at line 134 of file VidaliaWindow.cpp.

References retranslateUi().

QVariant VidaliaWindow::getSetting ( QString  setting,
QVariant  defaultValue 
)

Gets the saved value of a property associated with this window object. If no value was saved, the default value is returned.

Definition at line 94 of file VidaliaWindow.cpp.

References _settings, and VSettings::value().

Referenced by MessageLog::loadSettings(), BandwidthGraph::loadSettings(), MessageLog::registerLogEvents(), and restoreWindowState().

void VidaliaWindow::helpRequested ( const QString &  topic) [signal]
void VidaliaWindow::restoreWindowState ( )

Restores the last size and location of the window.

Definition at line 65 of file VidaliaWindow.cpp.

References getSetting().

Referenced by setVisible().

void VidaliaWindow::retranslateUi ( ) [protected, virtual]

Called when the user wants to change the currently visible language.

Called when the user wants to change the currently visible language. Subclasses can reimplement this to update their UI.

Reimplemented in BandwidthGraph, ConfigDialog, HelpBrowser, MessageLog, MainWindow, and NetViewer.

Definition at line 147 of file VidaliaWindow.cpp.

Referenced by changeEvent().

void VidaliaWindow::saveSetting ( QString  prop,
QVariant  value 
)

Saves a value associated with a setting name for this window object.

Saves a value associated with a property name for this window object.

Definition at line 101 of file VidaliaWindow.cpp.

References _settings, and VSettings::setValue().

Referenced by BandwidthGraph::saveChanges(), MessageLog::saveSettings(), and saveWindowState().

void VidaliaWindow::saveWindowState ( )

Saves the size and location of the window.

Definition at line 53 of file VidaliaWindow.cpp.

References saveSetting().

Referenced by setVisible(), and ~VidaliaWindow().

void VidaliaWindow::setShortcut ( const QString &  shortcut,
const char *  slot 
)

Associates a shortcut key sequence with a slot.

Definition at line 46 of file VidaliaWindow.cpp.

References vApp.

Referenced by BandwidthGraph::BandwidthGraph().

void VidaliaWindow::setVisible ( bool  visible) [virtual, slot]

Shows or hides this window.

Overloaded QWidget::setVisible(). If this window is already visible and visible is true, this window will be brought to the top and given focus. If visible is false, then the window state will be saved and this window will be hidden.

Reimplemented in MainWindow.

Definition at line 111 of file VidaliaWindow.cpp.

References restoreWindowState(), and saveWindowState().

virtual void VidaliaWindow::showWindow ( ) [inline, virtual, slot]

Show this window. This method really just exists for subclasses to override, since QMainWindow::show() is non-virtual.

Reimplemented in BandwidthGraph.

Definition at line 65 of file VidaliaWindow.h.

Referenced by ConfigDialog::applyChanges(), MainWindow::createActions(), HelpBrowser::showWindow(), ConfigDialog::showWindow(), and MainWindow::stopped().


Member Data Documentation

QString VidaliaWindow::_name [private]

Name associated with this window.

Definition at line 73 of file VidaliaWindow.h.

Referenced by VidaliaWindow().

Object used to store window properties

Reimplemented in BandwidthGraph, and MessageLog.

Definition at line 74 of file VidaliaWindow.h.

Referenced by getSetting(), saveSetting(), VidaliaWindow(), and ~VidaliaWindow().


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