]> code.citadel.org Git - citadel.git/commitdiff
Killed the refresh timer in who.cpp
authorSteve Williams <patriot@uncensored.citadel.org>
Mon, 15 Nov 1999 04:19:19 +0000 (04:19 +0000)
committerSteve Williams <patriot@uncensored.citadel.org>
Mon, 15 Nov 1999 04:19:19 +0000 (04:19 +0000)
Updated the who function so that refreshes are no longer automated, but
WILL work when clicking on 'refresh' on the who window.
who_refresh had a timer which wasn't stoppable, which would, when
connecting to another bbs, continue running and then core dump.
Removed the read new button from roomview.  It wasn't necessary as new
messages dump automatically.

daphne/ChangeLog
daphne/citclient.cpp
daphne/includes.hpp
daphne/main.cpp
daphne/roomtree.cpp
daphne/roomview.cpp
daphne/userlogin.cpp
daphne/who.cpp

index 547c760a7c2218644ab0bdaf6494f2fbde27d349..0246751cedb73439494ca6a0a67d41818b3e4ed6 100644 (file)
@@ -1,7 +1,16 @@
- $Log$
- Revision 1.8  1999/11/12 00:49:05  smw
- Updated README.  Tweaked zip slightly.  Started mods for Chat and for
- 'reply to' mail.
+$Log$
+Revision 1.9  1999/11/15 04:19:18  smw
+Killed the refresh timer in who.cpp
+Updated the who function so that refreshes are no longer automated, but
+WILL work when clicking on 'refresh' on the who window.
+who_refresh had a timer which wasn't stoppable, which would, when
+connecting to another bbs, continue running and then core dump.
+Removed the read new button from roomview.  It wasn't necessary as new
+messages dump automatically.
+
+Revision 1.8  1999/11/12 00:49:05  smw
+Updated README.  Tweaked zip slightly.  Started mods for Chat and for
+'reply to' mail.
 
 Revision 1.7  1999/11/11 05:41:38  smw
 Another zap tweak:  After zapping a room the user is taken directly to the
index 9c04ca5ba5119f3f190c93d3a1e1e7acbc2ddd54..fee17a290c2a9f38f5158fd8ff06e5f354f91a64 100644 (file)
@@ -174,12 +174,12 @@ int CitClient::serv_trans(
        // wxBeginBusyCursor();
 
        serv_puts(command);
-
+/*
        if (IsConnected() == FALSE) {
                wxSleep(20);    // Give a crashed server some time to restart
                reconnect_session();
                serv_puts(command);
-       }
+       } */
 
        serv_gets(response);
 
index 93242a8313f1e54eb496f72e15b50c2e2439b98e..270960a5716389e34e6c9ed679ed6ed2acc3babd 100644 (file)
@@ -237,7 +237,6 @@ private:
 };
 
 
-
 // Global server properties
 
 class ServProps : public wxMDIChildFrame {
index 7d71dbf797ee54d68b046c1756b55c94e94e2c0c..e0e92c2fa9d027bc6bd2c067c9fbee2f806d529b 100644 (file)
@@ -365,11 +365,12 @@ void MyFrame::DoTerm(wxCommandEvent& WXUNUSED(event))
 
         // Kill the client connection and don't destroy Daphne
         citadel->detach();
-       BigMDI->SetStatusText("Not connected"); 
-       delete TheWholist;
+       BigMDI->SetStatusText("Not connected", 0);      
        RoomList->DeleteAllItems();
-}
-
+       BigMDI->SetStatusText("", 1);
+       BigMDI->SetStatusText("", 2);
+ }
 
 
 // Edit menu handler
@@ -416,7 +417,6 @@ void MyFrame::OnRoomsMenu(wxCommandEvent& cmd) {
                        if (citadel->IsConnected()==FALSE) {
                 wxMessageBox("You are not connected to a BBS.");
         } else
-
                new RoomView(citadel, this, RoomList->GetNextRoom());
        }
 }
index 024dfd6d273d412eefc8baa449c2b863a6471df3..8bed5eb202391e4b4010fa1100ddbc926c1f307f 100644 (file)
@@ -15,8 +15,8 @@ enum {
        RI_NOTHING,
        RI_ROOM,
        RI_CURRUSER,
-       RI_SERVPROPS,
-       RI_ZAPPED
+       RI_SERVPROPS
+/*     RI_ZAPPED */
 };
 
 
@@ -97,7 +97,7 @@ void RoomTree::LoadRoomList(void) {
        wxTreeItemId prev;
        int i, pos, floornum, where;
        int mailfloor;
-       int zapfloor;
+/*     int zapfloor; */
        unsigned int roomflags;
 
        prev = null_item;
@@ -195,7 +195,7 @@ void RoomTree::LoadRoomList(void) {
        }
 
 
-       // Create a bogus floor for zapped rooms
+/*     // Create a bogus floor for zapped rooms
 
        zapfloor = AppendItem(
                GetRootItem(),
@@ -225,7 +225,7 @@ void RoomTree::LoadRoomList(void) {
                         );
         }
 
-
+*/
 
        wxTreeItemId sp = AppendItem(
                GetRootItem(),
@@ -290,10 +290,10 @@ void RoomTree::OnDoubleClick(wxTreeEvent& evt) {
                RoomList->LoadRoomList();
                break;
 
-       case RI_ZAPPED:
+/*     case RI_ZAPPED:
                RoomList->DeleteAllItems();
                RoomList->LoadRoomList(); 
-               break;
+               break; */
 
 
        case RI_SERVPROPS:
index fc15c7d893bf667b585f105d9b11a9e3b95965cf..1f7030606b9eefeaab6b48f45629f6586854947c 100644 (file)
@@ -5,10 +5,10 @@ enum {
        BUTTON_GOTO,
        BUTTON_SKIP,
        BUTTON_CLOSE,
-       BUTTON_READNEW,
+/*     BUTTON_READNEW, */
        BUTTON_READALL,
        BUTTON_ENTER,
-       BUTTON_ZAP
+       BUTTON_ZAP 
 };
 
 
@@ -16,10 +16,10 @@ BEGIN_EVENT_TABLE(RoomView, wxMDIChildFrame)
        EVT_BUTTON(     BUTTON_GOTO,            RoomView::OnButtonPressed)
        EVT_BUTTON(     BUTTON_SKIP,            RoomView::OnButtonPressed)
        EVT_BUTTON(     BUTTON_CLOSE,           RoomView::OnButtonPressed)
-       EVT_BUTTON(     BUTTON_READNEW,         RoomView::OnButtonPressed)
+/*     EVT_BUTTON(     BUTTON_READNEW,         RoomView::OnButtonPressed)*/
        EVT_BUTTON(     BUTTON_READALL,         RoomView::OnButtonPressed)
        EVT_BUTTON(     BUTTON_ENTER,           RoomView::OnButtonPressed)
-       EVT_BUTTON(     BUTTON_ZAP,             RoomView::OnButtonPressed)
+       EVT_BUTTON(     BUTTON_ZAP,             RoomView::OnButtonPressed)
 END_EVENT_TABLE()
 
 
@@ -147,18 +147,18 @@ RoomView::RoomView(
        g3->right.LeftOf(goto_button, 3);
        skip_button->SetConstraints(g3);
 
-       wxButton *readnew_button = new wxButton(
+/*     wxButton *readnew_button = new wxButton(
                this,
                BUTTON_READNEW,
                " Read new ",
-               wxDefaultPosition);
+               wxDefaultPosition); 
 
        wxLayoutConstraints *c2 = new wxLayoutConstraints;
        c2->top.SameAs(skip_button, wxTop);
        c2->bottom.SameAs(skip_button, wxBottom);
        c2->width.AsIs();
        c2->right.LeftOf(skip_button, 3);
-       readnew_button->SetConstraints(c2);
+       readnew_button->SetConstraints(c2); */
 
        wxButton *readall_button = new wxButton(
                this,
@@ -167,10 +167,10 @@ RoomView::RoomView(
                wxDefaultPosition);
 
        wxLayoutConstraints *c3 = new wxLayoutConstraints;
-       c3->top.SameAs(readnew_button, wxTop);
-       c3->bottom.SameAs(readnew_button, wxBottom);
+       c3->top.SameAs(goto_button, wxTop);
+       c3->bottom.SameAs(goto_button, wxBottom);
        c3->width.AsIs();
-       c3->right.LeftOf(readnew_button, 3);
+       c3->right.LeftOf(goto_button, 3);
        readall_button->SetConstraints(c3);
 
        wxButton *enter_button = new wxButton(
@@ -225,8 +225,8 @@ void RoomView::OnButtonPressed(wxCommandEvent& whichbutton) {
 
        if (whichbutton.GetId() == BUTTON_CLOSE) {
                delete this;
-       } else if (whichbutton.GetId() == BUTTON_READNEW) {
-               do_readloop("MSGS NEW");
+/*     } else if (whichbutton.GetId() == BUTTON_READNEW) { 
+               do_readloop("MSGS NEW"); */
        } else if (whichbutton.GetId() == BUTTON_READALL) {
                do_readloop("MSGS ALL");
        } else if (whichbutton.GetId() == BUTTON_ENTER) {
@@ -244,7 +244,7 @@ void RoomView::OnButtonPressed(wxCommandEvent& whichbutton) {
                citsock->serv_trans(sendcmd, recvcmd, xferbuf, ThisRoom);
                new RoomView(citsock, citMyMDI, "_BASEROOM_"); 
                RoomList->LoadRoomList();
-               delete this;
+               delete this; 
        }
 }
 
index 6770c71b3dc8ea315a9faf279c63a391772a37f0..da78a2bdc4ca5388c82166c96e2973a284f0f281 100644 (file)
@@ -145,7 +145,7 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
         banner->SetConstraints(b1);
 
         wxStaticText *rname = new wxStaticText(banner, -1, citsock->HumanNode);
-        rname->SetFont(wxFont(18, wxDEFAULT, wxNORMAL, wxNORMAL));
+        rname->SetFont(wxFont(16, wxDEFAULT, wxNORMAL, wxNORMAL));
         rname->SetForegroundColour(wxColour(0xFF, 0xFF, 0x00));
         wxLayoutConstraints *t2 = new wxLayoutConstraints;
         t2->top.SameAs(banner, wxTop, 1);
index cdf2a393ab11eccd7b2ad62eb8bb5ae952eff314..0186de608874b07084847f663633e25c623c0192 100644 (file)
@@ -15,7 +15,8 @@
 // IDs for the controls and the menu commands
 enum
 {
-       BUTTON_DISMISS
+       BUTTON_REFRESH,
+       BUTTON_CLOSE,
 };
 
 // ----------------------------------------------------------------------------
@@ -26,6 +27,8 @@ enum
 // handlers) which process them. It can be also done at run-time, but for the
 // simple menu events like this the static method is much simpler.
 BEGIN_EVENT_TABLE(     who, wxMDIChildFrame)
+       EVT_BUTTON(     BUTTON_REFRESH,         who::OnButtonPressed)
+       EVT_BUTTON(     BUTTON_CLOSE,           who::OnButtonPressed)
 END_EVENT_TABLE()
 
 // ============================================================================
@@ -52,8 +55,7 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
        citsock = sock;
 
 
-
-       who_refresh *ref = new who_refresh(this);
+       /*who_refresh *ref = new who_refresh(this);*/
 
        // set the frame icon
        /* SetIcon(wxICON(mondrian)); */
@@ -68,10 +70,33 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
                "wholist");
 
 
+       wxButton *refresh_button = new wxButton(
+               this,
+               BUTTON_REFRESH,
+               "Refresh",
+               wxPoint(100,100),
+               wxSize(100,30),
+               0L,
+               wxDefaultValidator,
+               "refresh_button"
+               );
+
+       wxButton *close_button = new wxButton(
+               this,
+               BUTTON_CLOSE,
+               "Close",
+               wxPoint(200,200),
+               wxSize(100,30),
+               0L,
+               wxDefaultValidator,
+               "close_button"
+               );
+
+       
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
        c1->top.SameAs(this, wxTop, 10);                // 10 from the top
        c1->bottom.SameAs(this, wxBottom, 10);
-       c1->left.SameAs(this, wxLeft, 10);
+       c1->left.SameAs(this, wxLeft, 10); 
        c1->right.SameAs(this, wxRight, 10);
        wholist->SetConstraints(c1);
 
@@ -85,6 +110,20 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
        c2->centreX.SameAs(this, wxCentreX);
        c2->height.AsIs(); c2->width.AsIs();
 
+       wxLayoutConstraints *b1 = new wxLayoutConstraints;
+       b1->bottom.SameAs(this, wxBottom, 2);
+       b1->height.AsIs(); 
+       b1->width.AsIs();
+       b1->right.SameAs(this, wxRight, 10);
+       close_button->SetConstraints(b1);
+
+       wxLayoutConstraints *b2 = new wxLayoutConstraints;
+       b2->bottom.SameAs(close_button, wxBottom);
+       b2->left.SameAs(this, wxLeft, 10);
+       b2->height.AsIs(); 
+       b2->width.AsIs();
+       refresh_button->SetConstraints(b2);
+
        SetAutoLayout(TRUE);
        Show(TRUE);
        LoadWholist();
@@ -92,6 +131,17 @@ who::who(CitClient *sock, wxMDIParentFrame *MyMDI)
 }
 
 
+void who::OnButtonPressed(wxCommandEvent& whichbutton) {
+
+
+       if (whichbutton.GetId() == BUTTON_CLOSE) {
+       wholist->DeleteAllItems();      
+       delete this;
+}
+       if (whichbutton.GetId() == BUTTON_REFRESH) {
+       LoadWholist(); 
+}
+}
 // Load up the control
 void who::LoadWholist(void) {
 
@@ -102,6 +152,14 @@ void who::LoadWholist(void) {
        wxString sess, user, room, host;
        wxStringTokenizer *wl;
 
+               if (wholist==NULL) {
+               return; }
+                if (citadel->IsConnected()==FALSE) { 
+                wxMessageBox("You are not connected to a BBS."); 
+               return; 
+        } else 
+
+
        sendcmd = "RWHO";
        if (citsock->serv_trans(sendcmd, recvcmd, rwho) != 1) return;
        wholist->DeleteAllItems();
@@ -123,17 +181,23 @@ void who::LoadWholist(void) {
 
 
 
-
+/*
 who_refresh::who_refresh(who *parent_who)
        : wxTimer() {
 
+               if (citadel->IsConnected()==FALSE) {
+               Stop();
+               delete this;
+        } else
+
        which_who = parent_who;         // Know which instance to refresh
 
        Start(30000, FALSE);            // Call every 30 seconds
-}
+} */
 
 
-void who_refresh::Notify(void) {
+/*void who_refresh::Notify(void)  {
+
        which_who->LoadWholist();
-}
+} */