#include <mainwindow.h>
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< stationlistWidget > | m_streamlistwidget |
QPointer < streamdirectoryDockwidget > | m_streamDirectory |
KToggleAction * | showStreamdirectoryAction |
KSystemTrayIcon | systray |
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.
MainWindow::MainWindow | ( | QWidget * | parent = 0 |
) |
The constructor.
KXmlGuiWindow
documentation). Definition at line 37 of file mainwindow.cpp.
References importKradioripperSettings::askForImport(), m_streamlistwidget, prepareForExitingApp(), setupActions(), setupStreamDirectory(), and setupSystrayAndStatusbar().
MainWindow::~MainWindow | ( | ) | [virtual] |
The destructor.
This is a dummy function. See prepareForExitingApp() for details.
Definition at line 63 of file mainwindow.cpp.
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().
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().
void MainWindow::closeEvent | ( | QCloseEvent * | event | ) | [protected, virtual] |
Reimplemented from base class.
Definition at line 68 of file mainwindow.cpp.
References systray, and toggleVisibility().
void MainWindow::display_global_settings_dialog | ( | ) | [private, slot] |
Displays the settings_general_dialog.
Definition at line 178 of file mainwindow.cpp.
Referenced by setupActions().
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().
void MainWindow::hideStreamdirectory | ( | ) | [private, slot] |
Convenience slot for showStreamdirectory(bool false).
Definition at line 216 of file mainwindow.cpp.
References showStreamdirectory().
void MainWindow::prepareForExitingApp | ( | ) | [private, slot] |
Prepares the main winget to exit the application. This means actually:
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.
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.
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().
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().
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().
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().
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().
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().
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().
void MainWindow::showStreamdirectory | ( | bool | visible | ) | [private, slot] |
Sets the visibility of the streamdirectory and saves this value also in the config file.
visible | Choose true to show the streamdirectory and false to hide it. |
Definition at line 205 of file mainwindow.cpp.
References m_streamDirectory.
Referenced by hideStreamdirectory(), setupActions(), and setVisible().
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().
QPointer<streamdirectoryDockwidget> MainWindow::m_streamDirectory [private] |
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().
QPointer<stationlistWidget> MainWindow::m_streamlistwidget [private] |
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] |
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().