Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index 6ee4106..ce0eabc 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp @@ -1,4 +1,5 @@ #include <stdio.h> #include <unistd.h> +#include <errno.h> #include <qpe/qpeapplication.h> @@ -13,4 +14,5 @@ #include <qpe/qpeapplication.h> #include <qtoolbutton.h> +#include <qevent.h> #include <asdevice.h> @@ -42,4 +44,11 @@ NetworkSettings::NetworkSettings( QWidget *parent, // populate main Listbox Profiles_LB->clear(); + QPEApplication::setStylusOperation( + Profiles_LB->viewport(), QPEApplication::RightOnHold ); + + connect( Profiles_LB, + SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), + this, SLOT(SLOT_EditNode(QListBoxItem*)) ); + { Name2Connection_t & M = NSResources->connections(); NodeCollection * NC; @@ -79,20 +88,16 @@ NetworkSettings::~NetworkSettings() { QString S; - S = NSD.generateSettings(); - if( ! S.isEmpty() ) { - QMessageBox::warning( - 0, - tr( "In System Config" ), - S - ); - } + if( isModified() ) { + S = NSD.saveSettings(); + if( ! S.isEmpty() ) { + // problem saving + QMessageBox::warning( + 0, + tr( "Saving setup" ), S ); + } - S = NSD.saveSettings(); - if( ! S.isEmpty() ) { - // problem saving - QMessageBox::warning( - 0, - tr( "Saving setup" ), S ); + SLOT_GenerateConfig(); } + } @@ -146,7 +151,4 @@ void NetworkSettings::SLOT_RefreshStates( void ) { } -void NetworkSettings::SLOT_NoLongerBusy( void ) { - NSResources->busy( FALSE ); -} void NetworkSettings::SLOT_AddNode( void ) { SLOT_EditNode( 0 ); @@ -167,5 +169,4 @@ void NetworkSettings::SLOT_DeleteNode( void ) { delete LBI; setModified( 1 ); - NSD.forceGeneration(1); } } @@ -173,4 +174,6 @@ void NetworkSettings::SLOT_DeleteNode( void ) { void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { QString OldName = ""; + + printf( "------------------ Edit NOde\n" ); EditConnection EC( this ); @@ -187,6 +190,5 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { // disable refresh timer UpdateTimer->stop(); - NSResources->busy( TRUE ); - QTimer::singleShot( 1000, this, SLOT( SLOT_NoLongerBusy() )); + // we need to retry while( 1 ) { @@ -320,13 +322,5 @@ void NetworkSettings::updateProfileState( QListBoxItem * LBI ) { void NetworkSettings::SLOT_GenerateConfig( void ) { - QString S = NSD.generateSettings( TRUE ); - - if( ! S.isEmpty() ) { - QMessageBox::warning( - 0, - tr( "Generating system configuration" ), - S - ); - } + NSD.regenerate(); } |