Пример #1
0
/**
Test case for DEF087773: ECOM ValidateRegistry checks for existence of RSC file only

@SYMTestCaseID			SYSLIB-ECOM-CT-0655
@SYMTestCaseDesc		Checks for existence of resource files for different downgrade paths
@SYMTestPriority			high
@SYMTestActions			Data driven tests.
						Create different sets of language dependant resource file on "C"
						Drive and verify the ECom discovery process
@SYMTestExpectedResults The test must not fail.
@SYMDEF					DEF087773
*/
void REComLanguagePluginTest::StaticRunTestsL()
	{
	TEST.Next(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-0655 "));
	TInt numberOfElements = sizeof(LangTestData)/sizeof(TLangTestEntry);

	TUid ifUid={0x10009DB9};
	for(TInt i = 0; i < numberOfElements; i++)
		{
		// kill ecom server so that language downgrade changes are picked up
		ECOMTU_KILL_SERVER_L(TEST);

		// Prepare test
        #ifndef SYMBIAN_DISTINCT_LOCALE_MODEL
		SetLanguage(*(LangTestData[i].localeFile), LangTestData[i].downgradePathSetup);
        #else
		SetLanguage(*(LangTestData[i].lang),*(LangTestData[i].region),*(LangTestData[i].collation),LangTestData[i].downgradePathSetup);
        #endif
		
		CopyFiles(i);

		// 1st boot
		TEST.Printf(_L("\tLanguage Plugin Test %d - 1st boot \n"), i);
		DoCheckL(i,ifUid, EDriveC );

		// kill ecom server for second boot
		ECOMTU_KILL_SERVER_L(TEST);

		// 2nd boot
		TEST.Printf(_L("\tLanguage Plugin Test %d - 2nd boot \n"), i);
		DoCheckL(i, ifUid, EDriveC);

		DeleteFiles(i);
		WAIT_FOR3s;
		}
	}
Пример #2
0
void GUI::SetMeta(){
	// Disable logging
	EnableLogging(false);
	// Enable tooltips
	ConfigTooltips(1000, 5000, 0, 200);
	// Load configuration settings
	Config::Load();
	// Set language to display
	SetLanguage(wxLANGUAGE_ENGLISH);
	wxString *language = Config::Language();
	for(unsigned char cur_lang = wxLANGUAGE_ABKHAZIAN; cur_lang <= wxLANGUAGE_ZULU; cur_lang++)
		if(*language == wxLocale::GetLanguageName(cur_lang)){
			SetLanguage(static_cast<wxLanguage>(cur_lang));
			break;
		}
}
Пример #3
0
void MainWindow::LoadSettings()
{

    if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool())
    {
        showMaximized();
    }
    else
    {
        resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
               mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
    }


    mUI.mActionShowAll->setChecked(mSettings->value(SETTINGS_SHOW_ALL, true).toBool());
    mUI.mActionShowStyle->setChecked(mSettings->value(SETTINGS_SHOW_STYLE, true).toBool());
    mUI.mActionShowAllStyle->setChecked(mSettings->value(SETTINGS_SHOW_ALL_STYLE, true).toBool());
    mUI.mActionShowErrors->setChecked(mSettings->value(SETTINGS_SHOW_ERRORS, true).toBool());


    mUI.mResults->ShowResults(SHOW_ALL, mUI.mActionShowAll->isChecked());
    mUI.mResults->ShowResults(SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
    mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked());
    mUI.mResults->ShowResults(SHOW_ALL_STYLE, mUI.mActionShowAllStyle->isChecked());

    mUI.mActionToolbar->setChecked(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());
    mUI.mToolBar->setVisible(mSettings->value(SETTINGS_TOOLBARS_SHOW, true).toBool());

    mApplications->LoadSettings(mSettings);

    SetLanguage(mSettings->value(SETTINGS_LANGUAGE, mTranslation->SuggestLanguage()).toInt());
}
Пример #4
0
void Puzzle::Init()
{
    SetLanguage(lang);
    SetDefaultCharset(CHARSET_UTF8);
    menu.Set(THISBACK(MainMenu));
    Status();
}
Пример #5
0
//********************************************************************
Bool Static_MakeText(
			Handle hObject,
			long reason	// См. enum BROWSE_REASON
			)
{
// В конце вызывается WordControl

	switch(reason)
		{
		case BROWSE_CHAR:
			// Символ
			// Установить язык
			{
			long lang = CED_GetCharFontLang(hObject);
			if (lang != gLanguage)
				SetLanguage(lang);
			}

			// Записать символ
			ONE_CHAR(hObject);
			break;

		case BROWSE_LINE_END:
			// Конец строки
			if ( 0 ||
				gFormat==ROUT_FMT_SmartText ||
				( gPreserveLineBreaks || gEdLineHardBreak)
				)
				NEW_LINE;
			break;

		case BROWSE_PARAGRAPH_END:
			// Конец абзаца
			NEW_LINE;
			break;

		case BROWSE_TABLE_START:
			// Начало таблицы

			// Включить таблицу в текст страницы
			if (gTableTextOptions & ROUT_TABLE_TEXT_INCLUDED)
				{if (!IncludeTable()) return FALSE;}
			else
				// Обозначить место таблицы в тексте страницы
				{if (!TableStub()) return FALSE;}

			break;

		case BROWSE_TABLE_END:
			// Конец таблицы
			NEW_LINE;
			break;

		}

	// Слежение за словами и строками
	WORDS_CONTROL(reason);

	return TRUE;	// Продолжить просмотр
}
Пример #6
0
bool Settings::LoadSettings()
////////////////////////////////////////////////////////////////////////
{
	#define GETSTRING(a,b) if (settingsfile.GetString(a, tempstring)) Set##b(tempstring);
	#define GETBOOL(a,b) if (settingsfile.GetBool(a, tempbool)) Set##b(tempbool);
	#define GETINT(a,b) if (settingsfile.GetInteger(a, tempint)) Set##b(tempint);

	BString tempstring;
	bool tempbool;
	int tempint;
	
	DataFile settingsfile;
	if (settingsfile.LoadDataFile(GetSettingsFile()))
	{
		if (settingsfile.GetBool("ASKONEXIT", tempbool))
			SetAskOnExit(tempbool);
		if (settingsfile.GetString("LANGUAGE", tempstring))
			SetLanguage(tempstring);
		if (settingsfile.GetInteger("WINDOWLEFT", tempint))
			SetWindowLeft(tempint);
		GETINT("WINDOWTOP", WindowTop);
		GETINT("WINDOWWIDTH", WindowWidth);
		GETINT("WINDOWHEIGHT", WindowHeight);
		GETSTRING("TERMINALWINDOW", TerminalWindow);
		
		GETSTRING("LEFTPANELPATH", LeftPanelPath);
		GETSTRING("RIGHTPANELPATH", RightPanelPath);
		
		return true;		
	}
	else
		return false;
}
Пример #7
0
void KPstateSelectLanguage::MouseClick(KPstateContext *pContext,
                                       MouseButton button,
                                       MouseButtonEvent event,
                                       int x, int y)
{
    auto signal = KPstate::EvaluateMouseClick(pContext, button, event, x, y);

    switch (signal)
    {
        case Signal::Back:
            pContext->ChangeState(pContext->GetPreviousState());
            return;

        default:
            break;
    }

    const auto idsToStrings = GetLanguageList(pContext);

    for (auto &item : idsToStrings)
    {
        auto id = static_cast<std::size_t>(item.first);
        auto signalSelectLanguage = static_cast<Signal>(id);

        if (signal == signalSelectLanguage)
        {
            SetLanguage(pContext, signal);
            pContext->ChangeState(StateId::MainMenu);
            return;
        }
    }
}
Пример #8
0
void MainWindow::LoadSettings()
{
    if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool())
    {
        showMaximized();
    }
    else
    {
        resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
               mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
    }

    mUI.mActionShowStyle->setChecked(mSettings->value(SETTINGS_SHOW_STYLE, true).toBool());
    mUI.mActionShowErrors->setChecked(mSettings->value(SETTINGS_SHOW_ERRORS, true).toBool());
    mUI.mActionShowWarnings->setChecked(mSettings->value(SETTINGS_SHOW_WARNINGS, true).toBool());
    mUI.mActionShowPortability->setChecked(mSettings->value(SETTINGS_SHOW_PORTABILITY, true).toBool());
    mUI.mActionShowPerformance->setChecked(mSettings->value(SETTINGS_SHOW_PERFORMANCE, true).toBool());
    mUI.mActionShowInformation->setChecked(mSettings->value(SETTINGS_SHOW_INFORMATION, true).toBool());

    mUI.mResults->ShowResults(SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
    mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked());

    mUI.mActionToolBarMain->setChecked(mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool());
    mUI.mToolBarMain->setVisible(mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool());
    mUI.mToolBarView->setVisible(mSettings->value(SETTINGS_TOOLBARS_VIEW_SHOW, true).toBool());

    mApplications->LoadSettings(mSettings);

    SetLanguage(mSettings->value(SETTINGS_LANGUAGE, mTranslation->SuggestLanguage()).toInt());
}
Пример #9
0
SystemEngine::SystemEngine()
{
    IF_PRINT_DEBUG(SYSTEM_DEBUG) << "constructor invoked" << std::endl;

    _not_done = true;
    SetLanguage("en@quot"); //Default language is English
}
Пример #10
0
LANGID Translations::SetDefaultLanguage()
{
    auto languageResource = GetLanguageResourceByLocaleID(GetUserDefaultUILanguage());

    // Try to set the language resource but don't fail if it can't be loaded
    // English will we used instead in case of error
    return SetLanguage(languageResource, false) ? languageResource.localeID : 0;
}
Пример #11
0
void MainWindow::LoadSettings()
{
    // Window/dialog sizes
    if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool())
    {
        showMaximized();
    }
    else
    {
        resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
               mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
    }

    // Show * states
    mUI.mActionShowStyle->setChecked(mSettings->value(SETTINGS_SHOW_STYLE, true).toBool());
    mUI.mActionShowErrors->setChecked(mSettings->value(SETTINGS_SHOW_ERRORS, true).toBool());
    mUI.mActionShowWarnings->setChecked(mSettings->value(SETTINGS_SHOW_WARNINGS, true).toBool());
    mUI.mActionShowPortability->setChecked(mSettings->value(SETTINGS_SHOW_PORTABILITY, true).toBool());
    mUI.mActionShowPerformance->setChecked(mSettings->value(SETTINGS_SHOW_PERFORMANCE, true).toBool());
    mUI.mActionShowInformation->setChecked(mSettings->value(SETTINGS_SHOW_INFORMATION, true).toBool());

    mUI.mResults->ShowResults(SHOW_ERRORS, mUI.mActionShowErrors->isChecked());
    mUI.mResults->ShowResults(SHOW_STYLE, mUI.mActionShowStyle->isChecked());

    // Main window settings
    const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
    mUI.mActionToolBarMain->setChecked(showMainToolbar);
    mUI.mToolBarMain->setVisible(showMainToolbar);

    const bool showViewToolbar = mSettings->value(SETTINGS_TOOLBARS_VIEW_SHOW, true).toBool();
    mUI.mActionToolBarView->setChecked(showViewToolbar);
    mUI.mToolBarView->setVisible(showViewToolbar);

    const bool showFilterToolbar = mSettings->value(SETTINGS_TOOLBARS_FILTER_SHOW, true).toBool();
    mUI.mActionToolBarFilter->setChecked(showFilterToolbar);
    mUI.mToolBarFilter->setVisible(showFilterToolbar);

    SetLanguage(mSettings->value(SETTINGS_LANGUAGE, mTranslation->SuggestLanguage()).toString());

    bool succeeded = mApplications->LoadSettings();
    if (!succeeded)
    {
        QString msg = tr("There was a problem with loading the editor application settings.\n\n"
                         "This is probably because the settings were changed between the Cppcheck versions. "
                         "Please check (and fix) the editor application settings, otherwise the editor "
                         "program might not start correctly.");
        QMessageBox msgBox(QMessageBox::Warning,
                           tr("Cppcheck"),
                           msg,
                           QMessageBox::Ok,
                           this);
        msgBox.exec();

    }

}
Пример #12
0
void MainWindow::LoadSettings()
{
    // Window/dialog sizes
    if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool()) {
        showMaximized();
    } else {
        resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
               mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
    }

    ShowTypes *types = mUI.mResults->GetShowTypes();
    mUI.mActionShowStyle->setChecked(types->isShown(ShowTypes::ShowStyle));
    mUI.mActionShowErrors->setChecked(types->isShown(ShowTypes::ShowErrors));
    mUI.mActionShowWarnings->setChecked(types->isShown(ShowTypes::ShowWarnings));
    mUI.mActionShowPortability->setChecked(types->isShown(ShowTypes::ShowPortability));
    mUI.mActionShowPerformance->setChecked(types->isShown(ShowTypes::ShowPerformance));
    mUI.mActionShowInformation->setChecked(types->isShown(ShowTypes::ShowInformation));

    const bool stdCpp11 = mSettings->value(SETTINGS_STD_CPP11, false).toBool();
    mUI.mActionCplusplus11->setChecked(stdCpp11);
    const bool stdC99 = mSettings->value(SETTINGS_STD_C99, false).toBool();
    mUI.mActionC99->setChecked(stdC99);
    const bool stdPosix = mSettings->value(SETTINGS_STD_POSIX, false).toBool();
    mUI.mActionPosix->setChecked(stdPosix);

    // Main window settings
    const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
    mUI.mActionToolBarMain->setChecked(showMainToolbar);
    mUI.mToolBarMain->setVisible(showMainToolbar);

    const bool showViewToolbar = mSettings->value(SETTINGS_TOOLBARS_VIEW_SHOW, true).toBool();
    mUI.mActionToolBarView->setChecked(showViewToolbar);
    mUI.mToolBarView->setVisible(showViewToolbar);

    const bool showFilterToolbar = mSettings->value(SETTINGS_TOOLBARS_FILTER_SHOW, true).toBool();
    mUI.mActionToolBarFilter->setChecked(showFilterToolbar);
    mUI.mToolBarFilter->setVisible(showFilterToolbar);

    SetLanguage(mSettings->value(SETTINGS_LANGUAGE, mTranslation->SuggestLanguage()).toString());

    bool succeeded = mApplications->LoadSettings();
    if (!succeeded) {
        const QString msg = tr("There was a problem with loading the editor application settings.\n\n"
                               "This is probably because the settings were changed between the Cppcheck versions. "
                               "Please check (and fix) the editor application settings, otherwise the editor "
                               "program might not start correctly.");
        QMessageBox msgBox(QMessageBox::Warning,
                           tr("Cppcheck"),
                           msg,
                           QMessageBox::Ok,
                           this);
        msgBox.exec();

    }

}
Пример #13
0
j2::j2() {
	qtfx = "Joachim [@4 Green text]{@40}.1&";	
	CtrlLayout(*this, "Joachim 0.1");
	SetLanguage( LNG_('D','E','D','E') );
	SetDefaultCharset(CHARSET_UTF8);
    e.SetQTF(qtfx);
    mbu <<= THISBACK(Quit);
    a <<  THISBACK(DragEnter);  	
    a <<  THISBACK(GotFocus);  	
}
Пример #14
0
	bool DescribeProcessRequest::Create(rude::CGI& cgi)
	{
		const char* val = NULL;
		SetVersion(cgi["version"]);
		SetUser(cgi["user"]);

		SetLanguage(cgi["language"]);
		SetIdentifiers(cgi["identifier"]);
		return true;
	}
Пример #15
0
void CLanguage::Init( const CUString& strLanguageDir, const CUString& strLanguage )
{
    m_strLanguageDir = strLanguageDir;

    // remove all vector elements
    m_vLangFiles.clear();

    SearchLanguageFiles( );

    SetLanguage( strLanguage );
}
Пример #16
0
/**
Test case for CR0209: Enable Dynamic Language Switching in ECOM

@SYMTestCaseID			SYSLIB-ECOM-CT-3169
@SYMTestCaseDesc		Checks for picking up correct resource files for different downgrade paths in running time
@SYMTestPriority		high
@SYMTestActions			Data driven tests.
						Start up Ecom server
						Create different sets of language dependant resource file on "C" on running time.
						Drive and verify the ECom discovery process
@SYMTestExpectedResults The test must not fail.
@SYMDEF					CR0209
*/
void REComLanguagePluginTest::DynamicRunTestsOnCL()
	{
	TEST.Next(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-3169 "));
	TInt numberOfElements = sizeof(LangTestData)/sizeof(TLangTestEntry);

	RImplInfoPtrArray implArray;
	TUid ifUid={0x10009DB9};

	//start up ecom server
	REComSession::ListImplementationsL(ifUid, implArray);

	for(TInt i = 0; i < numberOfElements; i++)
		{

		// Prepare test
		CopyFiles(i);

        #ifndef SYMBIAN_DISTINCT_LOCALE_MODEL
        SetLanguage(*(LangTestData[i].localeFile), LangTestData[i].downgradePathSetup);
        #else
        SetLanguage(*(LangTestData[i].lang),*(LangTestData[i].region),*(LangTestData[i].collation),LangTestData[i].downgradePathSetup);
        #endif
		WAIT_FOR3s;

		TEST.Printf(_L("\tLanguage Plugin Test %d - Dynamic switch on C \n"), i);
		DoCheckL(i,ifUid, EDriveC);

		DeleteFiles(i);
		WAIT_FOR3s;
		implArray.ResetAndDestroy();

		}

	// Post test clean up
	REComSession::FinalClose();
	implArray.ResetAndDestroy();

	//kill ecomserver after finishing test
	ECOMTU_KILL_SERVER_L(TEST);

	}
Пример #17
0
CXmlConfig::CXmlConfig(CString strConfigFile):m_strLanguageCode(_T("0x0409")),m_bKnownLanguage(TRUE)
{
	if(!FindFirstFileExists((LPCTSTR)strConfigFile,FALSE))
	{
		HANDLE hFile = NULL;
		hFile = CreateFile(strConfigFile, READ_CONTROL, 0, NULL,
			CREATE_ALWAYS, 0, NULL);
		if (hFile != INVALID_HANDLE_VALUE)
		{
			CloseHandle(hFile);
		}
	}
	QueryDefaultLanguage();
	m_strConfigFile = strConfigFile;
	try
	{
		SetLanguage();	
		std::wifstream configFile(m_strConfigFile,ios_base::binary,_SH_SECURE);//以安全权限方式打开
		if(configFile)
		{
			//configFile.imbue(std::locale("CHS")); 
			file<TCHAR> fdoc(configFile);
			TCHAR* pConfigData = m_xmlDoc.allocate_string(fdoc.data());        // 分配字符串并将Config数据复制进去
			m_xmlDoc.parse<0>(pConfigData); 
			locale::global(locale("C"));//还原全局区域设定
			m_xmlRoot = m_xmlDoc.first_node();	
			if(0 == m_xmlRoot)
			{
				m_xmlDoc.append_node(m_xmlDoc.allocate_node(rapidxml::node_pi,m_xmlDoc.allocate_string(_T("xml version='1.0' encoding='utf-8'"))));
				m_xmlRoot =   m_xmlDoc.allocate_node(node_element,_T("config"),_T(""));  
				m_xmlDoc.append_node(m_xmlRoot);
			}
			configFile.close();
		}
		else
		{
			locale::global(locale("C"));//还原全局区域设定
			//LOGEX_FATAL(_T("cannot open file: ") + m_strConfigFile);
			throw runtime_error(string("cannot open file ")/* + filename*/);
		}
	}
	catch(...)
	{
		locale::global(locale("C"));//还原全局区域设定
		//LOGEX_FATAL(_T("error reading stream. "));
		throw runtime_error("error reading stream.");
	}


   locale::global(locale(""));
   //LOG_INFO(_T("ANSI CodePage: %d"), GetACP());
  // LOG_INFO(_T("SystemDefaultLangID: 0x%04x"), GetSystemDefaultLangID());
}
Пример #18
0
StateId KPstateSelectLanguage::ESCKeyAction(KPstateContext *pContext) const
{
    if (pContext->GetConfig().Language)
    {
        return pContext->GetMenu().RestoreLastStateId();
    }
    else
    {
        // Default: Set Language to "English"
        SetLanguage(pContext, Signal::SelectEnglish);
        return StateId::MainMenu;
    }
}
Пример #19
0
void CMainFrame::_loadSettings()
{
	QSettings settings(QSettings::IniFormat, QSettings::UserScope, "ATools", "SfxEditor");
	if (settings.status() == QSettings::NoError)
	{
		if (settings.contains("BackgroundColor"))
			g_global3D.backgroundColor = settings.value("BackgroundColor").toUInt();
		if (settings.contains("ShowGrid"))
		{
			g_global3D.grid = settings.value("ShowGrid").toBool();
			ui.actionGrille->setChecked(g_global3D.grid);
		}
		if (settings.contains("WindowGeometry"))
		{
			restoreGeometry(settings.value("WindowGeometry").toByteArray());
			if (isFullScreen())
				ui.actionPlein_cran->setChecked(true);
		}
		if (settings.contains("WindowState"))
			restoreState(settings.value("WindowState").toByteArray());
		if (settings.contains("Language"))
		{
			switch (settings.value("Language").toInt())
			{
			case LANG_ENG:
				ui.actionEnglish->setChecked(true);
				SetLanguage(ui.actionEnglish);
				break;
			case LANG_GER:
				ui.actionDeutsch->setChecked(true);
				SetLanguage(ui.actionDeutsch);
				break;
			}
		}

		if (m_modelViewer && !m_modelViewer->IsAutoRefresh())
			m_modelViewer->RenderEnvironment();
	}
}
Пример #20
0
void Settings::SetDefaults()
////////////////////////////////////////////////////////////////////////
{
	SetAskOnExit(false);
	SetLanguage("English");
	SetWindowLeft(100);
	SetWindowTop(100);
	SetWindowWidth(600);
	SetWindowHeight(400);
	SetLeftPanelPath("/");
	SetRightPanelPath("/");
	SetTerminalWindow("Genesis Terminal");
}
Пример #21
0
/**
Test case for CR0209: Enable Dynamic Language Switching in ECOM on Z: drive

@SYMTestCaseID			SYSLIB-ECOM-CT-3170
@SYMTestCaseDesc		Checks for picking up correct resource files for different downgrade paths in running time.
@SYMTestPriority		high
@SYMTestActions			Data driven tests.
						Start up Ecom server
						Change languae downgrade path on running time.
						Drive and verify the ECom discovery process.
@SYMTestExpectedResults The test must not fail.
@SYMDEF					CR0209
*/
void REComLanguagePluginTest::DynamicRunTestsOnZL()
	{
	TEST.Next(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-3170 "));
	TInt numberOfElements = sizeof(LangTestData2)/sizeof(TLangTestEntry2);

	//Interface ID in a DLL existing on Z: Drive
	TUid ifUid={0x10009DE1};

	//start up ecom server
	RImplInfoPtrArray implArray;
	REComSession::ListImplementationsL(ifUid, implArray);
	WAIT_FOR3s;

	for(TInt i = 0; i < numberOfElements; i++)
		{

		// Prepare test
        #ifndef SYMBIAN_DISTINCT_LOCALE_MODEL
        SetLanguage(*(LangTestData2[i].localeFile), LangTestData2[i].downgradePathSetup);
        #else
        SetLanguage(*(LangTestData2[i].lang),*(LangTestData2[i].region),*(LangTestData2[i].collation),LangTestData2[i].downgradePathSetup);
        #endif
		WAIT_FOR3s;

		// Dynamic language downgrade path changing
		TEST.Printf(_L("\tLanguage Plugin Test %d - Dynamic switch on Z \n"), i);
		DoCheckL(i,ifUid, EDriveZ);
		implArray.ResetAndDestroy();

		}

	// Post test clean up
	REComSession::FinalClose();
	implArray.ResetAndDestroy();

	}
Пример #22
0
BOOL OpSpellUiSessionImpl::SetLanguage(const uni_char *lang)
{
	if (!IsValid())
		return FALSE;

	OpString preferred_lang;
	SpellUIHandler *handler = g_spell_ui_data->GetSpellUIHandler();
	if (lang && !uni_strcmp(lang, UNI_L("default")))
	{
		BOOL found = FALSE;
		if (handler->GetPreferredLanguage(preferred_lang))
		{
			if (g_internal_spellcheck->GetOpSpellCheckerLanguage(preferred_lang.CStr()))
			{
				lang = preferred_lang.CStr();
				found = TRUE;
			}
		}

		if (!found && g_internal_spellcheck->GetDefaultLanguage())
		{
			lang = g_internal_spellcheck->GetDefaultLanguage();
			found = TRUE;
		}
		if (!found)
			return FALSE;
	}

	if (!lang || !*lang)
	{
		if (handler->GetSpellCheckerSession())
		{
			handler->DisableSpellcheck();
			return TRUE;
		}
		return FALSE;
	}
	if (handler->GetSpellCheckerSession())
	{
		if (!uni_strcmp(handler->GetSpellCheckerSession()->GetLanguageString(), lang))
			return TRUE; // we already use this lanugage...
		SetLanguage(NULL);
	}
	g_spell_ui_data->InvalidateData();
	return handler->SetSpellCheckLanguage(lang);
}
Пример #23
0
Threads::Threads()
	: threads(0)
	, area(-2.0,-1.1, 0.60, 1.1)
	, densityR (1)
	, densityC (1)
	, rows (1)
	, cols (1)
	, julia_c(Complex(-0.4,0.6))
	, posOnClick(0,0)
	, moveShift(0,0)
	, moving(false)
{
	SetLanguage(SetLNGCharset(GetSystemLNG(), CHARSET_UTF8));
	CtrlLayout(*this, t_("Threads"));
	inp_col.SetData(4);
	inp_row.SetData(3);
	inp_iter.SetData(500);
	inp_threads.SetData(3);
	edb_re.SetData(-0.4);
	edb_im.SetData(0.6);
	AddFrame(statusBar);
	
	statusBar.AddFrame(time.Right(140));
	
	BackPaint();
	Zoomable().Sizeable();
	picbox.onPaint = callback(this, &Threads::picbox_Paint);
	picbox.onLeftDown = callback(this, &Threads::picbox_LeftDown);
	picbox.onLeftUp = callback(this, &Threads::picbox_LeftUp);
	picbox.onMouseMove= callback(this, &Threads::picbox_MouseMove);
	
	cbx_fractal_set.Add( t_("Mandelbrot"));
	cbx_fractal_set.Add( t_("Qubic Mandelbrot"));
	cbx_fractal_set.Add( t_("Quadric Mandelbrot"));
	cbx_fractal_set.Add( t_("Julia Set"));
	cbx_fractal_set.Add( t_("Qubic Julia Set"));
	cbx_fractal_set.Add( t_("Quadric Julia Set"));
	cbx_fractal_set.Add( t_("Phoenix Set"));
	cbx_fractal_set.Add( t_("BacPhoenix Set"));
	cbx_fractal_set.Add( t_("Bać Set - my own :) discovered by mistake..."));
	
	cbx_fractal_set.WhenAction = THISBACK(SetSelected);
	btn_recalculate.WhenAction = THISBACK(DoJob);
	cbx_fractal_set.SetIndex(0);
}
Пример #24
0
CAlmanacDiagramCtrl::CAlmanacDiagramCtrl()
{
	CString str = _T("ESWN");
	SetLanguage(str);

	LOGFONT logFont;
	memset(&logFont, 0, sizeof(LOGFONT));
	logFont.lfCharSet	= DEFAULT_CHARSET;
	logFont.lfUnderline = FALSE;
	logFont.lfHeight = 15;
	m_TextFont.CreateFontIndirect(&logFont);
	logFont.lfHeight = 12;
	m_StarFont.CreateFontIndirect(&logFont);
	m_LinePen.CreatePen(PS_SOLID, 2, RGB(200, 200, 200));

	m_hSigStrong = AfxGetApp()->LoadIcon(IDI_ICON_GPS_STRONG);
	m_hSigWeak = AfxGetApp()->LoadIcon(IDI_ICON_GPS_WEAK);
}
Пример #25
0
int zkd_main (int scorelimit, int timelimit, const char* ciphertext)
{
    LoadStringMessage(ciphertext);

    srand(time(0));

    /*setup directories*/

    StopSolve();

    memset(&siSolveInfo,0,sizeof(SOLVEINFO));
    siSolveInfo.ioc_weight=siSolveInfo.ent_weight=siSolveInfo.chi_weight=5;
    siSolveInfo.dioc_weight=0;
    siSolveInfo.max_tabu=300;
    siSolveInfo.swaps=5;
    siSolveInfo.max_tol=40;
    siSolveInfo.disp_all=DispAll;
    siSolveInfo.disp_info=DispInfo;

    sprintf(siSolveInfo.log_name,"/%s","log.txt");
    siSolveInfo.optima_tabu=&tabu_list;
    SetInfo(&siSolveInfo);
    Reset();
	
	siSolveInfo.time_limit = timelimit;
	siSolveInfo.score_limit = scorelimit;
	siSolveInfo.iteration_limit = -1;

    //language
    iLang=0;
    SetLanguage();


    //sovle parameters
    message.SetBlockSize(1);

    //SetSolveTypeFeatures();

    InitKey();

    Solve();
    
    return siSolveInfo.best_score;
}
	ERMsg CBioSIMModelBase::FinaliseInit()
	{
		ERMsg msg;

		SetLanguage(m_info.m_language);//Set global language variable

		if ((NB_INPUT_PARAMETER == -1 || m_info.m_inputParameters.size() == NB_INPUT_PARAMETER))
		{
			//process parameters
			msg += ProcessParameters(m_info.m_inputParameters);
		}
		else
		{
			//the number of input parameters in the model is incorrect
			msg = GetErrorMessage(ERROR_BAD_NUMBER_PARAMETER);
		}

		return msg;
	}
Пример #27
0
void Localization::SetLanguage(const QString& language)
{
    if (language.isEmpty())
    {
        URHO3D_LOGWARNING("Localization::SetLanguage(language): language name is empty");
        return;
    }
    if (GetNumLanguages() == 0)
    {
        URHO3D_LOGWARNING("Localization::SetLanguage(language): no loaded languages");
        return;
    }
    int index = GetLanguageIndex(language);
    if (index == -1)
    {
        URHO3D_LOGWARNING("Localization::SetLanguage(language): language not found");
        return;
    }
    SetLanguage(index);
}
Пример #28
0
bool CXmlConfig::FlushData()
{
   // Use Writing Lock to queue FlushData invokings in the same process,
   // to avoid open file failure caused by FlushData function being invoked 
   // in multiple threads at the same time. 
   // [HLZHU 2013-07-01]
   LockToWrite();
	try
	{
		SetLanguage();	
		std::wofstream configFile(m_strConfigFile,ios_base::out,_SH_DENYRW);//以独占读写权限方式打开 
		if(configFile)
		{
		//	configFile.imbue(std::locale("CHS")); 
			configFile << m_xmlDoc;
			locale::global(locale("C"));//还原全局区域设定
			configFile.close();
		}
		else
		{
			locale::global(locale("C"));//还原全局区域设定
			//LOGEX_FATAL(_T("cannot open file: %s to write."), m_strConfigFile);
			UnLock();
         return false;
		}
	}
	catch(...)
	{
		locale::global(locale("C"));//还原全局区域设定
		//LOGEX_FATAL(_T("write file: %s exception."), m_strConfigFile);
		UnLock();
      return false;
	}

   UnLock();
	return true;
}
Пример #29
0
bool GCBanner::Load( const U8Archive &GCBannArc )
{
	// read layout data
	const u8 *brlytFile = GCBannArc.GetFile("/arc/blyt/my_GCTop_a.brlyt");
	if( !brlytFile )
		return false;

	if(!Layout::Load(brlytFile))
		return false;

	u32 length_start = 0, length_loop = 0;

	const u8 *brlan_loop = GCBannArc.GetFile("/arc/anim/my_GCTop_a_BackLoop.brlan");
	if (brlan_loop)
		length_loop = Animator::LoadAnimators((const RLAN_Header *)brlan_loop, *this, 1);

	LoadTextures(GCBannArc);
	SetLanguage("ENG");
	SetLoopStart(length_start);
	SetLoopEnd(length_start + length_loop);
	SetFrame(0);

	return true;
}
// -----------------------------------------------------------------------------
// CIAUpdateBGControllerFile::InternalizeL
//
// -----------------------------------------------------------------------------
//
void CIAUpdateBGControllerFile::InternalizeL( RReadStream& aStream )
    {
    // If you make changes here, 
    // remember to update ExternalizeL accordingly!!!

    TInt version( aStream.ReadInt32L() );

    // Notice! In the future, some checking maybe required here
    // to be sure that file version is correct and the data can be
    // internalized correctly between different versions.
    if ( version != KVersion )
        {
        // For now, just leave with the corrupt error.
        User::Leave( KErrCorrupt );
        }
	
    TInt64 refreshTime( 0 );
    aStream >> refreshTime;
    SetRefreshTime( refreshTime );
    
    TInt language( aStream.ReadInt32L() );
    // Static casting is safe to do here because enum and TInt are the same.
    SetLanguage( static_cast< TLanguage >( language ) );
    }