]> code.citadel.org Git - citadel.git/commitdiff
Only allow one Wholist window at a time.
authorArt Cancro <ajc@citadel.org>
Mon, 8 Mar 1999 02:48:11 +0000 (02:48 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 8 Mar 1999 02:48:11 +0000 (02:48 +0000)
daphne/includes.hpp
daphne/main.cpp

index 8658b1fc03285c59552aa6fb5978936a17352739..84a2d1da8220afb8e20f7a64965c91514337b3c7 100644 (file)
@@ -8,6 +8,7 @@
 #include "utils.h"
 
 
+// TCPsocket represents a socket-level TCP connection to a server.
 class TCPsocket {
 public:
        TCPsocket::TCPsocket(void);
@@ -26,7 +27,7 @@ private:
 
 
 
-
+// CitClient represents an application-level connection to a Citadel server.
 class CitClient {
 public:
        CitClient(void);
@@ -79,7 +80,7 @@ private:
 };
 
 
-
+// Receive an express message (page)
 class express_message : public wxFrame {
 public:
        express_message(CitClient *sock, wxString sender,
@@ -106,7 +107,10 @@ private:
        wxMDIParentFrame *citMyMDI;
        DECLARE_EVENT_TABLE()
 };
-// userlogin is the frame for logging in.
+
+
+
+// Just testing...
 class TestWindow : public wxMDIChildFrame {
 public:
        TestWindow(CitClient *sock, wxMDIParentFrame *MyMDI);
@@ -120,6 +124,10 @@ private:
        CitClient *citsock;
        DECLARE_EVENT_TABLE()
 };
+
+
+
+
 // userlogin is the frame for logging in.
 class UserLogin : public wxMDIChildFrame {
 public:
@@ -137,7 +145,9 @@ private:
        wxMDIParentFrame *citMyMDI;
        DECLARE_EVENT_TABLE()
 };
-// userlogin is the frame for logging in.
+
+
+// Who is online?
 class who : public wxMDIChildFrame {
 public:
        who(CitClient *sock, wxMDIParentFrame *MyMDI);
index 6778991bbaa255aef9ff4dad4d39268d58acc9a5..75e7d9a22ec0c7513261cc2cbde606a3760c238d 100644 (file)
@@ -42,6 +42,9 @@ private:
        void OnUsersMenu(wxCommandEvent& cmd);
        void OnWindowMenu(wxCommandEvent& cmd);
        wxButton *do_cmd;
+
+       who *TheWholist;
+
        // any class wishing to process wxWindows events must use this macro
        DECLARE_EVENT_TABLE()
 };
@@ -140,6 +143,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
                title, pos, size, wxDEFAULT_FRAME_STYLE
                ) {
 
+       TheWholist = NULL;
+
        // create a menu bar
        wxMenu *menuFile = new wxMenu;
        menuFile->Append(MENU_CONNECT, "&Connect");
@@ -197,8 +202,12 @@ void MyFrame::OnUsersMenu(wxCommandEvent& cmd) {
        int id;
        
        id = cmd.GetId();
-       if (id == UMENU_WHO)
-               new who(citadel, this);
+       if (id == UMENU_WHO) {
+               if (TheWholist == NULL)
+                       TheWholist = new who(citadel, this);
+               else
+                       TheWholist->Activate();
+       }
        else if (id == UMENU_SEND_EXPRESS)
                new SendExpress(citadel, this, NULL);
 }