Small clean of subtitles applet code.
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / applet / subtitleswidget.cpp
index a3ce0f3..ab27035 100644 (file)
@@ -1,36 +1,35 @@
-/****************************************************************************+
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of meegotouch-controlpanelapplets.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at directui@nokia.com.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation
-** and appearing in the file LICENSE.LGPL included in the packaging
-** of this file.
-**
-****************************************************************************/
+/*
+ *  Subtitles control panel applet.
+ *  Copyright (C) 2011 Roman Moravcik
+ *
+ *  encodings structure imported from totem-subtitle-encoding.c
+ *  Copyright (C) 2001-2006 Bastien Nocera <hadess@hadess.net>
+ *
+ *  Based on Battery applet from meegotouch-controlpanelapplets
+ *  Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ *  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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include "subtitleswidget.h"
-#include "dcpsubtitles.h"
 
 #include <QGraphicsLinearLayout>
-#include <QSettings>
-#include <QDebug>
 
-#include <MStylableWidget>
 #include <MLayout>
-#include <MLinearLayoutPolicy>
-#include <MButton>
 #include <MSeparator>
 #include <MContainer>
-#include <MLabel>
-#include <MComboBox>
 
 #include <MWidgetCreator>
 M_REGISTER_WIDGET_NO_CREATE (SubtitlesWidget);
@@ -54,10 +53,10 @@ typedef struct {
 } FontStyle;
 
 static FontStyle font_styles[] = {
-    {FONT_STYLE_REGULAR,       qtTrId("Regular")},
-    {FONT_STYLE_ITALIC,                qtTrId("Italic")},
-    {FONT_STYLE_BOLD,          qtTrId("Bold")},
-    {FONT_STYLE_ITALIC_BOLD,   qtTrId("Italic Bold")},
+    {FONT_STYLE_REGULAR,       qtTrId ("Regular")},
+    {FONT_STYLE_ITALIC,                qtTrId ("Italic")},
+    {FONT_STYLE_BOLD,          qtTrId ("Bold")},
+    {FONT_STYLE_ITALIC_BOLD,   qtTrId ("Italic Bold")},
 };
 
 static const int font_sizes[] =
@@ -182,110 +181,110 @@ typedef struct {
 } SubtitleEncoding;
 
 static SubtitleEncoding encodings[] = {
-    {SUBTITLE_ENCODING_ISO_8859_6,     "ISO-8859-6",           qtTrId("Arabic")},
-    {SUBTITLE_ENCODING_IBM_864,                "IBM864",               qtTrId("Arabic")},
-    {SUBTITLE_ENCODING_MAC_ARABIC,     "MAC_ARABIC",           qtTrId("Arabic")},
-    {SUBTITLE_ENCODING_WINDOWS_1256,   "WINDOWS-1256",         qtTrId("Arabic")},
+    {SUBTITLE_ENCODING_ISO_8859_6,     "ISO-8859-6",           qtTrId ("Arabic")},
+    {SUBTITLE_ENCODING_IBM_864,                "IBM864",               qtTrId ("Arabic")},
+    {SUBTITLE_ENCODING_MAC_ARABIC,     "MAC_ARABIC",           qtTrId ("Arabic")},
+    {SUBTITLE_ENCODING_WINDOWS_1256,   "WINDOWS-1256",         qtTrId ("Arabic")},
 
-    {SUBTITLE_ENCODING_ARMSCII_8,      "ARMSCII-8",            qtTrId("Armenian")},
+    {SUBTITLE_ENCODING_ARMSCII_8,      "ARMSCII-8",            qtTrId ("Armenian")},
 
-    {SUBTITLE_ENCODING_ISO_8859_4,     "ISO-8859-4",           qtTrId("Baltic")},
-    {SUBTITLE_ENCODING_ISO_8859_13,    "ISO-8859-13",          qtTrId("Baltic")},
-    {SUBTITLE_ENCODING_WINDOWS_1257,   "WINDOWS-1257",         qtTrId("Baltic")},
+    {SUBTITLE_ENCODING_ISO_8859_4,     "ISO-8859-4",           qtTrId ("Baltic")},
+    {SUBTITLE_ENCODING_ISO_8859_13,    "ISO-8859-13",          qtTrId ("Baltic")},
+    {SUBTITLE_ENCODING_WINDOWS_1257,   "WINDOWS-1257",         qtTrId ("Baltic")},
 
-    {SUBTITLE_ENCODING_ISO_8859_14,    "ISO-8859-14",          qtTrId("Celtic")},
+    {SUBTITLE_ENCODING_ISO_8859_14,    "ISO-8859-14",          qtTrId ("Celtic")},
 
-    {SUBTITLE_ENCODING_ISO_8859_2,     "ISO-8859-2",           qtTrId("Central European")},
-    {SUBTITLE_ENCODING_IBM_852,                "IBM852",               qtTrId("Central European")},
-    {SUBTITLE_ENCODING_MAC_CE,         "MAC_CE",               qtTrId("Central European")},
-    {SUBTITLE_ENCODING_WINDOWS_1250,   "WINDOWS-1250",         qtTrId("Central European")},
+    {SUBTITLE_ENCODING_ISO_8859_2,     "ISO-8859-2",           qtTrId ("Central European")},
+    {SUBTITLE_ENCODING_IBM_852,                "IBM852",               qtTrId ("Central European")},
+    {SUBTITLE_ENCODING_MAC_CE,         "MAC_CE",               qtTrId ("Central European")},
+    {SUBTITLE_ENCODING_WINDOWS_1250,   "WINDOWS-1250",         qtTrId ("Central European")},
 
-    {SUBTITLE_ENCODING_GB18030,                "GB18030",              qtTrId("Chinese Simplified")},
-    {SUBTITLE_ENCODING_GB2312,         "GB2312",               qtTrId("Chinese Simplified")},
-    {SUBTITLE_ENCODING_GBK,            "GBK",                  qtTrId("Chinese Simplified")},
-    {SUBTITLE_ENCODING_HZ,             "HZ",                   qtTrId("Chinese Simplified")},
+    {SUBTITLE_ENCODING_GB18030,                "GB18030",              qtTrId ("Chinese Simplified")},
+    {SUBTITLE_ENCODING_GB2312,         "GB2312",               qtTrId ("Chinese Simplified")},
+    {SUBTITLE_ENCODING_GBK,            "GBK",                  qtTrId ("Chinese Simplified")},
+    {SUBTITLE_ENCODING_HZ,             "HZ",                   qtTrId ("Chinese Simplified")},
 
-    {SUBTITLE_ENCODING_BIG5,           "BIG5",                 qtTrId("Chinese Traditional")},
-    {SUBTITLE_ENCODING_BIG5_HKSCS,     "BIG5-HKSCS",           qtTrId("Chinese Traditional")},
-    {SUBTITLE_ENCODING_EUC_TW,         "EUC-TW",               qtTrId("Chinese Traditional")},
+    {SUBTITLE_ENCODING_BIG5,           "BIG5",                 qtTrId ("Chinese Traditional")},
+    {SUBTITLE_ENCODING_BIG5_HKSCS,     "BIG5-HKSCS",           qtTrId ("Chinese Traditional")},
+    {SUBTITLE_ENCODING_EUC_TW,         "EUC-TW",               qtTrId ("Chinese Traditional")},
 
-    {SUBTITLE_ENCODING_MAC_CROATIAN,   "MAC_CROATIAN",         qtTrId("Croatian")},
+    {SUBTITLE_ENCODING_MAC_CROATIAN,   "MAC_CROATIAN",         qtTrId ("Croatian")},
 
-    {SUBTITLE_ENCODING_ISO_8859_5,     "ISO-8859-5",           qtTrId("Cyrillic")},
-    {SUBTITLE_ENCODING_IBM_855,                "IBM855",               qtTrId("Cyrillic")},
-    {SUBTITLE_ENCODING_ISO_IR_111,     "ISO-IR-111",           qtTrId("Cyrillic")},
-    {SUBTITLE_ENCODING_KOI8_R,         "KOI8-R",               qtTrId("Cyrillic")},
-    {SUBTITLE_ENCODING_MAC_CYRILLIC,   "MAC-CYRILLIC",         qtTrId("Cyrillic")},
-    {SUBTITLE_ENCODING_WINDOWS_1251,   "WINDOWS-1251",         qtTrId("Cyrillic")},
+    {SUBTITLE_ENCODING_ISO_8859_5,     "ISO-8859-5",           qtTrId ("Cyrillic")},
+    {SUBTITLE_ENCODING_IBM_855,                "IBM855",               qtTrId ("Cyrillic")},
+    {SUBTITLE_ENCODING_ISO_IR_111,     "ISO-IR-111",           qtTrId ("Cyrillic")},
+    {SUBTITLE_ENCODING_KOI8_R,         "KOI8-R",               qtTrId ("Cyrillic")},
+    {SUBTITLE_ENCODING_MAC_CYRILLIC,   "MAC-CYRILLIC",         qtTrId ("Cyrillic")},
+    {SUBTITLE_ENCODING_WINDOWS_1251,   "WINDOWS-1251",         qtTrId ("Cyrillic")},
 
-    {SUBTITLE_ENCODING_CP_866,         "CP866",                qtTrId("Cyrillic/Russian")},
+    {SUBTITLE_ENCODING_CP_866,         "CP866",                qtTrId ("Cyrillic/Russian")},
 
-    {SUBTITLE_ENCODING_MAC_UKRAINIAN,  "MAC_UKRAINIAN",        qtTrId("Cyrillic/Ukrainian")},
-    {SUBTITLE_ENCODING_KOI8_U,         "KOI8-U",               qtTrId("Cyrillic/Ukrainian")},
+    {SUBTITLE_ENCODING_MAC_UKRAINIAN,  "MAC_UKRAINIAN",        qtTrId ("Cyrillic/Ukrainian")},
+    {SUBTITLE_ENCODING_KOI8_U,         "KOI8-U",               qtTrId ("Cyrillic/Ukrainian")},
 
-    {SUBTITLE_ENCODING_GEOSTD8,                "GEORGIAN-PS",          qtTrId("Georgian")},
+    {SUBTITLE_ENCODING_GEOSTD8,                "GEORGIAN-PS",          qtTrId ("Georgian")},
 
-    {SUBTITLE_ENCODING_ISO_8859_7,     "ISO-8859-7",           qtTrId("Greek")},
-    {SUBTITLE_ENCODING_MAC_GREEK,      "MAC_GREEK",            qtTrId("Greek")},
-    {SUBTITLE_ENCODING_WINDOWS_1253,   "WINDOWS-1253",         qtTrId("Greek")},
+    {SUBTITLE_ENCODING_ISO_8859_7,     "ISO-8859-7",           qtTrId ("Greek")},
+    {SUBTITLE_ENCODING_MAC_GREEK,      "MAC_GREEK",            qtTrId ("Greek")},
+    {SUBTITLE_ENCODING_WINDOWS_1253,   "WINDOWS-1253",         qtTrId ("Greek")},
 
-    {SUBTITLE_ENCODING_MAC_GUJARATI,   "MAC_GUJARATI",         qtTrId("Gujarati")},
+    {SUBTITLE_ENCODING_MAC_GUJARATI,   "MAC_GUJARATI",         qtTrId ("Gujarati")},
 
-    {SUBTITLE_ENCODING_MAC_GURMUKHI,   "MAC_GURMUKHI",         qtTrId("Gurmukhi")},
+    {SUBTITLE_ENCODING_MAC_GURMUKHI,   "MAC_GURMUKHI",         qtTrId ("Gurmukhi")},
 
-    {SUBTITLE_ENCODING_ISO_8859_8_I,   "ISO-8859-8-I",         qtTrId("Hebrew")},
-    {SUBTITLE_ENCODING_IBM_862,                "IBM862",               qtTrId("Hebrew")},
-    {SUBTITLE_ENCODING_MAC_HEBREW,     "MAC_HEBREW",           qtTrId("Hebrew")},
-    {SUBTITLE_ENCODING_WINDOWS_1255,   "WINDOWS-1255",         qtTrId("Hebrew")},
+    {SUBTITLE_ENCODING_ISO_8859_8_I,   "ISO-8859-8-I",         qtTrId ("Hebrew")},
+    {SUBTITLE_ENCODING_IBM_862,                "IBM862",               qtTrId ("Hebrew")},
+    {SUBTITLE_ENCODING_MAC_HEBREW,     "MAC_HEBREW",           qtTrId ("Hebrew")},
+    {SUBTITLE_ENCODING_WINDOWS_1255,   "WINDOWS-1255",         qtTrId ("Hebrew")},
 
-    {SUBTITLE_ENCODING_ISO_8859_8,     "ISO-8859-8",           qtTrId("Hebrew Visual")},
+    {SUBTITLE_ENCODING_ISO_8859_8,     "ISO-8859-8",           qtTrId ("Hebrew Visual")},
 
-    {SUBTITLE_ENCODING_MAC_DEVANAGARI, "MAC_DEVANAGARI",       qtTrId("Hindi")},
+    {SUBTITLE_ENCODING_MAC_DEVANAGARI, "MAC_DEVANAGARI",       qtTrId ("Hindi")},
 
-    {SUBTITLE_ENCODING_MAC_ICELANDIC,  "MAC_ICELANDIC",        qtTrId("Icelandic")},
+    {SUBTITLE_ENCODING_MAC_ICELANDIC,  "MAC_ICELANDIC",        qtTrId ("Icelandic")},
 
-    {SUBTITLE_ENCODING_EUC_JP,         "EUC-JP",               qtTrId("Japanese")},
-    {SUBTITLE_ENCODING_ISO_2022_JP,    "ISO2022JP",            qtTrId("Japanese")},
-    {SUBTITLE_ENCODING_SHIFT_JIS,      "SHIFT-JIS",            qtTrId("Japanese")},
+    {SUBTITLE_ENCODING_EUC_JP,         "EUC-JP",               qtTrId ("Japanese")},
+    {SUBTITLE_ENCODING_ISO_2022_JP,    "ISO2022JP",            qtTrId ("Japanese")},
+    {SUBTITLE_ENCODING_SHIFT_JIS,      "SHIFT-JIS",            qtTrId ("Japanese")},
 
-    {SUBTITLE_ENCODING_EUC_KR,         "EUC-KR",               qtTrId("Korean")},
-    {SUBTITLE_ENCODING_ISO_2022_KR,    "ISO2022KR",            qtTrId("Korean")},
-    {SUBTITLE_ENCODING_JOHAB,          "JOHAB",                qtTrId("Korean")},
-    {SUBTITLE_ENCODING_UHC,            "UHC",                  qtTrId("Korean")},
+    {SUBTITLE_ENCODING_EUC_KR,         "EUC-KR",               qtTrId ("Korean")},
+    {SUBTITLE_ENCODING_ISO_2022_KR,    "ISO2022KR",            qtTrId ("Korean")},
+    {SUBTITLE_ENCODING_JOHAB,          "JOHAB",                qtTrId ("Korean")},
+    {SUBTITLE_ENCODING_UHC,            "UHC",                  qtTrId ("Korean")},
 
-    {SUBTITLE_ENCODING_ISO_8859_10,    "ISO-8859-10",          qtTrId("Nordic")},
+    {SUBTITLE_ENCODING_ISO_8859_10,    "ISO-8859-10",          qtTrId ("Nordic")},
 
-    {SUBTITLE_ENCODING_MAC_FARSI,      "MAC_FARSI",            qtTrId("Persian")},
+    {SUBTITLE_ENCODING_MAC_FARSI,      "MAC_FARSI",            qtTrId ("Persian")},
 
-    {SUBTITLE_ENCODING_ISO_8859_16,    "ISO-8859-16",          qtTrId("Romanian")},
-    {SUBTITLE_ENCODING_MAC_ROMANIAN,   "MAC_ROMANIAN",         qtTrId("Romanian")},
+    {SUBTITLE_ENCODING_ISO_8859_16,    "ISO-8859-16",          qtTrId ("Romanian")},
+    {SUBTITLE_ENCODING_MAC_ROMANIAN,   "MAC_ROMANIAN",         qtTrId ("Romanian")},
 
-    {SUBTITLE_ENCODING_ISO_8859_3,     "ISO-8859-3",           qtTrId("South European")},
+    {SUBTITLE_ENCODING_ISO_8859_3,     "ISO-8859-3",           qtTrId ("South European")},
 
-    {SUBTITLE_ENCODING_TIS_620,                "TIS-620",              qtTrId("Thai")},
+    {SUBTITLE_ENCODING_TIS_620,                "TIS-620",              qtTrId ("Thai")},
 
-    {SUBTITLE_ENCODING_ISO_8859_9,     "ISO-8859-9",           qtTrId("Turkish")},
-    {SUBTITLE_ENCODING_IBM_857,                "IBM857",               qtTrId("Turkish")},
-    {SUBTITLE_ENCODING_MAC_TURKISH,    "MAC_TURKISH",          qtTrId("Turkish")},
-    {SUBTITLE_ENCODING_WINDOWS_1254,   "WINDOWS-1254",         qtTrId("Turkish")},
+    {SUBTITLE_ENCODING_ISO_8859_9,     "ISO-8859-9",           qtTrId ("Turkish")},
+    {SUBTITLE_ENCODING_IBM_857,                "IBM857",               qtTrId ("Turkish")},
+    {SUBTITLE_ENCODING_MAC_TURKISH,    "MAC_TURKISH",          qtTrId ("Turkish")},
+    {SUBTITLE_ENCODING_WINDOWS_1254,   "WINDOWS-1254",         qtTrId ("Turkish")},
 
-    {SUBTITLE_ENCODING_UTF_7,          "UTF-7",                qtTrId("Unicode")},
-    {SUBTITLE_ENCODING_UTF_8,          "UTF-8",                qtTrId("Unicode")},
-    {SUBTITLE_ENCODING_UTF_16,         "UTF-16",               qtTrId("Unicode")},
-    {SUBTITLE_ENCODING_UCS_2,          "UCS-2",                qtTrId("Unicode")},
-    {SUBTITLE_ENCODING_UCS_4,          "UCS-4",                qtTrId("Unicode")},
+    {SUBTITLE_ENCODING_UTF_7,          "UTF-7",                qtTrId ("Unicode")},
+    {SUBTITLE_ENCODING_UTF_8,          "UTF-8",                qtTrId ("Unicode")},
+    {SUBTITLE_ENCODING_UTF_16,         "UTF-16",               qtTrId ("Unicode")},
+    {SUBTITLE_ENCODING_UCS_2,          "UCS-2",                qtTrId ("Unicode")},
+    {SUBTITLE_ENCODING_UCS_4,          "UCS-4",                qtTrId ("Unicode")},
 
-    {SUBTITLE_ENCODING_ISO_8859_1,     "ISO-8859-1",           qtTrId("Western")},
-    {SUBTITLE_ENCODING_ISO_8859_15,    "ISO-8859-15",          qtTrId("Western")},
-    {SUBTITLE_ENCODING_IBM_850,                "IBM850",               qtTrId("Western")},
-    {SUBTITLE_ENCODING_MAC_ROMAN,      "MAC_ROMAN",            qtTrId("Western")},
-    {SUBTITLE_ENCODING_WINDOWS_1252,   "WINDOWS-1252",         qtTrId("Western")},
+    {SUBTITLE_ENCODING_ISO_8859_1,     "ISO-8859-1",           qtTrId ("Western")},
+    {SUBTITLE_ENCODING_ISO_8859_15,    "ISO-8859-15",          qtTrId ("Western")},
+    {SUBTITLE_ENCODING_IBM_850,                "IBM850",               qtTrId ("Western")},
+    {SUBTITLE_ENCODING_MAC_ROMAN,      "MAC_ROMAN",            qtTrId ("Western")},
+    {SUBTITLE_ENCODING_WINDOWS_1252,   "WINDOWS-1252",         qtTrId ("Western")},
 
-    {SUBTITLE_ENCODING_TCVN,           "TCVN",                 qtTrId("Vietnamese")},
-    {SUBTITLE_ENCODING_VISCII,         "VISCII",               qtTrId("Vietnamese")},
-    {SUBTITLE_ENCODING_WINDOWS_1258,   "WINDOWS-1258",         qtTrId("Vietnamese")},
+    {SUBTITLE_ENCODING_TCVN,           "TCVN",                 qtTrId ("Vietnamese")},
+    {SUBTITLE_ENCODING_VISCII,         "VISCII",               qtTrId ("Vietnamese")},
+    {SUBTITLE_ENCODING_WINDOWS_1258,   "WINDOWS-1258",         qtTrId ("Vietnamese")},
 
-    {SUBTITLE_ENCODING_CURRENT_LOCALE, NULL,                   qtTrId("Current Locale")}
+    {SUBTITLE_ENCODING_CURRENT_LOCALE, NULL,                   qtTrId ("Current Locale")}
 };
 
 /******************************************************************************
@@ -347,7 +346,8 @@ SubtitlesWidget::initWidget ()
     m_AutoloadSubtitlesSwitch->setChecked (autoload_subtitles);
 
     QString subtitle_font = m_SubtitlesSettings->value ("subtitle_font").toString ();
-    PangoFontDescription *font_desc = pango_font_description_from_string ((const char *) subtitle_font.toAscii().data());
+    PangoFontDescription *font_desc = pango_font_description_from_string (
+                                           (const char *) subtitle_font.toAscii ().data ());
     if (font_desc) {
         index = 0;
         while (font_sizes[index] != -1) {
@@ -412,13 +412,13 @@ SubtitlesWidget::addAutoloadSubtitlesContainer ()
     Q_ASSERT (m_MainLayout);
 
     container = new MContainer (this);
-    container->setContentsMargins (0,0,0,0);
+    container->setContentsMargins (0.0, 0.0, 0.0, 0.0);
     container->setStyleName ("CommonLargePanelInverted");
     container->setHeaderVisible (false);
 
     layout = new QGraphicsLinearLayout (Qt::Horizontal);
-    layout->setContentsMargins (0,0,0,0);
-    layout->setSpacing (0);
+    layout->setContentsMargins (0.0, 0.0, 0.0, 0.0);
+    layout->setSpacing (0.0);
     container->centralWidget()->setLayout (layout);
 
     MLabel *label = new MLabel;
@@ -455,12 +455,12 @@ SubtitlesWidget::addSubtitlesFontStyleContainer ()
     Q_ASSERT (m_MainLayout);
 
     container = new MContainer (this);
-    container->setContentsMargins (0,0,0,0);
+    container->setContentsMargins (0.0, 0.0, 0.0, 0.0);
     container->setStyleName ("CommonLargePanelInverted");
     container->setHeaderVisible (false);
 
     layout = new QGraphicsLinearLayout (Qt::Vertical);
-    layout->setContentsMargins (0, 0, 0, 0);
+    layout->setContentsMargins (0.0, 0.0, 0.0, 0.0);
     layout->setSpacing (0.0);
     container->centralWidget()->setLayout (layout);
 
@@ -477,7 +477,7 @@ SubtitlesWidget::addSubtitlesFontStyleContainer ()
     buttonGroup = new MLayout;
     buttonGroupLayout = new MLinearLayoutPolicy (buttonGroup, Qt::Horizontal);
     buttonGroupLayout->setNotifyWidgetsOfLayoutPositionEnabled (true);
-    buttonGroupLayout->setContentsMargins (14, 0, 14, 0);
+    buttonGroupLayout->setContentsMargins (14.0, 0.0, 14.0, 0.0);
     buttonGroupLayout->setSpacing (0.0);
 
     m_RegularStyleButton = new MButton ();
@@ -508,7 +508,7 @@ SubtitlesWidget::addSubtitlesFontStyleContainer ()
              this, SLOT (BoldStyleButtonToggled (bool)));
 
     layout->addItem (buttonGroup);
-    layout->setAlignment(buttonGroup, Qt::AlignLeft);
+    layout->setAlignment (buttonGroup, Qt::AlignLeft);
 
     spacer = new MSeparator;
     spacer->setStyleName ("CommonXLargeSpacer");
@@ -523,12 +523,12 @@ SubtitlesWidget::addSubtitlesFontSizeContainer ()
 {
     int                   index = 0;
 
-    m_SubtitlesFontSizeCombo = new MComboBox();
-    m_SubtitlesFontSizeCombo->setTitle(qtTrId ("Font size"));
+    m_SubtitlesFontSizeCombo = new MComboBox ();
+    m_SubtitlesFontSizeCombo->setTitle (qtTrId ("Font size"));
     m_SubtitlesFontSizeCombo->setStyleName ("CommonComboBoxInverted");
 
     while (font_sizes[index] != -1) {
-        m_SubtitlesFontSizeCombo->addItem(QString::number(font_sizes[index]));
+        m_SubtitlesFontSizeCombo->addItem (QString::number (font_sizes[index]));
         index++;
     }
 
@@ -544,16 +544,16 @@ SubtitlesWidget::addSubtitlesEncodingContainer ()
 {
     int                   index = 0;
 
-    m_SubtitlesEncodingCombo = new MComboBox();
-    m_SubtitlesEncodingCombo->setTitle(qtTrId ("Encoding"));
+    m_SubtitlesEncodingCombo = new MComboBox ();
+    m_SubtitlesEncodingCombo->setTitle (qtTrId ("Encoding"));
     m_SubtitlesEncodingCombo->setStyleName ("CommonComboBoxInverted");
 
     while (index < SUBTITLE_ENCODING_LAST) {
-        if (encodings[index].charset.isNull()) {
-            m_SubtitlesEncodingCombo->addItem(encodings[index].name);
+        if (encodings[index].charset.isNull ()) {
+            m_SubtitlesEncodingCombo->addItem (encodings[index].name);
         } else {
-            m_SubtitlesEncodingCombo->addItem(QString("%1 (%2)").arg(encodings[index].name)
-                                                                .arg(encodings[index].charset));
+            m_SubtitlesEncodingCombo->addItem (QString ("%1 (%2)").arg (encodings[index].name)
+                                                                  .arg (encodings[index].charset));
         }
         index++;
     }
@@ -568,8 +568,6 @@ SubtitlesWidget::addSubtitlesEncodingContainer ()
 void
 SubtitlesWidget::retranslateUi ()
 {
-    if (m_TitleLabel)
-        m_TitleLabel->setText (qtTrId("Subtitles"));
 }
 
 void
@@ -590,7 +588,7 @@ SubtitlesWidget::RegularStyleButtonToggled (bool toggled)
 
     QString subtitle_font = m_SubtitlesSettings->value ("subtitle_font").toString ();
     PangoFontDescription *font_desc = pango_font_description_from_string (
-                                                (const char *) subtitle_font.toAscii().data());
+                                                (const char *) subtitle_font.toAscii ().data ());
     if (font_desc) {
         if (toggled) {
             pango_font_description_set_style (font_desc, PANGO_STYLE_NORMAL);
@@ -615,7 +613,7 @@ SubtitlesWidget::ItalicStyleButtonToggled (bool toggled)
 
     QString subtitle_font = m_SubtitlesSettings->value ("subtitle_font").toString ();
     PangoFontDescription *font_desc = pango_font_description_from_string (
-                                                (const char *) subtitle_font.toAscii().data());
+                                                (const char *) subtitle_font.toAscii ().data ());
     if (font_desc) {
         if (toggled) {
             pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC);
@@ -633,7 +631,7 @@ SubtitlesWidget::BoldStyleButtonToggled (bool toggled)
 {
     QString subtitle_font = m_SubtitlesSettings->value ("subtitle_font").toString ();
     PangoFontDescription *font_desc = pango_font_description_from_string (
-                                                (const char *) subtitle_font.toAscii().data());
+                                                (const char *) subtitle_font.toAscii ().data ());
     if (font_desc) {
         if (toggled) {
             pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
@@ -651,7 +649,7 @@ SubtitlesWidget::SubtitlesFontSizeActivated (int index)
 {
     QString subtitle_font = m_SubtitlesSettings->value ("subtitle_font").toString ();
     PangoFontDescription *font_desc = pango_font_description_from_string (
-                                                (const char *) subtitle_font.toAscii().data());
+                                                (const char *) subtitle_font.toAscii ().data ());
     if (font_desc) {
         if (pango_font_description_get_size (font_desc)  != (font_sizes[index] * PANGO_SCALE)) {
             pango_font_description_set_size (font_desc, font_sizes[index] * PANGO_SCALE);