aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpchannelswindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-13 17:31:42 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-13 17:31:42 +0800
commita0da9bca472043e7f13d4d6ea1809f6b63a598b0 (patch)
treef318a37656b5b25c4028739b8e59ebb4d132d34d /qmidiplayer-desktop/qmpchannelswindow.cpp
parent3312e495cf54a8bd6451552216f5aeea1a06d486 (diff)
downloadQMidiPlayer-a0da9bca472043e7f13d4d6ea1809f6b63a598b0.tar.xz
Fix pitch bend range handling.
Allow registering a string option as file path. Provide an easier way to set path values in options. Revert to old geometry storage mechanism and improved it. Hope this one will work on Windows. Make the time slider less ugly.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index bd021f1..9b6df60 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -80,8 +80,8 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) :
0,
true
);
- if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QByteArray()).toByteArray().length())
- restoreGeometry(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,-999,-999)).toByteArray());
+ if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,999,999)).toRect()!=QRect(-999,-999,999,999))
+ setGeometry(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,999,999)).toRect());
if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlWShown",0).toInt())
{show();qmpMainWindow::getInstance()->setFuncState("Channel",true);}
}
@@ -92,13 +92,17 @@ void qmpChannelsWindow::showEvent(QShowEvent *event)
{
qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlWShown",1);
}
- if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QByteArray()).toByteArray().length())
- restoreGeometry(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,-999,-999)).toByteArray());
+ if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,999,999)).toRect()!=QRect(-999,-999,999,999))
+ setGeometry(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlW",QRect(-999,-999,999,999)).toRect());
event->accept();
}
void qmpChannelsWindow::closeEvent(QCloseEvent *event)
{
+ if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt())
+ {
+ qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlW",geometry());
+ }
setVisible(false);
if(!qmpMainWindow::getInstance()->isFinalizing()&&qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt())
{
@@ -108,15 +112,6 @@ void qmpChannelsWindow::closeEvent(QCloseEvent *event)
event->accept();
}
-void qmpChannelsWindow::moveEvent(QMoveEvent *event)
-{
- if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt())
- {
- qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlW",saveGeometry());
- }
- event->accept();
-}
-
void qmpChannelsWindow::resetAcitivity()
{
for(int i=0;i<16;++i)ui->twChannels->item(i,0)->setIcon(*chi);