--- a/ftuapplication/ftuapplication.pri Tue Jul 06 14:06:30 2010 +0300
+++ b/ftuapplication/ftuapplication.pri Wed Aug 18 09:39:42 2010 +0300
@@ -17,4 +17,4 @@
HEADERS += ./inc/*.h
SOURCES += ./src/*.cpp
-RESOURCES += ../translations/translations.qrc
+
--- a/ftuapplication/src/main.cpp Tue Jul 06 14:06:30 2010 +0300
+++ b/ftuapplication/src/main.cpp Wed Aug 18 09:39:42 2010 +0300
@@ -21,7 +21,7 @@
#include <QtGui>
#include <hbapplication.h>
-#include <QTranslator>
+#include <HbTranslator>
#include <QLocale>
#include <QTime>
#include <QDebug>
@@ -37,31 +37,9 @@
HbApplication app(argc, argv);
- QTranslator translator;
- QString translation = "ftu_";
- if(argc > 1){
- translation.append(argv[1]);
- }
- else{
- // another option to load locale could be QLocale::system().language())
- translation.append(QLocale::system().name()); // this seems to be ftu_en_US in Windows and ftu_en_GB in WINSCW emulator and hardware
- }
- translator.load(translation, ":/translations" );
- app.installTranslator(&translator);
-
- QString exampleWizardsTranslation = "ftuexamplewizards_";
- if(argc > 1){
- exampleWizardsTranslation.append(argv[1]);
- }
- else{
- exampleWizardsTranslation.append(QLocale::system().name());
- }
- QTranslator exampleWizardsTranslator;
-
- exampleWizardsTranslator.load(exampleWizardsTranslation, ":/translations" );
- app.installTranslator(&exampleWizardsTranslator);
-
+ HbTranslator *translator = new HbTranslator("/resource/qt/translations/","firsttimesetup");
+
FtuFirstTimeUse ftuFirstTimeUse;
#ifdef ROM
QDir::setCurrent("Z:/");
@@ -76,5 +54,6 @@
QDEBUG("FTU::FtuFirstTimeUse::main");
//Work around to make sure that ftu exits
User::Exit(0);
+ delete translator;
return ret;
}
--- a/stateproviders/ftustateprovider/ftustateprovider.pri Tue Jul 06 14:06:30 2010 +0300
+++ b/stateproviders/ftustateprovider/ftustateprovider.pri Wed Aug 18 09:39:42 2010 +0300
@@ -18,3 +18,5 @@
SOURCES += ./src/*.cpp
RESOURCES += resources/resources.qrc
+
+DOCML += resources/ftustateprovider.docml
--- a/stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h Tue Jul 06 14:06:30 2010 +0300
+++ b/stateproviders/ftustateprovider/inc/ftuwizardactivatedstate.h Wed Aug 18 09:39:42 2010 +0300
@@ -37,6 +37,7 @@
class FtuContentService;
class FtuWizard;
class HbMenu;
+class HbTranslator;
/** @ingroup group_ftustateprovider
* @brief The state handles wizard activation and interaction.
@@ -200,6 +201,7 @@
*/
QGraphicsWidget* mCurrentView;
+ HbTranslator *mTranslator;
FTU_TEST_FRIEND_CLASS(FtuStateProviderTest)
};
--- a/stateproviders/ftustateprovider/inc/ftuwizardmenustate.h Tue Jul 06 14:06:30 2010 +0300
+++ b/stateproviders/ftustateprovider/inc/ftuwizardmenustate.h Wed Aug 18 09:39:42 2010 +0300
@@ -37,6 +37,7 @@
class HbAction;
class FtuStateCenrepHandler;
class HbMenu;
+class HbTranslator;
/** @ingroup group_ftustateprovider
* @brief The state where wizard menu is shown
@@ -144,7 +145,7 @@
FtuStateCenrepHandler* mCenrepHandler;
QList<bool> mCompletedWizardList;
-
+ HbTranslator *mTranslator;
FTU_TEST_FRIEND_CLASS(FtuStateProviderTest)
};
--- a/stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp Tue Jul 06 14:06:30 2010 +0300
+++ b/stateproviders/ftustateprovider/src/ftuwizardactivatedstate.cpp Wed Aug 18 09:39:42 2010 +0300
@@ -36,6 +36,7 @@
#include <QGraphicsWidget>
#include <QDir>
#include <hbmenu.h>
+#include <HbTranslator>
const char *FTUSTATEPROVIDER_DOCML2 = ":/xml/ftustateprovider.docml";
@@ -68,12 +69,13 @@
mWizardStackedWidget(NULL),
mBackAction(NULL),
mPreviousView(NULL),
- mCurrentView(NULL)
+ mCurrentView(NULL),
+ mTranslator(NULL)
{
mMainWindow = hbInstance->allMainWindows().at(0);
mDocumentLoader = new HbDocumentLoader();
mPluginView = new HbView();
-
+ mTranslator = new HbTranslator("/resource/qt/translations/","firsttimesetup");
bool ok = false;
mDocumentLoader->load(FTUSTATEPROVIDER_DOCML2, &ok);
QGraphicsWidget *widget = mDocumentLoader->findWidget(WIZARD_VIEW);
@@ -82,7 +84,7 @@
mPluginView->setWidget(widget);
mMainWindow->addView(mPluginView);
- mPluginView->setTitle(qtTrId("txt_ftu_title_setup"));
+ mPluginView->setTitle(hbTrId("txt_ftu_title_setup"));
mPluginTitleLabel = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(WIZARD_INFOTEXT_LABEL));
@@ -106,6 +108,10 @@
{
delete mBackAction;
}
+ if(mTranslator){
+ delete mTranslator;
+ mTranslator = NULL;
+ }
}
// ---------------------------------------------------------------------------
--- a/stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp Tue Jul 06 14:06:30 2010 +0300
+++ b/stateproviders/ftustateprovider/src/ftuwizardmenustate.cpp Wed Aug 18 09:39:42 2010 +0300
@@ -27,6 +27,7 @@
#include <hbinstance.h>
#include <hblistview.h>
#include <hbdocumentloader.h>
+#include <HbTranslator>
#include <QStandardItemModel>
#include <QDate>
@@ -55,11 +56,12 @@
mInfoText(NULL),
mListView(NULL),
mDocumentLoader(NULL),
- mModel(NULL)
+ mModel(NULL),
+ mTranslator(NULL)
{
mMainWindow = hbInstance->allMainWindows().at(0);
mModel = new QStandardItemModel(this);
-
+ mTranslator = new HbTranslator("/resource/qt/translations/","firsttimesetup");
mDocumentLoader = new HbDocumentLoader();
bool ok = false;
mDocumentLoader->load(FTUSTATEPROVIDER_DOCML, &ok);
@@ -67,7 +69,7 @@
Q_ASSERT_X(ok && (widget != 0), "ftustateprovider", "invalid DocML file");
mTocView = qobject_cast<HbView*>(widget);
- mTocView->setTitle(qtTrId("txt_long_caption_FTU_widget"));
+ mTocView->setTitle(hbTrId("txt_long_caption_FTU_widget"));
mMainWindow->addView(mTocView);
// Set as initial view.
@@ -92,6 +94,10 @@
}
delete mDocumentLoader;
delete mCenrepHandler;
+ if(mTranslator){
+ delete mTranslator;
+ mTranslator = NULL;
+ }
}
// ---------------------------------------------------------------------------
@@ -232,7 +238,7 @@
void FtuWizardMenuState::createInfoText()
{
mInfoText = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(TOC_INFOTEXT_LABEL));
- mInfoText->setPlainText(qtTrId("txt_ftu_subhead_select_setting_you_want_to_edit"));
+ mInfoText->setPlainText(hbTrId("txt_ftu_subhead_select_setting_you_want_to_edit"));
}
// ---------------------------------------------------------------------------
@@ -278,14 +284,14 @@
QList<QVariant> iconList;
HbIcon icon (wizards[index]->wizardSettings().mTocDefaultIcon.filePath());
iconList.append(icon);
- HbIcon rightIcon(QString(qtTrId("qtg_small_tick")));
+ HbIcon rightIcon(QString("qtg_small_tick"));
if(progress < progressCompelete)
{
QString progressStr;
QString progressNumber;
progressNumber.setNum(progress);
- progressStr = qtTrId("txt_ftu_list_progress_status").arg(progressNumber);
+ progressStr = hbTrId("txt_ftu_list_progress_status").arg(progressNumber);
data << progressStr;
}
else