]> code.citadel.org Git - citadel.git/commitdiff
good stuff
authorArt Cancro <ajc@citadel.org>
Wed, 24 Feb 1999 03:31:59 +0000 (03:31 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 24 Feb 1999 03:31:59 +0000 (03:31 +0000)
daphne/citclient.cpp
daphne/citclient.hpp
daphne/main.cpp
daphne/tcp_sockets.hpp
daphne/userlogin.cpp
daphne/who.cpp
daphne/who.hpp

index 3b586c703286aa73f59197b51c360f07b7a013d0..8be84473f32f5a0febff5ce5e001d28619492eec 100644 (file)
@@ -3,7 +3,6 @@
 
 #include <wx/wx.h>
 
-#include "tcp_sockets.hpp"
 #include "citclient.hpp"
 
 
@@ -31,7 +30,7 @@ int CitClient::attach(const wxString& host, const wxString& port) {
 
        if (sock.is_connected())
                sock.detach();
-       if (sock.attach("uncnsrd.mt-kisco.ny.us", "citadel")==0) {
+       if (sock.attach(host, port)==0) {
                serv_gets(ServerReady);
                initialize_session();
                return(0);
index 0875c768cd0fe60d721b7e7ea5b7b847f71dff10..5a787fe091fb317a48eb824c5078dbceb6c651bd 100644 (file)
@@ -1,5 +1,7 @@
 #include <wx/socket.h>
 
+#include "tcp_sockets.hpp"
+
 class CitClient {
 public:
        CitClient(void);
index 19004195d487eb5c53691209008fc8f05bda43fa..cd7c236ea7e77a19396b0e6a6655541aa2f70e97 100644 (file)
@@ -221,7 +221,7 @@ void MyFrame::OnConnect(wxCommandEvent& unused) {
                wxMessageBox("You are already connected to a Citadel server.",
                        "Oops!");
        } else {
-               retval = citadel->attach("uncnsrd.mt-kisco.ny.us", "citadel");
+               retval = citadel->attach("uncnsrd", "citadel");
                if (retval == 0) {
                        SetStatusText("** connected **");
                        new TestWindow(citadel, this);
index cca840e3bda5e24fd3c96ad97681af121efa0b46..95ae97554ff87e94b1121d3dd0435a13b2c834e5 100644 (file)
@@ -9,7 +9,7 @@ public:
        void serv_puts(char *);
        bool is_connected(void);
 private:
-       int serv_sock = (-1);
+       int serv_sock;
        int connectsock(char *, char *, char *);
        void timeout(int);
 };
index 668a3f8bb7a2ab63dcdac7870bebd84a22a52af9..30c971672f186e61948529ba54c0cb06c8276b9e 100644 (file)
@@ -160,7 +160,7 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
        h0->top.Below(humannode, 10);
        h0->bottom.Above(username, -10);
        h0->left.SameAs(this, wxLeft, 10);
-       h0->width.SameAs(this, wxWidth, -20);
+       h0->right.SameAs(this, wxRight, 10);
        hello->SetConstraints(h0);
 
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
index 4ec63cc57d6816c7d60297aa2bd89262f8ff9d53..73552d68dfc125ab587fad1f59f01336fa7a6652 100644 (file)
@@ -69,11 +69,35 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
 
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
        c1->top.SameAs(this, wxTop, 10);                // 10 from the top
-       c1->bottom.SameAs(this, wxBottom, -10);
+       c1->bottom.SameAs(this, wxBottom, 10);
        c1->left.SameAs(this, wxLeft, 10);
-       c1->right.SameAs(this, wxRight, -10);
+       c1->right.SameAs(this, wxRight, 10);
        wholist->SetConstraints(c1);
 
+       wholist->InsertColumn(0, "Session", wxLIST_FORMAT_CENTER, (-1));
+       wholist->InsertColumn(1, "User name", wxLIST_FORMAT_CENTER, (-1));
+       wholist->InsertColumn(2, "Room", wxLIST_FORMAT_CENTER, (-1));
+       wholist->InsertColumn(3, "From host", wxLIST_FORMAT_CENTER, (-1));
+
        SetAutoLayout(TRUE);
        Show(TRUE);
+
+       LoadWholist();
+}
+
+
+// Load up the control
+void who::LoadWholist(void) {
+       wxString sendcmd, recvcmd, buf;
+       wxStringList rwho;
+       int i;
+
+       sendcmd = "RWHO";
+       if (citsock->serv_trans(sendcmd, recvcmd, rwho) != 2) return;
+       wholist->DeleteAllItems();
+
+        for (i=0; i<rwho.Number(); ++i) {
+                buf.Printf("%s", (wxString *)rwho.Nth(i)->GetData());
+               wholist->InsertItem((long)i, buf);
+       }
 }
index 4862cb5b54623275adaec88b398ba751a24f4af1..2d147300dd9f78b21b76d5b69358207fc6464898 100644 (file)
@@ -7,5 +7,6 @@ private:
        void OnButtonPressed(wxCommandEvent& whichbutton);
        CitClient *citsock;
        wxListCtrl *wholist;
+       void LoadWholist();
        DECLARE_EVENT_TABLE()
 };