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 | |
parent | a0da9bca472043e7f13d4d6ea1809f6b63a598b0 (diff) | |
download | QMidiPlayer-0355a9b37694fd0d25fedb7c50e28cf30ad45ed7.tar.xz |
Minor bug fixes. #4 is now addressed.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 22 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.hpp | 1 |
2 files changed, 7 insertions, 16 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(); 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(); |