aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp22
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.hpp1
3 files changed, 11 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ba8018..fe98a32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
2017-02-13 0.8.5 indev
+Also use the new mechanism to handle the main Window.
+Explicit initialization of variable fixes #4 2).
+
+2017-02-13 0.8.5 indev
Fix pitch bend range handling.
Allow registering a string option as file path.
Provide an easier way to set path values in options.
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index 12fa2a1..d65d873 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -62,7 +62,7 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) :
setButtonHeight(ui->pbPrev,36);setButtonHeight(ui->pbSettings,36);setButtonHeight(ui->pbStop,36);
//setButtonHeight(ui->pbChannels,36);setButtonHeight(ui->pbPList,36);
//setButtonHeight(ui->pbEfx,36);setButtonHeight(ui->pbVisualization,36);
- playing=false;stopped=true;dragging=false;
+ playing=false;stopped=true;dragging=false;fin=false;
settingsw=new qmpSettingsWindow(this);pmgr=new qmpPluginManager();
plistw=new qmpPlistWindow(this);player=NULL;timer=NULL;
singleFS=qmpSettingsWindow::getSettingsIntf()->value("Behavior/SingleInstance",0).toInt();
@@ -103,12 +103,8 @@ void qmpMainWindow::init()
}}
if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus",0).toInt())
{
- QRect g=geometry();
- g.setTopLeft(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/MainW",QPoint(-999,-999)).toPoint());
- if(g.topLeft()!=QPoint(-999,-999))setGeometry(g);
- else setGeometry(QStyle::alignedRect(
- Qt::LeftToRight,Qt::AlignCenter,size(),
- qApp->desktop()->availableGeometry()));
+ QRect g=qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/MainW",QRect(-999,-999,999,999)).toRect();
+ if(g!=QRect(-999,-999,999,999))setGeometry(g);
}show();
ui->vsMasterVol->setValue(qmpSettingsWindow::getSettingsIntf()->value("Audio/Gain",50).toInt());
connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets()));
@@ -195,6 +191,10 @@ int qmpMainWindow::pharseArgs()
void qmpMainWindow::closeEvent(QCloseEvent *event)
{
+ if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt())
+ {
+ qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/MainW",geometry());
+ }
on_pbStop_clicked();fin=true;
for(auto i=mfunc.begin();i!=mfunc.end();++i)
i->second.setAssignedControl((QReflectiveAction*)NULL),
@@ -205,14 +205,6 @@ void qmpMainWindow::closeEvent(QCloseEvent *event)
event->accept();
}
-void qmpMainWindow::moveEvent(QMoveEvent *event)
-{
- if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt())
- {
- qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/MainW",event->pos());
- }
- event->accept();
-}
void qmpMainWindow::dropEvent(QDropEvent *event)
{
QList<QUrl> l=event->mimeData()->urls();
diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp
index 9a80dec..baadb6d 100644
--- a/qmidiplayer-desktop/qmpmainwindow.hpp
+++ b/qmidiplayer-desktop/qmpmainwindow.hpp
@@ -125,7 +125,6 @@ class qmpMainWindow:public QMainWindow
explicit qmpMainWindow(QWidget *parent = 0);
void init();
void closeEvent(QCloseEvent *event);
- void moveEvent(QMoveEvent *event);
void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
~qmpMainWindow();