[vlc-commits] Qt: provide a button to open subtitle
Jean-Baptiste Kempf
git at videolan.org
Sun May 22 23:58:38 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun May 22 23:57:17 2011 +0200| [10f1025e051b22043dc719a88ea102d0b4fb741b] | committer: Jean-Baptiste Kempf
Qt: provide a button to open subtitle
Useful for people with accessibility difficulties. No icon yet.
Close #2253
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10f1025e051b22043dc719a88ea102d0b4fb741b
---
modules/gui/qt4/actions_manager.cpp | 2 ++
modules/gui/qt4/actions_manager.hpp | 1 +
modules/gui/qt4/components/controller.cpp | 4 ++++
modules/gui/qt4/components/controller.hpp | 9 ++++++---
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index cc4e535..7773ea4 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -91,6 +91,8 @@ void ActionsManager::doAction( int id_action )
THEMIM->toggleRandom(); break;
case INFO_ACTION:
THEDP->mediaInfoDialog(); break;
+ case OPEN_SUB_ACTION:
+ THEDP->loadSubtitlesFile(); break;
default:
msg_Dbg( p_intf, "Action: %i", id_action );
break;
diff --git a/modules/gui/qt4/actions_manager.hpp b/modules/gui/qt4/actions_manager.hpp
index 866be09..d73c811 100644
--- a/modules/gui/qt4/actions_manager.hpp
+++ b/modules/gui/qt4/actions_manager.hpp
@@ -54,6 +54,7 @@ typedef enum actionType_e
RANDOM_ACTION,
LOOP_ACTION,
INFO_ACTION,
+ OPEN_SUB_ACTION,
} actionType_e;
class ActionsManager : public QObject
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index ea8a89a..0696bf7 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -249,6 +249,10 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
NORMAL_BUTTON( OPEN );
}
break;
+ case OPEN_SUB_BUTTON:{
+ NORMAL_BUTTON( OPEN_SUB );
+ }
+ break;
case PREVIOUS_BUTTON:{
NORMAL_BUTTON( PREVIOUS );
}
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index bd051c4..9c4f932 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -86,6 +86,7 @@ typedef enum buttonType_e
INFO_BUTTON,
PREVIOUS_BUTTON,
NEXT_BUTTON,
+ OPEN_SUB_BUTTON,
BUTTON_MAX,
SPLITTER = 0x20,
@@ -110,7 +111,8 @@ static const char* const nameL[BUTTON_MAX] = { N_("Play"), N_("Stop"), N_("Open"
N_("De-Fullscreen"), N_("Extended panel"), N_("Playlist"), N_("Snapshot"),
N_("Record"), N_("A->B Loop"), N_("Frame By Frame"), N_("Trickplay Reverse"),
N_("Step backward" ), N_("Step forward"), N_("Quit"), N_("Random"),
- N_("Loop/Repeat mode"), N_("Information"), N_("Previous"), N_("Next") };
+ N_("Loop/Repeat mode"), N_("Information"), N_("Previous"), N_("Next"),
+ N_("Open subtitles file")};
static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_("Stop playback"), N_("Open a medium"),
N_("Previous media in the playlist, skip backward when keep-pressed"),
@@ -121,7 +123,8 @@ static const char* const tooltipL[BUTTON_MAX] = { I_PLAY_TOOLTIP,
N_( "Loop from point A to point B continuously." ), N_("Frame by frame"),
N_("Reverse"), N_("Step backward"), N_("Step forward"), N_("Quit"),
N_("Random"), N_("Change the loop and repeat modes"), N_("Information"),
- N_("Previous media in the playlist"), N_("Next media in the playlist")};
+ N_("Previous media in the playlist"), N_("Next media in the playlist"),
+ N_("Open subtitles file")};
static const QString iconL[BUTTON_MAX] ={ ":/toolbar/play_b", ":/toolbar/stop_b",
":/toolbar/eject", ":/toolbar/previous_b", ":/toolbar/next_b",
":/toolbar/slower", ":/toolbar/faster", ":/toolbar/fullscreen",
@@ -130,7 +133,7 @@ static const QString iconL[BUTTON_MAX] ={ ":/toolbar/play_b", ":/toolbar/stop_b"
":/toolbar/frame", ":/toolbar/reverse", ":/toolbar/skip_back",
":/toolbar/skip_fw", ":/toolbar/clear", ":/buttons/playlist/shuffle_on",
":/buttons/playlist/repeat_all", ":/menu/info",
- ":/toolbar/previous_b", ":/toolbar/next_b", };
+ ":/toolbar/previous_b", ":/toolbar/next_b", "" };
enum
{
More information about the vlc-commits
mailing list