2010-06-17 11:59:53 +00:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file notifypluginoptionspage.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2010-07-01 13:23:15 +00:00
|
|
|
* @brief Notify Plugin options page header
|
2010-06-17 11:59:53 +00:00
|
|
|
* @see The GNU Public License (GPL) Version 3
|
2010-07-01 13:23:15 +00:00
|
|
|
* @defgroup notify
|
2010-06-17 11:59:53 +00:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NOTIFYPLUGINOPTIONSPAGE_H
|
|
|
|
#define NOTIFYPLUGINOPTIONSPAGE_H
|
|
|
|
|
|
|
|
#include "coreplugin/dialogs/ioptionspage.h"
|
2011-01-22 17:38:22 +00:00
|
|
|
#include "uavobjectmanager.h"
|
|
|
|
#include "uavobject.h"
|
2010-06-17 11:59:53 +00:00
|
|
|
|
|
|
|
#include "QString"
|
|
|
|
#include <QStringList>
|
2010-07-18 18:16:30 +00:00
|
|
|
#include <QItemSelectionModel>
|
2010-06-17 11:59:53 +00:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QtCore/QSettings>
|
|
|
|
#include <phonon>
|
|
|
|
|
2010-07-18 18:16:30 +00:00
|
|
|
class NotifyTableModel;
|
|
|
|
|
2010-06-17 11:59:53 +00:00
|
|
|
class NotifyPluginConfiguration;
|
|
|
|
class SoundNotifyPlugin;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class NotifyPluginOptionsPage;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using namespace Core;
|
|
|
|
|
|
|
|
class NotifyPluginOptionsPage : public IOptionsPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit NotifyPluginOptionsPage(/*NotifyPluginConfiguration *config, */QObject *parent = 0);
|
|
|
|
|
|
|
|
QString id() const { return QLatin1String("settings"); }
|
|
|
|
QString trName() const { return tr("settings"); }
|
|
|
|
QString category() const { return QLatin1String("Notify Plugin");}
|
|
|
|
QString trCategory() const { return tr("Notify Plugin");}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QWidget *createPage(QWidget *parent);
|
|
|
|
void apply();
|
|
|
|
void finish();
|
|
|
|
void restoreFromSettings();
|
|
|
|
|
|
|
|
void updateConfigView(NotifyPluginConfiguration* notification);
|
2010-07-01 13:23:15 +00:00
|
|
|
void getOptionsPageValues(NotifyPluginConfiguration* notification);
|
2010-06-17 11:59:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
UAVObjectManager *objManager;
|
|
|
|
SoundNotifyPlugin* owner;
|
|
|
|
QSettings* settings;
|
|
|
|
QStringList listDirCollections;
|
|
|
|
QStringList listSoundFiles;
|
|
|
|
QString currentCollectionPath;
|
|
|
|
int sizeNotifyList;
|
|
|
|
Phonon::MediaObject *sound1;
|
|
|
|
Phonon::MediaObject *sound2;
|
|
|
|
Phonon::MediaObject *notifySound;
|
|
|
|
Phonon::AudioOutput *audioOutput;
|
2010-07-01 13:23:15 +00:00
|
|
|
QStringList delegateItems;
|
2010-07-18 18:16:30 +00:00
|
|
|
NotifyTableModel* notifyRulesModel;
|
|
|
|
QItemSelectionModel *notifyRulesSelection;
|
2010-06-17 11:59:53 +00:00
|
|
|
QList<NotifyPluginConfiguration*> privListNotifications;
|
|
|
|
|
|
|
|
Ui::NotifyPluginOptionsPage *options_page;
|
2010-07-01 13:23:15 +00:00
|
|
|
//NotifyPluginConfiguration *notify;
|
2010-06-17 11:59:53 +00:00
|
|
|
|
|
|
|
signals:
|
2010-07-18 18:16:30 +00:00
|
|
|
void updateNotifications(QList<NotifyPluginConfiguration*> list);
|
|
|
|
void resetNotification(void);
|
|
|
|
void entryUpdated(int index);
|
|
|
|
void entryAdded(int position);
|
|
|
|
|
2010-06-17 11:59:53 +00:00
|
|
|
|
|
|
|
private slots:
|
2010-07-01 13:23:15 +00:00
|
|
|
void showPersistentComboBox( const QModelIndex & parent, int start, int end );
|
|
|
|
void showPersistentComboBox2 ( const QModelIndex & topLeft, const QModelIndex & bottomRight );
|
|
|
|
|
2010-07-18 18:16:30 +00:00
|
|
|
// void on_buttonTestSound1_clicked();
|
|
|
|
// void on_buttonTestSound2_clicked();
|
2010-06-17 11:59:53 +00:00
|
|
|
void on_buttonTestSoundNotification_clicked();
|
|
|
|
|
|
|
|
void on_buttonAddNotification_clicked();
|
|
|
|
void on_buttonDeleteNotification_clicked();
|
|
|
|
void on_buttonModifyNotification_clicked();
|
2010-07-18 18:16:30 +00:00
|
|
|
void on_tableNotification_changeSelection( const QItemSelection & selected, const QItemSelection & deselected );
|
2010-06-17 11:59:53 +00:00
|
|
|
void on_soundLanguage_indexChanged(int index);
|
|
|
|
void on_buttonSoundFolder_clicked(const QString& path);
|
|
|
|
void on_UAVObject_indexChanged(QString val);
|
|
|
|
void changeButtonText(Phonon::State newstate, Phonon::State oldstate);
|
|
|
|
void on_chkEnableSound_toggled(bool state);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NOTIFYPLUGINOPTIONSPAGE_H
|