Broke out help functions into separate Help module.
This commit is contained in:
@@ -6,6 +6,7 @@ set (glabels_sources
|
|||||||
glabels_main.cpp
|
glabels_main.cpp
|
||||||
BarcodeStyle.cpp
|
BarcodeStyle.cpp
|
||||||
ColorNode.cpp
|
ColorNode.cpp
|
||||||
|
Help.cpp
|
||||||
LabelModel.cpp
|
LabelModel.cpp
|
||||||
LabelModelItem.cpp
|
LabelModelItem.cpp
|
||||||
LabelRegion.cpp
|
LabelRegion.cpp
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/* Help.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
||||||
|
*
|
||||||
|
* This file is part of gLabels-qt.
|
||||||
|
*
|
||||||
|
* gLabels-qt is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* gLabels-qt is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Help.h"
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Help
|
||||||
|
{
|
||||||
|
|
||||||
|
void displayContents( QWidget *parent )
|
||||||
|
{
|
||||||
|
std::cout << "TODO: Help::displayContents" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void displayAbout( QWidget *parent )
|
||||||
|
{
|
||||||
|
QMessageBox aboutBox( QMessageBox::NoIcon,
|
||||||
|
QMessageBox::tr("About gLabels"),
|
||||||
|
QMessageBox::tr("<h2>gLabels-qt</h2>"
|
||||||
|
"<p>x.x.x</p>"
|
||||||
|
"<p>A label and business card creation program.</p>"
|
||||||
|
"<font size=\"smaller\">"
|
||||||
|
"<p><a href=\"http://glabels.org\">Homepage</a></p>"
|
||||||
|
"<p>Copyright © 2013 Jim Evins <evins@snaught.com></p>"
|
||||||
|
"</font>"),
|
||||||
|
QMessageBox::Ok,
|
||||||
|
parent );
|
||||||
|
aboutBox.setIconPixmap( QPixmap( ":/images/glabels-logo.png" ) );
|
||||||
|
|
||||||
|
aboutBox.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
/* Help.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 Jim Evins <evins@snaught.com>
|
||||||
|
*
|
||||||
|
* This file is part of gLabels-qt.
|
||||||
|
*
|
||||||
|
* gLabels-qt is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* gLabels-qt is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with gLabels-qt. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef glabels_Help_h
|
||||||
|
#define glabels_Help_h
|
||||||
|
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace gLabels
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Help
|
||||||
|
{
|
||||||
|
void displayContents( QWidget *parent );
|
||||||
|
void displayAbout( QWidget *parent );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // glabels_Help_h
|
||||||
+3
-16
@@ -21,11 +21,11 @@
|
|||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "Icons.h"
|
#include "Icons.h"
|
||||||
|
#include "Help.h"
|
||||||
|
|
||||||
|
|
||||||
namespace gLabels
|
namespace gLabels
|
||||||
@@ -698,26 +698,13 @@ namespace gLabels
|
|||||||
|
|
||||||
void MainWindow::helpContents()
|
void MainWindow::helpContents()
|
||||||
{
|
{
|
||||||
std::cout << "ACTION: help->Contents" << std::endl;
|
Help::displayContents( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::helpAbout()
|
void MainWindow::helpAbout()
|
||||||
{
|
{
|
||||||
QMessageBox aboutBox( QMessageBox::NoIcon,
|
Help::displayAbout( this );
|
||||||
tr("About gLabels"),
|
|
||||||
tr("<h2>gLabels-qt</h2>"
|
|
||||||
"<p>x.x.x</p>"
|
|
||||||
"<p>A label and business card creation program.</p>"
|
|
||||||
"<font size=\"smaller\">"
|
|
||||||
"<p><a href=\"http://glabels.org\">Homepage</a></p>"
|
|
||||||
"<p>Copyright © 2013 Jim Evins <evins@snaught.com></p>"
|
|
||||||
"</font>"),
|
|
||||||
QMessageBox::Ok,
|
|
||||||
this );
|
|
||||||
aboutBox.setIconPixmap( QPixmap( ":/images/glabels-logo.png" ) );
|
|
||||||
|
|
||||||
aboutBox.exec();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user