diff --git a/data/themes/default/ListArrow.png b/data/themes/default/ListArrow.png new file mode 100644 index 000000000..9ad96e5bf Binary files /dev/null and b/data/themes/default/ListArrow.png differ diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 2634ff90f..b584aa4d8 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -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 ); diff --git a/include/WelcomeScreen.h b/include/WelcomeScreen.h new file mode 100644 index 000000000..81121bea5 --- /dev/null +++ b/include/WelcomeScreen.h @@ -0,0 +1,57 @@ +/* + * WelcomeScreen.h - header file for WelcomeScreen + * + * Copyright (c) 2009 Tobias Doerffel + * + * 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 + + +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 + diff --git a/src/gui/WelcomeScreen.cpp b/src/gui/WelcomeScreen.cpp new file mode 100644 index 000000000..cc57ec51f --- /dev/null +++ b/src/gui/WelcomeScreen.cpp @@ -0,0 +1,140 @@ +/* + * WelcomeScreen.cpp - implementation of WelcomeScreen + * + * Copyright (c) 2009 Tobias Doerffel + * + * 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 + +#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() ) + { + 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" + diff --git a/src/gui/dialogs/WelcomeScreen.ui b/src/gui/dialogs/WelcomeScreen.ui new file mode 100644 index 000000000..ad366c872 --- /dev/null +++ b/src/gui/dialogs/WelcomeScreen.ui @@ -0,0 +1,462 @@ + + + WelcomeScreen + + + + 0 + 0 + 767 + 664 + + + + + + + + 4 + + + 24 + + + 8 + + + 24 + + + 10 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 24 + 75 + true + + + + Welcome to LMMS + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 10 + 16 + + + + + + + + 24 + + + 24 + + + + + New project + + + + 24 + 24 + + + + + + + + Import project + + + + 24 + 24 + + + + + + + + Open tutorial + + + + 24 + 24 + + + + + + + + Instant MIDI action + + + + 24 + 24 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 24 + + + + + + + + 4 + + + 10 + + + + + + 18 + + + + Recent projects + + + + + + + + 18 + + + + Recent community resources + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + + 18 + + + + Did you know...? + + + + + + + QFrame::NoFrame + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + + + + + + + 18 + + + + Online resources + + + + + + + QFrame::NoFrame + + + 4 + + + + Users forum + + + http://sourceforge.net/apps/phpbb/lmms/ + + + + + Online manual + + + http://lmms.sourceforge.net/wiki/NewManual + + + + + Wiki + + + http://lmms.sourceforge.net/wiki/ + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + + 16 + 16 + + + + QAbstractItemView::ScrollPerPixel + + + + + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + + 16 + 16 + + + + QAbstractItemView::ScrollPerPixel + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 16 + 16 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 16 + 16 + + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 16 + 16 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 16 + 16 + + + + + + + + +