* Minor fixes in database storage
authorNikolay Tischenko <niktischenko@gmail.com>
Sat, 11 Sep 2010 20:34:29 +0000 (03:34 +0700)
committerNikolay Tischenko <niktischenko@gmail.com>
Sat, 11 Sep 2010 20:34:29 +0000 (03:34 +0700)
* Minor fixes in file storage
* Imlementing library page (implemented walking throw library, work with
playlists)

15 files changed:
someplayer.pro.user
src/dbstorage.cpp
src/filestorage.cpp
src/library.h
src/libraryform.cpp
src/libraryform.h
src/mainwindow.cpp
src/mainwindow.h
src/playerform.cpp
src/playerform.h
src/playlist.cpp
src/playlist.h
src/someplayer.h
src/ui/libraryform.ui
src/ui/playerform.ui

index 94896bd..fdaaadf 100644 (file)
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.DebuggingHelpersLastDeployed" type="QVariantMap"/>
     <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">1</value>
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.DebuggingHelpersLastDeployed" type="QVariantMap"/>
     <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">1</value>
     <valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
-     <value key="192.168.77.2" type="QDateTime">2010-09-10T01:22:53</value>
+     <value key="192.168.77.2" type="QDateTime">2010-09-12T03:30:33</value>
     </valuemap>
    </valuemap>
    <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
     </valuemap>
    </valuemap>
    <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
index 03db3fd..429e00c 100644 (file)
@@ -27,7 +27,7 @@ void DbStorage::_prepare_queries() {
        _get_tracks_for_album_query = new QSqlQuery(db);
        _get_tracks_for_album_query->prepare("SELECT id, title, source, count, length FROM tracks WHERE artist_id IN "
                                                                                 "(SELECT id FROM artist WHERE name = :artist_name) AND album_id IN "
        _get_tracks_for_album_query = new QSqlQuery(db);
        _get_tracks_for_album_query->prepare("SELECT id, title, source, count, length FROM tracks WHERE artist_id IN "
                                                                                 "(SELECT id FROM artist WHERE name = :artist_name) AND album_id IN "
-                                                                                "(SELECT id FROM album WHERE name =: album_name);");
+                                                                                "(SELECT id FROM album WHERE name = :album_name);");
 
        _get_favorites_query = new QSqlQuery(db);
        _get_favorites_query->prepare("SELECT track_id as id, title, artist, album.name as album, source, count, length FROM "
 
        _get_favorites_query = new QSqlQuery(db);
        _get_favorites_query->prepare("SELECT track_id as id, title, artist, album.name as album, source, count, length FROM "
index f383a1c..f32f47d 100644 (file)
@@ -20,11 +20,12 @@ QList<Playlist> FileStorage::getPlaylists() {
 }
 
 Playlist FileStorage::getPlaylist(QString name) {
 }
 
 Playlist FileStorage::getPlaylist(QString name) {
-       QFile playlistFile (_path_prefix+"/"+name+_PLAYLIST_FILE_EXTENSION_);
+       QFile playlistFile (_path_prefix+"/"+name+"."+_PLAYLIST_FILE_EXTENSION_);
        Playlist playlist;
        playlist.setName("Bad playlist");
        if (playlistFile.exists()) {
                playlist.setName(name);
        Playlist playlist;
        playlist.setName("Bad playlist");
        if (playlistFile.exists()) {
                playlist.setName(name);
+               playlistFile.open(QFile::ReadOnly);
                QTextStream stream(&playlistFile);
                QString buffer = stream.readLine();
                int index = 0;
                QTextStream stream(&playlistFile);
                QString buffer = stream.readLine();
                int index = 0;
@@ -32,13 +33,13 @@ Playlist FileStorage::getPlaylist(QString name) {
                        while (!stream.atEnd()) {
                                buffer = stream.readLine();
                                if (_meta_regexp.indexIn(buffer) != -1) {
                        while (!stream.atEnd()) {
                                buffer = stream.readLine();
                                if (_meta_regexp.indexIn(buffer) != -1) {
-                                       int seconds = _meta_regexp.cap(0).toInt();
-                                       QString artist = _meta_regexp.cap(1);
-                                       QString album = _meta_regexp.cap(2);
-                                       QString title = _meta_regexp.cap(3);
+                                       int seconds = _meta_regexp.cap(1).toInt();
+                                       QString artist = _meta_regexp.cap(2);
+                                       QString album = _meta_regexp.cap(3);
+                                       QString title = _meta_regexp.cap(4);
                                        buffer = stream.readLine();
                                        if (_path_regexp.indexIn(buffer) != -1) {
                                        buffer = stream.readLine();
                                        if (_path_regexp.indexIn(buffer) != -1) {
-                                               QString source = _path_regexp.cap(0);
+                                               QString source = _path_regexp.cap(1);
                                                TrackMetadata meta(title, artist, album, seconds);
                                                Track track(index++, meta, source);
                                                playlist.addTrack(track);
                                                TrackMetadata meta(title, artist, album, seconds);
                                                Track track(index++, meta, source);
                                                playlist.addTrack(track);
@@ -59,7 +60,8 @@ QStringList FileStorage::getPlaylistsNames() {
                QFileInfo info(entry);
                QString suffix = info.suffix().toLower();
                if (suffix == _PLAYLIST_FILE_EXTENSION_) {
                QFileInfo info(entry);
                QString suffix = info.suffix().toLower();
                if (suffix == _PLAYLIST_FILE_EXTENSION_) {
-                       playlistNames.append(info.fileName());
+                       playlistNames.append(info.fileName()
+                                                                .replace(QString(".%1").arg(_PLAYLIST_FILE_EXTENSION_), "", Qt::CaseInsensitive));
                }
        }
        return playlistNames;
                }
        }
        return playlistNames;
index 515f3d8..c9e460a 100644 (file)
@@ -9,6 +9,9 @@
 #include "mediascanner.h"
 #include "tagresolver.h"
 
 #include "mediascanner.h"
 #include "tagresolver.h"
 
+#define _DATABASE_PATH_ "/tmp"
+#define _PLAYLISTS_PATH_ "/tmp"
+
 // represents media library: tracks, playlists
 // it uses different media storages for tracks and playlists
 // but dynamic playlits will be stored with tracks into the same storage
 // represents media library: tracks, playlists
 // it uses different media storages for tracks and playlists
 // but dynamic playlits will be stored with tracks into the same storage
index b41545d..cc9e1a0 100644 (file)
 #include "libraryform.h"
 #include "ui_libraryform.h"
 #include "libraryform.h"
 #include "ui_libraryform.h"
+#include "library.h"
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <QModelIndex>
+#include <QModelIndexList>
+#include "track.h"
+#include "playlist.h"
+#include <QDebug>
+#include <QTime>
 
 
-LibraryForm::LibraryForm(QWidget *parent) :
+using namespace SomePlayer::DataObjects;
+
+inline QString __format_track_string(TrackMetadata meta) {
+       int minutes = meta.length() / 60;
+       int seconds = meta.length() % 60;
+       QTime time(0, minutes, seconds);
+       return QString("[%1] %2").arg(time.toString("mm:ss")).arg(meta.title());
+
+}
+
+inline void __fill_model(QStandardItemModel *model, QList<QString> data) {
+       model->clear();
+       int count = data.count();
+       model->setRowCount(count);
+       for (int i = 0; i < count; i++) {
+               model->setItem(i, 0, new QStandardItem(data.at(i)));
+       }
+}
+
+inline void __fill_model_tracks (QStandardItemModel *model, QList<Track> tracks) {
+       int count = tracks.count();
+       model->setRowCount(count);
+       for (int i = 0; i < count; i++) {
+               TrackMetadata meta = tracks.at(i).metadata();
+               model->setItem(i, 0, new QStandardItem(__format_track_string(meta)));
+       }
+}
+
+LibraryForm::LibraryForm(Library *lib, QWidget *parent) :
     QWidget(parent),
     ui(new Ui::LibraryForm)
 {
     QWidget(parent),
     ui(new Ui::LibraryForm)
 {
+       _lib = lib;
+       _model = new QStandardItemModel(this);
+       _state = STATE_NONE;
     ui->setupUi(this);
     ui->setupUi(this);
+       connect(ui->playerButton, SIGNAL(clicked()), this, SLOT(_player()));
+       connect(ui->viewButton, SIGNAL(clicked()), this, SLOT(_view_button()));
+       connect(ui->playlistsButton, SIGNAL(clicked()), this, SLOT(_playlists_button()));
+       connect(ui->listView, SIGNAL(clicked(QModelIndex)), this, SLOT(_process_list_click(QModelIndex)));
+       connect(ui->addButton, SIGNAL(clicked()), this, SLOT(_add_button()));
+       connect(ui->backButton, SIGNAL(clicked()), this, SLOT(_back_button()));
+       _view_button();
 }
 
 LibraryForm::~LibraryForm()
 {
     delete ui;
 }
 }
 
 LibraryForm::~LibraryForm()
 {
     delete ui;
 }
+
+void LibraryForm::_player() {
+       emit player();
+}
+
+void LibraryForm::_view_button() {
+       QList<QString> artitst = _lib->getArtists();
+       __fill_model(_model, artitst);
+       ui->listView->setModel(_model);
+       _state = STATE_ARTIST;
+       ui->backButton->setEnabled(false);
+       ui->listLabel->setText("Artists");
+}
+
+void LibraryForm::_dynamic_button() {
+}
+
+void LibraryForm::_process_list_click(QModelIndex index) {
+       if (_state == STATE_NONE) return;
+       QString data = index.data().toString();
+       switch (_state) {
+       case STATE_ARTIST:
+               __fill_model(_model, _lib->getAlbumsForArtist(data));
+               _current_artist = data;
+               _state = STATE_ALBUM;
+               ui->backButton->setEnabled(true);
+               ui->listLabel->setText(QString("Albums by \"%1\"").arg(_current_artist));
+               break;
+       case STATE_ALBUM:
+               _current_album = data;
+               _current_tracks = _lib->getTracksForAlbum(data, _current_artist);
+               __fill_model_tracks(_model, _current_tracks);
+               _state = STATE_TRACK;
+               ui->backButton->setEnabled(true);
+               ui->listLabel->setText(QString("Tracks from \"%1\" by \"%2\"").arg(_current_album).arg(_current_artist));
+               break;
+       case STATE_PLAYLIST:
+               {
+                       Playlist playlist = _lib->getPlaylist(data);
+                       _current_tracks = playlist.tracks();
+                       __fill_model_tracks(_model, _current_tracks);
+                       _state = STATE_PLAYLIST_TRACK;
+                       ui->backButton->setEnabled(true);
+                       ui->listLabel->setText(QString("Tracks in playlist \"%1\"").arg(data));
+               }
+               break;
+       default:
+               return;
+       }
+}
+
+void LibraryForm::_add_button() {
+       if (_state == STATE_NONE) return;
+       QModelIndexList selected = ui->listView->selectionModel()->selectedIndexes();
+       ui->listView->selectionModel()->clearSelection();
+       switch (_state) {
+       case STATE_ARTIST:
+               foreach (QModelIndex id, selected) {
+                       _add_artist(id.data().toString());
+               }
+               break;
+       case STATE_ALBUM:
+               foreach (QModelIndex id, selected) {
+                       _add_album(_current_artist, id.data().toString());
+               }
+               break;
+       case STATE_TRACK:
+               foreach (QModelIndex id, selected) {
+                       _add_track(_current_tracks.at(id.row()));
+               }
+               break;
+       case STATE_PLAYLIST:
+               foreach (QModelIndex id, selected) {
+                       _add_playlist(id.data().toString());
+               }
+               break;
+       case STATE_PLAYLIST_TRACK:
+               foreach (QModelIndex id, selected) {
+                       _add_track(_current_tracks.at(id.row()));
+               }
+               break;
+       default:
+               return;
+       }
+}
+
+
+void LibraryForm::_add_artist(QString artist) {
+       qDebug() << "adding ARTIST " << artist;
+       QList<QString> albums = _lib->getAlbumsForArtist(artist);
+       foreach(QString album, albums) {
+               _add_album(artist, album);
+       }
+}
+
+void LibraryForm::_add_album(QString artist, QString album) {
+       qDebug() << "adding ALBUM " << album << " by " << artist;
+       QList<Track> tracks = _lib->getTracksForAlbum(album, artist);
+       foreach(Track track, tracks) {
+               _add_track(track);
+       }
+}
+
+void LibraryForm::_add_track(Track track) {
+       qDebug() << "adding TRACK " << track.metadata().title() << " from " << track.metadata().album() << " by " << track.metadata().artist();
+}
+
+void LibraryForm::_add_playlist(QString name) {
+       qDebug() << "adding playlist \"" << name << "\"";
+       Playlist playlist = _lib->getPlaylist(name);
+       QList<Track> tracks = playlist.tracks();
+       foreach (Track track, tracks) {
+               _add_track(track);
+       }
+}
+
+void LibraryForm::_back_button() {
+       switch (_state) {
+       case STATE_ALBUM:
+               _view_button();
+               break;
+       case STATE_TRACK:
+               __fill_model(_model, _lib->getAlbumsForArtist(_current_artist));
+               _state = STATE_ALBUM;
+               ui->listLabel->setText(QString("Albums by \"%1\"").arg(_current_artist));
+               break;
+       case STATE_PLAYLIST_TRACK:
+               _playlists_button();
+       default:
+               return;
+       }
+}
+
+void LibraryForm::_playlists_button() {
+       QList<QString> playlists = _lib->getPlaylistsNames();
+       __fill_model(_model, playlists);
+       ui->listView->setModel(_model);
+       _state = STATE_PLAYLIST;
+       ui->backButton->setEnabled(false);
+       ui->listLabel->setText("Playlists");
+}
index a4aefc5..009b692 100644 (file)
@@ -2,21 +2,52 @@
 #define LIBRARYFORM_H
 
 #include <QWidget>
 #define LIBRARYFORM_H
 
 #include <QWidget>
+#include "someplayer.h"
+
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <QModelIndex>
 
 namespace Ui {
     class LibraryForm;
 }
 
 
 namespace Ui {
     class LibraryForm;
 }
 
+using SomePlayer::DataObjects::Library;
+using SomePlayer::DataObjects::Track;
+
+enum LibraryFormListState {STATE_NONE, STATE_ARTIST, STATE_ALBUM, STATE_TRACK, STATE_PLAYLIST, STATE_PLAYLIST_TRACK};
+
 class LibraryForm : public QWidget
 {
     Q_OBJECT
 
 public:
 class LibraryForm : public QWidget
 {
     Q_OBJECT
 
 public:
-    explicit LibraryForm(QWidget *parent = 0);
+       explicit LibraryForm(Library *lib, QWidget *parent = 0);
     ~LibraryForm();
     ~LibraryForm();
+signals:
+       void player();
+private slots:
+       void _player();
+       void _view_button();
+       void _dynamic_button();
+       void _playlists_button();
+       void _add_button();
+       void _back_button();
+       void _process_list_click(QModelIndex);
 
 private:
     Ui::LibraryForm *ui;
 
 private:
     Ui::LibraryForm *ui;
+       Library *_lib;
+       QStandardItemModel *_model;
+       LibraryFormListState _state;
+       QString _current_artist;
+       QString _current_album;
+       QList<Track> _current_tracks;
+
+       void _add_artist(QString artist);
+       void _add_album(QString artist, QString album);
+       void _add_track(Track track);
+       void _add_playlist(QString name);
 };
 
 #endif // LIBRARYFORM_H
 };
 
 #endif // LIBRARYFORM_H
index 69ff230..f14edf9 100644 (file)
@@ -8,10 +8,13 @@
 
 #include "library.h"
 
 
 #include "library.h"
 
+using namespace SomePlayer::DataObjects;
+
 MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
 {
 MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
 {
+       _library = new Library(_DATABASE_PATH_, _PLAYLISTS_PATH_);
        ui->setupUi(this);
        connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia()));
        connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt()));
        ui->setupUi(this);
        connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia()));
        connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt()));
@@ -19,13 +22,12 @@ MainWindow::MainWindow(QWidget *parent) :
        connect(ui->actionPlayer, SIGNAL(triggered()), this, SLOT(player()));
        connect(ui->actionLibrary, SIGNAL(triggered()), this, SLOT(library()));
        setAnimated(true);
        connect(ui->actionPlayer, SIGNAL(triggered()), this, SLOT(player()));
        connect(ui->actionLibrary, SIGNAL(triggered()), this, SLOT(library()));
        setAnimated(true);
-       _playerForm = new PlayerForm();
-       _libraryForm = new LibraryForm();
+       _playerForm = new PlayerForm(_library, ui->stackedWidget);
+       _libraryForm = new LibraryForm(_library, ui->stackedWidget);
        ui->stackedWidget->insertWidget(0, _playerForm);
        ui->stackedWidget->insertWidget(1, _libraryForm);
        ui->stackedWidget->insertWidget(0, _playerForm);
        ui->stackedWidget->insertWidget(1, _libraryForm);
-       _playerForm->setAttribute(Qt::WA_Maemo5StackedWindow);
-       _libraryForm->setAttribute(Qt::WA_Maemo5StackedWindow);
        connect(_playerForm, SIGNAL(library()), this, SLOT(library()));
        connect(_playerForm, SIGNAL(library()), this, SLOT(library()));
+       connect(_libraryForm, SIGNAL(player()), this, SLOT(player()));
        library();
 }
 
        library();
 }
 
@@ -53,11 +55,13 @@ void MainWindow::about() {
 }
 
 void MainWindow::player() {
 }
 
 void MainWindow::player() {
+       _playerForm->show();
        ui->stackedWidget->setCurrentIndex(0);
        setWindowTitle("SomePlayer");
 }
 
 void MainWindow::library() {
        ui->stackedWidget->setCurrentIndex(0);
        setWindowTitle("SomePlayer");
 }
 
 void MainWindow::library() {
+       _libraryForm->show();
        ui->stackedWidget->setCurrentIndex(1);
        setWindowTitle("SomePlayer Library");
 }
        ui->stackedWidget->setCurrentIndex(1);
        setWindowTitle("SomePlayer Library");
 }
index 5acedb4..033630d 100644 (file)
@@ -5,11 +5,14 @@
 #include <QMessageBox>
 #include "playerform.h"
 #include "libraryform.h"
 #include <QMessageBox>
 #include "playerform.h"
 #include "libraryform.h"
+#include "library.h"
 
 namespace Ui {
        class MainWindow;
 }
 
 
 namespace Ui {
        class MainWindow;
 }
 
+using SomePlayer::DataObjects::Library;
+
 class MainWindow : public QMainWindow
 {
        Q_OBJECT
 class MainWindow : public QMainWindow
 {
        Q_OBJECT
@@ -30,6 +33,7 @@ public slots:
 private:
        PlayerForm *_playerForm;
        LibraryForm *_libraryForm;
 private:
        PlayerForm *_playerForm;
        LibraryForm *_libraryForm;
+       Library *_library;
 };
 
 #endif // MAINWINDOW_H
 };
 
 #endif // MAINWINDOW_H
index 3040bb1..d6e5929 100644 (file)
@@ -1,12 +1,15 @@
 #include "playerform.h"
 #include "ui_playerform.h"
 
 #include "playerform.h"
 #include "ui_playerform.h"
 
-PlayerForm::PlayerForm(QWidget *parent) :
+using namespace SomePlayer::DataObjects;
+
+PlayerForm::PlayerForm(Library* lib, QWidget *parent) :
+       _lib(lib),
     QWidget(parent),
     ui(new Ui::PlayerForm)
 {
     ui->setupUi(this);
     QWidget(parent),
     ui(new Ui::PlayerForm)
 {
     ui->setupUi(this);
-       connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(_library()));
+       connect(ui->libraryButton, SIGNAL(clicked()), this, SLOT(_library()));
 }
 
 PlayerForm::~PlayerForm()
 }
 
 PlayerForm::~PlayerForm()
index 6c06393..ea57a27 100644 (file)
@@ -2,17 +2,20 @@
 #define PLAYERFORM_H
 
 #include <QWidget>
 #define PLAYERFORM_H
 
 #include <QWidget>
+#include "someplayer.h"
 
 namespace Ui {
     class PlayerForm;
 }
 
 
 namespace Ui {
     class PlayerForm;
 }
 
+using SomePlayer::DataObjects::Library;
+
 class PlayerForm : public QWidget
 {
     Q_OBJECT
 
 public:
 class PlayerForm : public QWidget
 {
     Q_OBJECT
 
 public:
-       explicit PlayerForm(QWidget *parent = 0);
+       explicit PlayerForm(Library *lib, QWidget *parent = 0);
     ~PlayerForm();
 signals:
        void library();
     ~PlayerForm();
 signals:
        void library();
@@ -22,6 +25,7 @@ private slots:
 
 private:
     Ui::PlayerForm *ui;
 
 private:
     Ui::PlayerForm *ui;
+       Library *_lib;
 };
 
 #endif // PLAYERFORM_H
 };
 
 #endif // PLAYERFORM_H
index a934bb1..d036714 100644 (file)
@@ -7,6 +7,17 @@ Playlist::Playlist()
        _name = "New playlist";
 }
 
        _name = "New playlist";
 }
 
+Playlist::Playlist(const Playlist &playlist) {
+       _name = playlist.name();
+       _tracks = playlist.tracks();
+}
+
+Playlist& Playlist::operator =(const Playlist &playlist) {
+       _name = playlist.name();
+       _tracks = playlist.tracks();
+       return *this;
+}
+
 QString Playlist::name() const {
        return _name;
 }
 QString Playlist::name() const {
        return _name;
 }
index a937a3a..5c3ecde 100644 (file)
@@ -11,6 +11,9 @@ namespace SomePlayer {
                class Playlist {
                public:
                        Playlist();
                class Playlist {
                public:
                        Playlist();
+                       Playlist(const Playlist &playlist);
+
+                       Playlist &operator=(const Playlist &playlist);
 
                        QString name() const;
                        const QList<Track> &tracks() const;
 
                        QString name() const;
                        const QList<Track> &tracks() const;
index b02f444..8672705 100644 (file)
@@ -9,6 +9,7 @@ namespace SomePlayer {
                class TrackMetadata;
                class TagResolver;
                class Playlist;
                class TrackMetadata;
                class TagResolver;
                class Playlist;
+               class Library;
        };
        namespace Storage {
        };
        };
        namespace Storage {
        };
@@ -18,6 +19,7 @@ namespace SomePlayer {
 
 // common includes
 
 
 // common includes
 
+#include <QObject>
 #include <QString>
 #include <QStringList>
 #include <QList>
 #include <QString>
 #include <QStringList>
 #include <QList>
index 79017b2..cdc3ddd 100644 (file)
     <height>480</height>
    </rect>
   </property>
     <height>480</height>
    </rect>
   </property>
+  <property name="palette">
+   <palette>
+    <active>
+     <colorrole role="Text">
+      <brush brushstyle="SolidPattern">
+       <color alpha="255">
+        <red>0</red>
+        <green>85</green>
+        <blue>255</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </active>
+    <inactive>
+     <colorrole role="Text">
+      <brush brushstyle="SolidPattern">
+       <color alpha="255">
+        <red>0</red>
+        <green>85</green>
+        <blue>255</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </inactive>
+    <disabled>
+     <colorrole role="Text">
+      <brush brushstyle="SolidPattern">
+       <color alpha="255">
+        <red>127</red>
+        <green>127</green>
+        <blue>126</blue>
+       </color>
+      </brush>
+     </colorrole>
+    </disabled>
+   </palette>
+  </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QPushButton" name="pushButton">
-     <property name="text">
-      <string>ОЛОЛО!!</string>
-     </property>
-    </widget>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="viewButton">
+       <property name="text">
+        <string>View</string>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </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>
+     <item>
+      <widget class="QPushButton" name="dynamicButton">
+       <property name="text">
+        <string>Dynamic</string>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </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="QPushButton" name="playlistsButton">
+       <property name="text">
+        <string>Playlists</string>
+       </property>
+       <property name="flat">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QPushButton" name="backButton">
+         <property name="text">
+          <string>Back</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <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="QPushButton" name="addButton">
+         <property name="text">
+          <string>Add</string>
+         </property>
+         <property name="flat">
+          <bool>true</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>
+       <item>
+        <widget class="QPushButton" name="playerButton">
+         <property name="text">
+          <string>Player</string>
+         </property>
+         <property name="flat">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QLabel" name="listLabel">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+         <property name="textFormat">
+          <enum>Qt::AutoText</enum>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignCenter</set>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QListView" name="listView">
+         <property name="editTriggers">
+          <set>QAbstractItemView::NoEditTriggers</set>
+         </property>
+         <property name="selectionMode">
+          <enum>QAbstractItemView::MultiSelection</enum>
+         </property>
+         <property name="isWrapping" stdset="0">
+          <bool>false</bool>
+         </property>
+         <property name="spacing">
+          <number>1</number>
+         </property>
+         <property name="selectionRectVisible">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
    </item>
   </layout>
  </widget>
    </item>
   </layout>
  </widget>
index 6311270..8a8acba 100644 (file)
@@ -15,9 +15,9 @@
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
-    <widget class="QPushButton" name="pushButton">
+    <widget class="QPushButton" name="libraryButton">
      <property name="text">
      <property name="text">
-      <string>ПЫЩ!!</string>
+      <string>Library</string>
      </property>
     </widget>
    </item>
      </property>
     </widget>
    </item>