[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [babe] /: preview feature for collection views and toolbar icon size fixes
From:       Camilo Higuita <null () kde ! org>
Date:       2017-05-31 19:28:25
Message-ID: E1dG9I9-0006DR-9Z () code ! kde ! org
[Download RAW message or body]

Git commit 69fedbf0dadd8aa776258984ec93ea6304d474bd by Camilo Higuita.
Committed on 31/05/2017 at 19:28.
Pushed by camiloh into branch 'master'.

preview feature for collection views and toolbar icon size fixes

M  +1    -1    Babe.pro.user
M  +54   -2    babetable.cpp
M  +11   -2    babetable.h
M  +1    -0    data.qrc
M  +2    -2    data/icons/.directory
A  +65   -0    data/media-playback-stop.svg
M  +124  -75   mainwindow.cpp
M  +15   -13   mainwindow.h
M  +57   -2    mainwindow.ui
M  +1    -1    settings.cpp
M  +2    -7    settings.ui

https://commits.kde.org/babe/69fedbf0dadd8aa776258984ec93ea6304d474bd

diff --git a/Babe.pro.user b/Babe.pro.user
index f204226..baa4bce 100755
--- a/Babe.pro.user
+++ b/Babe.pro.user
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.2.2, 2017-05-24T13:57:46. -->
+<!-- Written by QtCreator 4.3.0, 2017-05-31T13:12:02. -->
 <qtcreator>
  <data>
   <variable>EnvironmentId</variable>
diff --git a/babetable.cpp b/babetable.cpp
index 24bf01f..82cb94b 100644
--- a/babetable.cpp
+++ b/babetable.cpp
@@ -22,7 +22,10 @@
 BabeTable::BabeTable(QWidget *parent) : QTableWidget(parent) {
 
 
+    preview = new QMediaPlayer(this);
+
     connect(this,&QTableWidget::doubleClicked, this, \
&BabeTable::on_tableWidget_doubleClicked); +    \
                connect(this,&QTableWidget::itemSelectionChanged,[this](){this->stopPreview();});
                
     //    connect(this->selectionModel(),&QItemSelectionModel::selectionChanged,[this](){ \
this->setSelectionMode(QAbstractItemView::SingleSelection);  //qDebug()<<"a row got \
                selected;";});
     //connect(this, SIGNAL(customContextMenuRequested(const \
QPoint&)),SLOT(setUpContextMenu(const QPoint&))); @@ -370,9 +373,20 @@ void \
BabeTable::populatePlaylist(const QStringList &urls, const QString &playlis  
 void BabeTable::passPlaylists() {}
 
-void BabeTable::enterEvent(QEvent *event) { Q_UNUSED(event); }
+void BabeTable::enterEvent(QEvent *event)
+{
+
+   QTableWidget::enterEvent(event);
+
+}
+
+void BabeTable::leaveEvent(QEvent *event)
+{
 
-void BabeTable::leaveEvent(QEvent *event) { Q_UNUSED(event); }
+    this->stopPreview();
+    QTableWidget::leaveEvent(event);
+
+}
 
 void BabeTable::passStyle(QString style) { this->setStyleSheet(style); }
 
@@ -800,6 +814,20 @@ void BabeTable::keyPressEvent(QKeyEvent *event) {
                 << this->model()->data(this->model()->index(row, \
LOCATION)).toString();  break;
     }
+    case Qt::Key_Space:
+    {
+        if(rowPreview)
+        {
+            if(preview->state()==QMediaPlayer::PlayingState) this->stopPreview();
+            else
+            {
+                previewRow= this->getIndex();
+                this->startPreview(this->getRowData(previewRow)[LOCATION]);
+            }
+        }
+
+        break;
+    }
 
     default: {
         QTableWidget::keyPressEvent(event);
@@ -826,6 +854,30 @@ void BabeTable::mousePressEvent(QMouseEvent *evt)
 
 }
 
+void BabeTable::enablePreview(const bool state)
+{
+    this->rowPreview=state;
+}
+
+void BabeTable::startPreview(const QString &url)
+{
+    preview->setMedia(QUrl::fromLocalFile(url));
+    preview->play();
+    this->item(this->getIndex(),BabeTable::TITLE)->setIcon(QIcon::fromTheme("quickview"));
 +    emit previewStarted();
+}
+
+void BabeTable::stopPreview()
+{
+    if(preview->state()==QMediaPlayer::PlayingState)
+    {
+        preview->stop();
+        this->item(this->previewRow,BabeTable::TITLE)->setIcon(QIcon::fromTheme(""));
 +        emit previewFinished();
+    }
+}
+
+
 void BabeTable::rateGroup(int id)
 {
     qDebug() << "rated with: " << id;
diff --git a/babetable.h b/babetable.h
index 2b5b9df..93ec280 100644
--- a/babetable.h
+++ b/babetable.h
@@ -24,7 +24,8 @@
 #include <QTimer>
 #include <QGraphicsEffect>
 #include <QGraphicsOpacityEffect>
-#include<QItemSelectionModel>
+#include <QItemSelectionModel>
+#include <QtMultimedia/QMediaPlayer>
 
 #include "settings.h"
 #include "notify.h"
@@ -60,7 +61,7 @@ public:
     };
 
 
-//    const QMap<int, QString> columnsNames{{TRACK, "track"}, {TITLE, "title"}, \
{ARTIST, "artist"},{ALBUM,"album"},{GENRE,"genre"},{LOCATION,"location"},{STARS,"stars"},{BABE,"babe"},{ART,"art"},{PLAYED,"played"},{PLAYLIST,"playlist"}};
 +    //    const QMap<int, QString> columnsNames{{TRACK, "track"}, {TITLE, "title"}, \
{ARTIST, "artist"},{ALBUM,"album"},{GENRE,"genre"},{LOCATION,"location"},{STARS,"stars"},{BABE,"babe"},{ART,"art"},{PLAYED,"played"},{PLAYLIST,"playlist"}};
  QStringList playlistsMenus;
     QStringList colors = BaeUtils::MoodColors;
     void populateTableView(const QList<QMap<int,QString>> &mapList, const bool \
&descriptiveTitle); @@ -76,6 +77,9 @@ public:
     void populatePlaylist(const QStringList &urls, const QString &playlist);
     void setAddMusicMsg(const QString &msg, const QString &icon);
     int getIndex();
+    void enablePreview(const bool state);
+    void startPreview(const QString &url);
+    void stopPreview();
     QString getStars(const int &value);
     void removeRepeated();
     QList<int> getSelectedRows(const bool &onRightClick=true);
@@ -124,6 +128,8 @@ private:
 
     CollectionDB connection;
 
+    QMediaPlayer *preview;
+    int previewRow=-1;
     Notify nof;
     QToolButton *fav1;
     QToolButton *fav2;
@@ -135,6 +141,7 @@ private:
     int rColumn=0;
     bool rowColoring=false;
     bool rowDragging=false;
+    bool rowPreview=true;
     QMenu *contextMenu;
     QMenu* playlistsMenu;
     QMenu* sendToMenu;
@@ -165,6 +172,8 @@ signals:
     void infoIt_clicked(QString title, QString artist, QString album);
     void finishedPopulatingPlaylist(QString playlist);
     void indexesMoved(int track,int newRow);
+    void previewStarted();
+    void previewFinished();
 
 };
 
diff --git a/data.qrc b/data.qrc
index 9989638..8862ef7 100644
--- a/data.qrc
+++ b/data.qrc
@@ -44,5 +44,6 @@
         <file>data/icons/youtube.svg</file>
         <file>data/pattern.png</file>
         <file>data/LilyScriptOne-Regular.ttf</file>
+        <file>data/media-playback-stop.svg</file>
     </qresource>
 </RCC>
diff --git a/data/icons/.directory b/data/icons/.directory
index 8217790..32fa830 100644
--- a/data/icons/.directory
+++ b/data/icons/.directory
@@ -1,4 +1,4 @@
 [Dolphin]
 PreviewsShown=true
-Timestamp=2017,3,1,15,43,50
-Version=3
+Timestamp=2017,5,31,12,35,54
+Version=4
diff --git a/data/media-playback-stop.svg b/data/media-playback-stop.svg
new file mode 100644
index 0000000..75b65ef
--- /dev/null
+++ b/data/media-playback-stop.svg
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   viewBox="0 0 48 48"
+   version="1.1"
+   id="svg6"
+   sodipodi:docname="media-playback-stop.svg"
+   width="48"
+   height="48"
+   inkscape:version="0.92.1 r">
+  <metadata
+     id="metadata10">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1366"
+     inkscape:window-height="692"
+     id="namedview8"
+     showgrid="false"
+     inkscape:zoom="5.2149125"
+     inkscape:cx="-0.13559322"
+     inkscape:cy="8"
+     inkscape:window-x="0"
+     inkscape:window-y="26"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg6" />
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#4d4d4d;
+      }
+      </style>
+  </defs>
+  <path
+     style="color:#4d4d4d;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3"
+     d="M 6,6 V 42 H 42 V 6 Z M 9,9 H 39 V 39 H 9 Z m 6,6 V 33 H 33 V 15 Z"
+     class="ColorScheme-Text"
+     id="path4"
+     inkscape:connector-curvature="0" />
+</svg>
diff --git a/mainwindow.cpp b/mainwindow.cpp
index d2253f2..5159c08 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -27,31 +27,20 @@ MainWindow::MainWindow(const QStringList &files, QWidget *parent) \
:  {
     ui->setupUi(this);
 
-
     this->setWindowTitle(" Babe ... \xe2\x99\xa1  \xe2\x99\xa1 \xe2\x99\xa1 ");
     this->setWindowIcon(QIcon(":Data/data/babe_48.svg"));
     this->setWindowIconText("Babe...");
     this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+    this->defaultWindowFlags = this->windowFlags();
 
 
     album_art = new Album(":Data/data/babe.png",BaeUtils::BIG_ALBUM,0,false);
     ALBUM_SIZE = album_art->getSize();
 
-
     ui->controls->installEventFilter(this);
 
-
-    //    auto blurWidget = new QWidget(album_art);
-    //   blurWidget->setGeometry(0,ALBUM_SIZE-static_cast<int>(ALBUM_SIZE*0.25),ALBUM_SIZE,static_cast<int>(ALBUM_SIZE*0.25));
                
-
-    //    QGraphicsBlurEffect* effect	= new QGraphicsBlurEffect();
-    //    effect->setBlurRadius(5);
-    //   blurWidget->setGraphicsEffect(effect);
-
-
     this->setMinimumSize(ALBUM_SIZE*3,0);
 
-
     this->defaultGeometry = (QStyle::alignedRect(
                                  Qt::LeftToRight,
                                  Qt::AlignCenter,
@@ -63,7 +52,6 @@ MainWindow::MainWindow(const QStringList &files, QWidget *parent) :
     this->saveSettings("GEOMETRY",this->geometry(),"MAINWINDOW");
 
     player = new QMediaPlayer();
-    defaultWindowFlags = this->windowFlags();
     //mpris = new Mpris(this);
 
     connect(this, &MainWindow::finishedPlayingSong, this, &MainWindow::addToPlayed);
@@ -181,6 +169,9 @@ void MainWindow::setUpViews()
     //connect(playlistTable->table,SIGNAL(createPlaylist_clicked()),this,SLOT(playlistsView()));
                
     connect(playlistTable->table,&BabeTable::queueIt_clicked,this,&MainWindow::addToQueue);
                
     connect(playlistTable->table,&BabeTable::infoIt_clicked,this,&MainWindow::infoIt);
 +    connect(playlistTable->table,&BabeTable::previewStarted,this,&MainWindow::pause);
 +    connect(playlistTable->table,&BabeTable::previewFinished,this,&MainWindow::play);
 +
 
     collectionTable = new BabeTable(this);
     //connect(collectionTable, &BabeTable::tableWidget_doubleClicked, this, \
&MainWindow::addToPlaylist); @@ -195,6 +186,8 @@ void MainWindow::setUpViews()
     connect(collectionTable,&BabeTable::babeIt_clicked,this,&MainWindow::babeIt);
     connect(collectionTable,&BabeTable::queueIt_clicked,this,&MainWindow::addToQueue);
                
     connect(collectionTable,&BabeTable::infoIt_clicked,this,&MainWindow::infoIt);
+    connect(collectionTable,&BabeTable::previewStarted,this,&MainWindow::pause);
+    connect(collectionTable,&BabeTable::previewFinished,this,&MainWindow::play);
 
     mainList = new BabeTable(this);
     mainList->hideColumn(BabeTable::ALBUM);
@@ -202,6 +195,7 @@ void MainWindow::setUpViews()
     mainList->horizontalHeader()->setVisible(false);
     mainList->enableRowColoring(true);
     mainList->enableRowDragging(true);
+    mainList->enablePreview(false);
 
     //mainList->setSelectionMode(QAbstractItemView::SingleSelection);
 
@@ -250,6 +244,8 @@ void MainWindow::setUpViews()
     connect(filterList,&BabeTable::queueIt_clicked,this,&MainWindow::addToQueue);
     connect(filterList,&BabeTable::moodIt_clicked,mainList,&BabeTable::colorizeRow);
     connect(filterList,&BabeTable::infoIt_clicked,this,&MainWindow::infoIt);
+    connect(filterList,&BabeTable::previewStarted,this,&MainWindow::pause);
+    connect(filterList,&BabeTable::previewFinished,this,&MainWindow::play);
 
     mainListView = new QStackedWidget(this);
     mainListView->setFrameShape(QFrame::NoFrame);
@@ -268,6 +264,9 @@ void MainWindow::setUpViews()
     connect(resultsTable,&BabeTable::babeIt_clicked,this,&MainWindow::babeIt);
     connect(resultsTable,&BabeTable::queueIt_clicked,this,&MainWindow::addToQueue);
     connect(resultsTable,&BabeTable::infoIt_clicked,this,&MainWindow::infoIt);
+    connect(resultsTable,&BabeTable::previewStarted,this,&MainWindow::pause);
+    connect(resultsTable,&BabeTable::previewFinished,this,&MainWindow::play);
+
 
     rabbitTable = new RabbitView(this);
     connect(rabbitTable,&RabbitView::playAlbum,this,&MainWindow::putAlbumOnPlay);
@@ -275,6 +274,8 @@ void MainWindow::setUpViews()
     connect(rabbitTable->getTable(),&BabeTable::queueIt_clicked,this,&MainWindow::addToQueue);
                
     connect(rabbitTable->getTable(),&BabeTable::babeIt_clicked,this,&MainWindow::babeIt);
                
     connect(rabbitTable->getTable(),&BabeTable::infoIt_clicked,this,&MainWindow::infoIt);
 +    connect(rabbitTable->getTable(),&BabeTable::previewStarted,this,&MainWindow::pause);
 +    connect(rabbitTable->getTable(),&BabeTable::previewFinished,this,&MainWindow::play);
  
     albumsTable = new AlbumsView(false,this);
     connect(albumsTable,&AlbumsView::populateCoversFinished,[this](){qDebug()<<"finished \
populateHeadsFinished";}); @@ -286,7 +287,8 @@ void MainWindow::setUpViews()
     connect(albumsTable,&AlbumsView::playAlbum,this,&MainWindow::putAlbumOnPlay);
     connect(albumsTable,&AlbumsView::babeAlbum_clicked,this,&MainWindow::babeAlbum);
     connect(albumsTable,&AlbumsView::albumDoubleClicked,this,&MainWindow::albumDoubleClicked);
                
-
+    connect(albumsTable->albumTable,&BabeTable::previewStarted,this,&MainWindow::pause);
 +    connect(albumsTable->albumTable,&BabeTable::previewFinished,this,&MainWindow::play);
  
     artistsTable = new AlbumsView(true,this);
     artistsTable->albumTable->showColumn(BabeTable::ALBUM);
@@ -299,6 +301,9 @@ void MainWindow::setUpViews()
     connect(artistsTable,&AlbumsView::playAlbum,this,&MainWindow::putAlbumOnPlay);
     connect(artistsTable,&AlbumsView::babeAlbum_clicked,this,&MainWindow::babeAlbum);
                
     connect(artistsTable,&AlbumsView::albumDoubleClicked,this,&MainWindow::albumDoubleClicked);
 +    connect(artistsTable->albumTable,&BabeTable::previewStarted,this,&MainWindow::pause);
 +    connect(artistsTable->albumTable,&BabeTable::previewFinished,this,&MainWindow::play);
 +
 
     infoTable = new InfoView(this);
     connect(infoTable,&InfoView::playAlbum,this,&MainWindow::putAlbumOnPlay);
@@ -940,21 +945,78 @@ void MainWindow::putPixmap(const QByteArray &array)
 
 void MainWindow::setToolbarIconSize(const int &iconSize) //tofix
 {
-    //    qDebug()<< "Toolbar icons size changed"<<iconSize;
     ui->mainToolBar->setIconSize(QSize(iconSize,iconSize));
-    //playback->setIconSize(QSize(iconSize,iconSize));
-    //utilsBar->setIconSize(QSize(iconSize,iconSize));
-    ui->mainToolBar->update();
-    //this->utilsBar->setIconSize(QSize(iconSize,iconSize));
-    /*for (auto obj : ui->collectionUtils->children())
-    {
-        if(static_cast<QToolButton *>(obj)!=0)
-        {
-            //static_cast<QToolButton \
                *>(obj)->setIconSize(QSize(iconSize,iconSize));
-        }
-    }*/
-    //playback->update();
-    // this->update();
+
+
+
+   for(auto obj: ui->controls->children())
+   {
+       if(qobject_cast<QToolButton *>(obj)!=NULL)
+       {
+           qDebug()<< obj->objectName();
+           qobject_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+
+           //static_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+       }
+
+   }
+
+   for(auto obj: ui->playlistUtils->children())
+   {
+       if(qobject_cast<QToolButton *>(obj)!=NULL)
+       {
+           qDebug()<< obj->objectName();
+           qobject_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+
+           //static_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+       }
+
+   }
+
+   for(auto obj: ui->collectionUtils->children())
+   {
+       if(qobject_cast<QToolButton *>(obj)!=NULL)
+       {
+           qDebug()<< obj->objectName();
+           qobject_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+
+           //static_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+       }
+
+   }
+
+   for(auto obj: infoTable->infoUtils->children())
+   {
+       if(qobject_cast<QToolButton *>(obj)!=NULL)
+       {
+           qDebug()<< obj->objectName();
+           qobject_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+
+           //static_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+       }
+
+   }
+
+   for(auto obj: playlistTable->btnContainer->children())
+   {
+       if(qobject_cast<QToolButton *>(obj)!=NULL)
+       {
+           qDebug()<< obj->objectName();
+           qobject_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+
+           //static_cast<QToolButton *>(obj)->setIconSize(QSize(iconSize,iconSize));
+       }
+
+   }
+
+
+   ui->mainToolBar->update();
+  ui->controls->update();
+   ui->playlistUtils->update();
+    infoTable->infoUtils->update();
+    playlistTable->btnContainer->update();
+   ui->collectionUtils->update();
+
 }
 
 void MainWindow::collectionView()
@@ -1351,10 +1413,8 @@ void MainWindow::feedRabbit()
 
 void MainWindow::loadTrack()
 {
-
     if(stopped) updater->start(100);
 
-
     prev_song = current_song;
     prev_song_pos = current_song_pos;
 
@@ -1363,7 +1423,6 @@ void MainWindow::loadTrack()
 
     calibrateBtn_menu->actions().at(3)->setEnabled(false);
 
-
     current_song_pos = mainList->getIndex();
     current_song = mainList->getRowData(current_song_pos);
 
@@ -1377,15 +1436,10 @@ void MainWindow::loadTrack()
     if(BaeUtils::fileExists(current_song[BabeTable::LOCATION]))
     {
         player->setMedia(QUrl::fromLocalFile(current_song[BabeTable::LOCATION]));
-        player->play();
-        ui->play_btn->setIcon(QIcon(":Data/data/media-playback-pause.svg"));
+        this->play();
 
-        //        timer->stop();
         timer->start(3000);
 
-
-        this->setWindowTitle(current_song[BabeTable::TITLE]+" \xe2\x99\xa1 \
                "+current_song[BabeTable::ARTIST]);
-
         album_art->setTitle(current_song[BabeTable::ARTIST],current_song[BabeTable::ALBUM]);
  
         feedRabbit();
@@ -1526,26 +1580,12 @@ void MainWindow::on_seekBar_sliderMoved(const int &position)
     player->setPosition(player->duration() / 1000 * position);
 }
 
-void MainWindow::stopPlayback()
-{
-    album_art->putDefaultPixmap();
-    current_song.clear();
-    prev_song = current_song;
-    current_song_pos =0;
-    prev_song_pos =current_song_pos;
-    ui->play_btn->setIcon(QIcon(":Data/data/media-playback-start.svg"));
 
-    player->stop();
-    updater->stop();
-
-    this->setWindowTitle("Babe...");
-    stopped = true;
-}
 
 void MainWindow::update()
 {
 
-    if(mainList->rowCount()==0) stopPlayback();
+    if(mainList->rowCount()==0) stop();
 
     if(!current_song.isEmpty())
     {
@@ -1603,18 +1643,6 @@ void MainWindow::removequeuedTracks()
 
 }
 
-int MainWindow::firstQueuedTrack()
-{
-    int result=0;
-    for(auto row=0;row<this->mainList->rowCount();row++)
-        if(mainList->item(row,BabeTable::TITLE)->icon().name()=="clock")
-        {
-            result = row;
-            break;
-        }
-
-    return result;
-}
 
 void MainWindow::next()
 {
@@ -1674,20 +1702,41 @@ void MainWindow::on_play_btn_clicked()
 {
     if(mainList->rowCount() > 0 || !current_song.isEmpty())
     {
-        if(player->state() == QMediaPlayer::PlayingState)
-        {
-            player->pause();
-            ui->play_btn->setIcon(QIcon(":Data/data/media-playback-start.svg"));
-        }
-        else
-        {
-            player->play();
-            //updater->start();
-            ui->play_btn->setIcon(QIcon(":Data/data/media-playback-pause.svg"));
-        }
+        if(player->state() == QMediaPlayer::PlayingState) this->pause();
+        else this->play();
     }
 }
 
+void MainWindow::play()
+{
+    player->play();
+    ui->play_btn->setIcon(QIcon(":Data/data/media-playback-pause.svg"));
+    this->setWindowTitle(current_song[BabeTable::TITLE]+" \xe2\x99\xa1 \
"+current_song[BabeTable::ARTIST]); +
+}
+
+void MainWindow::pause()
+{
+    player->pause();
+    ui->play_btn->setIcon(QIcon(":Data/data/media-playback-start.svg"));
+}
+
+void MainWindow::stop()
+{
+    album_art->putDefaultPixmap();
+    current_song.clear();
+    prev_song = current_song;
+    current_song_pos =0;
+    prev_song_pos =current_song_pos;
+    ui->play_btn->setIcon(QIcon(":Data/data/media-playback-stop.svg"));
+
+    player->stop();
+    updater->stop();
+
+    this->setWindowTitle(" Babe ... \xe2\x99\xa1  \xe2\x99\xa1 \xe2\x99\xa1 ");
+    stopped = true;
+}
+
 void MainWindow::on_backward_btn_clicked()
 {
     if(mainList->rowCount() > 0)
diff --git a/mainwindow.h b/mainwindow.h
index d5b67c7..84acebc 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -90,7 +90,7 @@ public:
     void loadTrack();
     void loadTrackAt(const int &pos);
     bool babeTrack(const QMap<int, QString> &track);
-
+    QList<QMap<int,QString>> searchFor(const QStringList &queries);
 
     QStringList searchKeys = \
{"location:","artist:","album:","title:","genre:","online:","playlist:"};  
@@ -108,7 +108,17 @@ public slots:
     void addToPlaylist(const QList<QMap<int,QString>> &mapList, const bool \
&notRepeated=false, const appendPos &pos = APPENDBOTTOM);  void putPixmap(const \
QByteArray &array);  void populateResultsTable(const QList<QMap<int,QString>> \
                &mapList);
-    QList<QMap<int,QString>> searchFor(const QStringList &queries);
+    void addToQueue(const QList<QMap<int, QString> > &tracks);
+
+    void pause();
+    void play();
+    void stop();
+    void next();
+    void back();
+
+    void expand();
+    void go_mini();
+    void go_playlistMode();
     void dummy();
 
 private slots:
@@ -165,7 +175,6 @@ private slots:
     void loadMood();
     bool removeQueuedTrack(const QMap<int, QString> &track, const int &pos);
     void removequeuedTracks();
-    void addToQueue(const QList<QMap<int, QString> > &tracks);
     void on_filterBtn_clicked();
     void on_filter_textChanged(const QString &arg1);
     void infoIt(const QString &title, const QString &artist, const QString &album);
@@ -228,22 +237,17 @@ private:
     void setUpPlaylist();
     void setUpRightFrame();
 
-    void next();
-    void back();
     int shuffleNumber();
-    void expand();
-    void go_mini();
-    void go_playlistMode();
-    void stopPlayback();
-    int firstQueuedTrack();
 
     void clearMainList();
+    void clearCurrentList();
     void calibrateMainList();
+
     void updateList();
     void populateMainList();
-    void clearCurrentList();
     bool isBabed(const QMap<int, QString> &track);
     void feedRabbit();
+
     void saveSettings(const QString &key, const QVariant &value,const QString \
                &group);
     QVariant loadSettings(const QString &key, const QString &group, const QVariant \
&defaultValue = QVariant());  
@@ -273,8 +277,6 @@ private:
     bool shuffle = false;
     bool stopped = false;
 
-
-
 signals:
     void finishedPlayingSong(QString url);
     void collectionChecked();
diff --git a/mainwindow.ui b/mainwindow.ui
index 9db177b..0eb8602 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -37,6 +37,14 @@
   </property>
   <widget class="QWidget" name="centralWidget">
    <widget class="QToolButton" name="playlists_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>10</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -76,6 +84,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="artists_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>240</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -115,6 +131,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="rabbit_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>200</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -157,6 +181,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="settings_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>160</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -199,6 +231,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="albums_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>120</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -241,6 +281,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="tracks_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>90</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -280,6 +328,14 @@
     </property>
    </widget>
    <widget class="QToolButton" name="info_view">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>50</y>
+      <width>34</width>
+      <height>34</height>
+     </rect>
+    </property>
     <property name="sizePolicy">
      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
       <horstretch>0</horstretch>
@@ -447,8 +503,7 @@
         <string>...</string>
        </property>
        <property name="icon">
-        <iconset theme="media-playback-start-symbolic">
-         <normaloff>.</normaloff>.</iconset>
+        <iconset theme="media-playback-start"/>
        </property>
        <property name="autoRaise">
         <bool>true</bool>
diff --git a/settings.cpp b/settings.cpp
index 584248c..43f7c59 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -399,7 +399,7 @@ void settings::setToolbarIconSize(const int &iconSize)
     case 22:
         ui->toolbarIconSize->setCurrentIndex(1);
         break;
-    case 24:
+    case 32:
         ui->toolbarIconSize->setCurrentIndex(2);
         break;
     default:
diff --git a/settings.ui b/settings.ui
index cd281e9..9c30063 100644
--- a/settings.ui
+++ b/settings.ui
@@ -440,7 +440,7 @@
       <item row="11" column="1" colspan="3">
        <widget class="QComboBox" name="toolbarIconSize">
         <property name="currentText">
-         <string>22</string>
+         <string>16</string>
         </property>
         <item>
          <property name="text">
@@ -454,12 +454,7 @@
         </item>
         <item>
          <property name="text">
-          <string>24</string>
-         </property>
-        </item>
-        <item>
-         <property name="text">
-          <string>48</string>
+          <string>32</string>
          </property>
         </item>
        </widget>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic