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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
#include "helpwindow.h"
#include <QPushButton>
#include <QTabWidget>
#include <QApplication>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QTextBrowser>
#include <QScreen>
namespace MediaConch {
//***************************************************************************
// Constructor / Desructor
//***************************************************************************
//---------------------------------------------------------------------------
Help::Help(QWidget *parent) : QDialog(parent)
{
QRect ScreenGeometry = QGuiApplication::primaryScreen()->geometry();
move(ScreenGeometry.width()/5, y());
resize(ScreenGeometry.width()-ScreenGeometry.width()/5*2, ScreenGeometry.height()*3/4);
setWindowFlags(windowFlags()&(0xFFFFFFFF-Qt::WindowContextHelpButtonHint));
setWindowTitle("MediaConch help");
Close=new QPushButton("&Close");
Close->setDefault(true);
QDialogButtonBox* Dialog=new QDialogButtonBox();
Dialog->addButton(Close, QDialogButtonBox::AcceptRole);
connect(Dialog, SIGNAL(accepted()), this, SLOT(close()));
QVBoxLayout* L=new QVBoxLayout();
Central=new QTabWidget(this);
QTextBrowser* Text1=new QTextBrowser(this);
Text1->setReadOnly(true);
Text1->setOpenExternalLinks(true);
Text1->setSource(QUrl("qrc:/Help/FAQ/FAQ.html"));
Central->addTab(Text1, tr("FAQ"));
QTextBrowser* Text2=new QTextBrowser(this);
Text2->setReadOnly(true);
Text2->setOpenExternalLinks(true);
Text2->setSource(QUrl("qrc:/Help/How To Use/How To Use.html"));
Central->addTab(Text2, tr("How To Use"));
QTextBrowser* Text3=new QTextBrowser(this);
Text3->setReadOnly(true);
Text3->setOpenExternalLinks(true);
Text3->setSource(QUrl("qrc:/Help/Data Format/Data Format.html"));
Central->addTab(Text3, tr("Data Format"));
QTextBrowser* Text4=new QTextBrowser(this);
Text4->setReadOnly(true);
Text4->setOpenExternalLinks(true);
Text4->setSource(QUrl("qrc:/Help/About/About.html"));
Central->addTab(Text4, tr("About"));
L->addWidget(Central);
L->addWidget(Close);
setLayout(L);
}
//---------------------------------------------------------------------------
Help::~Help()
{
}
//***************************************************************************
// Functions
//***************************************************************************
//---------------------------------------------------------------------------
void Help::GettingStarted()
{
Central->setCurrentIndex(0);
show();
}
//---------------------------------------------------------------------------
void Help::HowToUse()
{
Central->setCurrentIndex(1);
show();
}
//---------------------------------------------------------------------------
void Help::DataFormat()
{
Central->setCurrentIndex(2);
show();
}
//---------------------------------------------------------------------------
void Help::About()
{
Central->setCurrentIndex(3);
show();
}
}
|