summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-09 20:01:42 (UTC)
committer mickeyl <mickeyl>2004-01-09 20:01:42 (UTC)
commit88af644c534f19e391ebbe8ea0babf3ccf459eb1 (patch) (side-by-side diff)
treef49e88a6dfc58d3f196e6918bb402a14ee9f0ad0
parent56bb9961db1158250bbfe971f4556b56c0bd6581 (diff)
downloadopie-88af644c534f19e391ebbe8ea0babf3ccf459eb1.zip
opie-88af644c534f19e391ebbe8ea0babf3ccf459eb1.tar.gz
opie-88af644c534f19e391ebbe8ea0babf3ccf459eb1.tar.bz2
save configuration settings in accept(), not in the ~
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp16
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h3
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp3
3 files changed, 16 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 7f39230..9358866 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -91,11 +91,17 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
tab->removePage( tab_4 );
};
-WellenreiterConfigWindow::~WellenreiterConfigWindow()
+void WellenreiterConfigWindow::accept()
{
save();
+ QDialog::accept();
+}
+
+
+WellenreiterConfigWindow::~WellenreiterConfigWindow()
+{
}
void WellenreiterConfigWindow::performAutodetection()
@@ -307,9 +313,9 @@ void WellenreiterConfigWindow::performAction( const QString& type,
qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type );
return;
}
- qDebug( "going to perform action %d (script='%s')", action, (const char*) script );
+ qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script );
switch( action )
{
case 0: /* Ignore */ return;
@@ -397,13 +403,13 @@ void WellenreiterConfigWindow::load()
c->setGroup( "UI" );
lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
openTree->setChecked( c->readBoolEntry( "openTree", true ) );
disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
- newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 0 ) );
+ newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm
newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
- newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 0 ) );
+ newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click
newClientScript->setText( c->readEntry( "newClientScript", "" ) );
- newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 0 ) );
+ newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click
newStationScript->setText( c->readEntry( "newStationScript", "" ) );
synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
c->setGroup( "GPS" );
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 5c998cb..d31d1e8 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -67,10 +67,11 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
void performAutodetection();
void channelAllClicked(int);
void performAction( const QString&, const QString&, const QString&, bool, int, int /* , const GpsLocation& */ );
- protected:
+ protected slots:
void synchronizeActionsAndScripts();
+ virtual void accept();
protected:
QMap<QString, int> _devicetype;
static WellenreiterConfigWindow* _instance;
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index fd88b63..10ead53 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -431,8 +431,11 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const
{
#ifdef DEBUG
qDebug( "creating scanlist item" );
#endif
+ if ( WellenreiterConfigWindow::instance() )
+ WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
+
decorateItem( type, essid, macaddr, wep, channel, signal, false );
}
const QString& MScanListItem::essid() const