aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpinfowindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-12 00:29:01 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-12 00:29:01 +0800
commitd779d32c8c32e0e0c22662046498620b11fa46de (patch)
treeba63a0d33d1fb6a07bca30d74dd72934b9ef69ce /qmidiplayer-desktop/qmpinfowindow.cpp
parentacf466561f17bf0eb6c19ea0467b27f5392aeb36 (diff)
downloadQMidiPlayer-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/qmpinfowindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpinfowindow.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/qmpinfowindow.cpp b/qmidiplayer-desktop/qmpinfowindow.cpp
index fda94f8..03084c1 100644
--- a/qmidiplayer-desktop/qmpinfowindow.cpp
+++ b/qmidiplayer-desktop/qmpinfowindow.cpp
@@ -15,13 +15,30 @@ qmpInfoWindow::qmpInfoWindow(QWidget *parent) :
ui->setupUi(this);
int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.);
setMinimumWidth(w);setMinimumHeight(h);
+ qmpMainWindow::getInstance()->registerFunctionality(
+ infof=new qmpInfoFunc(this),
+ std::string("FileInfo"),
+ tr("File Information").toStdString(),
+ NULL,
+ 0,
+ true
+ );
}
qmpInfoWindow::~qmpInfoWindow()
{
+ qmpMainWindow::getInstance()->unregisterFunctionality("FileInfo");
+ delete infof;
delete ui;
}
+void qmpInfoWindow::closeEvent(QCloseEvent *e)
+{
+ setVisible(false);
+ qmpMainWindow::getInstance()->setFuncState("FileInfo",false);
+ e->accept();
+}
+
void qmpInfoWindow::updateInfo()
{
char str[256];
@@ -57,3 +74,10 @@ void qmpInfoWindow::updateInfo()
strncpy(str,standards+player->getFileStandard()*3,3);str[3]='\0';
ui->lbFileStandard->setText(QString("File standard: ")+str);
}
+
+qmpInfoFunc::qmpInfoFunc(qmpInfoWindow *par)
+{p=par;}
+void qmpInfoFunc::show()
+{p->show();}
+void qmpInfoFunc::close()
+{p->close();}