/mergepatch_dialog.cpp

http://ewitool.googlecode.com/ · C++ · 49 lines · 20 code · 9 blank · 20 comment · 3 complexity · e032ff2631720d69afd47e346b963db6 MD5 · raw file

  1. /***************************************************************************
  2. * Copyright (C) 2008 by Steve Merrony *
  3. * steve@brahma *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 3 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #include "mergepatch_dialog.h"
  21. #include "ewi4000spatch.h"
  22. mergePatch_dialog::mergePatch_dialog( patch_t ewi_patches[EWI_NUM_PATCHES] ) : QDialog()
  23. {
  24. setupUi( this );
  25. // copy path names into list
  26. for (int i = 0; i < EWI_NUM_PATCHES; i++ ) {
  27. patch_listWidget->addItem( ewi4000sPatch::toQString( ewi_patches[i].parameters.name ) );
  28. }
  29. connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
  30. }
  31. mergePatch_dialog::~mergePatch_dialog()
  32. {
  33. }
  34. void mergePatch_dialog::accept() {
  35. chosenRow = patch_listWidget->currentRow();
  36. if (chosenRow == -1)
  37. QDialog::done( false );
  38. else
  39. QDialog::done( true );
  40. }