About box

This commit is contained in:
David Sansome 2010-02-03 20:45:32 +00:00
parent 8dd3242cd6
commit d9727f2731
6 changed files with 230 additions and 3 deletions

14
src/about.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "about.h"
#include "ui_about.h"
#include <QCoreApplication>
About::About(QWidget *parent)
: QDialog(parent)
{
ui_.setupUi(this);
setWindowTitle("About " + QCoreApplication::applicationName());
ui_.title->setText(QCoreApplication::applicationName());
ui_.version->setText("Version " + QCoreApplication::applicationVersion());
}

17
src/about.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef ABOUT_H
#define ABOUT_H
#include <QDialog>
#include "ui_about.h"
class About : public QDialog {
Q_OBJECT
public:
About(QWidget* parent = 0);
private:
Ui::About ui_;
};
#endif // ABOUT_H

188
src/about.ui Normal file
View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QDialog" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>488</width>
<height>415</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">#line {
color: lightgrey;
}
#title {
font-weight: bold;
font-size: 16px;
}
#version {
font-style: italic;
font-size: 10px;
}
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="pixmap">
<pixmap resource="../data/data.qrc">:/icon.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</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>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>64</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_2">
<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="title">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="version">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://code.google.com/p/clementine-player/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;http://code.google.com/p/clementine-player/&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Authors:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;David Sansome &amp;lt;&lt;a href=&quot;mailto:me@davidsansome.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;me@davidsansome.com&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Thanks to:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Mark Kretschmann &amp;lt;&lt;a href=&quot;mailto:markey@web.de&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;markey@web.de&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Max Howell &amp;lt;&lt;a href=&quot;mailto:max.howell@methylblue.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;max.howell@methylblue.com&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;... and all the Amarok contributors&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../data/data.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>About</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>About</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>

View File

@ -14,6 +14,7 @@
#include "multiloadingindicator.h"
#include "settingsdialog.h"
#include "libraryconfigdialog.h"
#include "about.h"
#include "qxtglobalshortcut.h"
@ -41,6 +42,7 @@ MainWindow::MainWindow(QWidget *parent)
edit_tag_dialog_(new EditTagDialog(this)),
multi_loading_indicator_(new MultiLoadingIndicator(this)),
library_config_dialog_(new LibraryConfigDialog(this)),
about_dialog_(new About(this)),
radio_model_(new RadioModel(this)),
playlist_(new Playlist(this)),
player_(new Player(playlist_, radio_model_->GetLastFMService(), this)),
@ -96,6 +98,7 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui_.action_clear_playlist, SIGNAL(triggered()), playlist_, SLOT(Clear()));
connect(ui_.action_edit_track, SIGNAL(triggered()), SLOT(EditTracks()));
connect(ui_.action_configure, SIGNAL(triggered()), settings_dialog_, SLOT(show()));
connect(ui_.action_about, SIGNAL(triggered()), about_dialog_, SLOT(show()));
// Give actions to buttons
ui_.forward_button->setDefaultAction(ui_.action_next_track);

View File

@ -18,6 +18,7 @@ class TrackSlider;
class EditTagDialog;
class MultiLoadingIndicator;
class SettingsDialog;
class About;
class QSortFilterProxyModel;
class SystemTrayIcon;
@ -82,6 +83,7 @@ class MainWindow : public QMainWindow {
EditTagDialog* edit_tag_dialog_;
MultiLoadingIndicator* multi_loading_indicator_;
LibraryConfigDialog* library_config_dialog_;
About* about_dialog_;
RadioModel* radio_model_;
Playlist* playlist_;

View File

@ -52,7 +52,8 @@ SOURCES += main.cpp \
settingsdialog.cpp \
librarydirectorymodel.cpp \
libraryconfigdialog.cpp \
lastfmconfigdialog.cpp
lastfmconfigdialog.cpp \
about.cpp
HEADERS += mainwindow.h \
player.h \
library.h \
@ -105,7 +106,8 @@ HEADERS += mainwindow.h \
settingsdialog.h \
librarydirectorymodel.h \
libraryconfigdialog.h \
lastfmconfigdialog.h
lastfmconfigdialog.h \
about.h
FORMS += mainwindow.ui \
libraryconfig.ui \
fileview.ui \
@ -116,7 +118,8 @@ FORMS += mainwindow.ui \
multiloadingindicator.ui \
settingsdialog.ui \
libraryconfigdialog.ui \
lastfmconfigdialog.ui
lastfmconfigdialog.ui \
about.ui
RESOURCES += ../data/data.qrc
OTHER_FILES += ../data/schema.sql \
../data/mainwindow.css