Bug 139292 - [PATCH] Select files to put in the playlist according to their duration
Summary: [PATCH] Select files to put in the playlist according to their duration
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.4-SVN
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
Depends on:
Reported: 2006-12-27 23:24 UTC by Giovanni Venturi
Modified: 2007-01-06 16:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:

amarok-collection-filter-editing.patch (31.62 KB, text/x-diff)
2007-01-06 13:46 UTC, Giovanni Venturi

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Venturi 2006-12-27 23:24:10 UTC
Version:           1.4-SVN (using KDE 3.5.5, compiled sources)
Compiler:          gcc version 3.4.6
OS:                Linux (i686) release

Sometimes I need to look for music title according their duration. It could be fine to select files to put in the playlist according their duration
Comment 1 Martin Aumueller 2006-12-27 23:45:28 UTC
You can search for them: just enter length:>300 to find all songs longer than 5 minutes. Or create a smart playlist using this criterion.
Comment 2 Giovanni Venturi 2006-12-27 23:51:13 UTC
Ok. So what do yo think to add a tooltip that points you on this feature? If 
you want I can add it and than commit it to the trunk if needed.

Comment 3 Martin Aumueller 2006-12-27 23:55:49 UTC
Where should this tooltip be added?

Some time ago it was suggested to place an icon depicting a filter right to the filter line edit, which would help building filters. If you could do something like this, that would be great!
Comment 4 richlv 2006-12-28 10:02:49 UTC
shameless plug ;) - in case you decide to work on this, maybe information at http://amarok.kde.org/wiki/Keyword_Filtering helps a bit.
Comment 5 Giovanni Venturi 2006-12-28 13:54:27 UTC
Thanks. It seems simple, like a Junior Job. I can try it :) Thanks.

Comment 6 Giovanni Venturi 2006-12-30 17:28:50 UTC
I'm working on this issue. When I finished I have to send a patch right? And 
if you like it I can commit it directly. Do I have I to send the patch here?
Comment 7 Martin Aumueller 2006-12-31 02:10:15 UTC
I'm happy to hear that you are working on this task! And yes, posting the patch here is probably the best to do.
Comment 8 Giovanni Venturi 2007-01-06 13:46:46 UTC
Here there is my work on this bug. I think to fix some other part of the code 
because I think more tests is needed, I need to add ToolTips and WhatsThis... 
but what do you think? Could be ok? Suggestions?

Created an attachment (id=19123)
Comment 9 Mark Kretschmann 2007-01-06 14:02:31 UTC
Reopening, because of patch
Comment 10 Martin Aumueller 2007-01-06 16:28:19 UTC
This patch seems to improve the discoverability of Amarok's advanced search features quite a lot. Please commit, so that we can work out the remaining bits!
Comment 11 Giovanni Venturi 2007-01-06 16:53:39 UTC
SVN commit 620553 by gianni:

With this commit I made visible an interesting function in Amarok
that was implemented but quite "hidden". Now you can filter
the collection titles with a dialog that help you choosing
the wanted parameters for the filter, for example now look for
a title in your collection that has length of 3 minutes is quite simple.

 M  +2 -1      Makefile.am  
 M  +13 -0     collectionbrowser.cpp  
 M  +1 -0      collectionbrowser.h  
 A             editcollectionfilterdialog.cpp   [License: no copyright]
 A             editcollectionfilterdialog.h   [License: no copyright]
 M  +1 -0      main.cpp  

--- trunk/extragear/multimedia/amarok/src/Makefile.am #620552:620553
@@ -146,7 +146,8 @@
     tracktooltip.cpp \
     transferdialog.cpp \
     xmlloader.cpp \
-    xspfplaylist.cpp
+    xspfplaylist.cpp \
+    editcollectionfilterdialog.cpp
 libamarok_la_LIBADD = \
     $(top_builddir)/amarok/src/amarokcore/libamarokcore.la \
--- trunk/extragear/multimedia/amarok/src/collectionbrowser.cpp #620552:620553
@@ -29,6 +29,7 @@
 #include "tagdialog.h"
 #include "threadweaver.h"
 #include "qstringx.h"
+#include "editcollectionfilterdialog.h"
 #include <taglib/tfile.h>   //TagLib::File::isWritable
@@ -64,6 +65,7 @@
 #include <ktoolbarbutton.h> //ctor
 #include <kurldrag.h>       //dragObject()
 #include <kio/job.h>
+#include <kpushbutton.h>
 extern "C"
@@ -101,13 +103,16 @@
         button       = new KToolBarButton( "locationbar_erase", 0, searchToolBar );
         m_searchEdit = new ClickLineEdit( i18n( "Enter search terms here" ), searchToolBar );
         m_searchEdit->installEventFilter( this );
+        KPushButton *filterButton = new KPushButton("...", searchToolBar, "filter");
         searchToolBar->setStretchableWidget( m_searchEdit );
         m_searchEdit->setFrame( QFrame::Sunken );
         connect( button, SIGNAL( clicked() ), SLOT( slotClearFilter() ) );
+        connect( filterButton, SIGNAL( clicked() ), SLOT( slotEditFilter() ) );
         QToolTip::add( button, i18n( "Clear search field" ) );
         QToolTip::add( m_searchEdit, i18n( "Enter space-separated terms to search in the collection" ) );
+        QToolTip::add( filterButton, i18n( "Click here to setup the collection filter" ) );
     } //</Search LineEdit>
@@ -277,6 +282,14 @@
+CollectionBrowser::slotEditFilter() //SLOT
+    EditCollectionFilterDialog *cod = new EditCollectionFilterDialog( this, m_searchEdit->text() );
+    if (cod->exec())
+      m_searchEdit->setText(cod->filter());
 CollectionBrowser::setupDirs()  //SLOT
--- trunk/extragear/multimedia/amarok/src/collectionbrowser.h #620552:620553
@@ -75,6 +75,7 @@
         void slotClearFilter();
         void slotSetFilterTimeout();
         void slotSetFilter();
+        void slotEditFilter();
         void layoutToolbar();
--- trunk/extragear/multimedia/amarok/src/main.cpp #620552:620553
@@ -72,6 +72,7 @@
     aboutData.addCredit( "Derek Nelson", I18N_NOOP( "graphics, splash-screen" ), "admrla@gmail.com" );
     aboutData.addCredit( "Enrico Ros", I18N_NOOP( "Analyzers, Context Browser and systray eye-candy" ), "eros.kde@email.it" );
     aboutData.addCredit( "Gérard Dürrmeyer", I18N_NOOP( "icons and image work" ), "gerard@randomtree.com" );
+    aboutData.addCredit( "Giovanni Venturi", I18N_NOOP( "dialog to filter the collection titles" ), "giovanni@ksniffer.org" );
     aboutData.addCredit( "Greg Meyer", I18N_NOOP( "Live CD, Bug squashing (oggb4mp3)" ), "greg@gkmweb.com" );
     aboutData.addCredit( "Harald Sitter", I18N_NOOP( "handbook enhancements, translations, bug fixes, screenshots, roKymoter (apachelogger)" ), "harald.sitter@kdemail.net" );
     aboutData.addCredit( "Jarkko Lehti", I18N_NOOP( "Tester, IRC channel operator, whipping" ), "grue@iki.fi" );