From d779d32c8c32e0e0c22662046498620b11fa46de Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 12 Feb 2017 00:29:01 +0800 Subject: 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. --- qmidiplayer-desktop/qmpinfowindow.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'qmidiplayer-desktop/qmpinfowindow.cpp') 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();} -- cgit v1.2.3