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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/***************************************************************************
* Copyright (C) 2005 by Christian Hubinger *
* e9806056@student.tuwien.ac.at *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "details.h"
// QT includes
#include <tqlcdnumber.h>
// KDE includes
#include <kdebug.h>
#include <kpushbutton.h>
Details::Details( TQWidget* parent, const char* name, WFlags fl )
: DetailsDesigner( parent, name, fl ) {
TQObject::connect( m_cmd_close, TQT_SIGNAL( clicked() ), this, TQT_SLOT ( close() ) );
}
Details::~Details() {}
/*$SPECIALIZATION$*/
void Details::close() {
kdDebug() << "void Details::close()" << endl;
emit closing();
TQWidget::close();
}
void Details::show() {
kdDebug() << "void Details::show()" << endl;
emit showing();
TQWidget::show();
}
void Details::hide() {
kdDebug() << "void Details::hide()" << endl;
emit closing();
TQWidget::hide();
}
void Details::slotUpdateRuleCount( const TQString& table, const TQString& chain, int num ) {
kdDebug() << "slotUpdateRuleCount( const TQString& " << table << ", const TQString& " << chain << ", int " << num << " )" << endl;
TQLCDNumber *lcd = 0;
if ( table == "filter" ) {
if ( chain == "INPUT" ) {
lcd = m_lcd_numRulesIn_Filter_Input;
}
if ( chain == "OUTPUT" ) {
lcd = m_lcd_numRulesIn_Filter_Output;
}
if ( chain == "FORWARD" ) {
lcd = m_lcd_numRulesIn_Filter_Forward;
}
} else if ( table == "nat" ) {
if ( chain == "OUTPUT" ) {
lcd = m_lcd_numRulesIn_Nat_Output;
}
if ( chain == "PREROUTING" ) {
lcd = m_lcd_numRulesIn_Nat_Prerouting;
}
if ( chain == "POSTROUTING" ) {
lcd = m_lcd_numRulesIn_Nat_Postrouting;
}
} else if ( table == "mangle" ) {
if ( chain == "INPUT" ) {
lcd = m_lcd_numRulesIn_Mangle_Input;
}
if ( chain == "OUTPUT" ) {
lcd = m_lcd_numRulesIn_Mangle_Output;
}
if ( chain == "FORWARD" ) {
lcd = m_lcd_numRulesIn_Mangle_Forward;
}
if ( chain == "PREROUTING" ) {
lcd = m_lcd_numRulesIn_Mangle_Prerouting;
}
if ( chain == "POSTROUTING" ) {
lcd = m_lcd_numRulesIn_Mangle_Postrouting;
}
}
if ( ! lcd ) {
kdDebug() << "ERROR unknown chain or table" << endl;
return;
}
lcd->display( num );
}
#include "details.moc"
|