MainWindow Class Reference

The mainwindow. More...

#include <mainwindow.h>

List of all members.

Public Slots

virtual void setVisible (bool visible)

Public Member Functions

 MainWindow (QWidget *parent=0)
virtual ~MainWindow ()

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
virtual bool queryClose ()
virtual void readProperties (const KConfigGroup &m_configGroup)
virtual void saveProperties (KConfigGroup &m_configGroup)

Private Slots

void actualize_systray_and_statusbar ()
void askForKradioripperImport ()
void display_global_settings_dialog ()
void displayTipOfDay ()
void hideStreamdirectory ()
void prepareForExitingApp ()
void setupActions ()
void setupStreamDirectory ()
void setupSystrayAndStatusbar ()
void showStreamdirectory (bool visible)
void toggleVisibility (const QSystemTrayIcon::ActivationReason reason=QSystemTrayIcon::Trigger)

Private Attributes

QPointer< stationlistWidgetm_streamlistwidget
QPointer
< streamdirectoryDockwidget
m_streamDirectory
KToggleAction * showStreamdirectoryAction
KSystemTrayIcon systray


Detailed Description

The mainwindow.

This class provides the mainwindow and handels the actions, session management, the global setting dialog, the Tip of the day and so on.

Definition at line 37 of file mainwindow.h.


Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0  ) 

The constructor.

  • Constructs the central widget (see m_streamlistwidget).
  • Sets up the actions.
    • Makes the actions availeble to the XML-GUI framework (See KXmlGuiWindow documentation).
    • Makes the actions availeble in the context menu of the central widget (see stationlistWidget).
  • Set up the XML GUI.
  • Display Tips of the Day (if not disabled by the user).

Definition at line 37 of file mainwindow.cpp.

References importKradioripperSettings::askForImport(), m_streamlistwidget, prepareForExitingApp(), setupActions(), setupStreamDirectory(), and setupSystrayAndStatusbar().

Here is the call graph for this function:

MainWindow::~MainWindow (  )  [virtual]

The destructor.

This is a dummy function. See prepareForExitingApp() for details.

Definition at line 63 of file mainwindow.cpp.


Member Function Documentation

void MainWindow::actualize_systray_and_statusbar (  )  [private, slot]

Actualizes the status in the status bar and in the tooltip of the system tray icon.

Definition at line 142 of file mainwindow.cpp.

References m_streamlistwidget, and systray.

Referenced by setupSystrayAndStatusbar().

Here is the caller graph for this function:

void MainWindow::askForKradioripperImport (  )  [private, slot]

Asks if the user wants to imports KRadioRipper's settings.

Definition at line 254 of file mainwindow.cpp.

References importKradioripperSettings::askForImport().

Referenced by setupActions().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::closeEvent ( QCloseEvent *  event  )  [protected, virtual]

Reimplemented from base class.

Definition at line 68 of file mainwindow.cpp.

References systray, and toggleVisibility().

Here is the call graph for this function:

void MainWindow::display_global_settings_dialog (  )  [private, slot]

Displays the settings_general_dialog.

Definition at line 178 of file mainwindow.cpp.

Referenced by setupActions().

Here is the caller graph for this function:

void MainWindow::displayTipOfDay (  )  [private, slot]

Displays the tip of the day (independently from if the user has disabled them or not).

Definition at line 191 of file mainwindow.cpp.

Referenced by setupActions().

Here is the caller graph for this function:

void MainWindow::hideStreamdirectory (  )  [private, slot]

Convenience slot for showStreamdirectory(bool false).

Definition at line 216 of file mainwindow.cpp.

References showStreamdirectory().

Here is the call graph for this function:

void MainWindow::prepareForExitingApp (  )  [private, slot]

Prepares the main winget to exit the application. This means actually:

  • call queryClose()

    This is necessary because queryClose() is not always called by the framework. For example, when you use the menu (File->Quit) or the system tray (right click->Quit) this results in a call of KApplication.quit() which will exit the event loop without closing regulary the main window - it will not even destroy it.

  • delete all children objects

    This is necessary because typically the destructor of the MainWindow class will never be called and there is no save way to ensure that it will be called. On the other side, it is necessary to destroy the children objects, because some of them relay on the destructor to remove temporary files or save configurations.

Note:
This slot is connected the signal QCoreApplication::aboutToQuit() and is called immediately before leaving the event loop. So, in this function, we can not relay on a running event loop!

Definition at line 196 of file mainwindow.cpp.

References queryClose().

Referenced by MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

bool MainWindow::queryClose (  )  [protected, virtual]

Reimplemented from KMainWindow. Saves some settings before the application closes.

Definition at line 160 of file mainwindow.cpp.

References m_streamlistwidget.

Referenced by prepareForExitingApp().

Here is the caller graph for this function:

void MainWindow::readProperties ( const KConfigGroup &  m_configGroup  )  [protected, virtual]

Reimplemented from KMainWindow to restore the last session.

Definition at line 172 of file mainwindow.cpp.

References m_streamlistwidget, and setVisible().

Here is the call graph for this function:

void MainWindow::saveProperties ( KConfigGroup &  m_configGroup  )  [protected, virtual]

Reimplemented from KMainWindow to save this session for restoring.

Definition at line 165 of file mainwindow.cpp.

References m_streamlistwidget.

void MainWindow::setupActions (  )  [private, slot]

Sets up the actions that are supported by this class.

Definition at line 221 of file mainwindow.cpp.

References askForKradioripperImport(), display_global_settings_dialog(), displayTipOfDay(), m_streamDirectory, showStreamdirectory(), and showStreamdirectoryAction.

Referenced by MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::setupStreamDirectory (  )  [private, slot]

Sets up the dock widget with the stream directory.

Definition at line 110 of file mainwindow.cpp.

References m_streamDirectory.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::setupSystrayAndStatusbar (  )  [private, slot]

Sets up the system tray icon and the status bar.

Definition at line 85 of file mainwindow.cpp.

References actualize_systray_and_statusbar(), m_streamlistwidget, systray, and toggleVisibility().

Referenced by MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from base class to influence also floating dock widgets.

Definition at line 116 of file mainwindow.cpp.

References showStreamdirectory(), and showStreamdirectoryAction.

Referenced by readProperties(), and toggleVisibility().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::showStreamdirectory ( bool  visible  )  [private, slot]

Sets the visibility of the streamdirectory and saves this value also in the config file.

Parameters:
visible Choose true to show the streamdirectory and false to hide it.
Note:
If MainWindow is not visible, the streamdirectory will be hidden indepentendly of the parameter.

Definition at line 205 of file mainwindow.cpp.

References m_streamDirectory.

Referenced by hideStreamdirectory(), setupActions(), and setVisible().

Here is the caller graph for this function:

void MainWindow::toggleVisibility ( const QSystemTrayIcon::ActivationReason  reason = QSystemTrayIcon::Trigger  )  [private, slot]

Toggles the property "visibility" of QMainWindow.

Definition at line 123 of file mainwindow.cpp.

References setVisible().

Referenced by closeEvent(), and setupSystrayAndStatusbar().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

A pointer to the dock widget that contains the stream directory.

Definition at line 90 of file mainwindow.h.

Referenced by setupActions(), setupStreamDirectory(), and showStreamdirectory().

A pointer to the central widget.

The central widget is created in the constructor of this class, and the constructor also sets this pointer.

To access the central widget, we could use QMainWindow::centralWidget() and typecast to stationlistWidget - but using this pointer, we don't have to typecast all the time!

Definition at line 88 of file mainwindow.h.

Referenced by actualize_systray_and_statusbar(), MainWindow(), queryClose(), readProperties(), saveProperties(), and setupSystrayAndStatusbar().

KToggleAction* MainWindow::showStreamdirectoryAction [private]

Definition at line 91 of file mainwindow.h.

Referenced by setupActions(), and setVisible().

KSystemTrayIcon MainWindow::systray [private]

The system tray support.

Definition at line 93 of file mainwindow.h.

Referenced by actualize_systray_and_statusbar(), closeEvent(), and setupSystrayAndStatusbar().


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

doxygen