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

/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
22#include "ewi4000spatch.h"
23
24mergePatch_dialog::mergePatch_dialog( patch_t ewi_patches[EWI_NUM_PATCHES] ) : QDialog()
25{
26	setupUi( this );
27	
28	// copy path names into list
29	for (int i = 0; i < EWI_NUM_PATCHES; i++ ) {
30		patch_listWidget->addItem( ewi4000sPatch::toQString( ewi_patches[i].parameters.name ) );
31	}
32	
33	connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
34}
35
36
37mergePatch_dialog::~mergePatch_dialog()
38{
39}
40
41void mergePatch_dialog::accept() {
42	
43	chosenRow = patch_listWidget->currentRow();
44	if (chosenRow == -1)
45		QDialog::done( false );
46	else
47		QDialog::done( true );
48}
49