Skip to content

Commit 7ab4e3a

Browse files
committed
fix #13
1 parent 19ad903 commit 7ab4e3a

File tree

10 files changed

+4
-329
lines changed

10 files changed

+4
-329
lines changed

Makefile.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ WXSQLITEPLUS_OBJECTS = \
7070
wxsqliteplus_encrypkeydlg.o \
7171
wxsqliteplus_filterdlg.o \
7272
wxsqliteplus_indexbook.o \
73-
wxsqliteplus_ipcframe.o \
7473
wxsqliteplus_paneldata.o \
7574
wxsqliteplus_preferences.o \
7675
wxsqliteplus_sortdlg.o \
@@ -215,9 +214,6 @@ wxsqliteplus_filterdlg.o: $(srcdir)/src/filterdlg.cpp
215214
wxsqliteplus_indexbook.o: $(srcdir)/src/indexbook.cpp
216215
$(CXXC) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(srcdir)/src/indexbook.cpp
217216

218-
wxsqliteplus_ipcframe.o: $(srcdir)/src/ipcframe.cpp
219-
$(CXXC) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(srcdir)/src/ipcframe.cpp
220-
221217
wxsqliteplus_paneldata.o: $(srcdir)/src/paneldata.cpp
222218
$(CXXC) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(srcdir)/src/paneldata.cpp
223219

build/msw/makefile.gcc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ WXSQLITEPLUS_OBJECTS = \
9797
wxsqliteplus_encrypkeydlg.o \
9898
wxsqliteplus_filterdlg.o \
9999
wxsqliteplus_indexbook.o \
100-
wxsqliteplus_ipcframe.o \
101100
wxsqliteplus_paneldata.o \
102101
wxsqliteplus_preferences.o \
103102
wxsqliteplus_sortdlg.o \
@@ -293,9 +292,6 @@ wxsqliteplus_filterdlg.o: ../../src/filterdlg.cpp
293292
wxsqliteplus_indexbook.o: ../../src/indexbook.cpp
294293
$(CXX) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(CPPDEPS) $<
295294

296-
wxsqliteplus_ipcframe.o: ../../src/ipcframe.cpp
297-
$(CXX) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(CPPDEPS) $<
298-
299295
wxsqliteplus_paneldata.o: ../../src/paneldata.cpp
300296
$(CXX) -c -o $@ $(WXSQLITEPLUS_CXXFLAGS) $(CPPDEPS) $<
301297

build/msw/makefile.vc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ WXSQLITEPLUS_OBJECTS = \
113113
wxsqliteplus_encrypkeydlg.obj \
114114
wxsqliteplus_filterdlg.obj \
115115
wxsqliteplus_indexbook.obj \
116-
wxsqliteplus_ipcframe.obj \
117116
wxsqliteplus_paneldata.obj \
118117
wxsqliteplus_preferences.obj \
119118
wxsqliteplus_sortdlg.obj \
@@ -382,9 +381,6 @@ wxsqliteplus_filterdlg.obj: ..\..\src\filterdlg.cpp
382381
wxsqliteplus_indexbook.obj: ..\..\src\indexbook.cpp
383382
$(CXX) /c /nologo /TP /Fo$@ $(WXSQLITEPLUS_CXXFLAGS) ..\..\src\indexbook.cpp
384383

385-
wxsqliteplus_ipcframe.obj: ..\..\src\ipcframe.cpp
386-
$(CXX) /c /nologo /TP /Fo$@ $(WXSQLITEPLUS_CXXFLAGS) ..\..\src\ipcframe.cpp
387-
388384
wxsqliteplus_paneldata.obj: ..\..\src\paneldata.cpp
389385
$(CXX) /c /nologo /TP /Fo$@ $(WXSQLITEPLUS_CXXFLAGS) ..\..\src\paneldata.cpp
390386

build/msw/wxsqliteplus_wxsqliteplus.vcproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,6 @@
464464
RelativePath="..\..\src\indexbook.cpp"
465465
>
466466
</File>
467-
<File
468-
RelativePath="..\..\src\ipcframe.cpp"
469-
>
470-
</File>
471467
<File
472468
RelativePath="..\..\src\paneldata.cpp"
473469
>
@@ -598,10 +594,6 @@
598594
RelativePath="..\..\src\indexbook.h"
599595
>
600596
</File>
601-
<File
602-
RelativePath="..\..\src\ipcframe.h"
603-
>
604-
</File>
605597
<File
606598
RelativePath="..\..\src\paneldata.h"
607599
>

src/ipcframe.cpp

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/ipcframe.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/sqliteplusframe.cpp

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ wxString g_SQLiteObjTypeName[5] =
109109
IMPLEMENT_DYNAMIC_CLASS(wxSQLitePlusFrame, wxFrame)
110110

111111
BEGIN_EVENT_TABLE(wxSQLitePlusFrame, wxFrame)
112-
EVT_SOCKET(ID_IPC_SERVER, wxSQLitePlusFrame::OnServerEvent)
113-
EVT_SOCKET(ID_IPC_SRV_SOCK, wxSQLitePlusFrame::OnSrvSocketEvent)
114-
115112
EVT_CLOSE(wxSQLitePlusFrame::OnCloseWindow)
116113
EVT_TREE_ITEM_RIGHT_CLICK(ID_DBTREE, wxSQLitePlusFrame::OnDbtreeItemRightClick)
117114
EVT_TREE_SEL_CHANGED(ID_DBTREE, wxSQLitePlusFrame::OnDbtreeItemSelChanged)
@@ -248,21 +245,16 @@ bool wxSQLitePlusFrame::Create(wxWindow* parent, wxWindowID id,
248245
m_MnuTransact->Check(ID_MNU_AUTOTRANSACT, (autotransact == 1));
249246
m_TbTransact->ToggleTool(ID_MNU_AUTOTRANSACT, (autotransact == 1));
250247

251-
LaunchServer();
252-
253248
return true;
254249
}
255250
/*---------------------------------------------------------------------------*/
256251
wxSQLitePlusFrame::~wxSQLitePlusFrame()
257252
{
258-
if (m_Server)
259-
delete m_Server;
260253
GetAuiManager().UnInit();
261254
}
262255
/*---------------------------------------------------------------------------*/
263256
void wxSQLitePlusFrame::Init()
264257
{
265-
m_Server = NULL;
266258
m_TreeCtrl = NULL;
267259
m_CenterNotebook = NULL;
268260
m_MnuFile = NULL;
@@ -769,65 +761,6 @@ void wxSQLitePlusFrame::InitNodeParams()
769761
}
770762
}
771763
/*---------------------------------------------------------------------------*/
772-
void wxSQLitePlusFrame::OnServerEvent(wxSocketEvent& event)
773-
{
774-
wxSocketBase *sock;
775-
776-
if (event.GetSocketEvent() == wxSOCKET_CONNECTION)
777-
{
778-
sock = m_Server->Accept(false);
779-
if (sock)
780-
{
781-
// On indique que le gestionnaire d'évènement est La fenêtre
782-
sock->SetEventHandler(*this, ID_IPC_SRV_SOCK);
783-
// Spécification des évènements à générer
784-
sock->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_OUTPUT_FLAG | wxSOCKET_LOST_FLAG);
785-
// les évènements peuvent être générés
786-
sock->Notify(true);
787-
}
788-
}
789-
}
790-
/*---------------------------------------------------------------------------*/
791-
void wxSQLitePlusFrame::OnSrvSocketEvent(wxSocketEvent& event)
792-
{
793-
wxSocketBase* ev_sock;
794-
wxChar buffer[1024];
795-
wxUint32 len;
796-
wxString str, verb;
797-
798-
if (event.GetSocketEvent() == wxSOCKET_INPUT)
799-
{
800-
ev_sock = event.GetSocket();
801-
ev_sock->SetFlags(wxSOCKET_BLOCK|wxSOCKET_WAITALL);
802-
if (!ev_sock->Error())
803-
{
804-
len = ev_sock->ReadMsg(buffer, 1024 * sizeof(wxChar)).LastCount();
805-
if (len > 0)
806-
{
807-
str.Printf(("%s"), buffer);
808-
// wxLogMessage(str);
809-
verb = str.BeforeFirst((' '));
810-
if (verb == IPC_VERB_SHOW)
811-
{
812-
Raise();
813-
}
814-
else if (verb == IPC_VERB_OPEN)
815-
{
816-
str = str.AfterFirst((' '));
817-
if (!str.IsEmpty())
818-
CmdOpen(str);
819-
}
820-
else
821-
{
822-
verb = wxString::Format(_("[%s]\nis not a correct IPC action."),
823-
str.c_str());
824-
wxMessageBox(verb, _("Internal Error"));
825-
}
826-
}
827-
}
828-
}
829-
}
830-
/*---------------------------------------------------------------------------*/
831764
void wxSQLitePlusFrame::OnDbtreeItemRightClick(wxTreeEvent& event)
832765
{
833766
wxTreeItemId item = event.GetItem();
@@ -2700,31 +2633,3 @@ bool wxSQLitePlusFrame::DoFinishTransaction()
27002633
}
27012634
}
27022635
/*---------------------------------------------------------------------------*/
2703-
void wxSQLitePlusFrame::LaunchServer()
2704-
{
2705-
wxIPV4address addr;
2706-
2707-
addr.Service(0); // pick an open port number.
2708-
// Création du serveur
2709-
m_Server = new wxSocketServer(addr);
2710-
2711-
// On teste si le serveur écoute
2712-
if (m_Server->Ok())
2713-
{
2714-
// Gets the new address, actually it is just the port number
2715-
m_Server->GetLocal(addr);
2716-
wxGetApp().SetService((unsigned int)addr.Service());
2717-
// On indique que le gestionnaire d'évènement est La fenêtre
2718-
m_Server->SetEventHandler(*this, ID_IPC_SERVER);
2719-
// Spécification des évènements à générer
2720-
m_Server->SetNotify(wxSOCKET_CONNECTION_FLAG);
2721-
// les évènements peuvent être générés
2722-
m_Server->Notify(true);
2723-
}
2724-
else
2725-
{
2726-
delete m_Server;
2727-
m_Server = NULL;
2728-
}
2729-
}
2730-
/*---------------------------------------------------------------------------*/

src/sqliteplusframe.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,13 @@ class wxSQLitePlusFrame: public wxFrame
8585

8686
void CmdOpen(const wxString& file);
8787

88-
void LaunchServer();
89-
9088
protected:
9189

9290
void Init();
9391
void CreateControls();
9492
void CreateToolbars();
9593
void CreateMenus();
9694

97-
void OnServerEvent(wxSocketEvent& event);
98-
void OnSrvSocketEvent(wxSocketEvent& event);
99-
10095
void OnCloseWindow(wxCloseEvent& event);
10196
void OnDbtreeItemRightClick(wxTreeEvent& event);
10297
void OnDbtreeItemSelChanged(wxTreeEvent& event);
@@ -156,7 +151,6 @@ class wxSQLitePlusFrame: public wxFrame
156151

157152
private:
158153

159-
wxSocketServer* m_Server;
160154
wxAuiManager m_auiManager;
161155
wxTreeCtrl* m_TreeCtrl;
162156
wxAuiNotebook* m_CenterNotebook;

0 commit comments

Comments
 (0)