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 STATIONLISTWIDGET_H 00022 #define STATIONLISTWIDGET_H 00023 00024 #include <KAction> 00025 #include <KActionCollection> 00026 #include <KMenu> 00027 #include <QTreeView> 00028 #include "customizableheaderview.h" 00029 #include "stationlistmodel.h" 00030 00050 class stationlistWidget : public QTreeView 00051 { 00052 00053 Q_OBJECT 00054 00055 public: 00067 explicit stationlistWidget(KActionCollection *actionCollection, 00068 QWidget *parent = 0, 00069 QWidget *mainWindow = 0); 00071 virtual ~stationlistWidget(); 00073 virtual bool queryClose(); 00078 virtual void readProperties(const KConfigGroup & m_configGroup); 00083 virtual void saveProperties(KConfigGroup & m_configGroup); 00087 QPointer<stationlistModel> stationlistmodel(); 00088 00089 signals: 00094 void multipleSelected(bool value); 00099 void noneSelected(bool value); 00104 void oneSelected(bool value); 00105 00106 public slots: 00108 void deleteStation(); 00121 void saveAllColumnSizes(); 00126 void scrollToRow(const QModelIndex & index); 00127 00128 protected: 00131 KMenu contextMenu; 00135 virtual void contextMenuEvent(QContextMenuEvent * e); 00143 virtual void mousePressEvent(QMouseEvent *event); 00144 00145 private: 00149 KAction *deleteAction; 00151 KAction *newFolderAction; 00153 KAction *newStreamAction; 00155 KAction *pasteAction; 00157 KAction *recordAction; 00159 KAction *selectAllAction; 00161 KAction *startListenInAction; 00163 KAction * stopListenInAction; 00165 KAction *stopRecordAction; 00167 KAction *streamSettingsAction; 00169 00174 QPointer<stationlistModel> m_stationlistModel; 00176 void setupActions(KActionCollection *actionCollection); 00177 00178 private slots: 00180 void enableStopListenInAction(bool enabled); 00182 void reloadStatusOfListenInAction(); 00184 void reloadStatusOfPasteAction(); 00186 void reloadStatusOfStartAndStopActions(); 00189 void saveColumnSize(const int column); 00191 void recalculateActionsStatus(); 00192 }; 00193 00194 #endif