NetworkWindow.cpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * The contents of this file are subject to the Mozilla Public
  3. * License Version 1.1 (the "License"); you may not use this file
  4. * except in compliance with the License. You may obtain a copy of
  5. * the License at http://www.mozilla.org/MPL/
  6. *
  7. * Software distributed under the License is distributed on an "AS
  8. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9. * implied. See the License for the specific language governing
  10. * rights and limitations under the License.
  11. *
  12. * The Original Code is Vision.
  13. *
  14. * The Initial Developer of the Original Code is The Vision Team.
  15. * Portions created by The Vision Team are
  16. * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
  17. * Reserved.
  18. *
  19. * Contributor(s): Rene Gollent
  20. */
  21. #include <View.h>
  22. #include <Messenger.h>
  23. #include "ClientWindow.h"
  24. #include "NetworkPrefsView.h"
  25. #include "NetPrefsServerView.h"
  26. #include "NetworkWindow.h"
  27. #include "Vision.h"
  28. #include <stdio.h>
  29. NetworkWindow::NetworkWindow (void)
  30. : BWindow (
  31. BRect (50, 50, 500, 350),
  32. S_NETWORK_WINDOW_TITLE,
  33. B_TITLED_WINDOW,
  34. B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
  35. {
  36. AddChild (new NetworkPrefsView (Bounds(), "network"));
  37. BRect netFrame (0,0,0,0);
  38. netFrame = vision_app->GetRect ("NetPrefWinRect");
  39. if (netFrame.Width() != 0.0)
  40. MoveTo(netFrame.left, netFrame.top);
  41. }
  42. NetworkWindow::~NetworkWindow (void)
  43. {
  44. //
  45. }
  46. bool
  47. NetworkWindow::QuitRequested (void)
  48. {
  49. vision_app->SetRect ("NetPrefWinRect", Frame());
  50. be_app_messenger.SendMessage (M_NETWORK_CLOSE);
  51. return true;
  52. }
  53. NetPrefServerWindow::NetPrefServerWindow (BHandler *target)
  54. : BWindow (
  55. BRect (50, 50, 350, 250),
  56. S_SERVERPREFS_TITLE,
  57. B_TITLED_WINDOW,
  58. B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
  59. {
  60. AddChild ((serverView = new NetPrefsServerView (Bounds(), "server settings", BMessenger(target))));
  61. }
  62. NetPrefServerWindow::~NetPrefServerWindow (void)
  63. {
  64. //
  65. }
  66. bool
  67. NetPrefServerWindow::QuitRequested (void)
  68. {
  69. return true;
  70. }
  71. void
  72. NetPrefServerWindow::SetNetworkData (BMessage *msg)
  73. {
  74. serverView->SetNetworkData (msg);
  75. }