Skip to content

Commit

Permalink
Add a basic about dialog to allow developers to easily check the current
Browse files Browse the repository at this point in the history
browser and AXR core versions. This completes part of issue #2 but can't
consider it closed yet since we still need more information displayed as
well as a nicer design.
  • Loading branch information
jakepetroules committed Nov 19, 2012
1 parent e1a054b commit 7913663
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 1 deletion.
65 changes: 65 additions & 0 deletions src/browser/AboutDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/********************************************************************
* a A
* AM\/MA
* (MA:MMD
* :: VD
* :: º
* ::
* :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6
+ 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6
* 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6
* :: TMMTMC ___MMMM VMMMMMMM6 MMMM
* MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM
* :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM
* :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM
* :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM
* TTMMT MMMM MMMM AMMM6 MMMMD MMMM
* TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM
* TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM
* TMMM MMMM
* TMMM .MMM
* TMM .MMD ARBITRARY·······XML········RENDERING
* TMM MMA ====================================
* TMN MM
* MN ZM
* MM,
*
*
* AUTHORS: see AUTHORS file
*
* COPYRIGHT: ©2012 - All Rights Reserved
*
* LICENSE: see LICENSE file
*
* WEB: http://axr.vg
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS"
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
* FITNESS FOR A PARTICULAR PURPOSE.
*
********************************************************************/

#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "config.h"
#include "AXRGlobal.h"

AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);

ui->mainLabel->setText(ui->mainLabel->text()
.arg(BROWSER_VERSION_STRING)
.arg(__TIMESTAMP__)
.arg(AXR_VERSION_STRING)
.arg(axrVersionString()));
}

AboutDialog::~AboutDialog()
{
delete ui;
}
65 changes: 65 additions & 0 deletions src/browser/AboutDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/********************************************************************
* a A
* AM\/MA
* (MA:MMD
* :: VD
* :: º
* ::
* :: ** .A$MMMMND AMMMD AMMM6 MMMM MMMM6
+ 6::Z. TMMM MMMMMMMMMDA VMMMD AMMM6 MMMMMMMMM6
* 6M:AMMJMMOD V MMMA VMMMD AMMM6 MMMMMMM6
* :: TMMTMC ___MMMM VMMMMMMM6 MMMM
* MMM TMMMTTM, AMMMMMMMM VMMMMM6 MMMM
* :: MM TMMTMMMD MMMMMMMMMM MMMMMM MMMM
* :: MMMTTMMM6 MMMMMMMMMMM AMMMMMMD MMMM
* :. MMMMMM6 MMMM MMMM AMMMMMMMMD MMMM
* TTMMT MMMM MMMM AMMM6 MMMMD MMMM
* TMMMM8 MMMMMMMMMMM AMMM6 MMMMD MMMM
* TMMMMMM$ MMMM6 MMMM AMMM6 MMMMD MMMM
* TMMM MMMM
* TMMM .MMM
* TMM .MMD ARBITRARY·······XML········RENDERING
* TMM MMA ====================================
* TMN MM
* MN ZM
* MM,
*
*
* AUTHORS: see AUTHORS file
*
* COPYRIGHT: ©2012 - All Rights Reserved
*
* LICENSE: see LICENSE file
*
* WEB: http://axr.vg
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS"
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
* FITNESS FOR A PARTICULAR PURPOSE.
*
********************************************************************/

#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H

#include <QDialog>

namespace Ui {
class AboutDialog;
}

class AboutDialog : public QDialog
{
Q_OBJECT

public:
explicit AboutDialog(QWidget *parent = 0);
~AboutDialog();

private:
Ui::AboutDialog *ui;
};

#endif // ABOUTDIALOG_H
97 changes: 97 additions & 0 deletions src/browser/AboutDialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>About AXR Browser</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="mainLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:18pt; font-weight:600;&quot;&gt;AXR Browser&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Version:&lt;/span&gt; %1 (built %2)&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;AXR core version:&lt;/span&gt; %3 (runtime version %4)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="copyrightLabel">
<property name="text">
<string>Copyright (c) 2010-2012 AXR Project Contributors. All Rights Reserved.</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
9 changes: 9 additions & 0 deletions src/browser/BrowserApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "AXRWarning.h"
#include "LogWindow.h"
#include "PreferencesDialog.h"
#include "AboutDialog.h"
#include "BrowserApplication.h"
#include "BrowserSettings.h"
#include "BrowserWindow.h"
Expand All @@ -60,6 +61,7 @@ class BrowserApplication::Private
PreferencesDialog *preferencesDialog;
LogWindow *logWindow;
BrowserWindow *mainWindow;
AboutDialog *aboutDialog;
};

BrowserApplication::BrowserApplication(int &argc, char **argv)
Expand All @@ -74,6 +76,7 @@ BrowserApplication::BrowserApplication(int &argc, char **argv)

d->settings = new BrowserSettings();
d->preferencesDialog = new PreferencesDialog();
d->aboutDialog = new AboutDialog();
d->logWindow = new LogWindow();
d->mainWindow = new BrowserWindow();
d->mainWindow->show();
Expand Down Expand Up @@ -107,6 +110,7 @@ BrowserApplication::BrowserApplication(int &argc, char **argv)
BrowserApplication::~BrowserApplication()
{
delete d->mainWindow;
delete d->aboutDialog;
delete d->logWindow;
delete d->preferencesDialog;
delete d->settings;
Expand Down Expand Up @@ -173,3 +177,8 @@ void BrowserApplication::showLogWindow()
{
d->logWindow->show();
}

void BrowserApplication::showAboutDialog()
{
d->aboutDialog->show();
}
1 change: 1 addition & 0 deletions src/browser/BrowserApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class BrowserApplication : public QApplication
QIODevice* loggingDevice() const;
void showPreferencesDialog();
void showLogWindow();
void showAboutDialog();

protected:
bool event(QEvent *e);
Expand Down
1 change: 1 addition & 0 deletions src/browser/BrowserWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ void BrowserWindow::showPreferences()

void BrowserWindow::showAbout()
{
qApp->showAboutDialog();
}

void BrowserWindow::toggleAntialiasing(bool on)
Expand Down
3 changes: 3 additions & 0 deletions src/browser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR})

set(browser_SOURCES
Info.plist
AboutDialog.cpp
AboutDialog.h
AboutDialog.ui
LogWindow.cpp
LogWindow.h
LogWindow.ui
Expand Down
2 changes: 1 addition & 1 deletion src/core

0 comments on commit 7913663

Please sign in to comment.