@ -896,7 +896,7 @@ if you have some ideas, patches, wishes or whatever.
<listitem><para>A XML file named p.e. kmfruleoption_mac_option.xml</para></listitem>
<listitem><para>A desktop file p.e. kmfruleoptionedit_mac.desktop that registeres the plugin within the KDE services framework.</para></listitem>
<listitem><para>An KParts Plugin component/class that derives form either KMFRuleOptionEditInterface or KMFRuleTargetOptionEditInterface named p.e. KMFRuleOptionEditMAC </para></listitem>
<listitem><para>A Class deriving from QWidget that may be loaded into the editor view when editing that option.</para>
<listitem><para>A Class deriving from T QWidget that may be loaded into the editor view when editing that option.</para>
<para>Most likely you'll use QTDesigner to design the GUI. If you do this you need to inherit from the generated class.</para></listitem>
</itemizedlist>
</sect2>
@ -1003,17 +1003,17 @@ class KMFRuleEditMac;
class KMFRuleOptionEditMAC : public KMFRuleOptionEditInterface {
TQ_OBJECT
public:
KMFRuleOptionEditMAC(QObject *parent = 0, const char *name = 0);
KMFRuleOptionEditMAC(T QObject *parent = 0, const char *name = 0);
~KMFRuleOptionEditMAC();
void loadRule( IPTRule* rule );
QWidget* editWidget();
const QString& optionEditName() const;
const QString& description() const;
T QWidget* editWidget();
const T QString& optionEditName() const;
const T QString& description() const;
private slots:
void slotAddRuleOption(QString*, QPtrList< QString >* );
void slotAddTargetOption(QString*, QPtrList< QString >* );
void slotAddRuleOption(T QString*, QPtrList< T QString >* );
void slotAddTargetOption(T QString*, QPtrList< T QString >* );
void slotShowOverview();
private:
@ -1027,11 +1027,11 @@ class TDEInstance;
class KMFRuleOptionEditMACFactory : public KLibFactory {
TQ_OBJECT
public:
KMFRuleOptionEditMACFactory( QObject *parent = 0, const char *name = 0 );
KMFRuleOptionEditMACFactory( T QObject *parent = 0, const char *name = 0 );
virtual ~KMFRuleOptionEditMACFactory() {
};
virtual QObject* createObject( QObject* parent = 0, const char* pname = 0,
const char* name = "QObject",
virtual T QObject* createObject( T QObject* parent = 0, const char* pname = 0,
const char* name = "T QObject",
const QStringList &args = QStringList() );
};
@ -1064,7 +1064,7 @@ public:
#include "kmfruleeditmac.h"
// Constructor get out plugin into a valid state
KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)
KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(T QObject *parent, const char *name)
: KMFRuleOptionEditInterface(parent, name) {
// Initialise the editor class
@ -1073,11 +1073,11 @@ KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)
m_edit->hide();
// Connect the Signals for the editor class to our slots passing them to the app
connect( m_edit,SIGNAL(sigAddRuleOpt(QString*, QPtrList< QString >* ) ),
this,SLOT( slotAddRuleOption(QString*, QPtrList< QString >* ) ) );
connect( m_edit,SIGNAL(sigAddRuleOpt(T QString*, QPtrList< T QString >* ) ),
this,SLOT( slotAddRuleOption(T QString*, QPtrList< T QString >* ) ) );
//
//connect( m_edit,SIGNAL(sigAddTargetOpt(QString*, QPtrList< QString >* ) ),
// this,SLOT( slotAddTargetOption(QString*, QPtrList< QString >* ) ) );
//connect( m_edit,SIGNAL(sigAddTargetOpt(T QString*, QPtrList< T QString >* ) ),
// this,SLOT( slotAddTargetOption(T QString*, QPtrList< T QString >* ) ) );
connect( m_edit,SIGNAL(sigHideMe() ),
this,SLOT( slotShowOverview() ) );
}
@ -1085,14 +1085,14 @@ KMFRuleOptionEditMAC::KMFRuleOptionEditMAC(QObject *parent, const char *name)
KMFRuleOptionEditMAC::~KMFRuleOptionEditMAC() {}
// Slot to pass the Signals to the app
void KMFRuleOptionEditMAC::slotAddRuleOption(QString* name, QPtrList< QString >* values ) {
void KMFRuleOptionEditMAC::slotAddRuleOption(T QString* name, QPtrList< T QString >* values ) {
if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
ruleedit->addRuleOption( name, values );
} else {
kdDebug() << "KMFRuleOptionEditMAC::slotAddRuleOption(): parent() not of type KMFRuleEditInterface" << endl;
}
}
void KMFRuleOptionEditMAC::slotAddTargetOption(QString* name, QPtrList< QString >* values ) {
void KMFRuleOptionEditMAC::slotAddTargetOption(T QString* name, QPtrList< T QString >* values ) {
if ( KMFRuleEditInterface* ruleedit = dynamic_cast<KMFRuleEditInterface*> ( parent() ) ) {
ruleedit->addRuleTargetOption( name, values );
} else {
@ -1111,11 +1111,11 @@ void KMFRuleOptionEditMAC::slotShowOverview() {
// Get info for GUI about the plugin
const QString& KMFRuleOptionEditMAC::optionEditName() const {
return *( new QString( i18n("MAC Option") ) );
const T QString& KMFRuleOptionEditMAC::optionEditName() const {
return *( new T QString( i18n("MAC Option") ) );
}
const QString& KMFRuleOptionEditMAC::description() const {
return *( new QString( i18n("This plugin manages the MAC address based options of iptables.") ) );
const T QString& KMFRuleOptionEditMAC::description() const {
return *( new T QString( i18n("This plugin manages the MAC address based options of iptables.") ) );
}
// We must implement this as it is called from the underliening rule editor
@ -1129,7 +1129,7 @@ void KMFRuleOptionEditMAC::loadRule( IPTRule* rule ) {
}
// return a pointer to our editor widget
QWidget* KMFRuleOptionEditMAC::editWidget() {
T QWidget* KMFRuleOptionEditMAC::editWidget() {
if ( ! m_edit ) {
kdDebug() << "KMFRuleOptionEditMAC::editWidget() - m_edit == 0" << endl;
return 0;
@ -1145,13 +1145,13 @@ QWidget* KMFRuleOptionEditMAC::editWidget() {
// TDEInstance* KMFRuleOptionEditMACFactory::s_instance = 0L;
// TDEAboutData* KMFRuleOptionEditMACFactory::s_about = 0L;
KMFRuleOptionEditMACFactory::KMFRuleOptionEditMACFactory( QObject* parent, const char* name )
KMFRuleOptionEditMACFactory::KMFRuleOptionEditMACFactory( T QObject* parent, const char* name )
: KLibFactory( parent, name ) {
}
QObject* KMFRuleOptionEditMACFactory::createObject( QObject* parent, const char* name,
T QObject* KMFRuleOptionEditMACFactory::createObject( T QObject* parent, const char* name,
const char*, const QStringList & ) {
QObject * obj = new KMFRuleOptionEditMAC( parent, name );
T QObject * obj = new KMFRuleOptionEditMAC( parent, name );
emit objectCreated( obj );
return obj;
}
@ -1203,7 +1203,7 @@ class KMFRuleEditMac : public KMyFirewallRuleEditorMac {
TQ_OBJECT
public:
KMFRuleEditMac( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
KMFRuleEditMac( T QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~KMFRuleEditMac();
void loadRule( IPTRule* );
@ -1223,7 +1223,7 @@ private:
IPTRule* m_rule;
signals:
void sigAddRuleOpt( QString*, QPtrList<QString>* );
void sigAddRuleOpt( T QString*, QPtrList<T QString>* );
void sigHideMe();
};
@ -1280,7 +1280,7 @@ Author: Christian Hubinger <chubinger@gmail.com>, (C) 2001-2004
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
KMFRuleEditMac::KMFRuleEditMac( QWidget* parent, const char* name, WFlags fl )
KMFRuleEditMac::KMFRuleEditMac( T QWidget* parent, const char* name, WFlags fl )
: KMyFirewallRuleEditorMac( parent, name, fl ) {
m_err_handler = new KMFErrorHandler( "KMFRuleEditMac" );
m_check_input = new KMFCheckInput();
@ -1301,7 +1301,7 @@ KMFRuleEditMac::~KMFRuleEditMac() {
* font changes
*/
bool KMFRuleEditMac::event( QEvent* ev ) {
bool ret = QWidget::event( ev );
bool ret = T QWidget::event( ev );
if ( ev->type() == QEvent::ApplicationFontChange ) {}
return ret;
}
@ -1317,13 +1317,13 @@ void KMFRuleEditMac::loadRule( IPTRule * rule ) {
t_src_mac5 ->clear();
t_src_mac6 ->clear();
m_rule = rule;
QString line = "";
T QString line = "";
IPTRuleOption* opt = 0;
opt = m_rule->getOptionForName("mac_opt");
if ( opt ) {
QStringList args = opt->getValues();
QString src, dest;
T QString src, dest;
line = *args.at(1);
if ( line.isEmpty() || line == "UNDEFINED" )
return;
@ -1332,7 +1332,7 @@ void KMFRuleEditMac::loadRule( IPTRule * rule ) {
c_inv_src_mac->setChecked( true );
}
int num = 1;
QString part = "";
T QString part = "";
c_src_mac->setChecked( true );
while ( !line.isEmpty() ) {
int pos = -1;
@ -1374,21 +1374,21 @@ void KMFRuleEditMac::accept() {
kdDebug() << "KMFRuleEditMac::accept()" << endl;
m_rule->chain()->table()->kmfDoc()->startTransaction();
m_rule->saveState();
QString tok1 = t_src_mac1->text().upper();
QString tok2 = t_src_mac2->text().upper();
QString tok3 = t_src_mac3->text().upper();
QString tok4 = t_src_mac4->text().upper();
QString tok5 = t_src_mac5->text().upper();
QString tok6 = t_src_mac6->text().upper();
T QString tok1 = t_src_mac1->text().upper();
T QString tok2 = t_src_mac2->text().upper();
T QString tok3 = t_src_mac3->text().upper();
T QString tok4 = t_src_mac4->text().upper();
T QString tok5 = t_src_mac5->text().upper();
T QString tok6 = t_src_mac6->text().upper();
if ( c_src_mac->isChecked() && ( tok1.isEmpty() || tok2.isEmpty() || tok3.isEmpty() || tok4.isEmpty() || tok5.isEmpty() || tok6.isEmpty() ) ) {
const QString & msg = i18n( "One ore more of the fields are empty. Please fill out all fields to define a valid MAC address." );
const T QString & msg = i18n( "One ore more of the fields are empty. Please fill out all fields to define a valid MAC address." );
KMessageBox::error( this, msg );
m_rule->chain()->table()->kmfDoc()->endTransaction();
return ;
}
QString mac = "";
T QString mac = "";
if ( c_src_mac->isChecked() ) {
mac = tok1 + ":" + tok2 + ":" + tok3 + ":" + tok4 + ":" + tok5 + ":" + tok6;
@ -1399,15 +1399,15 @@ void KMFRuleEditMac::accept() {
}
}
QPtrList<QString>* values = new QPtrList<QString>;
QString* op = new QString( "mac_opt" );
QPtrList<T QString>* values = new QPtrList<T QString>;
T QString* op = new T QString( "mac_opt" );
if ( c_src_mac->isChecked() && !mac.isEmpty() ) {
kdDebug() << "Add new mac option" << endl;
QString* src_mac = new QString( mac );
T QString* src_mac = new T QString( mac );
if ( c_inv_src_mac->isChecked() ) {
src_mac->prepend( "! " );
}
values->append( new QString( "bool:on" ) );
values->append( new T QString( "bool:on" ) );
values->append( src_mac );
}
emit sigAddRuleOpt( op, values );