示例#1
0
void CIrcWnd::OnBnClickedBnIrcconnect()
{
	if(!m_bConnected)
	{
		if( thePrefs.GetIRCNick().MakeLower() == _T("emule") || thePrefs.GetIRCNick().MakeLower().Find(_T("emuleirc")) != -1 )
		{
			InputBox inputbox;
			inputbox.SetLabels(GetResString(IDS_IRC_NEWNICK), GetResString(IDS_IRC_NEWNICKDESC), _T("eMule"));
			if (inputbox.DoModal() == IDOK)
			{
				CString input = inputbox.GetInput();
				input.Trim();
				input = input.SpanExcluding(_T(" !@#$%^&*():;<>,.?{}~`+=-"));
				if( input != "" )
					thePrefs.SetIRCNick(input.GetBuffer());
			}
		}
		//if not connected, connect..
		m_pIrcMain->Connect();
	}
	else
	{
		//If connected, disconnect..
		m_pIrcMain->Disconnect();
	}
}
示例#2
0
文件: shards.cpp 项目: exaexa/orthos
int orthos_skin_start()
{
	int res_x = 0, res_y = 0;
	x_get_resolution (&res_x, &res_y);
	exaSetParams (res_x, res_y, 32);
	if (!exaInit() ) return 1;

	exaKeyRepeat (0.4, 0.05);

	const char*font_fn = config ("font");

	font.loadfromfreetype (font_fn ? font_fn :
	                       "/usr/share/fonts/ttf-bitstream-vera/VeraMono.ttf", 128);

	box.setcaption (login_line);

	glClearColor (0, 0, 0, 0);
	glShadeModel (GL_SMOOTH);
	glDisable (GL_DEPTH_TEST);

	glMatrixMode (GL_PROJECTION);
	glLoadIdentity();
	glFrustum (-0.16, 0.16, -0.1, 0.1, 0.1, 100);
	glMatrixMode (GL_MODELVIEW);


	Mode = 0;
	box.setcaption (login_line);
	box.pwmask (false);
	box.setcolor (0.4, 0.4, 0.4);
	box.flash (0, 0, 0);
	exaGetElapsedTime();
	return 0;
}
示例#3
0
void CPPgDirectories::OnBnClickedAddUNC()
{
	InputBox inputbox;
	inputbox.SetLabels(GetResString(IDS_UNCFOLDERS), GetResString(IDS_UNCFOLDERS), _T("\\\\Server\\Share"));
	if (inputbox.DoModal() != IDOK)
		return;
	CString unc=inputbox.GetInput();

	// basic unc-check 
	if (!PathIsUNC(unc)){
		AfxMessageBox(GetResString(IDS_ERR_BADUNC), MB_ICONERROR);
		return;
	}

	if (unc.Right(1) == _T("\\"))
		unc.Delete(unc.GetLength()-1, 1);

	for (POSITION pos = thePrefs.shareddir_list.GetHeadPosition();pos != 0;){
		if (unc.CompareNoCase(thePrefs.shareddir_list.GetNext(pos))==0)
			return;
	}
	for (int posi = 0; posi < m_ctlUncPaths.GetItemCount(); posi++){
		if (unc.CompareNoCase(m_ctlUncPaths.GetItemText(posi, 0)) == 0)
			return;
	}

	m_ctlUncPaths.InsertItem(m_ctlUncPaths.GetItemCount(), unc);
	SetModified();
}
示例#4
0
void CIrcWnd::OnBnClickedIrcConnect()
{
	if (!m_bConnected)
	{
		CString sInput = thePrefs.GetIRCNick();
		sInput.Trim();
		sInput = sInput.SpanExcluding(_T(" !@#$%^&*():;<>,.?{}~`+=-"));
		sInput = sInput.Left(25);
		while (sInput.IsEmpty()
			   || sInput.CompareNoCase(_T("emule")) == 0
			   || stristr(sInput, _T("emuleirc")) != NULL)
		{
			InputBox inputBox;
			inputBox.SetLabels(GetResString(IDS_IRC_NEWNICK), GetResString(IDS_IRC_NEWNICKDESC), sInput);
			if (inputBox.DoModal() == IDOK)
			{
				sInput = inputBox.GetInput();
				sInput.Trim();
				sInput = sInput.SpanExcluding(_T(" !@#$%^&*():;<>,.?{}~`+=-"));
				sInput = sInput.Left(25);
			}
			else
				return;
		}
		thePrefs.SetIRCNick(sInput);
		//if not connected, connect..
		m_pIrcMain->Connect();
	}
	else
	{
		//If connected, disconnect..
		m_pIrcMain->Disconnect();
		m_wndChanList.ResetServerChannelList();
	}
}
示例#5
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());
}
示例#6
0
		static LRESULT CALLBACK CIB_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
		{
			InputBox *self;
			self = (InputBox *)GetWindowLong(hWnd, GWL_USERDATA);

			switch (msg)
			{
				case WM_CREATE:
					self = (InputBox *) ((CREATESTRUCT *)lParam)->lpCreateParams;
					SetWindowLong(hWnd, GWL_USERDATA, (long)self);
					self->create(hWnd);
				break;
				case WM_COMMAND:
					switch(LOWORD(wParam)) {
						case IDOK:
							self->submit();
						case IDCANCEL:
							self->close();
						break;
					}
					break;
				case WM_CLOSE:
					self->hide();
					return 0;
				case WM_DESTROY:
					self->destroy();
					break;
			}
			return(DefWindowProc (hWnd, msg, wParam, lParam));
		}
示例#7
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);
}
示例#8
0
文件: shards.cpp 项目: exaexa/orthos
int orthos_skin_update()
{
	exaUpdate();
	float time = 0;

	while (time < 0.035) {
		time += exaGetElapsedTime();
		exaUSleep (2000);
	}

	rot += time;
	box.update (time);
	sess.update (time);
	shut.update (time);

	if (exaIsKeyHit (EKEY_RETURN) )
		switch (Mode) {
		case 0:
			login = box.text;
			Mode = 1;
			box.clear();
			box.setcaption ("password");
			box.setcolor (0.2, 0.2, 0.2);
			box.pwmask (true);
			break;
		case 1:
			pw = box.text;
			box.clear();
			if (selected_session) {
				if (validate_login (login.c_str(), pw.c_str() ) ) {
					Mode = 0;
					box.setcaption (login_line);
					box.setcolor (0.4, 0.4, 0.4);
					box.flash (1, 0, 0);
					box.pwmask (false);
				} else Mode = 3;
			} else {
				Mode = 2;
				box.setcaption ("session");
				box.setcolor (0.1, 0.1, 0.4);
				box.pwmask (false);
			}
			break;
		case 2:
			session = box.text;
			box.clear();
			if (validate_login (login.c_str(), pw.c_str() ) ) {
				Mode = 0;
				box.setcaption (login_line);
				box.setcolor (0.4, 0.4, 0.4);
				box.flash (1, 0, 0);
				box.pwmask (false);
			} else Mode = 3;
			break;
		case 3:
		case 4:
			break;
		default:
			Mode = 0;
			box.clear();
			box.setcaption (login_line);
			box.pwmask (false);
			box.setcolor (0.4, 0.4, 0.4);
			box.flash (0, 0, 0);
			break;
		}

	glClear (GL_COLOR_BUFFER_BIT);
	glLoadIdentity();

	glTranslatef (0, 0, -1);
	glRotatef (rot, 1, 0, 0.3);
	glEnable (GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA, GL_ONE);
	do_sphere();
	glDisable (GL_BLEND);

	if (invert) {
		glPushMatrix();
		glLoadIdentity();
		glMatrixMode (GL_PROJECTION);
		glPushMatrix();
		glLoadIdentity();
		glOrtho (0, 1, 0, 1, 1, -1);
		glColor4f (1, 1, 1, 1);
		glEnable (GL_BLEND);
		glBlendFunc (GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
		glBegin (GL_QUADS);
		glVertex2f (0, 0);
		glVertex2f (0, 1);
		glVertex2f (1, 1);
		glVertex2f (1, 0);
		glEnd();
		glPopMatrix();
		glMatrixMode (GL_MODELVIEW);
		glPopMatrix();
	}


	glLoadIdentity();
	glTranslatef (0, -13, -25);
	box.draw();
	glTranslatef (0, 2, 0);
	sess.draw();
	glTranslatef (0, -6, 0);
	shut.draw();

	exaglSwapBuffers();
	switch (Mode) {
	case 3:
		do_login (login.c_str(), selected_session ? sessions[selected_session].cmd.c_str() : session.c_str() );
		return 0;
	case 4:
		return 0;
	}
	return 1;
}
示例#9
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);
}
示例#10
0
文件: default.cpp 项目: kidaa/aur
int orthos_skin_update()
{
    exaUpdate();
    float time=0;

    while(time<0.02) {
        time+=exaGetElapsedTime();
        exaUSleep(2000);
    }

    rot+=time;
    box.update(time);
    sess.update(time);
    shut.update(time);

    if(exaIsKeyHit(EKEY_RETURN))
        switch(Mode) {
        case 0:
            login=box.text;
            Mode=1;
            box.clear();
            box.setcaption("password");
            box.setcolor(0.2,0.2,0.2);
            box.pwmask(true);
            break;
        case 1:
            pw=box.text;
            box.clear();
            if(selected_session) {
                if(validate_login(login.c_str(),pw.c_str())) {
                    Mode=0;
                    box.setcaption(login_line);
                    box.setcolor(0.4,0.4,0.4);
                    box.flash(1,0,0);
                    box.pwmask(false);
                } else Mode=3;
            } else {
                Mode=2;
                box.setcaption("session");
                box.setcolor(0.1,0.1,0.4);
                box.pwmask(false);
            }
            break;
        case 2:
            session=box.text;
            box.clear();
            if(validate_login(login.c_str(),pw.c_str())) {
                Mode=0;
                box.setcaption(login_line);
                box.setcolor(0.4,0.4,0.4);
                box.flash(1,0,0);
                box.pwmask(false);
            } else Mode=3;
            break;
        case 3:
        case 4:
            break;
        default:
            Mode=0;
            box.clear();
            box.setcaption(login_line);
            box.pwmask(false);
            box.setcolor(0.4,0.4,0.4);
            box.flash(0,0,0);
            break;
        }

    glClear(GL_COLOR_BUFFER_BIT);
    glLoadIdentity();

    glTranslatef(0,0,-5);
    glRotatef(rot,0,0,1);
    for(int i=0; i<10; ++i) {
        glBegin(GL_TRIANGLE_STRIP);
        glColor3f(0,0,0);
        glVertex3f(1,5,5);
        glVertex3f(-1,5,5);
        glColor3f(0,0.1,0.3);
        glVertex3f(1,5,-1);
        glVertex3f(-1,5,-1);
        glColor3f(0,0,0);
        glVertex3f(1,5,-20);
        glVertex3f(-1,5,-20);
        glEnd();
        glRotatef(36,0,0,1);
    }

    glLoadIdentity();
    glTranslatef(0,0,-25);
    box.draw();
    glTranslatef(0,2,0);
    sess.draw();
    glTranslatef(0,-6,0);
    shut.draw();

    exaglSwapBuffers();
    switch (Mode) {
    case 3:
        do_login(login.c_str(),selected_session?sessions[selected_session].cmd.c_str():session.c_str());
        return 0;
    case 4:
        return 0;
    }
    return 1;
}