]> code.citadel.org Git - citadel.git/commitdiff
stuff
authorArt Cancro <ajc@citadel.org>
Mon, 22 Feb 1999 04:58:01 +0000 (04:58 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Feb 1999 04:58:01 +0000 (04:58 +0000)
daphne/Makefile
daphne/citclient.cpp
daphne/daphne
daphne/userlogin.cpp
daphne/utils.c [new file with mode: 0644]
daphne/utils.h [new file with mode: 0644]

index 22e1fa7956721eaa7842aa60cb3b2e1046c98577..b0917d32ce68492ed5b91ddd7ae6d1765a645b31 100644 (file)
@@ -1,8 +1,8 @@
 CFLAGS=`wx-config --cflags`
 LFLAGS=`wx-config --libs`
 
-daphne: main.o citclient.o userlogin.o testwindow.o who.o
-       c++ main.o citclient.o userlogin.o testwindow.o who.o \
+daphne: main.o citclient.o userlogin.o testwindow.o who.o utils.o
+       c++ main.o citclient.o userlogin.o testwindow.o who.o utils.o \
        $(LFLAGS) -o daphne
 
 main.o: main.cpp
@@ -19,3 +19,6 @@ testwindow.o: testwindow.cpp
 
 who.o: who.cpp
        c++ -c $(CFLAGS) who.cpp
+
+utils.o: utils.c
+       c++ -c $(CFLAGS) utils.c
index d7d6ea20ee4d61b2b835a157bf2dc285aa04c3ee..abeab8eecbee2d4d8eb265fa6ac47f6b56275685 100644 (file)
@@ -20,6 +20,7 @@ int CitClient::attach(const wxString& host, const wxString& port) {
        sock.SetNotify(0);
        sock.Connect(addr, TRUE);
        if (sock.IsConnected()) {
+               sock.WaitForRead(-1, 0);
                serv_gets(ServerReady);
                // FIX ... add check for not allowed to log in
                initialize_session();
@@ -97,6 +98,7 @@ int CitClient::serv_trans(
 
        serv_puts(command);
        serv_gets(response);
+       if (response.Length()==0) serv_gets(response);  //FIX vile sleazy hack
        first_digit = (response.GetChar(0)) - '0';
 
        if (first_digit == 1) {                 // LISTING_FOLLOWS
index 9effde8b2369c1b01361bcb021a9bd18b82841cc..3a9e70a00519efe49dab298c7d2f40ccc4cd8119 100755 (executable)
Binary files a/daphne/daphne and b/daphne/daphne differ
index da81a83d7247dbdd684d1d9ab4ee657b13bca377..17c30697fa808711fb725a51b019b63aaca784ad 100644 (file)
@@ -8,6 +8,7 @@
 #include "citclient.hpp"
 #include "userlogin.hpp"
 #include "who.hpp"
+#include "utils.h"
 
 // ----------------------------------------------------------------------------
 // private classes
@@ -60,6 +61,9 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
                        "UserLogin"
                        ) {
 
+       wxString sendcmd, recvcmd;
+       wxStringList xferbuf;
+
        citsock = sock;
        citMyMDI = MyMDI;
 
@@ -131,36 +135,34 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
                "exit_button"
                );
 
-
-       wxPanel *hnodepanel = new wxPanel(this, -1, wxDefaultPosition,
-                       wxDefaultSize, 0L, "");
-       hnodepanel->SetBackgroundColour(wxColour(0x00, 0x00, 0x77));
-       hnodepanel->SetForegroundColour(wxColour(0xFF, 0xFF, 0x00));
+       wxTextCtrl *hello = new wxTextCtrl(this, -1,
+               "", //value
+               wxDefaultPosition, wxDefaultSize,
+               wxTE_MULTILINE | wxTE_READONLY,
+               wxDefaultValidator, "");
 
        wxStaticText *humannode = new wxStaticText(
-               hnodepanel, -1, citsock->HumanNode,
+               this, -1, citsock->HumanNode,
                wxDefaultPosition, wxDefaultSize, 0, "");
        humannode->SetBackgroundColour(wxColour(0x00, 0x00, 0x77));
        humannode->SetForegroundColour(wxColour(0xFF, 0xFF, 0x00));
-       humannode->SetFont(wxFont(24, wxDEFAULT, wxNORMAL, wxNORMAL,
-                               FALSE, ""));
-
-       wxLayoutConstraints *t0 = new wxLayoutConstraints;
-       t0->top.SameAs(this, wxTop, 10);
-       t0->height.SameAs(this, wxTop, 50);
-       t0->left.SameAs(this, wxLeft, 10);
-       t0->right.SameAs(this, wxRight, 10);
-       hnodepanel->SetConstraints(t0);
+       /*humannode->SetFont(wxFont(24, wxDEFAULT, wxNORMAL, wxNORMAL,
+                               FALSE, ""));*/
 
        wxLayoutConstraints *t1 = new wxLayoutConstraints;
        t1->top.SameAs(this, wxTop, 10);
        t1->height.AsIs();
-       //t1->left.SameAs(this, wxLeft, 10);
-       //t1->right.SameAs(this, wxRight, 10);
        t1->centreX.SameAs(this, wxCentreX);
        t1->width.AsIs();
        humannode->SetConstraints(t1);
 
+       wxLayoutConstraints *h0 = new wxLayoutConstraints;
+       h0->top.Below(humannode, 10);
+       h0->bottom.Above(username, -10);
+       h0->left.SameAs(this, wxLeft, 10);
+       h0->right.SameAs(this, wxRight, -20);
+       hello->SetConstraints(h0);
+
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
        c1->bottom.SameAs(this, wxBottom, 10);          // 10 from the bottom
        c1->centreX.SameAs(this, wxCentreX);            // in the middle
@@ -207,6 +209,14 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
 
        SetAutoLayout(TRUE);
        Show(TRUE);
+
+       sendcmd = "MESG hello";
+       if (citsock->serv_trans(sendcmd, recvcmd, xferbuf)==1) {
+               ListToMultiline(recvcmd, xferbuf);
+               hello->SetValue(recvcmd);
+       }
+
+
 }
 
 
diff --git a/daphne/utils.c b/daphne/utils.c
new file mode 100644 (file)
index 0000000..383a001
--- /dev/null
@@ -0,0 +1,15 @@
+
+#include <wx/wx.h>
+#include "utils.h"
+
+void ListToMultiline(wxString& outputbuf, wxStringList inputlist) {
+       int i;
+       wxString buf;
+
+       outputbuf.Empty();
+       for (i=0; i<inputlist.Number(); ++i) {
+               buf.Printf("%s", (wxString *)inputlist.Nth(i)->GetData());
+               outputbuf.Append(buf);
+               outputbuf.Append("\n");
+       }
+}
diff --git a/daphne/utils.h b/daphne/utils.h
new file mode 100644 (file)
index 0000000..529a584
--- /dev/null
@@ -0,0 +1 @@
+void ListToMultiline(wxString& outputbuf, wxStringList inputlist);