Ejemplo n.º 1
0
static
BOOL
OnInitDialog(HWND hwndDlg)
{
    DWORD dwWaitInterval;

    DPRINT("OnInitDialog()\n");

    SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFUP),
                BM_SETIMAGE,(WPARAM)IMAGE_ICON,
                (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_UP)));
    SendMessage(GetDlgItem(hwndDlg, IDC_HRDPROFDWN),
                BM_SETIMAGE,(WPARAM)IMAGE_ICON,
                (LPARAM)(HANDLE)LoadIcon(hApplet, MAKEINTRESOURCE(IDI_DOWN)));

    if (!GetProfiles(hwndDlg))
        return FALSE;

    SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETRANGE, (WPARAM)0, (LPARAM)MAKELONG((SHORT)500, 0));

    dwWaitInterval = GetUserWaitInterval();
    if (dwWaitInterval == (DWORD)-1)
    {
        CheckDlgButton(hwndDlg, IDC_HRDPROFWAIT, BST_CHECKED);
        SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETPOS, 0, 30);
        EnableWindow(GetDlgItem(hwndDlg, IDC_HRDPROFEDIT), FALSE);
    }
    else
    {
        CheckDlgButton(hwndDlg, IDC_HRDPROFSELECT, BST_CHECKED);
        SendDlgItemMessageW(hwndDlg, IDC_HRDPROFUPDWN, UDM_SETPOS, 0, dwWaitInterval);
    }

    return TRUE;
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------
//! Adds a profile to the official list of column configuration profiles
//!
//! @param strProfile Name of the profile
//------------------------------------------------------------------------
void CViewConfigSectionProfiles::AddProfile(const CString& strProfile)
{
	// Add the strProfile to the list if not already there
	CSimpleArray<CString> profiles;
	GetProfiles(profiles);
	for (int i = 0; i < profiles.GetSize(); ++i)
		if (profiles[i] == strProfile)
			return;

	CString noconst(strProfile);
	profiles.Add(noconst);

	WriteSetting(m_ViewName, _T("CurrentProfiles"), ConvertArraySetting(profiles, _T(", ")));
}
Ejemplo n.º 3
0
//------------------------------------------------------------------------
//! Removes a profile from the official list of column configuration profiles
//!
//! @param strProfile Name of the profile
//------------------------------------------------------------------------
void CViewConfigSectionProfiles::DeleteProfile(const CString& strProfile)
{
	if (strProfile.IsEmpty())
		return;

	// Remove any settings
	RemoveSection(JoinSectionName(m_ViewName, strProfile));

	// Remove the strProfile from the list
	CSimpleArray<CString> profiles;
	GetProfiles(profiles);
	for (int i = 0; i < profiles.GetSize(); ++i)
		if (profiles[i] == strProfile)
			profiles.RemoveAt(i);
	WriteSetting(m_ViewName, _T("CurrentProfiles"), ConvertArraySetting(profiles, _T(", ")));
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------
//! Retrieves the section name of the currently active configuration profile
//!
//! @return Current section name
//------------------------------------------------------------------------
const CString& CViewConfigSectionProfiles::GetSectionName() const
{
	if (m_CurrentSection == m_ViewName)
	{
		CString strProfile = ReadSetting(m_ViewName, _T("ActiveProfile"), _T(""));
		if (strProfile.IsEmpty())
		{
			CSimpleArray<CString> profiles;
			GetProfiles(profiles);
			if (profiles.GetSize()>0)
				strProfile = profiles[0];
		}
		m_CurrentSection = JoinSectionName(m_ViewName, strProfile);
	}
	return m_CurrentSection;
}
Ejemplo n.º 5
0
	void COLAddrBook::ExtractChildFolders()
	{
		if (!m_initRef->Inited())
			return;

		Profiles profiles;
		GetProfiles(profiles);
		
		if (1 == profiles.size())
		{
			// профиль только один, его и будем открывать
			SessionLogOn(NULL, "", "", MAPI_NO_MAIL | MAPI_EXTENDED | MAPI_NEW_SESSION | MAPI_USE_DEFAULT);
		}
		else
		if (!profiles.empty())
		{
			// профилей более одного, запрашиваем пользовател¤
			SessionLogOn(NULL, "", "", MAPI_NO_MAIL | MAPI_EXTENDED | MAPI_NEW_SESSION | MAPI_LOGON_UI);
		}		

		COLFolderBase::ExtractChildFolders();
	}
Ejemplo n.º 6
0
///////////////////
// Initialize the Internet menu
bool Menu_Net_NETInitialize()
{
	iNetMode = net_internet;
    szNetCurServer = "";

	cInternet.Shutdown();
	cInternet.Initialize();

	cInternet.Add( new CListview(),								mi_ServerList, 40, 180, 560, 242);
	cInternet.Add( new CButton(BUT_BACK, tMenu->bmpButtons),    mi_Back,       25, 440, 50,  15);
	cInternet.Add( new CButton(BUT_ADD, tMenu->bmpButtons),		mi_AddServer,  140,440, 40,  15);
	cInternet.Add( new CButton(BUT_REFRESH, tMenu->bmpButtons), mi_Refresh,	250,440, 83,  15);
	cInternet.Add( new CButton(BUT_UPDATELIST, tMenu->bmpButtons),	mi_UpdateList,  390,440, 125,  15);
	cInternet.Add( new CButton(BUT_JOIN, tMenu->bmpButtons),    mi_Join,		570,440, 43,  15);
	cInternet.Add( new CLabel("Select player:",tLX->clNormalLabel),-1,		125, 152, 180,15);
	cInternet.Add( new CCombobox(),								mi_PlayerSelection,		225,150, 170,  19);
	if( tLXOptions->bEnableChat && tLXOptions->bEnableMiniChat )
		cInternet.Add( new CChatWidget(),						-1,	25, 15, 585, 85 );


	/*
	  Server list columns

      Connection speed
	  Name
	  State
	  Players
	  Ping
	  Address
    */

	// Add players to the list
	profile_t *p = GetProfiles();
	bool validName = false;
	for(;p;p=p->tNext) {
		if(p->iType == PRF_COMPUTER->toInt())
			continue;

		int i = ((CCombobox*) cInternet.getWidget( mi_PlayerSelection ))->addItem(p->sName, p->sName);
		((CCombobox*) cInternet.getWidget( mi_PlayerSelection ))->setImage(p->cSkin.getPreview(), i);
		if( p->sName == tLXOptions->sLastSelectedPlayer )
			validName=true;
	}

	if( ! validName )
		tLXOptions->sLastSelectedPlayer = GetProfiles()->sName;

	((CCombobox*) cInternet.getWidget( mi_PlayerSelection ))->setCurSIndexItem( tLXOptions->sLastSelectedPlayer );

    Menu_redrawBufferRect(0, 0, 640, 480);

	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "", tLXOptions->iInternetList[0]);
	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "Server Name", tLXOptions->iInternetList[1]);
	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "State", tLXOptions->iInternetList[2]);
	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "Players", tLXOptions->iInternetList[3]);
	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "Ping", tLXOptions->iInternetList[4]);

	if (tLXOptions->bUseIpToCountry)
	{	// Too lazy to update tLXOptions, so I'll calculate last column width from width of listview
		//int CountryColumnWidth = 21; // TODO: not used

		// HINT: because this column is optional, it is at the end of the array from options
		cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "Country", tLXOptions->iInternetList[5]);
	}

	cInternet.SendMessage( mi_ServerList, LVS_ADDCOLUMN, "Address", tLXOptions->iInternetList[6]);

	((CListview*) cInternet.getWidget( mi_ServerList ))->SetSortColumn( tLXOptions->iInternetSortColumn, true ); // Sorting

    // Load the list
	Menu_Net_NET_ServerList_Refresher();
	SvrList_UpdateUDPList();
	
	Timer("Menu_Net_NETInitialize serverlist timeout", null, NULL, SVRLIST_TIMEOUT, true).startHeadless();
	
	return true;
}