PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/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
21#include "pastepatch_dialog.h"
22
23pastePatch_dialog::pastePatch_dialog( int toOverwrite, Clipboard *clipboard ) : QDialog() {
24	
25	setupUi( this );
26	
27	// copy clipboard names into list
28	for (int i = 0; i < clipboard->count(); i++ ) {
29		listWidget->addItem( clipboard->getNameAt(i) );
30	}
31	
32	lcdNumber->display( toOverwrite + 1 );
33	
34	connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
35}
36
37
38pastePatch_dialog::~pastePatch_dialog()
39{
40}
41
42void pastePatch_dialog::accept() {
43	
44	chosenRow = listWidget->currentRow();
45	if (chosenRow == -1)
46		QDialog::done( false );
47	else
48		QDialog::done( true );
49}