Added new WelcomeScreen widget

The new WelcomeScreen widget is intended to be shown after startup
by default. It allows the user to choose how to start the session,
i.e. shows a list of recently edited projects, a list of new stuff
at the Sharing Platform as well as some help related information and
links.
This commit is contained in:
Tobias Doerffel
2009-08-21 18:36:18 +02:00
parent a5bf034575
commit 34a20ba610
5 changed files with 682 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

View File

@@ -1,6 +1,6 @@
/* LMMS style sheet */
QWhatsThat {
QWhatsThis {
color: black;
}
@@ -12,6 +12,28 @@ automationEditor {
background-color: rgb(0, 0, 0);
}
#WelcomeFrame {
border: 2px solid rgb(32,32,32);
border-radius: 8px;
padding:2px;
}
#TitleSeparator {
border: 1px solid qlineargradient(x1:0, y1:0, x2:1, y2:0,
stop:0 #ccc, stop: 0.5 #444,
stop:1 #ccc);
border-width: 1px 0px 0px 0px;
}
#WelcomeFrame, #WelcomeFrame * {
background-color: rgb(232,232,232);
color: black;
}
#WelcomeFrame QLabel {
color: rgb(128, 128, 128);
}
QMenu {
border:1px solid black;
background-color: rgb( 192, 192, 192 );

57
include/WelcomeScreen.h Normal file
View File

@@ -0,0 +1,57 @@
/*
* WelcomeScreen.h - header file for WelcomeScreen
*
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program 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 2 of the License, or (at your option) any later version.
*
* This program 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 this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#ifndef _WELCOME_SCREEN_H
#define _WELCOME_SCREEN_H
#include <QtGui/QWidget>
namespace Ui { class WelcomeScreen; }
class QListWidgetItem;
class WelcomeScreen : public QWidget
{
Q_OBJECT
public:
WelcomeScreen( QWidget * _parent );
~WelcomeScreen();
private slots:
void createNewProject();
void importProject();
void openTutorial();
void instantMidiAction();
void openOnlineResource( QListWidgetItem * _item );
private:
Ui::WelcomeScreen * ui;
} ;
#endif

140
src/gui/WelcomeScreen.cpp Normal file
View File

@@ -0,0 +1,140 @@
/*
* WelcomeScreen.cpp - implementation of WelcomeScreen
*
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program 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 2 of the License, or (at your option) any later version.
*
* This program 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 this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/
#include <QtGui/QDesktopServices>
#include "WelcomeScreen.h"
#include "RecentResourceListModel.h"
#include "engine.h"
#include "embed.h"
#include "ui_WelcomeScreen.h"
WelcomeScreen::WelcomeScreen( QWidget * _parent ) :
QWidget( _parent ),
ui( new Ui::WelcomeScreen )
{
ui->setupUi( this );
// polish UI
foreach( QPushButton * btn,
ui->WelcomeFrame->findChildren<QPushButton *>() )
{
btn->setText( " " + btn->text() + " " );
}
ui->iconLabel->setPixmap( embed::getIconPixmap( "icon" ) );
ui->newProjectButton->setIcon(
embed::getIconPixmap( "project_new_from_template" ) );
ui->importProjectButton->setIcon(
embed::getIconPixmap( "project_import" ) );
ui->openTutorialButton->setIcon(
embed::getIconPixmap( "help" ) );
ui->instantMidiActionButton->setIcon(
embed::getIconPixmap( "instrument_track" ) );
// connect signals of buttons
connect( ui->newProjectButton, SIGNAL( clicked() ),
this, SLOT( createNewProject() ) );
connect( ui->importProjectButton, SIGNAL( clicked() ),
this, SLOT( importProject() ) );
connect( ui->openTutorialButton, SIGNAL( clicked() ),
this, SLOT( openTutorial() ) );
connect( ui->instantMidiActionButton, SIGNAL( clicked() ),
this, SLOT( instantMidiAction() ) );
// setup recent projects list view
RecentResourceListModel * recentProjectsModel =
new RecentResourceListModel( engine::workingDirResourceDB(), -1, this );
recentProjectsModel->resourceListModel()->
setTypeFilter( ResourceItem::TypeProject );
ui->recentProjectsListView->setModel( recentProjectsModel );
// setup recent community resources list view
RecentResourceListModel * recentCommunityResourcesModel =
new RecentResourceListModel( engine::webResourceDB(), 100, this );
ui->communityResourcesListView->setModel( recentCommunityResourcesModel );
// setup online resources list widget
for( int i = 0; i < ui->onlineResourcesListWidget->count(); ++i )
{
ui->onlineResourcesListWidget->item( i )->setIcon(
embed::getIconPixmap( "ListArrow" ) );
}
connect( ui->onlineResourcesListWidget,
SIGNAL( itemClicked( QListWidgetItem * ) ),
this, SLOT( openOnlineResource( QListWidgetItem * ) ) );
}
WelcomeScreen::~WelcomeScreen()
{
}
void WelcomeScreen::createNewProject()
{
}
void WelcomeScreen::importProject()
{
}
void WelcomeScreen::openTutorial()
{
}
void WelcomeScreen::instantMidiAction()
{
}
void WelcomeScreen::openOnlineResource( QListWidgetItem * _item )
{
// the URL to be opened is encoded in status tip (no other
// possibility to store such information in Qt Designer)
QDesktopServices::openUrl( _item->statusTip() );
}
#include "moc_WelcomeScreen.cxx"

View File

@@ -0,0 +1,462 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WelcomeScreen</class>
<widget class="QWidget" name="WelcomeScreen">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>767</width>
<height>664</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,10,1" columnstretch="1,2,1">
<item row="1" column="1">
<widget class="QFrame" name="WelcomeFrame">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>24</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>24</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>24</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Welcome to LMMS</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="iconLabel"/>
</item>
</layout>
</item>
<item>
<widget class="Line" name="TitleSeparator">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>24</number>
</property>
<property name="leftMargin">
<number>24</number>
</property>
<item>
<widget class="QPushButton" name="newProjectButton">
<property name="text">
<string>New project</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="importProjectButton">
<property name="text">
<string>Import project</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="openTutorialButton">
<property name="text">
<string>Open tutorial</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="instantMidiActionButton">
<property name="text">
<string>Instant MIDI action</string>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,2,1,0,1">
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="verticalSpacing">
<number>10</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Recent projects</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Recent community resources</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Did you know...?</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QTextBrowser" name="didYouKnowBrowser">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<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:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;&quot;&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;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Online resources</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QListWidget" name="onlineResourcesListWidget">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="spacing">
<number>4</number>
</property>
<item>
<property name="text">
<string>Users forum</string>
</property>
<property name="statusTip">
<string>http://sourceforge.net/apps/phpbb/lmms/</string>
</property>
</item>
<item>
<property name="text">
<string>Online manual</string>
</property>
<property name="statusTip">
<string>http://lmms.sourceforge.net/wiki/NewManual</string>
</property>
</item>
<item>
<property name="text">
<string>Wiki</string>
</property>
<property name="statusTip">
<string>http://lmms.sourceforge.net/wiki/</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0" colspan="4">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QListView" name="recentProjectsListView">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QListView" name="communityResourcesListView">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>