* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
+ * Jean-Baptiste Kempf <jb@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*****************************************************************************/
#include <QApplication>
+#include <QLocale>
+#include <QTranslator>
#include "qt4.hpp"
+#include <vlc_os_specific.h>
#include "dialogs_provider.hpp"
#include "input_manager.hpp"
#include "main_interface.hpp"
#define TITLE_LONGTEXT N_("Show the name of the song or video in the " \
"controler window title")
-#define FILEDIALOG_PATH_TEXT N_("Path to use in file dialog")
+#define FILEDIALOG_PATH_TEXT N_("Path to use in openfile dialog")
#define NOTIFICATION_TEXT N_("Show notification popup on track change")
#define NOTIFICATION_LONGTEXT N_( \
#define ERROR_TEXT N_("Show unimportant error and warnings dialogs" )
#define MINIMAL_TEXT N_("Start in minimal view (menus hidden)." )
+#define UPDATER_TEXT N_("Activate the new updates notification")
+#define UPDATER_LONGTEXT N_("Activate the automatic notification of new " \
+ "versions of the software. It runs once a week." )
+
+#define COMPLETEVOL_TEXT N_("Allow the volume to be set to 400%" )
+#define COMPLETEVOL_LONGTEXT N_("Allow the volume to have range from 0% to " \
+ "400%, instead of 0% to 200%. This option " \
+ "can distort the audio, since it uses " \
+ "software amplification.")
+
vlc_module_begin();
set_shortname( (char *)"Qt" );
set_description( (char*)_("Qt interface") );
add_bool( "qt-minimal-view", VLC_FALSE, NULL, MINIMAL_TEXT,
MINIMAL_TEXT, VLC_TRUE );
+ add_bool( "qt-volume-complete", VLC_FALSE, NULL, COMPLETEVOL_TEXT,
+ COMPLETEVOL_LONGTEXT, VLC_TRUE);
add_bool( "qt-name-in-title", VLC_TRUE, NULL, TITLE_TEXT,
TITLE_LONGTEXT, VLC_FALSE );
add_string( "qt-filedialog-path", NULL, NULL, FILEDIALOG_PATH_TEXT,
ADVANCED_PREFS_LONGTEXT, VLC_FALSE );
add_bool( "qt-error-dialogs", VLC_TRUE, NULL, ERROR_TEXT,
ERROR_TEXT, VLC_FALSE );
+ add_bool( "qt-updates-notif", VLC_TRUE, NULL, UPDATER_TEXT,
+ UPDATER_LONGTEXT, VLC_FALSE );
add_integer( "qt-pl-showflags",
VLC_META_ENGINE_ARTIST|VLC_META_ENGINE_TITLE|
set_callbacks( OpenDialogs, Close );
vlc_module_end();
-
/*****************************************************************************
* Module callbacks
*****************************************************************************/
else
/*if( p_intf->pf_show_dialog )*/
vlc_thread_ready( p_intf );
+ // Translation - get locale
+ QLocale ql = QLocale::system ();
+ // Translations for qt's own dialogs
+ QTranslator qtTranslator( 0 );
+ // Let's find the right path for the translation file
+#if !defined( WIN32 )
+ QString path = QString(QT4LOCALEDIR);
+#else
+ QString path = QString( QString(system_VLCPath()) + DIR_SEP +
+ "locale" + DIR_SEP );
+#endif
+ // files depending on locale
+ bool b_loaded = qtTranslator.load( path + "qt_" + ql.name());
+ if (!b_loaded)
+ msg_Dbg(p_intf, "Error while initializing qt-specific localization");
+ app->installTranslator(&qtTranslator);
/* Start playing if needed */
if( !p_intf->pf_show_dialog && p_intf->b_play )
MainInputManager::killInstance();
DialogsProvider::killInstance();
delete p_intf->p_sys->p_mi;
+ delete app;
}
/*****************************************************************************