Changeset 2615

Show
Ignore:
Timestamp:
08/19/08 14:42:24 (3 months ago)
Author:
kris
Message:

Fixed the Firewall manager, now it doesn't crash and seems to work as it did
on QT3 before.

Location:
pcbsd/trunk/kcmPFManager
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/trunk/kcmPFManager/adddlg.ui

    r2178 r2615  
    9797      </item> 
    9898      <item row="0" column="1" colspan="2" > 
    99        <widget class="QComboBox" name="cbServices" > 
     99       <widget class="Q3ComboBox" name="cbServices" > 
    100100        <property name="editable" > 
    101101         <bool>true</bool> 
     
    107107      </item> 
    108108      <item row="4" column="2" > 
    109        <widget class="QComboBox" name="cbDirection" /> 
     109       <widget class="Q3ComboBox" name="cbDirection" /> 
    110110      </item> 
    111111      <item row="5" column="2" > 
    112        <widget class="QComboBox" name="cbProtocol" /> 
     112       <widget class="Q3ComboBox" name="cbProtocol" /> 
    113113      </item> 
    114114      <item rowspan="2" row="6" column="2" > 
    115        <widget class="QComboBox" name="cbInterfaces" /> 
     115       <widget class="Q3ComboBox" name="cbInterfaces" /> 
    116116      </item> 
    117117      <item row="4" column="0" colspan="2" > 
  • pcbsd/trunk/kcmPFManager/config/packetfilter.cpp

    r2178 r2615  
    1010#include <Q3Process> 
    1111#include <Q3UrlOperator> 
     12#include <qmessagebox.h> 
     13#include <Q3TextStream> 
    1214 
    1315#include <iostream> 
     
    108110void PacketFilter::init ( void ) 
    109111{ 
     112 
    110113    RcConfig *config = RcConfig::fromDefault(); 
    111114     
     
    131134    _rules.clear(); 
    132135     
    133     if ( file.open(IO_ReadOnly) ) 
    134     { 
    135         QTextStream stream(&file); 
     136    if ( file.open(QIODevice::ReadOnly) ) 
     137    { 
     138        Q3TextStream stream(&file); 
    136139        QString line; 
    137140         
     
    156159    if ( file.open(IO_WriteOnly) ) 
    157160    { 
    158         QTextStream stream(&file); 
     161        Q3TextStream stream(&file); 
    159162         
    160163        for ( size_t i = 0; i < _lines.size(); ++i ) 
  • pcbsd/trunk/kcmPFManager/config/rcconfig.cpp

    r2178 r2615  
    55#include <iostream> 
    66#include <QRegExp> 
     7#include <Q3TextStream> 
    78 
    89RcConfig::RcConfig ( void ) 
     
    2728    if ( file.open(IO_ReadOnly) ) 
    2829    { // It went good 
    29         QTextStream stream(&file); 
     30        Q3TextStream stream(&file); 
    3031        QString line; 
    3132            
     
    9394        if ( file.open(IO_WriteOnly) ) 
    9495        { 
    95             QTextStream stream(&file); 
     96            Q3TextStream stream(&file); 
    9697             
    9798            for ( qstr_vector_cit it = _lines.begin(); 
  • pcbsd/trunk/kcmPFManager/config/services.cpp

    r2178 r2615  
    55#include <qstringlist.h> 
    66#include <qregexp.h> 
     7#include <Q3TextStream> 
    78 
    89const QString services::_service_file = "/etc/services"; 
     
    1112services::services ( void ) 
    1213{ 
     14   load(); 
    1315} 
    1416 
     
    2628    if ( serv.open(IO_ReadOnly) ) 
    2729    { 
    28         QTextStream stream(&serv); 
     30        Q3TextStream stream(&serv); 
    2931        QString line; 
    3032         
  • pcbsd/trunk/kcmPFManager/kcm.cpp

    r2614 r2615  
    3333    { // Show our dialog 
    3434        _dlg = new PFManagerDlg(); 
    35          
     35        _dlg->load();         
    3636        _dlg->reparent(this, QPoint()); 
    3737        load(); 
  • pcbsd/trunk/kcmPFManager/pfaddlg.cpp

    r2178 r2615  
    77#include <qlineedit.h> 
    88#include <qpushbutton.h> 
     9#include <QMessageBox> 
    910#include <Q3ListBox> 
    1011 
    11 PFAddDlg::PFAddDlg ( QWidget *parent, rule *rules ) 
    12     : AddDlg() 
     12void PFAddDlg::init(void) 
    1313{ 
     14    rule *rules = 0; 
     15 
    1416    // Well: The incoming thing must always be the first item 
    1517    // Otherwise it won't work 
  • pcbsd/trunk/kcmPFManager/pfaddlg.hpp

    r2178 r2615  
    1010 
    1111class PFAddDlg : public QDialog, private Ui::AddDlg 
    12  
    1312{ 
    1413    Q_OBJECT 
     
    2221public: 
    2322 
    24     PFAddDlg ( QWidget *parent = 0, rule *rules = 0); 
     23    PFAddDlg() : QDialog() 
     24    { 
     25      setupUi(this); 
     26    } 
     27 
    2528    ~PFAddDlg ( void ); 
    2629     
     
    4144    void okClicked ( void ); 
    4245    void cancelClicked ( void ); 
     46    void init(void ); 
    4347}; 
    4448 
  • pcbsd/trunk/kcmPFManager/pfmanagerdlg.cpp

    r2181 r2615  
    8686void PFManagerDlg::addClicked ( void ) 
    8787{ 
    88     PFAddDlg dlg(this); 
     88    PFAddDlg *dlg = new PFAddDlg(); 
     89    dlg->init(); 
    8990     
    90     if ( dlg.exec() == QDialog::Accepted ) 
     91    if ( dlg->exec() == QDialog::Accepted ) 
    9192    { 
    92         _firewall.add_rule(*dlg.rules()); 
     93        _firewall.add_rule(* dlg->rules()); 
    9394        // Save content 
    9495        _firewall.save(); 
     
    105106    if (cur != 0) 
    106107    { 
    107         PFAddDlg dlg(this); 
     108        PFAddDlg *dlg = new PFAddDlg(); 
     109        dlg->init(); 
    108110        size_t tag = 0; 
    109111        rule *rule = 0; 
     
    115117        rule = &_firewall.rules()[tag]; 
    116118        // Show 
    117         dlg.rules(rule); 
    118         if ( dlg.exec() == QDialog::Accepted ) 
     119        dlg->rules(rule); 
     120        if ( dlg->exec() == QDialog::Accepted ) 
    119121        { // Refresh the list 
    120122            _firewall.save(); 
  • pcbsd/trunk/kcmPFManager/pfmanagerdlg.hpp

    r2181 r2615  
    1111{ 
    1212    Q_OBJECT 
    13  
    14     PacketFilter _firewall; 
    1513 
    1614public: 
     
    4947    } 
    5048 
     49    // Create the _firewall object 
     50    PacketFilter _firewall; 
     51 
    5152    ~PFManagerDlg ( void ); 
    5253