00001 /* 00002 Copyright (C) 2008-2010 Lukas Sommer < SommerLuk at gmail dot com > 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License or (at your option) version 3 or any later version 00008 accepted by the membership of KDE e.V. (or its successor approved 00009 by the membership of KDE e.V.), which shall act as a proxy 00010 defined in Section 14 of version 3 of the license. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef MAINWINDOW_H 00022 #define MAINWINDOW_H 00023 00024 #include "stationlistwidget.h" 00025 #include <QCloseEvent> 00026 #include <QDockWidget> 00027 #include <KAction> 00028 #include <KSystemTrayIcon> 00029 #include <KToggleAction> 00030 #include <KXmlGuiWindow> 00031 #include "streamdirectorydockwidget.h" 00032 00037 class MainWindow : public KXmlGuiWindow 00038 { 00039 00040 Q_OBJECT 00041 00042 public: 00057 MainWindow(QWidget *parent=0); 00061 virtual ~MainWindow(); 00062 00063 public slots: 00065 virtual void setVisible(bool visible); 00066 00067 protected: 00069 virtual void closeEvent(QCloseEvent *event); 00071 virtual bool queryClose(); 00073 virtual void readProperties(const KConfigGroup & m_configGroup); 00075 virtual void saveProperties(KConfigGroup & m_configGroup); 00076 00077 private: 00088 QPointer<stationlistWidget> m_streamlistwidget; 00090 QPointer<streamdirectoryDockwidget> m_streamDirectory; 00091 KToggleAction *showStreamdirectoryAction; 00093 KSystemTrayIcon systray; 00094 00095 private slots: 00097 void actualize_systray_and_statusbar(); 00099 void askForKradioripperImport(); 00101 void display_global_settings_dialog(); 00104 void displayTipOfDay(); 00106 void hideStreamdirectory(); 00126 void prepareForExitingApp(); 00128 void setupActions(); 00130 void setupStreamDirectory(); 00132 void setupSystrayAndStatusbar(); 00137 void showStreamdirectory(bool visible); 00139 void toggleVisibility( 00140 const QSystemTrayIcon::ActivationReason reason = QSystemTrayIcon::Trigger); 00141 }; 00142 00143 #endif