diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-02-12 00:29:01 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-02-12 00:29:01 +0800 |
commit | d779d32c8c32e0e0c22662046498620b11fa46de (patch) | |
tree | ba63a0d33d1fb6a07bca30d74dd72934b9ef69ce /qmidiplayer-desktop/qmpchannelswindow.cpp | |
parent | acf466561f17bf0eb6c19ea0467b27f5392aeb36 (diff) | |
download | QMidiPlayer-d779d32c8c32e0e0c22662046498620b11fa46de.tar.xz |
New functionality API. Port built-in features to the new API.
Start the revamp of the main Window. Credit of the new design goes to @BLumia.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index ed522a0..fc7c686 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -15,7 +15,6 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); pselectw=new qmpPresetSelector(this); ceditw=new qmpChannelEditor(this); - connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); mapper=qmpMainWindow::getInstance()->getPlayer()->getMidiMapper(); cha=new QPixmap(":/img/ledon.png");chi=new QPixmap(":/img/ledoff.png"); cb=new qmpCWNoteOnCB();fused=callbacksc=cbcnt=0; @@ -73,6 +72,18 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : ui->twChannels->setColumnWidth(3,192*(logicalDpiX()/96.)); ui->twChannels->setColumnWidth(4,208*(logicalDpiX()/96.)); ui->twChannels->setColumnWidth(5,32*(logicalDpiX()/96.)); + qmpMainWindow::getInstance()->registerFunctionality( + chnlf=new qmpChannelFunc(this), + std::string("Channel"), + tr("Channel").toStdString(), + getThemedIconc(":/img/channel.png"), + 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/ChnlWShown",0).toInt()) + {show();qmpMainWindow::getInstance()->setFuncState("Channel",true);} } void qmpChannelsWindow::showEvent(QShowEvent *event) @@ -81,6 +92,8 @@ 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()); event->accept(); } @@ -91,7 +104,7 @@ void qmpChannelsWindow::closeEvent(QCloseEvent *event) { qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlWShown",0); } - emit dialogClosing(); + qmpMainWindow::getInstance()->setFuncState("Channel",false); event->accept(); } @@ -99,8 +112,9 @@ void qmpChannelsWindow::moveEvent(QMoveEvent *event) { if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt()) { - qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlW",event->pos()); + qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/ChnlW",saveGeometry()); } + event->accept(); } void qmpChannelsWindow::resetAcitivity() @@ -174,6 +188,8 @@ void qmpChannelsWindow::channelMSChanged() qmpChannelsWindow::~qmpChannelsWindow() { + qmpMainWindow::getInstance()->unregisterFunctionality("Channel"); + delete chnlf; delete chi;delete cha; delete cb;delete ui; } @@ -212,3 +228,10 @@ void qmpChannelsWindow::changeMidiMapping(int chid,int idx) { qmpMainWindow::getInstance()->getPlayer()->setChannelOutput(chid,idx); } + +qmpChannelFunc::qmpChannelFunc(qmpChannelsWindow *par) +{p=par;} +void qmpChannelFunc::show() +{p->show();} +void qmpChannelFunc::close() +{p->close();} |