Commit 4a7e5531 authored by Bart van der Velden's avatar Bart van der Velden

Add comments and fix the copyright notice (#68)

parent de126373
......@@ -13,7 +13,7 @@ Prerequisites:
- Have taglib installed >= 1.9.1
- Have Qt installed >= 5.0
Buildin on Linux:
Building on Linux:
=================
The following steps were obtained from getting MusicCollection to work on Kubuntu
......@@ -129,31 +129,28 @@ Buildin on Linux:
Building on Windows
===================
These steps were obtained from getting MusicCollection to work on two systems, one a 64
bit Windows 7 Enterprise and one 64 bit Windows 7 Home Premium.
For Qt: set CMAKE_PREFIX_PATH to the path where Qt is installed, i.e. C:\Qt\5.1.1\msvc2010 on my
Windows machine.
On Linux:
Install TagLib:
- wget http://taglib.github.io/releases/taglib-1.9.1.tar.gz
- tar xvf taglib-1.9.1.tar.gz
- cd taglib-1.9.1/
- cmake .
- make
- sudo make install
- Create a build directory on the same level as MusicCollection: mkdir build
- cd build
- Configure cmake: cmake ../MusicCollection
- Build the software: make
- Run the software: ./musiccollection
- To build a debug version: cmake -DCMAKE_BUILD_TYPE=Debug ../MusicCollection
- After that: gdb musiccollection
These steps were obtained from getting MusicCollection to work on two systems, one a
64 bit Windows 7 Enterprise and one 64 bit Windows 7 Home Premium.
Install CMake
-------------
- Download a Windows installer from http://cmake.org/cmake/resources/software.html
- Run the installer
Install Boost
-------------
Install taglib
--------------
Install Qt Creator
------------------
For Qt: set CMAKE_PREFIX_PATH to the path where Qt is installed, i.e.
C:\Qt\5.2.1\msvc2010 on my
Windows machine.
On Windows:
......
......@@ -22,6 +22,9 @@
set (MUSICCOLLECTION_VERSION_MAJOR 0)
set (MUSICCOLLECTION_VERSION_MINOR 1)
# The copyright string
set (MUSICCOLLECTION_COPYRIGHT "Copyright 2012-2014 Bart van der Velden <bart@muckingabout.eu>")
# Configure a header file to pass some of the CMake settings
# to the source code
configure_file (
......
......@@ -136,7 +136,7 @@ bool HandleCommandLine(
stringstream ss;
ss << "MusicCollection, version: " << version.GetMajor() << "." <<
version.GetMinor() << ", git revision: " << version.GetGitSha1() << "\n";
ss << CopyrightNotice << "\n";
ss << version.Copyright() << "\n";
AddErrorMessage(message, ss.str());
retVal = false;
}
......
......@@ -26,11 +26,14 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
qDebug() << "Hello, world!";
// Set the version information for later use
Version version;
QString ret = QString("%1.%2 Git revision: %3").
arg(version.GetMajor(), version.GetMinor(), version.GetGitSha1());
QString ret = QString("Version %1.%2, Git revision: %3, Qt version: %4").
arg(version.GetMajor(), version.GetMinor(), version.GetGitSha1(),
qVersion());
QCoreApplication::setApplicationVersion(ret);
// Create and show the main window
MainWindow w;
w.show();
......
......@@ -19,10 +19,10 @@
#include "ui_mainwindow.h"
#include "ui/about.h"
#include <QFileDialog>
//#include <QMessageBox>
#include "FileTypeResolver.h"
#include "taglib.h"
//! Set-up the main window
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
m_ui(new Ui::MainWindow)
......@@ -41,11 +41,13 @@ MainWindow::MainWindow(QWidget *parent) :
m_ui->action_about_qt->setIcon(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"));
}
//! Clean-up the dialogue
MainWindow::~MainWindow()
{
delete m_ui;
}
//! Start a file open dialogue to select a file
void MainWindow::BrowseForFile()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Select File"));
......@@ -62,6 +64,7 @@ void MainWindow::LookupFile()
ftr.createFile(m_ui->filenameLineEdit->text().toStdString().c_str());
}
//! Show the about box
void MainWindow::ShowAboutDialog()
{
if (!m_aboutDialog)
......
......@@ -19,7 +19,6 @@
#define MAINWINDOW_H
#include <boost/scoped_ptr.hpp>
#include <QMainWindow>
namespace Ui
......@@ -28,26 +27,35 @@ namespace Ui
class MainWindow;
}
// Forward declaration for the About dialogue
class About;
//! MainWindow is the start dialogue of the application
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
//! Set-up the main window
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
//! Clean-up the dialogue
~MainWindow();
private slots:
//! Start a file open dialogue to select a file
void BrowseForFile();
void LookupFile();
//! Show the about box
void ShowAboutDialog();
private:
//! The MainWindow UI class
Ui::MainWindow* m_ui;
boost::scoped_ptr<About> m_aboutDialog;
//! The About dialogue is encapsulated in a scoped_ptr for resource management
boost::scoped_ptr<About> m_aboutDialog;
};
#endif // MAINWINDOW_H
......@@ -21,6 +21,7 @@
#define VERSION_MAJOR "@MUSICCOLLECTION_VERSION_MAJOR@"
#define VERSION_MINOR "@MUSICCOLLECTION_VERSION_MINOR@"
#define VERSION_GITSHA1 "@MUSICCOLLECTION_VERSION_GITSHA1@"
#define VERSION_COPYRIGHT "@MUSICCOLLECTION_COPYRIGHT@"
// Construct a Version object which gives access to current version information
Version::Version()
......@@ -28,6 +29,7 @@ Version::Version()
m_majorVersion = VERSION_MAJOR;
m_minorVersion = VERSION_MINOR;
m_gitSha1 = VERSION_GITSHA1;
m_copyright = VERSION_COPYRIGHT;
}
// Retrieve the major version number
......@@ -47,3 +49,9 @@ const char* Version::GetGitSha1() const
{
return m_gitSha1.c_str();
}
// Retrieve the copyright string
const char* Version::Copyright() const
{
return m_copyright.c_str();
}
......@@ -43,10 +43,14 @@ public:
//! Retrieve the git SHA1 hash for the current tree
const char* GetGitSha1() const;
//! Retrieve the copyright string
const char* Copyright() const;
private:
std::string m_majorVersion;
std::string m_minorVersion;
std::string m_gitSha1;
std::string m_copyright;
//! The copy constructor is not implemented
Version(const Version&);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment