Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
be8dd28d
Commit
be8dd28d
authored
Mar 26, 2009
by
Christophe Courtaut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translation now working. Use lrelease to gen .qm
parent
a5643863
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
55 deletions
+90
-55
src/gui/LibraryWidget.cpp
src/gui/LibraryWidget.cpp
+15
-3
src/gui/LibraryWidget.h
src/gui/LibraryWidget.h
+2
-0
src/gui/Preferences.cpp
src/gui/Preferences.cpp
+27
-15
src/gui/Preferences.h
src/gui/Preferences.h
+9
-6
src/gui/PreviewWidget.cpp
src/gui/PreviewWidget.cpp
+8
-7
src/gui/PreviewWidget.h
src/gui/PreviewWidget.h
+5
-4
src/main.cpp
src/main.cpp
+6
-2
vlmc_es.ts
vlmc_es.ts
+14
-14
vlmc_fr.ts
vlmc_fr.ts
+4
-4
No files found.
src/gui/LibraryWidget.cpp
View file @
be8dd28d
...
...
@@ -97,17 +97,17 @@ void LibraryWidget::on_pushButtonAddMedia_clicked()
{
case
0
:
insertNewMediaFromFileDialog
(
tr
(
"Open Audios"
),
tr
(
"Audio Files (*.mp3 *.oga *.flac *.aac *.wav)"
)
,
tr
(
"Audio Files
"
)
+
"
(*.mp3 *.oga *.flac *.aac *.wav)"
,
ListViewMediaItem
::
Audio
);
break
;
case
1
:
insertNewMediaFromFileDialog
(
tr
(
"Open Videos"
),
tr
(
"Video Files (*.mov *.avi *.mkv)"
)
,
tr
(
"Video Files
"
)
+
"
(*.mov *.avi *.mkv)"
,
ListViewMediaItem
::
Video
);
break
;
case
2
:
insertNewMediaFromFileDialog
(
tr
(
"Open Images"
),
tr
(
"Images Files (*.gif *.png *.jpg)"
)
,
tr
(
"Images Files
"
)
+
"
(*.gif *.png *.jpg)"
,
ListViewMediaItem
::
Image
);
break
;
}
...
...
@@ -135,3 +135,15 @@ void LibraryWidget::on_pushButtonRemoveMedia_clicked()
ListViewMediaItem
*
item
=
(
ListViewMediaItem
*
)
mediaList
->
currentItem
();
this
->
removeMedia
(
item
);
}
void
LibraryWidget
::
changeEvent
(
QEvent
*
e
)
{
switch
(
e
->
type
()
)
{
case
QEvent
::
LanguageChange
:
m_ui
.
retranslateUi
(
this
);
break
;
default:
break
;
}
}
src/gui/LibraryWidget.h
View file @
be8dd28d
...
...
@@ -63,6 +63,8 @@ public:
ListViewMediaItem
*
addMedia
(
QFileInfo
*
fileInfo
,
ListViewMediaItem
::
fType
fileType
);
bool
removeMedia
(
ListViewMediaItem
*
item
);
int
getIndex
(
ListViewMediaItem
*
media
);
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
private:
QString
getNewMediaFileName
(
QString
title
,
QString
filter
,
ListViewMediaItem
::
fType
);
ListViewMediaItem
*
insertNewMediaFromFileDialog
(
QString
title
,
QString
filter
,
ListViewMediaItem
::
fType
fileType
);
...
...
src/gui/Preferences.cpp
View file @
be8dd28d
#include "Preferences.h"
#include "ui_Preferences.h"
Preferences
::
Preferences
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_ui
(
new
Ui
::
Preferences
)
QTranslator
*
Preferences
::
m_currentLang
=
NULL
;
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"
);
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
()
...
...
@@ -16,12 +16,13 @@ Preferences::~Preferences()
delete
m_ui
;
}
void
Preferences
::
changeEvent
(
QEvent
*
e
)
void
Preferences
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
()
)
{
case
QEvent
::
LanguageChange
:
m_ui
->
retranslateUi
(
this
);
m_ui
->
retranslateUi
(
this
);
break
;
default:
break
;
...
...
@@ -35,9 +36,20 @@ void Preferences::on_pushButtonCancel_clicked()
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
);
QSettings
settings
;
QString
lang
=
settings
.
value
(
"Lang"
).
toString
();
QString
langValue
=
this
->
m_ui
->
comboBoxLanguage
->
itemData
(
this
->
m_ui
->
comboBoxLanguage
->
currentIndex
()
).
toString
();
if
(
this
->
m_currentLang
!=
NULL
)
{
qApp
->
removeTranslator
(
this
->
m_currentLang
);
delete
this
->
m_currentLang
;
this
->
m_currentLang
=
NULL
;
}
if
(
langValue
!=
""
)
{
m_currentLang
=
new
QTranslator
();
m_currentLang
->
load
(
"vlmc_"
+
langValue
,
QApplication
::
applicationDirPath
()
+
"/../"
);
qApp
->
installTranslator
(
m_currentLang
);
}
this
->
close
();
}
src/gui/Preferences.h
View file @
be8dd28d
...
...
@@ -3,29 +3,32 @@
#include <QtGui/QWidget>
#include <QTranslator>
#include <QApplication>
#include <QSettings>
#include <QtDebug>
namespace
Ui
{
class
Preferences
;
}
class
Preferences
:
public
QWidget
{
class
Preferences
:
public
QWidget
{
Q_OBJECT
Q_DISABLE_COPY
(
Preferences
)
Q_DISABLE_COPY
(
Preferences
)
public:
explicit
Preferences
(
QWidget
*
parent
=
0
);
explicit
Preferences
(
QWidget
*
parent
=
0
);
virtual
~
Preferences
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
virtual
void
changeEvent
(
QEvent
*
e
);
private:
Ui
::
Preferences
*
m_ui
;
static
QTranslator
*
m_currentLang
;
private
slots
:
void
on_pushButtonCancel_clicked
();
void
on_pushButtonApply_clicked
();
}
;
};
#endif // PREFERENCES_H
src/gui/PreviewWidget.cpp
View file @
be8dd28d
#include "PreviewWidget.h"
#include "ui_PreviewWidget.h"
PreviewWidget
::
PreviewWidget
(
QWidget
*
parent
)
:
QDialog
(
parent
),
m_ui
(
new
Ui
::
PreviewWidget
)
PreviewWidget
::
PreviewWidget
(
QWidget
*
parent
)
:
QDialog
(
parent
),
m_ui
(
new
Ui
::
PreviewWidget
)
{
m_ui
->
setupUi
(
this
);
m_ui
->
setupUi
(
this
);
}
PreviewWidget
::~
PreviewWidget
()
...
...
@@ -13,11 +13,12 @@ PreviewWidget::~PreviewWidget()
delete
m_ui
;
}
void
PreviewWidget
::
changeEvent
(
QEvent
*
e
)
void
PreviewWidget
::
changeEvent
(
QEvent
*
e
)
{
switch
(
e
->
type
())
{
switch
(
e
->
type
()
)
{
case
QEvent
::
LanguageChange
:
m_ui
->
retranslateUi
(
this
);
m_ui
->
retranslateUi
(
this
);
break
;
default:
break
;
...
...
src/gui/PreviewWidget.h
View file @
be8dd28d
...
...
@@ -7,15 +7,16 @@ namespace Ui {
class
PreviewWidget
;
}
class
PreviewWidget
:
public
QDialog
{
class
PreviewWidget
:
public
QDialog
{
Q_OBJECT
Q_DISABLE_COPY
(
PreviewWidget
)
Q_DISABLE_COPY
(
PreviewWidget
)
public:
explicit
PreviewWidget
(
QWidget
*
parent
=
0
);
explicit
PreviewWidget
(
QWidget
*
parent
=
0
);
virtual
~
PreviewWidget
();
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
virtual
void
changeEvent
(
QEvent
*
e
);
private:
Ui
::
PreviewWidget
*
m_ui
;
...
...
src/main.cpp
View file @
be8dd28d
...
...
@@ -26,7 +26,11 @@
int
main
(
int
argc
,
char
**
argv
)
{
QApplication
app
(
argc
,
argv
);
MainWindow
w
;
w
.
show
();
app
.
setApplicationName
(
"vlmc"
);
app
.
setOrganizationName
(
"vlmc"
);
app
.
setOrganizationDomain
(
"vlmc.org"
);
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
MainWindow
w
;
w
.
show
();
return
app
.
exec
();
}
vlmc_es.ts
View file @
be8dd28d
...
...
@@ -70,12 +70,12 @@
<
message
>
<
location
filename
=
"
src/gui/MainWindow.cpp
"
line
=
"
61
"
/>
<
source
>
Media
Library
<
/source
>
<
translation
>
b
iblioteca
multimedia
<
/translation
>
<
translation
type
=
"
unfinished
"
>
B
iblioteca
multimedia
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/MainWindow.cpp
"
line
=
"
67
"
/>
<
source
>
Preview
<
/source
>
<
translation
>
v
ista
previa
<
/translation
>
<
translation
type
=
"
unfinished
"
>
V
ista
previa
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
14
"
/>
...
...
@@ -95,7 +95,7 @@
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
43
"
/>
<
source
>
View
<
/source
>
<
translation
>
Vista
<
/translation
>
<
translation
type
=
"
unfinished
"
>
Vista
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
48
"
/>
...
...
@@ -105,12 +105,12 @@
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
53
"
/>
<
source
>
Tools
<
/source
>
<
translation
>
h
erramientas
<
/translation
>
<
translation
type
=
"
unfinished
"
>
H
erramientas
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
58
"
/>
<
source
>
Window
<
/source
>
<
translation
>
v
entana
<
/translation
>
<
translation
type
=
"
unfinished
"
>
V
entana
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
63
"
/>
...
...
@@ -131,7 +131,7 @@
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
95
"
/>
<
source
>
Preferences
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Preferencias
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -139,42 +139,42 @@
<
message
>
<
location
filename
=
"
src/gui/ui/Preferences.ui
"
line
=
"
17
"
/>
<
source
>
Preferences
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
>
Preferencias
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/Preferences.ui
"
line
=
"
30
"
/>
<
source
>
General
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
>
General
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/Preferences.ui
"
line
=
"
42
"
/>
<
source
>
Language
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
>
Idioma
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/Preferences.ui
"
line
=
"
74
"
/>
<
source
>
Apply
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
>
Aplicar
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/ui/Preferences.ui
"
line
=
"
81
"
/>
<
source
>
Cancel
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
translation
type
=
"
unfinished
"
>
Cancelar
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
9
"
/>
<
source
>
English
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Inglés
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
10
"
/>
<
source
>
French
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Francés
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
11
"
/>
<
source
>
Spanish
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Español
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
vlmc_fr.ts
View file @
be8dd28d
...
...
@@ -131,7 +131,7 @@
<
message
>
<
location
filename
=
"
src/gui/ui/MainWindow.ui
"
line
=
"
95
"
/>
<
source
>
Preferences
<
/source
>
<
translation
type
=
"
unfinished
"
>
Préférences
<
/translation
>
<
translation
>
Préférences
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
@@ -164,17 +164,17 @@
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
9
"
/>
<
source
>
English
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Anglais
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
10
"
/>
<
source
>
French
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Français
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
src/gui/Preferences.cpp
"
line
=
"
11
"
/>
<
source
>
Spanish
<
/source
>
<
translation
type
=
"
unfinished
"
>
<
/translation
>
<
translation
>
Espagnol
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment