From e123fc1efeb9cc200667a4218112539a46012fc8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sun, 22 Mar 2009 21:51:31 +0100 Subject: [PATCH] Qt: try to make the advanced open dialog more usable for files (who the H... uses files nowadays ;) ) --- modules/gui/qt4/components/open_panels.cpp | 13 ++ modules/gui/qt4/components/open_panels.hpp | 1 + modules/gui/qt4/ui/open_file.ui | 199 +++++++++++---------- 3 files changed, 117 insertions(+), 96 deletions(-) diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp index 8c338f3765..7d101a7745 100644 --- a/modules/gui/qt4/components/open_panels.cpp +++ b/modules/gui/qt4/components/open_panels.cpp @@ -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() { diff --git a/modules/gui/qt4/components/open_panels.hpp b/modules/gui/qt4/components/open_panels.hpp index fdeeb2adb2..34a8c018ab 100644 --- a/modules/gui/qt4/components/open_panels.hpp +++ b/modules/gui/qt4/components/open_panels.hpp @@ -110,6 +110,7 @@ public slots: private slots: void browseFileSub(); void browseFile(); + void deleteFile(); void toggleSubtitleFrame( bool ); }; diff --git a/modules/gui/qt4/ui/open_file.ui b/modules/gui/qt4/ui/open_file.ui index 769e980fd0..43382c0a11 100644 --- a/modules/gui/qt4/ui/open_file.ui +++ b/modules/gui/qt4/ui/open_file.ui @@ -1,112 +1,118 @@ - + + Jean-Baptiste Kempf OpenFile - - + + 0 0 - 571 - 271 + 566 + 344 - - + + 0 0 - - _("Open File") + + _("Open File") - - - - - _("Choose one or more media file to open") + + + + + _("Choose one or more media file to open") - - _("Select one or more files") + + _("File Selection") - - - - + + + + + _("You can select local files with the following list and buttons.") + + + + + + 16777215 100 - + Qt::DefaultContextMenu - + Qt::ScrollBarAsNeeded - + Qt::ScrollBarAlwaysOff - + QAbstractItemView::AllEditTriggers - + true - - QAbstractItemView::NoSelection - - - QAbstractItemView::SelectItems - - - - - - 100 - 0 - + + + + _("Add...") - - _("Select the subtitles file") + + + + + + + 0 + 0 + - - _("Browse...") + + _("Delete") - - - - _("Add a subtitles file") + + + + _("Add a subtitles file") - - _("Use a sub&titles file") + + _("Use a sub&titles file") - - - - + + + + 0 0 - + QFrame::StyledPanel - - + + - + Qt::Horizontal - + 16 20 @@ -114,12 +120,12 @@ - + - + Qt::Horizontal - + 30 26 @@ -127,12 +133,12 @@ - + - + Qt::Horizontal - + 16 20 @@ -140,25 +146,25 @@ - - - - + + + + 0 0 - - _("Size:") + + _("Size:") - + sizeSubComboBox - - - + + + 100 0 @@ -166,25 +172,25 @@ - - - - + + + + 0 0 - - _("Alignment:") + + _("Alignment:") - + alignSubComboBox - - - + + + 100 0 @@ -192,37 +198,37 @@ - - + + - - - + + + 100 0 - - _("Select the subtitles file") + + _("Select the subtitles file") - - _("Browse...") + + _("Browse...") - + - + Qt::Vertical - + QSizePolicy::MinimumExpanding - + 273 16 @@ -235,6 +241,7 @@ fileListWidg fileBrowseButton + delFileButton subCheckBox subInput subBrowseButton -- 2.39.2