aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmphelpwindow.cpp
blob: e3d2897a118edd6c81f644f53464fab514f45e50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <fluidsynth.h>
#include "qmphelpwindow.hpp"
#include "ui_qmphelpwindow.h"

qmpHelpWindow::qmpHelpWindow(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::qmpHelpWindow)
{
	ui->setupUi(this);
	int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.);
	setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h);
	ui->textBrowser->setSearchPaths(QStringList(QString(":/doc"))+QStringList(QString(":/img")));
	ui->textBrowser->setSource(QUrl("qrc:///doc/index_internal.html"));
}

qmpHelpWindow::~qmpHelpWindow()
{
	delete ui;
}

void qmpHelpWindow::on_textBrowser_sourceChanged(const QUrl &src)
{
	if(src.fileName()==QString("version_internal.html"))
	{
		QString s=ui->textBrowser->toHtml();
		s.replace("CT_QT_VERSION_STR",QT_VERSION_STR);
		s.replace("RT_QT_VERSION_STR",qVersion());
		s.replace("CT_FLUIDSYNTH_VERSION",FLUIDSYNTH_VERSION);
		s.replace("RT_FLUIDSYNTH_VERSION",fluid_version_str());
		s.replace("APP_VERSION",APP_VERSION);
		ui->textBrowser->setHtml(s);
	}
}