/pastepatch_dialog.cpp

http://ewitool.googlecode.com/ · C++ · 49 lines · 19 code · 10 blank · 20 comment · 3 complexity · 939cbc50ed55b28f61e5fd31e9c0f724 MD5 · raw file

  1. /***************************************************************************
  2. * Copyright (C) 2008 by Steve Merrony *
  3. * ewitool At merrony dot flyer dot co dot uk *
  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 "pastepatch_dialog.h"
  21. pastePatch_dialog::pastePatch_dialog( int toOverwrite, Clipboard *clipboard ) : QDialog() {
  22. setupUi( this );
  23. // copy clipboard names into list
  24. for (int i = 0; i < clipboard->count(); i++ ) {
  25. listWidget->addItem( clipboard->getNameAt(i) );
  26. }
  27. lcdNumber->display( toOverwrite + 1 );
  28. connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
  29. }
  30. pastePatch_dialog::~pastePatch_dialog()
  31. {
  32. }
  33. void pastePatch_dialog::accept() {
  34. chosenRow = listWidget->currentRow();
  35. if (chosenRow == -1)
  36. QDialog::done( false );
  37. else
  38. QDialog::done( true );
  39. }