]> code.citadel.org Git - citadel.git/commitdiff
Fixed who list to remove itself when disconnecting a session
authorSteve Williams <patriot@uncensored.citadel.org>
Mon, 8 Nov 1999 01:04:47 +0000 (01:04 +0000)
committerSteve Williams <patriot@uncensored.citadel.org>
Mon, 8 Nov 1999 01:04:47 +0000 (01:04 +0000)
Fixed room list to remove itself when disconnecting a session
Fixed status bar to reflect 'not connected' when disconnect button
is pressed.

daphne/Makefile
daphne/main.cpp
daphne/userlogin.cpp
daphne/who.cpp

index 2d75914ec00457199f68d653fc654d5026f066c8..b31f82e5a1f04cb23bfca6c824a7e745e931c06a 100644 (file)
@@ -19,5 +19,8 @@ daphne: main.o citclient.o userlogin.o testwindow.o who.o \
        selectuser.o servprops.o \
        $(LFLAGS) -o daphne
 
+install: 
+       
+       cp daphne /usr/local/bin/./
 clean:
        rm -f *.o core daphne
index 8eeb52d903904c279caa5838e6fb8430ab9798ac..cda3b7fb903b5d0e38147b117a83fed49b73a4c2 100644 (file)
@@ -339,15 +339,16 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 }
 
 
-// Testing for doterm
+// doterm(inate session)
 
 void MyFrame::DoTerm(wxCommandEvent& WXUNUSED(event))
 {
 
-        // Kill the client connection
+        // Kill the client connection and don't destroy Daphne
         citadel->detach();
        BigMDI->SetStatusText("Not connected"); 
-       
+       delete TheWholist;
+       RoomList->DeleteAllItems();
 }
 
 
@@ -369,12 +370,20 @@ void MyFrame::OnUsersMenu(wxCommandEvent& cmd) {
        
        id = cmd.GetId();
        if (id == UMENU_WHO) {
+               if (citadel->IsConnected()==FALSE) {
+                wxMessageBox("You are not connected to a BBS.");
+        } else 
+
                 //if (TheWholist == NULL)
                        TheWholist = new who(citadel, this);
                 //else
                         //TheWholist->Activate();
        }
        else if (id == UMENU_SEND_EXPRESS)
+                       if (citadel->IsConnected()==FALSE) {
+                wxMessageBox("You are not connected to a BBS.");
+        } else 
+
                new SendExpress(citadel, this, "");
 }
 
@@ -385,6 +394,10 @@ void MyFrame::OnRoomsMenu(wxCommandEvent& cmd) {
        
        id = cmd.GetId();
        if (id == RMENU_GOTO) {
+                       if (citadel->IsConnected()==FALSE) {
+                wxMessageBox("You are not connected to a BBS.");
+        } else
+
                new RoomView(citadel, this, RoomList->GetNextRoom());
        }
 }
@@ -431,6 +444,10 @@ void MyFrame::OnConnect(wxCommandEvent& unused) {
 }
 
 void MyFrame::OnGotoMail(wxCommandEvent& unused) {
+       if (citadel->IsConnected()==FALSE) {
+       wxMessageBox("You are not connected to a BBS.");
+
+       } else
        new RoomView(citadel, this, "_MAIL_");
        }
 
index 6770c71b3dc8ea315a9faf279c63a391772a37f0..f8e5fcde4e6034c84e720900642a8e71018df84e 100644 (file)
@@ -293,6 +293,9 @@ void UserLogin::OnButtonPressed(wxCommandEvent& whichbutton) {
 void UserLogin::BeginSession(wxString serv_response) {
        wxString junk;
 
+       if (citadel->IsConnected()==FALSE) {
+       citsock->curr_user = "";
+       } else
        extract(citsock->curr_user, serv_response.Mid(4), 0);
        BigMDI->SetStatusText(citsock->curr_user, 1);
        citsock->GotoRoom("_BASEROOM_", "", junk);
index 498a92ea3a88202ad11c2a3f737b3c0c1cfdb3f7..cdf2a393ab11eccd7b2ad62eb8bb5ae952eff314 100644 (file)
@@ -48,8 +48,11 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
                        "who"
                        ) {
 
+
        citsock = sock;
 
+
+
        who_refresh *ref = new who_refresh(this);
 
        // set the frame icon
@@ -77,6 +80,11 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
        wholist->InsertColumn(2, "Room", wxLIST_FORMAT_CENTER, 150);
        wholist->InsertColumn(3, "From host", wxLIST_FORMAT_CENTER, 150);
 
+       wxLayoutConstraints *c2 = new wxLayoutConstraints;
+       c2->bottom.SameAs(this, wxBottom, 10);
+       c2->centreX.SameAs(this, wxCentreX);
+       c2->height.AsIs(); c2->width.AsIs();
+
        SetAutoLayout(TRUE);
        Show(TRUE);
        LoadWholist();
@@ -86,6 +94,8 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
 
 // Load up the control
 void who::LoadWholist(void) {
+
+
        wxString sendcmd, recvcmd, buf;
        wxString rwho;
        int i = 0;
@@ -109,7 +119,7 @@ void who::LoadWholist(void) {
                wholist->SetItem(i, 3, host);
                ++i;
        }
-}
+   }
 
 
 
@@ -126,3 +136,4 @@ who_refresh::who_refresh(who *parent_who)
 void who_refresh::Notify(void) {
        which_who->LoadWholist();
 }
+