]> code.citadel.org Git - citadel.git/commitdiff
Got the wholist to refresh
authorArt Cancro <ajc@citadel.org>
Mon, 1 Mar 1999 03:12:38 +0000 (03:12 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 1 Mar 1999 03:12:38 +0000 (03:12 +0000)
daphne/citclient.cpp
daphne/who.cpp
daphne/who.hpp

index 8be84473f32f5a0febff5ce5e001d28619492eec..98395d87321968d957618123751e2215e10333da 100644 (file)
@@ -92,13 +92,11 @@ void CitClient::serv_gets(wxString& buf) {
        //      sock.Read(charbuf, 1);
        //      if (isprint(charbuf[0])) buf.Append(charbuf[0], 1);
        //} while(isprint(charbuf[0]));
-       printf("<%s\n", (const char *)buf);
 }
 
 
 // Write a line of text to the server
 void CitClient::serv_puts(wxString buf) {
-       printf(">%s\n", (const char *)buf);
        //sock.Write(buf, strlen(buf));
        //sock.Write("\n", 1);
        sock.serv_puts(buf);
@@ -160,7 +158,7 @@ void CitClient::initialize_session(void)  {
        wxString *infoptr;
        wxString infoline;
 
-       sendcmd = "IDEN 0|6|000|Daphne";
+       sendcmd = "IDEN 0|6|001|Daphne";
        serv_trans(sendcmd);
 
        sendcmd = "INFO";
index adadb004547ad320a87dfbc746a12fdc501a1cd1..3bb4ce73827fa06f876ba5c9a5dff68db9147950 100644 (file)
@@ -55,6 +55,8 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
 
        citsock = sock;
 
+       who_refresh *ref = new who_refresh(this);
+
        // set the frame icon
        /* SetIcon(wxICON(mondrian)); */
 
@@ -110,3 +112,19 @@ void who::LoadWholist(void) {
                wholist->SetItem(i, 3, host);
        }
 }
+
+
+
+
+who_refresh::who_refresh(who *parent_who)
+       : wxTimer() {
+
+       which_who = parent_who;         // Know which instance to refresh
+
+       Start(30000, FALSE);            // Call every 30 seconds
+}
+
+
+void who_refresh::Notify(void) {
+       which_who->LoadWholist();
+}
index 2d147300dd9f78b21b76d5b69358207fc6464898..5d74acafaac1bf5398991318e549e268ea9808b6 100644 (file)
@@ -3,10 +3,20 @@ class who : public wxMDIChildFrame {
 public:
        who(CitClient *sock, wxMDIParentFrame *MyMDI);
        int do_login();
+       void LoadWholist();
 private:
        void OnButtonPressed(wxCommandEvent& whichbutton);
        CitClient *citsock;
        wxListCtrl *wholist;
-       void LoadWholist();
        DECLARE_EVENT_TABLE()
 };
+
+
+// This is a timer that periodically refreshes the wholist.
+class who_refresh : public wxTimer {
+public:
+       who_refresh(who *parent_who);
+private:
+       who *which_who;
+       void Notify(void);
+};