]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Qt: try to make the advanced open dialog more usable for files (who the H... uses...
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 8c338f37651d0ac4a5b8e10321c914c5cd11d161..7d101a7745326eedffd078f621cf12959e91bcb3 100644 (file)
@@ -135,6 +135,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     /* Connects  */
     BUTTONACT( ui.fileBrowseButton, browseFile() );
+    BUTTONACT( ui.delFileButton, deleteFile() );
     BUTTONACT( ui.subBrowseButton, browseFileSub() );
     CONNECT( ui.subCheckBox, toggled( bool ), this, toggleSubtitleFrame( bool ) );
 
@@ -161,6 +162,18 @@ void FileOpenPanel::browseFile()
     updateMRL();
 }
 
+void FileOpenPanel::deleteFile()
+{
+    int i = ui.fileListWidg->currentRow();
+    if( i != -1 )
+    {
+        QListWidgetItem *temp = ui.fileListWidg->takeItem( i );
+        delete temp;
+    }
+
+    updateMRL();
+}
+
 /* Show a fileBrowser to select a subtitle */
 void FileOpenPanel::browseFileSub()
 {