diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-02-13 22:48:55 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-02-13 22:48:55 +0800 |
commit | 0355a9b37694fd0d25fedb7c50e28cf30ad45ed7 (patch) | |
tree | cbb44a91c02f0025f7baa3abe3a2259ee716fff2 /qmidiplayer-desktop/qmpmainwindow.cpp | |
parent | a0da9bca472043e7f13d4d6ea1809f6b63a598b0 (diff) | |
download | QMidiPlayer-0355a9b37694fd0d25fedb7c50e28cf30ad45ed7.tar.xz |
Minor bug fixes. #4 is now addressed.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
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(); |