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 @@ -2,2 +2,3 @@ #include <unistd.h> +#include <errno.h> @@ -14,2 +15,3 @@ #include <qtoolbutton.h> +#include <qevent.h> @@ -43,2 +45,9 @@ NetworkSettings::NetworkSettings( QWidget *parent, 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(); @@ -80,18 +89,14 @@ NetworkSettings::~NetworkSettings() { - 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(); } + } @@ -147,5 +152,2 @@ void NetworkSettings::SLOT_RefreshStates( void ) { -void NetworkSettings::SLOT_NoLongerBusy( void ) { - NSResources->busy( FALSE ); -} void NetworkSettings::SLOT_AddNode( void ) { @@ -168,3 +170,2 @@ void NetworkSettings::SLOT_DeleteNode( void ) { setModified( 1 ); - NSD.forceGeneration(1); } @@ -174,2 +175,4 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { QString OldName = ""; + + printf( "------------------ Edit NOde\n" ); EditConnection EC( this ); @@ -188,4 +191,3 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { UpdateTimer->stop(); - NSResources->busy( TRUE ); - QTimer::singleShot( 1000, this, SLOT( SLOT_NoLongerBusy() )); + // we need to retry @@ -321,11 +323,3 @@ 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(); } |