Commit 3471d454 authored by Christophe Courtaut's avatar Christophe Courtaut

Beginning of preferences ui for languages

parent eaac4b87
#include "Preferences.h"
#include "ui_Preferences.h"
Preferences::Preferences(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::Preferences)
{
m_ui->setupUi(this);
m_ui->comboBoxLanguage->addItem(tr( "English" ), "");
m_ui->comboBoxLanguage->addItem(tr( "French" ), "fr");
m_ui->comboBoxLanguage->addItem(tr( "Spanish" ), "es");
}
Preferences::~Preferences()
{
delete m_ui;
}
void Preferences::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
void Preferences::on_pushButtonCancel_clicked()
{
this->close();
}
void Preferences::on_pushButtonApply_clicked()
{
QTranslator translator;
qDebug() << QApplication::applicationDirPath() + "/../" << "vlmc_" + (this->m_ui->comboBoxLanguage->itemData(this->m_ui->comboBoxLanguage->currentIndex())).toString();
qDebug() << translator.load("vlmc_" + (this->m_ui->comboBoxLanguage->itemData(this->m_ui->comboBoxLanguage->currentIndex())).toString(), QApplication::applicationDirPath() + "/../");
QApplication::installTranslator(&translator);
this->close();
}
#ifndef PREFERENCES_H
#define PREFERENCES_H
#include <QtGui/QWidget>
#include <QTranslator>
#include <QtDebug>
namespace Ui {
class Preferences;
}
class Preferences : public QWidget {
Q_OBJECT
Q_DISABLE_COPY(Preferences)
public:
explicit Preferences(QWidget *parent = 0);
virtual ~Preferences();
protected:
virtual void changeEvent(QEvent *e);
private:
Ui::Preferences *m_ui;
private slots:
void on_pushButtonCancel_clicked();
void on_pushButtonApply_clicked();
}
;
#endif // PREFERENCES_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Preferences</class>
<widget class="QWidget" name="Preferences">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>444</width>
<height>388</height>
</rect>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="TabGeneral">
<attribute name="title">
<string>General</string>
</attribute>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Language</string>
</property>
</widget>
<widget class="QComboBox" name="comboBoxLanguage">
<property name="geometry">
<rect>
<x>110</x>
<y>10</y>
<width>121</width>
<height>24</height>
</rect>
</property>
</widget>
</widget>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>293</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButtonApply">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButtonCancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -23,7 +23,8 @@ SOURCES += src/main.cpp \
src/gui/TracksView.cpp \
src/gui/TracksScene.cpp \
src/gui/PreviewWidget.cpp \
src/gui/TracksRuler.cpp
src/gui/TracksRuler.cpp \
src/gui/Preferences.cpp
HEADERS += src/gui/MainWindow.h \
src/gui/DockWidgetManager.h \
src/gui/LibraryWidget.h \
......@@ -38,12 +39,17 @@ HEADERS += src/gui/MainWindow.h \
src/gui/TracksView.h \
src/gui/TracksScene.h \
src/gui/PreviewWidget.h \
src/gui/TracksRuler.h
src/gui/TracksRuler.h \
src/gui/Preferences.h
FORMS += src/gui/ui/MainWindow.ui \
src/gui/ui/Timeline.ui \
src/gui/ui/LibraryWidget.ui \
src/gui/ui/PreviewWidget.ui
src/gui/ui/PreviewWidget.ui \
src/gui/ui/Preferences.ui
RESOURCES +=
INCLUDEPATH += src/LibVLCpp
LIBS = -L/usr/local/lib \
-lvlc
TRANSLATIONS = vlmc_es.ts \
vlmc_fr.ts
CODECFORTR = UTF-8
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="es" sourcelanguage="en">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>LibraryWidget</name>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="99"/>
<source>Open Audios</source>
<translation>Abrir un sonido</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="100"/>
<source>Audio Files</source>
<translation>archivo de audio</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="105"/>
<source>Video Files</source>
<translation>archivo de vídeo</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="110"/>
<source>Images Files</source>
<translation>Imágenes</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="104"/>
<source>Open Videos</source>
<translation>Abrir un archivo de vídeo</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="109"/>
<source>Open Images</source>
<translation>Abrir una imagen</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="33"/>
<source>Audio</source>
<translation>Audio</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="59"/>
<source>Videos</source>
<translation>Vídeos</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="85"/>
<source>Images</source>
<translation>Imágenes</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="114"/>
<source>Add Media</source>
<translation>añadir media</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="130"/>
<source>Remove Media</source>
<translation>suprimir media</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="src/gui/MainWindow.cpp" line="61"/>
<source>Media Library</source>
<translation>biblioteca multimedia</translation>
</message>
<message>
<location filename="src/gui/MainWindow.cpp" line="67"/>
<source>Preview</source>
<translation>vista previa</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="14"/>
<source>VideoLAN Movie Creator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="31"/>
<source>File</source>
<translation>Archivo</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="37"/>
<source>Edit</source>
<translation>Edición</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="43"/>
<source>View</source>
<translation>Vista</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="48"/>
<source>Effects</source>
<translation>Efectos</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="53"/>
<source>Tools</source>
<translation>herramientas</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="58"/>
<source>Window</source>
<translation>ventana</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="63"/>
<location filename="src/gui/ui/MainWindow.ui" line="90"/>
<source>Help</source>
<translation>Ayuda</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="80"/>
<source>Quit</source>
<translation>Salir</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="85"/>
<source>About</source>
<translation>A propósito de</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="95"/>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Preferences</name>
<message>
<location filename="src/gui/ui/Preferences.ui" line="17"/>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="30"/>
<source>General</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="42"/>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="74"/>
<source>Apply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="81"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="9"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="10"/>
<source>French</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="11"/>
<source>Spanish</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreviewWidget</name>
<message>
<location filename="src/gui/ui/PreviewWidget.ui" line="17"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Timeline</name>
<message>
<location filename="src/gui/ui/Timeline.ui" line="20"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr" sourcelanguage="en">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>LibraryWidget</name>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="99"/>
<source>Open Audios</source>
<translation>Ouvrir un fichier audio</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="100"/>
<source>Audio Files</source>
<translation>Fichiers audio</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="105"/>
<source>Video Files</source>
<translation>Fichiers video</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="110"/>
<source>Images Files</source>
<translation>Images</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="104"/>
<source>Open Videos</source>
<translation>Ouvrir un fichier vidéo</translation>
</message>
<message>
<location filename="src/gui/LibraryWidget.cpp" line="109"/>
<source>Open Images</source>
<translation>Ouvrir une image</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="14"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="33"/>
<source>Audio</source>
<translation>Sons</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="59"/>
<source>Videos</source>
<translation>Videos</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="85"/>
<source>Images</source>
<translation>Images</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="114"/>
<source>Add Media</source>
<translation>Ajouter un média</translation>
</message>
<message>
<location filename="src/gui/ui/LibraryWidget.ui" line="130"/>
<source>Remove Media</source>
<translation>Supprimer un média</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="src/gui/MainWindow.cpp" line="61"/>
<source>Media Library</source>
<translation>Bibliothèque de médias</translation>
</message>
<message>
<location filename="src/gui/MainWindow.cpp" line="67"/>
<source>Preview</source>
<translation>Prévisualisation</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="14"/>
<source>VideoLAN Movie Creator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="31"/>
<source>File</source>
<translation>Fichier</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="37"/>
<source>Edit</source>
<translation>Edition</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="43"/>
<source>View</source>
<translation>Affichage</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="48"/>
<source>Effects</source>
<translation>Effets</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="53"/>
<source>Tools</source>
<translation>Outils</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="58"/>
<source>Window</source>
<translation>Fenêtre</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="63"/>
<location filename="src/gui/ui/MainWindow.ui" line="90"/>
<source>Help</source>
<translation>Aide</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="80"/>
<source>Quit</source>
<translation>Quitter</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="85"/>
<source>About</source>
<translation>À Propos</translation>
</message>
<message>
<location filename="src/gui/ui/MainWindow.ui" line="95"/>
<source>Preferences</source>
<translation type="unfinished">Préférences</translation>
</message>
</context>
<context>
<name>Preferences</name>
<message>
<location filename="src/gui/ui/Preferences.ui" line="17"/>
<source>Preferences</source>
<translation>Préférences</translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="30"/>
<source>General</source>
<translation>Général</translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="42"/>
<source>Language</source>
<translation>Langue</translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="74"/>
<source>Apply</source>
<translation>Appliquer</translation>
</message>
<message>
<location filename="src/gui/ui/Preferences.ui" line="81"/>
<source>Cancel</source>
<translation>Annuler</translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="9"/>
<source>English</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="10"/>
<source>French</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="src/gui/Preferences.cpp" line="11"/>
<source>Spanish</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreviewWidget</name>
<message>
<location filename="src/gui/ui/PreviewWidget.ui" line="17"/>
<source>Dialog</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Timeline</name>
<message>
<location filename="src/gui/ui/Timeline.ui" line="20"/>
<source>Form</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment