/inputsettingsframe.cpp

http://cutefootball.googlecode.com/ · C++ · 49 lines · 26 code · 4 blank · 19 comment · 2 complexity · 5c7f73e84b75bca43ce08a3347bd9d96 MD5 · raw file

  1. /*
  2. * Copyright 2010,2011 Timothy Rochford
  3. *
  4. * This file is part of CuteFootball.
  5. *
  6. * CuteFootball is free software: you can redistribute it and/or modify
  7. * it under the terms of the Lesser GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * CuteFootball is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * Lesser GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the Lesser GNU General Public License
  17. * along with CuteFootball. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #include "inputsettingsframe.h"
  21. #include "ui_inputSettingsFrame.h"
  22. inputSettingsFrame::inputSettingsFrame(MWindow *parent) :
  23. QFrame(parent),
  24. ui(new Ui::inputSettingsFrame)
  25. {
  26. ui->setupUi(this);
  27. ui->buttonBox->button(QDialogButtonBox::Ok)
  28. ->setText(tr("Main Menu"));
  29. connect(parent, SIGNAL(setFrame(MWindow::Frame)),
  30. this, SLOT(showFrame(MWindow::Frame)));
  31. connect(ui->buttonBox, SIGNAL(accepted()), parent, SLOT(hideHelpFrame()));
  32. connect(ui->buttonBox, SIGNAL(rejected()), parent, SLOT(hideHelpFrame()));
  33. }
  34. inputSettingsFrame::~inputSettingsFrame()
  35. {
  36. delete ui;
  37. }
  38. void inputSettingsFrame::showFrame(MWindow::Frame f)
  39. {
  40. qDebug() << "inputSettingsFrame::showFrame " << f;
  41. if ( f == MWindow::InputSettings )
  42. showMaximized();
  43. else
  44. setVisible(false);
  45. }