2016-10-16 17:04:21 -04:00
|
|
|
#ifndef CONF_H
|
|
|
|
#define CONF_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWidgetAction>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QSlider>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
#include "idm.h"
|
2016-10-23 21:26:58 -04:00
|
|
|
#include "../gui/icon.h"
|
2016-10-16 17:04:21 -04:00
|
|
|
|
|
|
|
class MenuItem : public QWidgetAction
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
QString str;
|
|
|
|
QWidget *wid;
|
|
|
|
|
|
|
|
QWidget *createWidget(QWidget *parent);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
MenuItem(const QString &label, QWidget *widget, QObject *parent = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Conf : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
enum DataType
|
|
|
|
{
|
|
|
|
LAST_PATH = 1,
|
|
|
|
NEXT_FILE,
|
|
|
|
VOLUME
|
|
|
|
};
|
|
|
|
|
|
|
|
QString lastPath;
|
|
|
|
bool nextFileState;
|
|
|
|
int volumeValue;
|
|
|
|
|
|
|
|
void sync();
|
|
|
|
QString confPath();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
void setLastPath(const QString &path);
|
|
|
|
void setNextFile(bool state);
|
|
|
|
void setVolume(int value);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
QString getLastPath();
|
|
|
|
bool nextFile();
|
|
|
|
void populateOptionsMenu(QMenu *menu, QWidget *parent);
|
|
|
|
int getVolume();
|
|
|
|
|
|
|
|
Conf(QObject *parent = 0);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void volume(int);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONF_H
|