Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/gtk-stats/gtkStatsBadVersionWindow.cxx

Go to the documentation of this file.
00001 // Filename: gtkStatsBadVersionWindow.cxx
00002 // Created by:  drose (18May01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "gtkStatsBadVersionWindow.h"
00020 #include "gtkStatsMonitor.h"
00021 
00022 #include <string_utils.h>
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //     Function: GtkStatsBadVersionWindow::Constructor
00026 //       Access: Public
00027 //  Description:
00028 ////////////////////////////////////////////////////////////////////
00029 GtkStatsBadVersionWindow::
00030 GtkStatsBadVersionWindow(GtkStatsMonitor *monitor,
00031                          int client_major, int client_minor,
00032                          int server_major, int server_minor) {
00033   set_title("Bad client");
00034 
00035   Gtk::VBox *box1 = new Gtk::VBox;
00036   box1->show();
00037   box1->set_border_width(8);
00038   add(*manage(box1));
00039 
00040   string message =
00041     "Rejected connection by " +
00042     monitor->get_client_progname() + " from " +
00043     monitor->get_client_hostname() + ".\nClient uses PStats version " +
00044     format_string(client_major) + "." + format_string(client_minor) +
00045     ",\nwhile server expects PStats version " +
00046     format_string(server_major) + "." + format_string(server_minor) + ".";
00047 
00048   Gtk::Label *label = new Gtk::Label(message);
00049   label->show();
00050   box1->pack_start(*manage(label), true, false, 8);
00051 
00052   Gtk::HBox *box2 = new Gtk::HBox;
00053   box2->show();
00054   box1->pack_start(*manage(box2), false, false, 0);
00055 
00056   Gtk::Button *close = new Gtk::Button("Close");
00057   close->set_usize(80, 30);
00058   close->show();
00059   box2->pack_start(*manage(close), true, false, 0);
00060   close->clicked.connect(slot(this, &GtkStatsBadVersionWindow::close_clicked));
00061 
00062   setup();
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function: GtkStatsBadVersionWindow::close_clicked
00067 //       Access: Private
00068 //  Description:
00069 ////////////////////////////////////////////////////////////////////
00070 void GtkStatsBadVersionWindow::
00071 close_clicked() {
00072   destruct();
00073 }

Generated on Fri May 2 03:19:59 2003 for Panda-Tool by doxygen1.3