summaryrefslogtreecommitdiffstats
path: root/kmyfirewall/kmfwidgets/kmfdocumentinfo.cpp
blob: ea58e4dc06e81208912a250b1d52f751133ad699 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// C++ Implementation:
//
// Description:
//
//
// Author: Christian Hubinger <chubinger@irrsinnig.org>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
// License: GPL
//


#include "kmfdocumentinfo.h"

// QT includes
#include <tqstring.h>
#include <tqtextedit.h>
#include <tqlineedit.h>
#include <tqpushbutton.h>


// KDE includes
#include <tdeapplication.h>
#include <kdebug.h>

// project includes
#include "../core/kmfdoc.h"
#include "../core/kmfnetwork.h"
#include "../core/kmfundoengine.h"
namespace KMF {
KMFDocumentInfo::KMFDocumentInfo(TQWidget* parent, const char* name, bool modal, WFlags fl)
		: KMyFirewallDocumentInfo(parent,name, modal,fl) {
	connect( b_help, TQ_SIGNAL( clicked() ),
		this, TQ_SLOT( slotHelp() ) );
			connect( b_saveAsTemplate, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotSaveAsTemplate() ) );
	
}

KMFDocumentInfo::~KMFDocumentInfo() {}

void KMFDocumentInfo::slotSaveAsTemplate() {
	kdDebug() << "slotSaveAsTemplate()" << endl;
	emit sigSaveAsTemplate();
}

/*$SPECIALIZATION$*/
void KMFDocumentInfo::accept() {
	if ( ! txt_name->text().isNull() ) {
		m_doc->setName( txt_name->text() );
//		m_doc->changed();
		// m_doc->network()->changed();
	}
	
	if ( ! txt_description->text().isNull() ) {
		m_doc->setDescription( txt_description->text() );
//		m_doc->changed();
		// m_doc->network()->changed();
	}
	
	TQDialog::accept();
}

void KMFDocumentInfo::loadDoc( KMFDoc* doc ) {
	m_doc = doc;
	txt_name->setText( doc->name() );
	txt_description->setText( doc->description() );
}

void KMFDocumentInfo::slotHelp() {
	kdDebug() << "void KMFDocumentInfo::slotHelp()" << endl;
	kapp->invokeHelp();
}


}

#include "kmfdocumentinfo.moc"