diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-09-07 18:16:31 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-09-07 18:16:31 +0000 |
| commit | df88edefa380fd8a3cdb33744cbb797bbb19ec44 (patch) | |
| tree | a3890dd02c10d7cc581dff3b70ec6d0de3404b26 /src/plugins | |
| parent | 764a05b854961d6b8a33bf509e4f4cda23afbf53 (diff) | |
| download | qmmp-df88edefa380fd8a3cdb33744cbb797bbb19ec44.tar.gz qmmp-df88edefa380fd8a3cdb33744cbb797bbb19ec44.tar.bz2 qmmp-df88edefa380fd8a3cdb33744cbb797bbb19ec44.zip | |
projectm: added save/restore geometry
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3692 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Visual/projectm/projectmplugin.cpp | 17 | ||||
| -rw-r--r-- | src/plugins/Visual/projectm/projectmplugin.h | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/Visual/projectm/projectmplugin.cpp b/src/plugins/Visual/projectm/projectmplugin.cpp index 7051a9c5d..e28eaa827 100644 --- a/src/plugins/Visual/projectm/projectmplugin.cpp +++ b/src/plugins/Visual/projectm/projectmplugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -27,7 +27,6 @@ #include <stdlib.h> #include <locale.h> #include <libprojectM/projectM.hpp> - #include <qmmp/buffer.h> #include <qmmp/output.h> #include "projectmwidget.h" @@ -36,14 +35,16 @@ ProjectMPlugin::ProjectMPlugin (QWidget *parent) : Visual (parent) { - setlocale(LC_NUMERIC, "C"); //fixes none-english locales problem + setlocale(LC_NUMERIC, "C"); //fixes problem with none-english locales setWindowTitle(tr("ProjectM")); m_projectMWidget = new ProjectMWidget(this); QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(m_projectMWidget); layout->setContentsMargins(0,0,0,0); setLayout(layout); - resize(300,300); //TODO save/load geometry + resize(300,300); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + restoreGeometry(settings.value("ProjectM/geometry").toByteArray()); } ProjectMPlugin::~ProjectMPlugin() @@ -61,3 +62,11 @@ void ProjectMPlugin::add (unsigned char *data, qint64 size, int chan) if (m_projectMWidget->projectMInstance()) m_projectMWidget->projectMInstance()->pcm()->addPCM16Data((short *)data, size/4); } + +void ProjectMPlugin::closeEvent (QCloseEvent *event) +{ + //save geometry + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.setValue("ProjectM/geometry", saveGeometry()); + Visual::closeEvent(event); //removes visualization object +} diff --git a/src/plugins/Visual/projectm/projectmplugin.h b/src/plugins/Visual/projectm/projectmplugin.h index cc11f641a..c0fcf577d 100644 --- a/src/plugins/Visual/projectm/projectmplugin.h +++ b/src/plugins/Visual/projectm/projectmplugin.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2012 by Ilya Kotov * + * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -39,6 +39,7 @@ public: void clear(); private: + void closeEvent(QCloseEvent *event); QTimer *m_timer; ProjectMWidget *m_projectMWidget; }; |
