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 @@ | |||
2 | #include <unistd.h> | 2 | #include <unistd.h> |
3 | #include <errno.h> | ||
3 | 4 | ||
@@ -14,2 +15,3 @@ | |||
14 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
16 | #include <qevent.h> | ||
15 | 17 | ||
@@ -43,2 +45,9 @@ NetworkSettings::NetworkSettings( QWidget *parent, | |||
43 | Profiles_LB->clear(); | 45 | Profiles_LB->clear(); |
46 | QPEApplication::setStylusOperation( | ||
47 | Profiles_LB->viewport(), QPEApplication::RightOnHold ); | ||
48 | |||
49 | connect( Profiles_LB, | ||
50 | SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), | ||
51 | this, SLOT(SLOT_EditNode(QListBoxItem*)) ); | ||
52 | |||
44 | { Name2Connection_t & M = NSResources->connections(); | 53 | { Name2Connection_t & M = NSResources->connections(); |
@@ -80,18 +89,14 @@ NetworkSettings::~NetworkSettings() { | |||
80 | 89 | ||
81 | S = NSD.generateSettings(); | 90 | if( isModified() ) { |
82 | if( ! S.isEmpty() ) { | 91 | S = NSD.saveSettings(); |
83 | QMessageBox::warning( | 92 | if( ! S.isEmpty() ) { |
84 | 0, | 93 | // problem saving |
85 | tr( "In System Config" ), | 94 | QMessageBox::warning( |
86 | S | 95 | 0, |
87 | ); | 96 | tr( "Saving setup" ), S ); |
88 | } | 97 | } |
89 | 98 | ||
90 | S = NSD.saveSettings(); | 99 | SLOT_GenerateConfig(); |
91 | if( ! S.isEmpty() ) { | ||
92 | // problem saving | ||
93 | QMessageBox::warning( | ||
94 | 0, | ||
95 | tr( "Saving setup" ), S ); | ||
96 | } | 100 | } |
101 | |||
97 | } | 102 | } |
@@ -147,5 +152,2 @@ void NetworkSettings::SLOT_RefreshStates( void ) { | |||
147 | 152 | ||
148 | void NetworkSettings::SLOT_NoLongerBusy( void ) { | ||
149 | NSResources->busy( FALSE ); | ||
150 | } | ||
151 | void NetworkSettings::SLOT_AddNode( void ) { | 153 | void NetworkSettings::SLOT_AddNode( void ) { |
@@ -168,3 +170,2 @@ void NetworkSettings::SLOT_DeleteNode( void ) { | |||
168 | setModified( 1 ); | 170 | setModified( 1 ); |
169 | NSD.forceGeneration(1); | ||
170 | } | 171 | } |
@@ -174,2 +175,4 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { | |||
174 | QString OldName = ""; | 175 | QString OldName = ""; |
176 | |||
177 | printf( "------------------ Edit NOde\n" ); | ||
175 | EditConnection EC( this ); | 178 | EditConnection EC( this ); |
@@ -188,4 +191,3 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) { | |||
188 | UpdateTimer->stop(); | 191 | UpdateTimer->stop(); |
189 | NSResources->busy( TRUE ); | 192 | |
190 | QTimer::singleShot( 1000, this, SLOT( SLOT_NoLongerBusy() )); | ||
191 | // we need to retry | 193 | // we need to retry |
@@ -321,11 +323,3 @@ void NetworkSettings::updateProfileState( QListBoxItem * LBI ) { | |||
321 | void NetworkSettings::SLOT_GenerateConfig( void ) { | 323 | void NetworkSettings::SLOT_GenerateConfig( void ) { |
322 | QString S = NSD.generateSettings( TRUE ); | 324 | NSD.regenerate(); |
323 | |||
324 | if( ! S.isEmpty() ) { | ||
325 | QMessageBox::warning( | ||
326 | 0, | ||
327 | tr( "Generating system configuration" ), | ||
328 | S | ||
329 | ); | ||
330 | } | ||
331 | } | 325 | } |