]> code.citadel.org Git - citadel.git/commitdiff
Changed 'enter' so that in normal rooms it doesn't ask 'to' anymore. Now
authorSteve Williams <patriot@uncensored.citadel.org>
Wed, 15 Dec 1999 02:43:08 +0000 (02:43 +0000)
committerSteve Williams <patriot@uncensored.citadel.org>
Wed, 15 Dec 1999 02:43:08 +0000 (02:43 +0000)
it only asks for a recipient in Mail.

Remove delete this; in button_goto (roomview.cpp), as it was causing
daphne to crash if goto was clicked more than once.  Unfortunately this
results in a potentially infinite number of room windows open at once,
but as this was the MAIN instability issue with the Linux version it had
to be dealt with.

Worked more on the windows port.  Executable is unstable and will be
worked on this week.  unfortunately wxWindows is not nearly as portable as
stated and I'll have to learn a whole new set of commands to deal with the
MSW port.  Getting there though.

daphne/Makefile
daphne/citclient.cpp
daphne/enter.cpp
daphne/includes.hpp
daphne/roomview.cpp

index cd1127f14a3a60ec29947ddd767b2678f39f4ccf..a3b40fb7ff7d9777b13471a03755f8b0414c9491 100644 (file)
@@ -6,7 +6,7 @@ all: daphne
 .SUFFIXES: .cpp .o .hpp
 
 .cpp.o:
-       c++ $(CFLAGS) -c -lwine $<
+       c++ $(CFLAGS) -c  $<
 
 
 daphne: main.o citclient.o userlogin.o testwindow.o who.o \
index fee17a290c2a9f38f5158fd8ff06e5f354f91a64..ef4e2fcc5572c39281ca3d88f6345d2e32d0ed43 100644 (file)
@@ -21,14 +21,12 @@ int CitClient::attach(wxString host, wxString port) {
         sock->SetNotify(0);
         sock->Connect(addr, TRUE);
         if (sock->IsConnected()) {
-/*                cout << "Connect succeeded\n" ; */
                 serv_gets(ServerReady);
                 initialize_session();
                curr_host = host;       // Remember host and port, in case
                curr_port = port;       // we need to auto-reconnect later
                 return(0);
         } else {
-               /* cout << "Connect failed\n" ;*/
                 return(1);
         }
 }
@@ -96,7 +94,6 @@ void CitClient::serv_gets(wxString& buf) {
                if (nl_pos < 0) {
                        sock->Read(&charbuf[nbytes], (sizeof(charbuf)-nbytes) );
                        nbytes += sock->LastCount();
-               /*      cout << "Read " << sock->LastCount() << " bytes \n";*/
                }
                for (i=nbytes; i>=0; --i)
                        if (charbuf[i] == 10) nl_pos = i;
@@ -116,7 +113,6 @@ void CitClient::serv_gets(wxString& buf) {
         GetLine(sock, buf);
 */
 
-/*     cout << "> " << buf << "(len=" << buf.Len() << ")\n"; */
 }
 
 
@@ -127,7 +123,6 @@ void CitClient::serv_gets(wxString& buf) {
 // Write a line of text to the server
 void CitClient::serv_puts(wxString buf) {
 
-       /* cout << "< " << buf << "\n" ; */
         sock->Write((const char *)buf, buf.Len());
         sock->Write("\n", 1);
 }
@@ -169,7 +164,6 @@ int CitClient::serv_trans(
 
        // If a mutex is to be wrapped around this function in the future,
        // it must begin HERE.
-/*     cout << "Beginning transaction\n"; */
        Critter.Enter();
        // wxBeginBusyCursor();
 
@@ -219,16 +213,13 @@ int CitClient::serv_trans(
 
        // If a mutex is to be wrapped around this function in the future,
        // it must end HERE.
-/*     cout << "Ending transaction...\n"; */
        // wxEndBusyCursor();
        Critter.Leave();
-/*     cout << "...done.\n"; */
 
        if (express_messages_waiting) {
                download_express_messages();
        }
 
-/*     cout << "serv_trans() returning " << first_digit << "\n"; */
        return first_digit;
 }
 
@@ -343,19 +334,16 @@ void CitClient::reconnect_session(void) {
 
        if (attach(curr_host, curr_port) != 0) {
                // FIX do this more elegantly
-       /*      cout << "Could not re-establish session (1)\n"; */
        }
 
        sendcmd = "USER " + curr_user;
        if (serv_trans(sendcmd) != 3) {
                // FIX do this more elegantly
-       /*      cout << "Could not re-establish session (2)\n"; */
        }
 
        sendcmd = "PASS " + curr_pass;
        if (serv_trans(sendcmd) != 2) {
                // FIX do this more elegantly
-       /*      cout << "Could not re-establish session (3)\n"; */
        }
 }
 
index 09fbe7bd8b510009d2e7d4b72aba11e6016f761a..d0d55a05bf75338824f574fc0f1e2796652b0bd4 100644 (file)
@@ -16,8 +16,11 @@ END_EVENT_TABLE()
 
 // frame constructor
 EnterMessage::EnterMessage(
-       CitClient *sock, wxMDIParentFrame *MyMDI,
-       wxString roomname, unsigned int roomflags)
+       CitClient *sock, 
+       wxMDIParentFrame *MyMDI,
+       wxString roomname, 
+       unsigned int roomflags) 
+
        : wxMDIChildFrame(MyMDI,        //parent
                        -1,     //window id
                        roomname + ": enter message",
@@ -53,6 +56,7 @@ EnterMessage::EnterMessage(
                 " Save ",
                 wxDefaultPosition);
 
+
        wxLayoutConstraints *c2 = new wxLayoutConstraints;
        c2->bottom.SameAs(cancel_button, wxBottom);
        c2->right.LeftOf(cancel_button, 5);
@@ -74,7 +78,7 @@ EnterMessage::EnterMessage(
        c6->height.AsIs();
        fromlabel->SetConstraints(c6);
 
-       wxString posting_name_choices[2];
+       wxString posting_name_choices[2]; 
        int num_choices;
 
        if (roomflags & QR_ANONONLY) {
@@ -103,8 +107,11 @@ EnterMessage::EnterMessage(
 
 
        // There may also be the opportunity to present a recipient.
-       // FIX ... disable this if we're not in a mail room
+       // FIX ... disable this if we're not in a mail room 
 
+       // Fixed, smw - 12/14/99
+       
+       if (roomname == "Mail") {
        wxStaticText *tolabel = new wxStaticText(this, -1, "To: ");
 
        wxLayoutConstraints *c8 = new wxLayoutConstraints;
@@ -137,7 +144,7 @@ EnterMessage::EnterMessage(
        d1->height.AsIs();
        findrecp->SetConstraints(d1);
 
-
+}
 
 
        // The main portion of this screen is a text entry box.
index 270960a5716389e34e6c9ed679ed6ed2acc3babd..03b944dcd53b10ac2750cd4c0e52e331a9d2bf1d 100644 (file)
@@ -320,8 +320,9 @@ private:
 
 class EnterMessage : public wxMDIChildFrame {
 public:
-       EnterMessage(CitClient *sock, wxMDIParentFrame *MyMDI,
-               wxString roomname, unsigned int roomflags);
+       EnterMessage(CitClient *sock,  
+       wxMDIParentFrame *MyMDI,
+       wxString roomname, unsigned int roomflags);
 private:
        void OnCancel(wxCommandEvent& whichbutton);
        void OnSave(wxCommandEvent& whichbutton);
index 1e0fc77ae0f38872eb83e947e0aa17c5c7846ade..3f03aea1c9ff9df1b334a1367e43ba97b36bc455 100644 (file)
@@ -256,7 +256,6 @@ void RoomView::OnButtonPressed(wxCommandEvent& whichbutton) {
                sendcmd = "SLRP HIGHEST";       // mark messages as read
                citsock->serv_trans(sendcmd, recvcmd, xferbuf, ThisRoom);
                new RoomView(citsock, citMyMDI, RoomList->GetNextRoom());
-               delete this;
        } else if (whichbutton.GetId() == BUTTON_ZAP) {
                if (citadel->IsConnected()==FALSE) {
                wxMessageBox("You are not connected to a BBS.");
@@ -304,11 +303,11 @@ void RoomView::do_readloop(wxString readcmd) {
        allmsgs = "<HTML><BODY>";
        i = 0;
        while (pos = xferbuf.Find('\n', FALSE), (pos >= 0)) {
-
+       
                buf.Printf("Reading message %d", ++i);
                citMyMDI->SetStatusText(buf, 0);
                 wxYield();
-
+               
                buf = xferbuf.Left(pos);
                xferbuf = xferbuf.Mid(pos+1);
 
@@ -322,7 +321,9 @@ void RoomView::do_readloop(wxString readcmd) {
                delete message;
 
                allmsgs += "<HR>";
-        }
+               
+               }
+
        citMyMDI->SetStatusText("Done", 0);
        allmsgs += "</BODY></HTML>";