Ejemplo n.º 1
0
BOOL CPPgGeneral::OnApply()
{
	CString strNick;
	GetDlgItem(IDC_NICK)->GetWindowText(strNick);
	strNick.Trim();
	if (!IsValidEd2kString(strNick))
		strNick.Empty();
	if (strNick.IsEmpty())
	{
		strNick = DEFAULT_NICK;
		GetDlgItem(IDC_NICK)->SetWindowText(strNick);
	}
	thePrefs.SetUserNick(strNick);

	if (m_language.GetCurSel() != CB_ERR)
	{
		WORD wNewLang = (WORD)m_language.GetItemData(m_language.GetCurSel());
		if (thePrefs.GetLanguageID() != wNewLang)
		{
			thePrefs.SetLanguageID(wNewLang);
			thePrefs.SetLanguage();

#ifdef _DEBUG
			// Can't yet be switched on-the-fly, too much unresolved issues..
			if (thePrefs.GetRTLWindowsLayout())
			{
				ModifyAllWindowStyles(theApp.emuledlg, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				ModifyAllWindowStyles(theApp.emuledlg->preferenceswnd, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				theApp.DisableRTLWindowsLayout();
				thePrefs.m_bRTLWindowsLayout = false;
			}
#endif
			theApp.emuledlg->preferenceswnd->Localize();
			theApp.emuledlg->statisticswnd->CreateMyTree();
			theApp.emuledlg->statisticswnd->Localize();
			theApp.emuledlg->statisticswnd->ShowStatistics(true);
			theApp.emuledlg->serverwnd->Localize();
			theApp.emuledlg->transferwnd->Localize();
			theApp.emuledlg->transferwnd->UpdateCatTabTitles();
			theApp.emuledlg->searchwnd->Localize();
			theApp.emuledlg->sharedfileswnd->Localize();
			theApp.emuledlg->chatwnd->Localize();
			theApp.emuledlg->Localize();
			theApp.emuledlg->ircwnd->Localize();
			theApp.emuledlg->kademliawnd->Localize();
		}
	}

	thePrefs.startMinimized = IsDlgButtonChecked(IDC_STARTMIN)!=0;
	thePrefs.m_bAutoStart = IsDlgButtonChecked(IDC_STARTWIN)!=0;
	if( thePrefs.m_bAutoStart )
		AddAutoStart();
	else
		RemAutoStart();
	thePrefs.confirmExit = IsDlgButtonChecked(IDC_EXIT)!=0;
	thePrefs.splashscreen = IsDlgButtonChecked(IDC_SPLASHON)!=0;
	thePrefs.bringtoforeground = IsDlgButtonChecked(IDC_BRINGTOFOREGROUND)!=0;
	thePrefs.updatenotify = IsDlgButtonChecked(IDC_CHECK4UPDATE)!=0;
	thePrefs.onlineSig = IsDlgButtonChecked(IDC_ONLINESIG)!=0;
	thePrefs.versioncheckdays = ((CSliderCtrl*)GetDlgItem(IDC_CHECKDAYS))->GetPos();
	thePrefs.m_bEnableMiniMule = IsDlgButtonChecked(IDC_MINIMULE) != 0;
	thePrefs.m_bPreventStandby = IsDlgButtonChecked(IDC_PREVENTSTANDBY) != 0;

	LoadSettings();

	SetModified(FALSE);
	return CPropertyPage::OnApply();
}
Ejemplo n.º 2
0
BOOL CPPgGeneral::OnApply()
{

	// eF-Mod :: InvisibleMode
	CString sKey; 
	((CComboBox*)GetDlgItem(IDC_INVISIBLE_MODE_SELECT_COMBO))->GetLBText(((CComboBox*)GetDlgItem(IDC_INVISIBLE_MODE_SELECT_COMBO))->GetCurSel(), sKey); 
	if (IsDlgButtonChecked(IDC_INVISIBLE_MODE)!=0) 
		thePrefs.SetInvisibleMode(true,m_iActualKeyModifier,sKey[0]); 
	else 
		thePrefs.SetInvisibleMode(false,m_iActualKeyModifier,sKey[0]); 

	thePrefs.m_bStartInvisible = IsDlgButtonChecked(IDC_INVISIBLE_ONSTART)!=0;
	// eF-Mod end

	CString strNick;
	GetDlgItem(IDC_NICK)->GetWindowText(strNick);
	strNick.Trim();
	if (!IsValidEd2kString(strNick))
		strNick.Empty();
	if (strNick.IsEmpty())
	{
		strNick = DEFAULT_NICK;
		GetDlgItem(IDC_NICK)->SetWindowText(strNick);
	}
	thePrefs.SetUserNick(strNick);

	if (m_language.GetCurSel() != CB_ERR)
	{
		WORD wNewLang = (WORD)m_language.GetItemData(m_language.GetCurSel());
		if (thePrefs.GetLanguageID() != wNewLang)
		{
			thePrefs.SetLanguageID(wNewLang);
			thePrefs.SetLanguage();

#ifdef _DEBUG
			// Can't yet be switched on-the-fly, too much unresolved issues..
			if (thePrefs.GetRTLWindowsLayout())
			{
				ModifyAllWindowStyles(theApp.emuledlg, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				ModifyAllWindowStyles(theApp.emuledlg->preferenceswnd, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				theApp.DisableRTLWindowsLayout();
				thePrefs.m_bRTLWindowsLayout = false;
			}
#endif
			theApp.emuledlg->preferenceswnd->Localize();
			theApp.emuledlg->statisticswnd->CreateMyTree();
			theApp.emuledlg->statisticswnd->Localize();
			theApp.emuledlg->statisticswnd->ShowStatistics(true);
			theApp.emuledlg->serverwnd->Localize();
			theApp.emuledlg->transferwnd->Localize();
			theApp.emuledlg->transferwnd->UpdateCatTabTitles();
			theApp.emuledlg->searchwnd->Localize();
			theApp.emuledlg->sharedfileswnd->Localize();
			theApp.emuledlg->chatwnd->Localize();
			theApp.emuledlg->Localize();
			theApp.emuledlg->kademliawnd->Localize();
		}
	}

	thePrefs.startMinimized = IsDlgButtonChecked(IDC_STARTMIN)!=0;
	thePrefs.m_bAutoStart = IsDlgButtonChecked(IDC_STARTWIN)!=0;
	if( thePrefs.m_bAutoStart )
		AddAutoStart();
	else
		RemAutoStart();
	thePrefs.beepOnError = IsDlgButtonChecked(IDC_BEEPER)!=0;
	thePrefs.confirmExit = IsDlgButtonChecked(IDC_EXIT)!=0;
	thePrefs.splashscreen = IsDlgButtonChecked(IDC_SPLASHON)!=0;
	thePrefs.bringtoforeground = IsDlgButtonChecked(IDC_BRINGTOFOREGROUND)!=0;
	thePrefs.updatenotify = IsDlgButtonChecked(IDC_CHECK4UPDATE)!=0;
	thePrefs.onlineSig = IsDlgButtonChecked(IDC_ONLINESIG)!=0;
	thePrefs.versioncheckdays = ((CSliderCtrl*)GetDlgItem(IDC_CHECKDAYS))->GetPos();

	theApp.emuledlg->transferwnd->downloadlistctrl.SetStyle();
	LoadSettings();

	SetModified(FALSE);
	return CPropertyPage::OnApply();
}
Ejemplo n.º 3
0
BOOL CPPgGeneral::OnApply()
{
	CString strNick;
	GetDlgItem(IDC_NICK)->GetWindowText(strNick);
	strNick.Trim();
	if (!IsValidEd2kString(strNick))
		strNick.Empty();
	if (strNick.IsEmpty())
	{
		strNick = DEFAULT_NICK;
		GetDlgItem(IDC_NICK)->SetWindowText(strNick);
	}

	if (thePrefs.GetUserNick() != strNick)
		thePrefs.m_bModifyNick = true;

	thePrefs.SetUserNick(strNick);

	if (m_language.GetCurSel() != CB_ERR)
	{
		WORD wNewLang = (WORD)m_language.GetItemData(m_language.GetCurSel());
		if (thePrefs.GetLanguageID() != wNewLang)
		{
			thePrefs.SetLanguageID(wNewLang);
			thePrefs.SetLanguage();

#ifdef _DEBUG
			// Can't yet be switched on-the-fly, too much unresolved issues..
			if (thePrefs.GetRTLWindowsLayout())
			{
				ModifyAllWindowStyles(theApp.emuledlg, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				ModifyAllWindowStyles(theApp.emuledlg->preferenceswnd, WS_EX_LAYOUTRTL | WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR, 0);
				theApp.DisableRTLWindowsLayout();
				thePrefs.m_bRTLWindowsLayout = false;
			}
#endif
			theApp.emuledlg->preferenceswnd->Localize();
			theApp.emuledlg->statisticswnd->CreateMyTree();
			theApp.emuledlg->statisticswnd->Localize();
			theApp.emuledlg->statisticswnd->ShowStatistics(true);
			theApp.emuledlg->serverwnd->Localize();
			theApp.emuledlg->transferwnd->Localize();
			theApp.emuledlg->transferwnd->UpdateCatTabTitles();
			theApp.emuledlg->searchwnd->Localize();
			theApp.emuledlg->sharedfileswnd->Localize();
			
			theApp.emuledlg->Localize();
#if _ENABLE_NOUSE
			theApp.emuledlg->chatwnd->Localize();
			theApp.emuledlg->ircwnd->Localize();
#endif
			theApp.emuledlg->kademliawnd->Localize();

			//{begin} VC-dgkang
			theApp.emuledlg->m_mainTabWnd.m_dlgResource.Localize();
			theApp.emuledlg->m_mainTabWnd.m_dlgSearch.Localize();
			//{end}
		}
	}

	thePrefs.startMinimized = IsDlgButtonChecked(IDC_STARTMIN)!=0;
	thePrefs.m_bAutoStart = IsDlgButtonChecked(IDC_STARTWIN)!=0;
	if( thePrefs.m_bAutoStart )
		AddAutoStart();
	else
		RemAutoStart();
	thePrefs.beepOnError = IsDlgButtonChecked(IDC_BEEPER)!=0;
	thePrefs.confirmExit = IsDlgButtonChecked(IDC_EXIT)!=0;
	thePrefs.splashscreen = IsDlgButtonChecked(IDC_SPLASHON)!=0;
	thePrefs.bringtoforeground = IsDlgButtonChecked(IDC_BRINGTOFOREGROUND)!=0;
	thePrefs.updatenotify = IsDlgButtonChecked(IDC_CHECK4UPDATE)!=0;
	thePrefs.onlineSig = IsDlgButtonChecked(IDC_ONLINESIG)!=0;
	thePrefs.versioncheckdays = ((CSliderCtrl*)GetDlgItem(IDC_CHECKDAYS))->GetPos();
	thePrefs.m_bEnableMiniMule = IsDlgButtonChecked(IDC_MINIMULE) != 0;

	// Added by thilon on 2006.08.03, 显示隐藏浏览器
	if(	thePrefs.m_bShowBroswer != (IsDlgButtonChecked(IDC_WEBBROWSER)!=0))
	{
		thePrefs.m_bShowBroswer = IsDlgButtonChecked(IDC_WEBBROWSER)!=0;
		//MessageBox(GetResString(IDS_RESTARTFORBROWSER),_T("eMule"),MB_OK);
		if(!thePrefs.m_bShowBroswer)
		{
			thePrefs.m_bShowBroswer = 0;//隐藏浏览器按钮
		}
		else
		{
			thePrefs.m_bShowBroswer = 1;//显示浏览器按钮
		}
	}

	theApp.emuledlg->transferwnd->downloadlistctrl.SetStyle();

	// Changed by thilon on 2007.07.23
	thePrefs.m_iFileBufferSize = m_iFileBufferSize;

	// added by vc-yavey on 20100429 : config rss <begin>
	thePrefs.m_uRssUpdateInterval = m_uRssIntervalSecond;
	thePrefs.m_bRssAutoDownload = m_bRssAutoDownload;
	// added by vc-yavey on 20100429 : config rss <end>

	LoadSettings();

	SetModified(FALSE);
	return CPropertyPage::OnApply();
}
Ejemplo n.º 4
0
void CPPgNTService::OnBnAllSettings(){
	thePrefs.startupsound=false;
	thePrefs.m_bEnableMiniMule=false;
	thePrefs.splashscreen=false;
	thePrefs.startMinimized=true;
	thePrefs.bringtoforeground=false;
	if(theApp.emuledlg->preferenceswnd->m_wndGeneral)
	{
		if(theApp.emuledlg->preferenceswnd->m_wndGeneral.GetDlgItem(IDC_STARTUPSOUNDON))
			theApp.emuledlg->preferenceswnd->m_wndGeneral.CheckDlgButton(IDC_STARTUPSOUNDON,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndGeneral.GetDlgItem(IDC_MINIMULE))
			theApp.emuledlg->preferenceswnd->m_wndGeneral.CheckDlgButton(IDC_MINIMULE,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndGeneral.GetDlgItem(IDC_SPLASHON))
			theApp.emuledlg->preferenceswnd->m_wndGeneral.CheckDlgButton(IDC_SPLASHON,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndGeneral.GetDlgItem(IDC_STARTMIN))
			theApp.emuledlg->preferenceswnd->m_wndGeneral.CheckDlgButton(IDC_STARTMIN,BST_CHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndGeneral.GetDlgItem(IDC_BRINGTOFOREGROUND))
			theApp.emuledlg->preferenceswnd->m_wndGeneral.CheckDlgButton(IDC_BRINGTOFOREGROUND,BST_UNCHECKED);
	}
	thePrefs.SetAutoConnect(true);
	if(theApp.emuledlg->preferenceswnd->m_wndConnection && theApp.emuledlg->preferenceswnd->m_wndConnection.GetDlgItem(IDC_AUTOCONNECT))
		theApp.emuledlg->preferenceswnd->m_wndConnection.CheckDlgButton(IDC_AUTOCONNECT,BST_CHECKED);
	thePrefs.SetWSIsEnabled(true); 
	if(theApp.emuledlg->preferenceswnd->m_wndWebServer && theApp.emuledlg->preferenceswnd->m_wndWebServer.GetDlgItem(IDC_WSENABLED))
	{
		theApp.emuledlg->preferenceswnd->m_wndWebServer.CheckDlgButton(IDC_WSENABLED,BST_CHECKED);
		theApp.emuledlg->preferenceswnd->m_wndWebServer.OnEnChangeWSEnabled();
	}
	RemAutoStart(); // remove from windows startup. 
	thePrefs.m_bSelCatOnAdd=false;
	if(theApp.emuledlg->preferenceswnd->m_wndMorph)
	{
		if(theApp.emuledlg->preferenceswnd->m_wndMorph.m_ctrlTreeOptions &&
			theApp.emuledlg->preferenceswnd->m_wndMorph.m_htiSelectCat)
			theApp.emuledlg->preferenceswnd->m_wndMorph.m_ctrlTreeOptions.SetCheckBoxEnable(theApp.emuledlg->preferenceswnd->m_wndMorph.m_htiSelectCat,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndMorph.m_bSelectCat)
			theApp.emuledlg->preferenceswnd->m_wndMorph.m_bSelectCat = false;
	}
	thePrefs.notifierSoundType = ntfstNoSound;
	thePrefs.notifierOnDownloadFinished = false;
    thePrefs.notifierOnNewDownload = false;
    thePrefs.notifierOnChat = false;
    thePrefs.notifierOnLog = false;
	thePrefs.notifierOnImportantError = false;
    thePrefs.notifierOnEveryChatMsg = false;
	thePrefs.notifierOnNewVersion = false;
	if(theApp.emuledlg->preferenceswnd->m_wndNotify)
	{
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_USESOUND) &&
			theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_USESPEECH) &&
			theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_NOSOUND))
				theApp.emuledlg->preferenceswnd->m_wndNotify.CheckRadioButton(IDC_CB_TBN_NOSOUND, IDC_CB_TBN_USESPEECH, IDC_CB_TBN_NOSOUND);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_ONDOWNLOAD))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_ONDOWNLOAD,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_ONNEWDOWNLOAD))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_ONNEWDOWNLOAD,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_ONCHAT))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_ONCHAT,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_ONLOG))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_ONLOG,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_IMPORTATNT))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_IMPORTATNT,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_POP_ALWAYS))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_POP_ALWAYS,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndNotify.GetDlgItem(IDC_CB_TBN_ONNEWVERSION))
			theApp.emuledlg->preferenceswnd->m_wndNotify.CheckDlgButton(IDC_CB_TBN_ONNEWVERSION,BST_UNCHECKED);
	}
	thePrefs.beepOnError=false;
	if(theApp.emuledlg->preferenceswnd->m_wndTweaks)
	{
		if(theApp.emuledlg->preferenceswnd->m_wndTweaks.m_ctrlTreeOptions &&
			theApp.emuledlg->preferenceswnd->m_wndTweaks.m_htiBeeper)
			theApp.emuledlg->preferenceswnd->m_wndTweaks.m_ctrlTreeOptions.SetCheckBoxEnable(theApp.emuledlg->preferenceswnd->m_wndTweaks.m_htiBeeper,BST_UNCHECKED);
		if(theApp.emuledlg->preferenceswnd->m_wndTweaks.m_bBeeper)
			theApp.emuledlg->preferenceswnd->m_wndTweaks.m_bBeeper = false;
	}
//	SetModified();
};