|
From: Tapio V. <aa...@us...> - 2011-01-26 09:15:15
|
Module: editor
Branch: master
Commit: 9e1b5706612a75c06d16027ebf94820898e1e532
Author: Tapio Vierros <tap...@gm...>
Date: Wed Jan 26 11:13:11 2011 +0200
Added a super fancy about dialog.
---
aboutdialog.ui | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
docs/Authors.txt | 8 ++++
editor.qrc | 38 +++++++++--------
editorapp.cc | 34 ++++++++++++++-
editorapp.hh | 10 +++++
5 files changed, 184 insertions(+), 21 deletions(-)
diff --git a/aboutdialog.ui b/aboutdialog.ui
new file mode 100644
index 0000000..58d5322
--- /dev/null
+++ b/aboutdialog.ui
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AboutDialog</class>
+ <widget class="QDialog" name="AboutDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>480</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <widget class="QWidget" name="tab1">
+ <attribute name="title">
+ <string>&About</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="lblName">
+ <property name="font">
+ <font>
+ <pointsize>32</pointsize>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string notr="true">ApplicationName</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lblVersion">
+ <property name="font">
+ <font>
+ <pointsize>16</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string notr="true">Version: XY</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="lblDescription">
+ <property name="text">
+ <string>This is an application for creating notes for karaoke games that score the performance based on pitch accuracy.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab3">
+ <attribute name="title">
+ <string>A&uthors</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QPlainTextEdit" name="txtAuthors">
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab2">
+ <attribute name="title">
+ <string>&License</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QPlainTextEdit" name="txtLicense">
+ <property name="lineWrapMode">
+ <enum>QPlainTextEdit::NoWrap</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cmdClose">
+ <property name="text">
+ <string>&Close</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/docs/Authors.txt b/docs/Authors.txt
new file mode 100644
index 0000000..b35c398
--- /dev/null
+++ b/docs/Authors.txt
@@ -0,0 +1,8 @@
+Primary Authors:
+Lasse Kärkkäinen
+Tapio Vierros
+
+See Git repository history for full list of contributors.
+
+This applications uses code from the Performous game.
+
diff --git a/editor.qrc b/editor.qrc
index e301484..25f0721 100644
--- a/editor.qrc
+++ b/editor.qrc
@@ -1,19 +1,21 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
-<file>icons/application-exit.png</file>
-<file>icons/document-new.png</file>
-<file>icons/document-save-as.png</file>
-<file>icons/document-save.png</file>
-<file>icons/edit-redo.png</file>
-<file>icons/edit-undo.png</file>
-<file>icons/green-document-open.png</file>
-<file>icons/help-about.png</file>
-<file>icons/help-hint.png</file>
-<file>icons/insert-object.png</file>
-<file>icons/insert-text.png</file>
-<file>icons/media-playback-pause.png</file>
-<file>icons/media-playback-start.png</file>
-<file>icons/media-playback-stop.png</file>
-<file>icons/preferences-other.png</file>
-</qresource>
+<RCC>
+ <qresource prefix="/">
+ <file>icons/application-exit.png</file>
+ <file>icons/document-new.png</file>
+ <file>icons/document-save-as.png</file>
+ <file>icons/document-save.png</file>
+ <file>icons/edit-redo.png</file>
+ <file>icons/edit-undo.png</file>
+ <file>icons/green-document-open.png</file>
+ <file>icons/help-about.png</file>
+ <file>icons/help-hint.png</file>
+ <file>icons/insert-object.png</file>
+ <file>icons/insert-text.png</file>
+ <file>icons/media-playback-pause.png</file>
+ <file>icons/media-playback-start.png</file>
+ <file>icons/media-playback-stop.png</file>
+ <file>icons/preferences-other.png</file>
+ <file>docs/Authors.txt</file>
+ <file>docs/License.txt</file>
+ </qresource>
</RCC>
diff --git a/editorapp.cc b/editorapp.cc
index 56db07c..857c4a6 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -463,9 +463,8 @@ void EditorApp::on_actionWhatsThis_triggered()
void EditorApp::on_actionAbout_triggered()
{
- QMessageBox::about(this, tr("About"),
- tr("Semi-automatic karaoke song editor.\n")
- );
+ AboutDialog aboutDialog(this);
+ aboutDialog.exec();
}
void EditorApp::updateSongMeta(bool readFromSongToUI)
@@ -600,3 +599,32 @@ void EditorApp::closeEvent(QCloseEvent *event)
if (promptSaving()) event->accept();
else event->ignore();
}
+
+
+AboutDialog::AboutDialog(QWidget* parent)
+ : QDialog(parent)
+{
+ setupUi(this);
+ setWindowTitle(tr("About %1").arg(PACKAGE));
+ // Setup About tab
+ lblName->setText(PACKAGE);
+ lblVersion->setText(QString(tr("Version: ")) + VERSION);
+
+ // Populate Authors tab
+ {
+ QFile f(":/docs/Authors.txt");
+ f.open(QIODevice::ReadOnly);
+ QTextStream in(&f);
+ txtAuthors->setPlainText(in.readAll());
+ }
+ // Poplate License text
+ {
+ QFile f(":/docs/License.txt");
+ f.open(QIODevice::ReadOnly);
+ QTextStream in(&f);
+ txtLicense->setPlainText(in.readAll());
+ }
+
+ connect(cmdClose, SIGNAL(clicked()), this, SLOT(accept()));
+ setModal(true);
+}
diff --git a/editorapp.hh b/editorapp.hh
index ee26dd4..5332042 100644
--- a/editorapp.hh
+++ b/editorapp.hh
@@ -2,6 +2,7 @@
#include <phonon/MediaObject>
#include "ui_editor.h"
+#include "ui_aboutdialog.h"
#include "operation.hh"
#include "song.hh"
@@ -14,6 +15,15 @@ namespace Phonon {
class AudioOutput;
}
+
+class AboutDialog: public QDialog, private Ui::AboutDialog
+{
+ Q_OBJECT
+public:
+ AboutDialog(QWidget* parent = 0);
+};
+
+
class EditorApp: public QMainWindow
{
Q_OBJECT
|