aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Visual/projectm/projectmplugin.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-09-07 18:16:31 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-09-07 18:16:31 +0000
commitdf88edefa380fd8a3cdb33744cbb797bbb19ec44 (patch)
treea3890dd02c10d7cc581dff3b70ec6d0de3404b26 /src/plugins/Visual/projectm/projectmplugin.cpp
parent764a05b854961d6b8a33bf509e4f4cda23afbf53 (diff)
downloadqmmp-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/Visual/projectm/projectmplugin.cpp')
-rw-r--r--src/plugins/Visual/projectm/projectmplugin.cpp17
1 files changed, 13 insertions, 4 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
+}