|
|
@ -395,7 +395,7 @@ bool KMyFirewall::checkRoot() {
|
|
|
|
"As the file format used to save the rulesets has changed, "
|
|
|
|
"As the file format used to save the rulesets has changed, "
|
|
|
|
"rulesets created with KMyFirewall < 1.0beta1 <b>WILL NOT</b> work, don't even try it!"
|
|
|
|
"rulesets created with KMyFirewall < 1.0beta1 <b>WILL NOT</b> work, don't even try it!"
|
|
|
|
"</p></qt>" );
|
|
|
|
"</p></qt>" );
|
|
|
|
KConfig* _config = kapp->config();
|
|
|
|
TDEConfig* _config = kapp->config();
|
|
|
|
_config->setGroup( "Notification Messages" );
|
|
|
|
_config->setGroup( "Notification Messages" );
|
|
|
|
TQString warn = "";
|
|
|
|
TQString warn = "";
|
|
|
|
warn = _config->readEntry( "compatibility_warning" );
|
|
|
|
warn = _config->readEntry( "compatibility_warning" );
|
|
|
@ -632,7 +632,7 @@ bool KMyFirewall::prepareForFileOpen( const KURL& url ) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! KIO::NetAccess::download( url, xmlfile, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
if ( ! TDEIO::NetAccess::download( url, xmlfile, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
kdDebug() << "Could not download file." << endl;
|
|
|
|
kdDebug() << "Could not download file." << endl;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -708,7 +708,7 @@ KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
|
|
|
|
kdDebug() << "void KMyFirewall::getDocumentLoaderForUrl( const KURL&" << url.fileName() << " )" << endl;
|
|
|
|
kdDebug() << "void KMyFirewall::getDocumentLoaderForUrl( const KURL&" << url.fileName() << " )" << endl;
|
|
|
|
err->setErrType( KMFError::OK );
|
|
|
|
err->setErrType( KMFError::OK );
|
|
|
|
TQString xmlfile;
|
|
|
|
TQString xmlfile;
|
|
|
|
if ( ! KIO::NetAccess::download( url, xmlfile, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
if ( ! TDEIO::NetAccess::download( url, xmlfile, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
kdDebug() << "Could not download file." << endl;
|
|
|
|
kdDebug() << "Could not download file." << endl;
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrMsg( i18n( "<qt>Could not download file %1</qt>" ).arg( url.url() ) );
|
|
|
|
err->setErrMsg( i18n( "<qt>Could not download file %1</qt>" ).arg( url.url() ) );
|
|
|
@ -768,7 +768,7 @@ KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
|
|
|
|
network()->setCurrentTarget( tg );
|
|
|
|
network()->setCurrentTarget( tg );
|
|
|
|
updateCaption();
|
|
|
|
updateCaption();
|
|
|
|
kdDebug() << "Returned IPT Doc for target: " << network()->currentTarget()->guiName() << endl;
|
|
|
|
kdDebug() << "Returned IPT Doc for target: " << network()->currentTarget()->guiName() << endl;
|
|
|
|
KIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
TDEIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
return network()->currentDocAsIPTDoc();
|
|
|
|
return network()->currentDocAsIPTDoc();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ( root.nodeName() == XML::GenericDoc_DocumentElement ) {
|
|
|
|
} else if ( root.nodeName() == XML::GenericDoc_DocumentElement ) {
|
|
|
@ -782,7 +782,7 @@ KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
|
|
|
|
network()->setCurrentTarget( tg );
|
|
|
|
network()->setCurrentTarget( tg );
|
|
|
|
updateCaption();
|
|
|
|
updateCaption();
|
|
|
|
kdDebug() << "Returned GEneric Doc for target: " << network()->currentTarget()->guiName() << endl;
|
|
|
|
kdDebug() << "Returned GEneric Doc for target: " << network()->currentTarget()->guiName() << endl;
|
|
|
|
KIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
TDEIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
return network()->currentDocAsGenericDoc();
|
|
|
|
return network()->currentDocAsGenericDoc();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ( root.nodeName() == XML::KMFNetwork_DocumentElement ) {
|
|
|
|
} else if ( root.nodeName() == XML::KMFNetwork_DocumentElement ) {
|
|
|
@ -802,16 +802,16 @@ KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "Returned KMFNetwork " << network()->currentTarget()->guiName() << endl;
|
|
|
|
kdDebug() << "Returned KMFNetwork " << network()->currentTarget()->guiName() << endl;
|
|
|
|
KIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
TDEIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
return network();
|
|
|
|
return network();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
TDEIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
kdDebug() << "ERROR: No Loader Found!" << endl;
|
|
|
|
kdDebug() << "ERROR: No Loader Found!" << endl;
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrMsg( i18n( "<qt>The document is not a valid KMyFirewall document.</qt>" ) );
|
|
|
|
err->setErrMsg( i18n( "<qt>The document is not a valid KMyFirewall document.</qt>" ) );
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
TDEIO::NetAccess::removeTempFile( xmlfile );
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrType( KMFError::NORMAL );
|
|
|
|
err->setErrMsg( i18n( "<qt>Could not download file %1.</qt>" ).arg( url.url() ) );
|
|
|
|
err->setErrMsg( i18n( "<qt>Could not download file %1.</qt>" ).arg( url.url() ) );
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -819,9 +819,9 @@ KMFDoc* KMyFirewall::getDocumentLoaderForUrl( const KURL& url, KMFError* err ) {
|
|
|
|
|
|
|
|
|
|
|
|
KMFError* KMyFirewall::parseDocument( const KURL& url ) {
|
|
|
|
KMFError* KMyFirewall::parseDocument( const KURL& url ) {
|
|
|
|
kdDebug() << "void KMyFirewall::parseDocument(TQString& file)" << endl;
|
|
|
|
kdDebug() << "void KMyFirewall::parseDocument(TQString& file)" << endl;
|
|
|
|
KIO::UDSEntry f_props;
|
|
|
|
TDEIO::UDSEntry f_props;
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! KIO::NetAccess::stat( url , f_props, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
if ( ! TDEIO::NetAccess::stat( url , f_props, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
closeSplash();
|
|
|
|
closeSplash();
|
|
|
|
const TQString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>"
|
|
|
|
const TQString msg = i18n( "<qt><p>The file <b>%1</b> could not be loaded.</p>"
|
|
|
|
"<p>If you are working with files stored on remote computers "
|
|
|
|
"<p>If you are working with files stored on remote computers "
|
|
|
@ -1018,7 +1018,7 @@ void KMyFirewall::checkStatus() {
|
|
|
|
fclose( sbin1 );
|
|
|
|
fclose( sbin1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ( KIO::NetAccess::exists( network()->currentTarget()->getFishUrl() + "/etc/kmyfirewall", true, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
if ( TDEIO::NetAccess::exists( network()->currentTarget()->getFishUrl() + "/etc/kmyfirewall", true, TDEApplication::kApplication()->mainWidget() ) ) {
|
|
|
|
kdDebug() << "Firewall is installed" << endl;
|
|
|
|
kdDebug() << "Firewall is installed" << endl;
|
|
|
|
isInstalled = true;
|
|
|
|
isInstalled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|