This commit is contained in:
Nekotekina 2015-09-16 21:31:41 +03:00
parent e86e72804b
commit 91c98a9533
4 changed files with 17 additions and 51 deletions

View File

@ -30,17 +30,6 @@
extern Module cellNetCtl; extern Module cellNetCtl;
std::unique_ptr<SignInDialogInstance> g_sign_in_dialog;
SignInDialogInstance::SignInDialogInstance()
{
}
void SignInDialogInstance::Close()
{
//state = signInDialogClose;
}
s32 cellNetCtlInit() s32 cellNetCtlInit()
{ {
cellNetCtl.Warning("cellNetCtlInit()"); cellNetCtl.Warning("cellNetCtlInit()");
@ -347,22 +336,19 @@ s32 cellNetCtlGetInfo(s32 code, vm::ptr<CellNetCtlInfo> info)
s32 cellNetCtlNetStartDialogLoadAsync(vm::ptr<CellNetCtlNetStartDialogParam> param) s32 cellNetCtlNetStartDialogLoadAsync(vm::ptr<CellNetCtlNetStartDialogParam> param)
{ {
cellNetCtl.Warning("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param); cellNetCtl.Error("cellNetCtlNetStartDialogLoadAsync(param=*0x%x)", param);
// TODO: Actually sign into PSN or an emulated network similar to PSN (ESN) // TODO: Actually sign into PSN or an emulated network similar to PSN (ESN)
// TODO: Properly open the dialog prompt for sign in // TODO: Properly open the dialog prompt for sign in
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0); sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_LOADED, 0);
g_sign_in_dialog->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
return CELL_NET_CTL_ERROR_NOT_CONNECTED; return CELL_OK;
} }
s32 cellNetCtlNetStartDialogAbortAsync() s32 cellNetCtlNetStartDialogAbortAsync()
{ {
cellNetCtl.Todo("cellNetCtlNetStartDialogAbortAsync()"); cellNetCtl.Error("cellNetCtlNetStartDialogAbortAsync()");
g_sign_in_dialog->status = CELL_NET_CTL_ERROR_DIALOG_ABORTED;
return CELL_OK; return CELL_OK;
} }
@ -371,7 +357,7 @@ s32 cellNetCtlNetStartDialogUnloadAsync(vm::ptr<CellNetCtlNetStartDialogResult>
{ {
cellNetCtl.Warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result); cellNetCtl.Warning("cellNetCtlNetStartDialogUnloadAsync(result=*0x%x)", result);
result->result = g_sign_in_dialog->status; result->result = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0); sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED, 0);
return CELL_OK; return CELL_OK;

View File

@ -261,22 +261,7 @@ struct CellNetCtlNatInfo
typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg); typedef void(cellNetCtlHandler)(s32 prev_state, s32 new_state, s32 event, s32 error_code, vm::ptr<u32> arg);
struct SignInDialogInstance static const char* InfoCodeToName(s32 code)
{
//std::atomic<SignInDialogState> state;
s32 status;
SignInDialogInstance();
virtual ~SignInDialogInstance() = default;
virtual void Close();
virtual void Create() = 0;
virtual void Destroy() = 0;
};
inline static const char* InfoCodeToName(s32 code)
{ {
switch (code) switch (code)
{ {

View File

@ -1,8 +1,5 @@
#include "stdafx_gui.h" #include "stdafx_gui.h"
#include "Emu/SysCalls/Modules.h"
#include "Emu/Memory/Memory.h"
#include "Emu/SysCalls/Modules/cellSysutil.h"
#include "SignInDialog.h" #include "SignInDialog.h"
// TODO: Make this look and work more reasonably // TODO: Make this look and work more reasonably
@ -50,26 +47,26 @@ void SignInDialogFrame::Create()
b_signin->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event) b_signin->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
{ {
this->status = CELL_OK; //this->status = CELL_OK;
this->m_dialog->Hide(); this->m_dialog->Hide();
this->Close(); //this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); //sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
}); });
b_cancel->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event) b_cancel->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
{ {
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED; //this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
this->m_dialog->Hide(); this->m_dialog->Hide();
this->Close(); //this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); //sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
}); });
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& event) m_dialog->Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& event)
{ {
this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED; //this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
this->m_dialog->Hide(); this->m_dialog->Hide();
this->Close(); //this->Close();
sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0); //sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
}); });
} }

View File

@ -1,12 +1,10 @@
#pragma once #pragma once
#include "Emu/SysCalls/Modules/cellNetCtl.h" class SignInDialogFrame
class SignInDialogFrame : public SignInDialogInstance
{ {
std::unique_ptr<wxDialog> m_dialog; std::unique_ptr<wxDialog> m_dialog;
public: public:
virtual void Create() override; virtual void Create();
virtual void Destroy() override; virtual void Destroy();
}; };