示例#1
0
void CPPgFiles::OnSetCleanupFilter()
{
	CString prompt = GetResString(IDS_FILTERFILENAMEWORD);
	InputBox inputbox;
	inputbox.SetLabels(GetResString(IDS_FNFILTERTITLE), prompt, thePrefs.GetFilenameCleanups());
	inputbox.DoModal();
	if (!inputbox.WasCancelled())
		thePrefs.SetFilenameCleanups(inputbox.GetInput());
}
示例#2
0
BOOL CPPgScheduler::OnCommand(WPARAM wParam, LPARAM lParam)
{ 
	int item= m_actions.GetSelectionMark(); 
	// add
	if (wParam>=MP_SCHACTIONS && wParam<MP_SCHACTIONS+20 && m_actions.GetItemCount()<16)
	{
		uint8 action=wParam-MP_SCHACTIONS;
		uint8 i=m_actions.GetItemCount();
		m_actions.InsertItem(i,GetActionLabel(action));
		m_actions.SetItemData(i,action);
		m_actions.SetSelectionMark(i);
		if (action<6)
			OnCommand(MP_CAT_EDIT,0);
	}
	else if (wParam>=MP_SCHACTIONS+20 && wParam<=MP_SCHACTIONS+80)
	{
		CString newval;
		newval.Format(_T("%i"),wParam-MP_SCHACTIONS-22);
		m_actions.SetItemText(item,1,newval);
	}
	else if (wParam == ID_HELP)
	{
		OnHelp();
		return TRUE;
	}

	switch (wParam){ 
		case MP_CAT_EDIT: 
        { 
			if (item!=-1) {
				InputBox inputbox;
				// todo: differen prompts
				CString prompt;
				switch (m_actions.GetItemData(item)) {
					case 1:
					case 2:
						prompt=GetResString(IDS_SCHED_ENTERDATARATELIMIT)+_T(" (")+GetResString(IDS_KBYTESPERSEC)+_T(")");
						break;
					default: prompt=GetResString(IDS_SCHED_ENTERVAL);
				}
				inputbox.SetLabels(GetResString(IDS_SCHED_ACTCONFIG),prompt,m_actions.GetItemText(item,1));
				inputbox.DoModal();
				CString res=inputbox.GetInput();
				if (!inputbox.WasCancelled()) m_actions.SetItemText(item,1,res);
			}
			break; 
        }
		case MP_CAT_REMOVE:
		{
			// remove
			if (item!=-1) {
				int ix=m_actions.GetSelectionMark();
				if (ix!=-1) {
					m_actions.DeleteItem(ix);
				}
			}
			break;
		}
	} 
	return CPropertyPage::OnCommand(wParam, lParam);
}
示例#3
0
BOOL CPPgScheduler::OnCommand(WPARAM wParam, LPARAM lParam)
{ 
   int item= m_actions.GetSelectionMark(); 
	// add
	if (wParam>=MP_SCHACTIONS && wParam<MP_SCHACTIONS+20 && m_actions.GetItemCount()<16)
	{
		int action=wParam-MP_SCHACTIONS;
		int i=m_actions.GetItemCount();
		m_actions.InsertItem(i,GetActionLabel(action));
    // MORPH START  leuk_he: Remove 2nd apply in scheduler
		SetModified();
    // MORPH END leuk_he: Remove 2nd apply in scheduler
		m_actions.SetItemData(i,action);
		m_actions.SetSelectionMark(i);
		if (action<6)
			OnCommand(MP_CAT_EDIT,0);
		// Mighty Knife START: parameterless schedule events
		else if (action>=ACTION_BACKUP && action<=ACTION_RELOAD) {
			// Small warning message
			if (action == ACTION_UPDIPCONF || action == ACTION_UPDFAKES || action == ACTION_UPDCOUNTRY) {
				XMessageBox (NULL,GetResString (IDS_SCHED_UPDATE_WARNING),
							 GetResString (IDS_WARNING),MB_OK | MB_ICONINFORMATION,NULL);
				m_actions.SetItemText(i,1,L"update");
			}
			else
				m_actions.SetItemText(i,1,L"-");
			CTime myTime1 ;m_time.GetTime(myTime1);  // MORPH add check for one time events
			CTime myTime2 ;m_timeTo.GetTime(myTime2);
			if ( myTime1!= myTime2) // leuk_he: warn because will be executeed every minute! 
				if(XMessageBox (NULL,GetResString(IDS_SCHED_WARNENDTIME),
				   GetResString (IDS_WARNING),MB_OKCANCEL| MB_ICONINFORMATION,NULL)== IDOK)
					 m_timeTo.SetTime(&myTime1); // On ok reset end time. 
		}
		//  Mighty Knife END
		//MORPH START - Changed by Stulle, Show cat name for scheduler cat actions
		else
			m_actions.SetItemText(i,1,L"-1 ("+GetResString(IDS_ALL)+L")");
		//MORPH END   - Changed by Stulle, Show cat name for scheduler cat actions
	}
	else if (wParam>=MP_SCHACTIONS+20 && wParam<=MP_SCHACTIONS+80)
	{
		CString newval;
		//MORPH START - Changed by Stulle, Show cat name for scheduler cat actions
		/*
		newval.Format(_T("%i"),wParam-MP_SCHACTIONS-22);
		*/
		int iCat = wParam-MP_SCHACTIONS-22;
		CString strCatTitle;
		if(iCat == -1)
			strCatTitle = GetResString(IDS_ALL);
		else
		{
			Category_Struct* thisCat = thePrefs.GetCategory(iCat);
			if(thisCat)
				strCatTitle = thisCat->strTitle;
			else // should not happen
				strCatTitle = GetResString(IDS_UNKNOWN);
		}
		newval.Format(L"%i (%s)",iCat,strCatTitle);
		//MORPH END   - Changed by Stulle, Show cat name for scheduler cat actions
		m_actions.SetItemText(item,1,newval);
		// MORPH START  leuk_he: Remove 2nd apply in scheduler
		SetModified();
		// lhane
   }
	else if (wParam == ID_HELP)
	{
		OnHelp();
		return TRUE;
	}

   switch (wParam){ 
		case MP_CAT_EDIT: 
        { 
			if (item!=-1) {
				InputBox inputbox;
				// todo: differen prompts
				CString prompt;
				switch (m_actions.GetItemData(item)) {
					case 1:
					case 2:
						prompt=GetResString(IDS_SCHED_ENTERDATARATELIMIT)+_T(" (")+GetResString(IDS_KBYTESPERSEC)+_T(")");
						break;
					default: prompt=GetResString(IDS_SCHED_ENTERVAL);
				}
				inputbox.SetLabels(GetResString(IDS_SCHED_ACTCONFIG),prompt,m_actions.GetItemText(item,1));
				inputbox.DoModal();
				CString res=inputbox.GetInput();
				if (!inputbox.WasCancelled()) m_actions.SetItemText(item,1,res);
         // MORPH START  leuk_he: Remove 2nd apply in scheduler
				SetModified();
        //MORPH END leuk_he: Remove 2nd apply in schedulerd
			}
			break; 
        }
		case MP_CAT_REMOVE:
		{
			// remove
			if (item!=-1) {
				int ix=m_actions.GetSelectionMark();
				if (ix!=-1) {
					m_actions.DeleteItem(ix);
				}
        // MORPH START  leuk_he: Remove 2nd apply in scheduler
				SetModified();
        // MORPH END leuk_he: Remove 2nd apply in scheduler
			}
			break;
		}
   } 
   return CPropertyPage::OnCommand(wParam, lParam);
}