File: createfavouritedialog.cpp

package info (click to toggle)
dc-qt 0.2.0.alpha-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,936 kB
  • ctags: 5,361
  • sloc: cpp: 28,936; makefile: 19
file content (34 lines) | stat: -rw-r--r-- 894 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 *  createfavouritedialog.cpp
 *  ui
 *
 *  Created by Mikael Gransell on 4/18/06.
 *  Copyright 2006 __MyCompanyName__. All rights reserved.
 *
 */

#include "createfavouritedialog.h"

#include "rpctypes.h"

CreateFavouriteDialog::CreateFavouriteDialog( const BackendConnectionPtr& backendConn,
											  QWidget* parent )
: QDialog(parent),
  backendConnection(backendConn)
{
	  ui.setupUi(this);
}

void CreateFavouriteDialog::on_createButton_clicked()
{
	rpc_types::FavouriteHub hubEntry;
	hubEntry.name = ui.nameEdit->text().toStdString();
	hubEntry.server = ui.serverEdit->text().toStdString();
	hubEntry.nick = ui.nickEdit->text().toStdString();
	hubEntry.password = ui.pwdEdit->text().toStdString();
	hubEntry.autoConnect = ui.autoConnectCheckBox->isChecked();
	
	// Add the favourite and close the dialog
	backendConnection->addFavouriteHub(hubEntry);
	done(QDialog::Accepted);
}