~ubuntu-branches/ubuntu/quantal/smb4k/quantal

« back to all changes in this revision

Viewing changes to core/smb4kcustomoptionsmanager_p.cpp

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    smb4kcustomoptionsmanager_p - Private helper classes for 
 
3
    Smb4KCustomOptionsManager class
 
4
                             -------------------
 
5
    begin                : Fr 29 Apr 2011
 
6
    copyright            : (C) 2011 by Alexander Reinholdt
 
7
    email                : alexander.reinholdt@kdemail.net
 
8
 ***************************************************************************/
 
9
 
 
10
/***************************************************************************
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 *   This program is distributed in the hope that it will be useful, but   *
 
17
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
19
 *   General Public License for more details.                              *
 
20
 *                                                                         *
 
21
 *   You should have received a copy of the GNU General Public License     *
 
22
 *   along with this program; if not, write to the                         *
 
23
 *   Free Software Foundation, 51 Franklin Street, Suite 500, Boston,      *
 
24
 *   MA 02110-1335, USA                                                    *
 
25
 ***************************************************************************/
 
26
 
 
27
// Qt includes
 
28
#include <QVBoxLayout>
 
29
#include <QHBoxLayout>
 
30
#include <QLabel>
 
31
#include <QCoreApplication>
 
32
 
 
33
// KDE includes
 
34
#include <klocale.h>
 
35
#include <kstandardguiitem.h>
 
36
#include <kuser.h>
 
37
 
 
38
// application specific includes
 
39
#include <smb4kcustomoptionsmanager_p.h>
 
40
#include <smb4ksettings.h>
 
41
 
 
42
 
 
43
Smb4KCustomOptionsDialog::Smb4KCustomOptionsDialog( Smb4KCustomOptions *options, QWidget *parent )
 
44
: KDialog( parent ), m_options( options )
 
45
{
 
46
  setCaption( i18n( "Custom Options" ) );
 
47
  setButtons( User1|Ok|Cancel );
 
48
  setDefaultButton( Ok );
 
49
  setButtonGuiItem( User1, KStandardGuiItem::defaults() );
 
50
  
 
51
  setupView();
 
52
  
 
53
  connect( this, SIGNAL( user1Clicked() ), SLOT( slotSetDefaultValues() ) );
 
54
  connect( this, SIGNAL( okClicked() ), SLOT( slotOKClicked() ) );
 
55
  
 
56
  KConfigGroup group( Smb4KSettings::self()->config(), "CustomOptionsDialog" );
 
57
  restoreDialogSize( group );
 
58
}
 
59
 
 
60
 
 
61
Smb4KCustomOptionsDialog::~Smb4KCustomOptionsDialog()
 
62
{
 
63
}
 
64
 
 
65
 
 
66
void Smb4KCustomOptionsDialog::setupView()
 
67
{
 
68
  QWidget *main_widget = new QWidget( this );
 
69
  setMainWidget( main_widget );
 
70
 
 
71
  QVBoxLayout *layout = new QVBoxLayout( main_widget );
 
72
  layout->setSpacing( 5 );
 
73
  layout->setMargin( 0 );
 
74
 
 
75
  QWidget *description = new QWidget( main_widget );
 
76
 
 
77
  QHBoxLayout *desc_layout = new QHBoxLayout( description );
 
78
  desc_layout->setSpacing( 5 );
 
79
  desc_layout->setMargin( 0 );
 
80
 
 
81
  QLabel *pixmap = new QLabel( description );
 
82
  QPixmap mount_pix = KIcon( "preferences-system-network" ).pixmap( KIconLoader::SizeHuge );
 
83
  pixmap->setPixmap( mount_pix );
 
84
  pixmap->setAlignment( Qt::AlignBottom );
 
85
 
 
86
  QLabel *label = NULL;
 
87
  
 
88
  switch ( m_options->type() )
 
89
  {
 
90
    case Smb4KCustomOptions::Host:
 
91
    {
 
92
      label = new QLabel( i18n( "<p>Define custom options for host <b>%1</b> and all the shares it provides.</p>", 
 
93
                          m_options->host()->hostName() ), description );
 
94
      break;
 
95
    }
 
96
    case Smb4KCustomOptions::Share:
 
97
    {
 
98
      label = new QLabel( i18n( "<p>Define custom options for share <b>%1</b> at host <b>%2</b>.</p>", 
 
99
                          m_options->share()->shareName(), m_options->share()->hostName() ), 
 
100
                          description );
 
101
      break;
 
102
    }
 
103
    default:
 
104
    {
 
105
      label = new QLabel();
 
106
      break;
 
107
    }
 
108
  }
 
109
  
 
110
  label->setWordWrap( true );
 
111
  label->setAlignment( Qt::AlignBottom );
 
112
 
 
113
  desc_layout->addWidget( pixmap, 0 );
 
114
  desc_layout->addWidget( label, Qt::AlignBottom );
 
115
  
 
116
  QWidget *editors = new QWidget( main_widget );
 
117
  
 
118
  QGridLayout *editors_layout = new QGridLayout( editors );
 
119
  editors_layout->setSpacing( 5 );
 
120
  editors_layout->setMargin( 0 );
 
121
 
 
122
  QLabel *unc_label = new QLabel( i18n( "UNC Address:" ), editors );
 
123
  KLineEdit *unc    = NULL;
 
124
  
 
125
  switch ( m_options->type() )
 
126
  {
 
127
    case Smb4KCustomOptions::Host:
 
128
    {
 
129
      unc = new KLineEdit( m_options->host()->unc(), editors );
 
130
      break;
 
131
    }
 
132
    case Smb4KCustomOptions::Share:
 
133
    {
 
134
      unc = new KLineEdit( m_options->share()->unc(), editors );
 
135
      break;
 
136
    }
 
137
    default:
 
138
    {
 
139
      break;
 
140
    }
 
141
  }
 
142
  unc->setReadOnly( true );
 
143
      
 
144
  QLabel *smb_label = new QLabel( i18n( "SMB Port:" ), editors );
 
145
  m_smb_port        = new KIntNumInput( (m_options->smbPort() != Smb4KSettings::remoteSMBPort() ?
 
146
                      m_options->smbPort() : Smb4KSettings::remoteSMBPort()), editors );
 
147
  m_smb_port->setRange( Smb4KSettings::self()->remoteSMBPortItem()->minValue().toInt(),
 
148
                        Smb4KSettings::self()->remoteSMBPortItem()->maxValue().toInt() );
 
149
  m_smb_port->setSliderEnabled( true );
 
150
 
 
151
#ifndef Q_OS_FREEBSD
 
152
  QLabel *fs_label = new QLabel( i18n( "Filesystem Port:" ), editors );
 
153
  m_fs_port        = new KIntNumInput( (m_options->fileSystemPort() != Smb4KSettings::remoteFileSystemPort() ? 
 
154
                     m_options->fileSystemPort() : Smb4KSettings::remoteFileSystemPort()), editors );
 
155
  m_fs_port->setRange( Smb4KSettings::self()->remoteFileSystemPortItem()->minValue().toInt(),
 
156
                       Smb4KSettings::self()->remoteFileSystemPortItem()->maxValue().toInt() );
 
157
  m_fs_port->setSliderEnabled( true );
 
158
     
 
159
  QLabel *rw_label = new QLabel( i18n( "Write Access:" ), editors );
 
160
  m_write_access   = new KComboBox( editors );
 
161
  m_write_access->insertItem( 0, Smb4KSettings::self()->writeAccessItem()->choices()
 
162
                                 .value( Smb4KSettings::EnumWriteAccess::ReadWrite ).label, 
 
163
                              QVariant::fromValue<int>( Smb4KCustomOptions::ReadWrite ) );
 
164
  m_write_access->insertItem( 1, Smb4KSettings::self()->writeAccessItem()->choices()
 
165
                                 .value( Smb4KSettings::EnumWriteAccess::ReadOnly ).label, 
 
166
                              QVariant::fromValue<int>( Smb4KCustomOptions::ReadOnly ) );
 
167
 
 
168
  if ( m_options->writeAccess() == Smb4KCustomOptions::UndefinedWriteAccess )
 
169
  {
 
170
    switch ( Smb4KSettings::writeAccess() )
 
171
    {
 
172
      case Smb4KSettings::EnumWriteAccess::ReadWrite:
 
173
      {
 
174
        m_write_access->setCurrentIndex( 0 );
 
175
        break;
 
176
      }
 
177
      case Smb4KSettings::EnumWriteAccess::ReadOnly:
 
178
      {
 
179
        m_write_access->setCurrentIndex( 1 );
 
180
        break;
 
181
      }
 
182
      default:
 
183
      {
 
184
        break;
 
185
      }
 
186
    }
 
187
  }
 
188
  else
 
189
  {
 
190
    switch ( m_options->writeAccess() )
 
191
    {
 
192
      case Smb4KCustomOptions::ReadWrite:
 
193
      {
 
194
        m_write_access->setCurrentIndex( 0 );
 
195
        break;
 
196
      }
 
197
      case Smb4KCustomOptions::ReadOnly:
 
198
      {
 
199
        m_write_access->setCurrentIndex( 1 );
 
200
        break;
 
201
      }
 
202
      default:
 
203
      {
 
204
        break;
 
205
      }
 
206
    }
 
207
  }
 
208
#endif
 
209
 
 
210
  QLabel *protocol_label = new QLabel( i18n( "Protocol Hint:" ), editors );
 
211
  m_protocol_hint        = new KComboBox( editors );
 
212
  m_protocol_hint->insertItem( 0, Smb4KSettings::self()->protocolHintItem()->choices()
 
213
                                  .value( Smb4KSettings::EnumProtocolHint::Automatic ).label,
 
214
                               QVariant::fromValue<int>( Smb4KCustomOptions::Automatic ) );
 
215
  m_protocol_hint->insertItem( 1, Smb4KSettings::self()->protocolHintItem()->choices()
 
216
                                  .value( Smb4KSettings::EnumProtocolHint::RPC ).label,
 
217
                               QVariant::fromValue<int>( Smb4KCustomOptions::RPC ) );
 
218
  m_protocol_hint->insertItem( 2, Smb4KSettings::self()->protocolHintItem()->choices()
 
219
                                  .value( Smb4KSettings::EnumProtocolHint::RAP ).label,
 
220
                               QVariant::fromValue<int>( Smb4KCustomOptions::RAP ) );
 
221
  m_protocol_hint->insertItem( 3, Smb4KSettings::self()->protocolHintItem()->choices()
 
222
                                  .value( Smb4KSettings::EnumProtocolHint::ADS ).label,
 
223
                               QVariant::fromValue<int>( Smb4KCustomOptions::ADS ) );
 
224
 
 
225
  if ( m_options->protocolHint() == Smb4KCustomOptions::UndefinedProtocolHint )
 
226
  {
 
227
    switch ( Smb4KSettings::protocolHint() )
 
228
    {
 
229
      case Smb4KSettings::EnumProtocolHint::Automatic:
 
230
      {
 
231
        m_protocol_hint->setCurrentIndex( 0 );
 
232
        break;
 
233
      }
 
234
      case Smb4KSettings::EnumProtocolHint::RPC:
 
235
      {
 
236
        m_protocol_hint->setCurrentIndex( 1 );
 
237
        break;
 
238
      }
 
239
      case Smb4KSettings::EnumProtocolHint::RAP:
 
240
      {
 
241
        m_protocol_hint->setCurrentIndex( 2 );
 
242
        break;
 
243
      }
 
244
      case Smb4KSettings::EnumProtocolHint::ADS:
 
245
      {
 
246
        m_protocol_hint->setCurrentIndex( 3 );
 
247
        break;
 
248
      }
 
249
      default:
 
250
      {
 
251
        break;
 
252
      }
 
253
    }
 
254
  }
 
255
  else
 
256
  {
 
257
    switch ( m_options->protocolHint() )
 
258
    {
 
259
      case Smb4KCustomOptions::Automatic:
 
260
      {
 
261
        m_protocol_hint->setCurrentIndex( 0 );
 
262
        break;
 
263
      }
 
264
      case Smb4KCustomOptions::RPC:
 
265
      {
 
266
        m_protocol_hint->setCurrentIndex( 1 );
 
267
        break;
 
268
      }
 
269
      case Smb4KCustomOptions::RAP:
 
270
      {
 
271
        m_protocol_hint->setCurrentIndex( 2 );
 
272
        break;
 
273
      }
 
274
      case Smb4KCustomOptions::ADS:
 
275
      {
 
276
        m_protocol_hint->setCurrentIndex( 3 );
 
277
        break;
 
278
      }
 
279
      default:
 
280
      {
 
281
        break;
 
282
      }
 
283
    }
 
284
  }
 
285
  
 
286
  QLabel *uid_label = new QLabel( i18n( "User ID:" ), editors );
 
287
  m_user_id         = new KComboBox( editors );
 
288
  
 
289
  for ( int i = 0; i < KUser::allUsers().size(); ++i )
 
290
  {
 
291
    KUser user = KUser::allUsers().at( i );
 
292
    m_user_id->insertItem( i, QString( "%1 (%2)" ).arg( user.loginName() ).arg( user.uid() ), 
 
293
                           QVariant::fromValue<K_UID>( user.uid() ) );
 
294
    
 
295
    if ( m_options->uid() == user.uid() )
 
296
    {
 
297
      m_user_id->setCurrentIndex( i );
 
298
    }
 
299
    else
 
300
    {
 
301
      // Do nothing
 
302
    }
 
303
  }
 
304
  
 
305
  QLabel *gid_label = new QLabel( i18n( "Group ID:" ), editors );
 
306
  m_group_id        = new KComboBox( editors );
 
307
  
 
308
  for ( int i = 0; i < KUserGroup::allGroups().size(); ++i )
 
309
  {
 
310
    KUserGroup group = KUserGroup::allGroups().at( i );
 
311
    m_group_id->insertItem( i, QString( "%1 (%2)" ).arg( group.name() ).arg( group.gid() ), 
 
312
                           QVariant::fromValue<K_UID>( group.gid() ) );
 
313
    
 
314
    if ( m_options->gid() == group.gid() )
 
315
    {
 
316
      m_group_id->setCurrentIndex( i );
 
317
    }
 
318
    else
 
319
    {
 
320
      // Do nothing
 
321
    }
 
322
  }
 
323
  
 
324
  m_kerberos = new QCheckBox( Smb4KSettings::self()->useKerberosItem()->label(), editors );
 
325
    
 
326
  if ( m_options->useKerberos() == Smb4KCustomOptions::UndefinedKerberos )
 
327
  {
 
328
    m_kerberos->setChecked( Smb4KSettings::useKerberos() );
 
329
  }
 
330
  else
 
331
  {
 
332
    switch ( m_options->useKerberos() )
 
333
    {
 
334
      case Smb4KCustomOptions::UseKerberos:
 
335
      {
 
336
        m_kerberos->setChecked( true );
 
337
        break;
 
338
      }
 
339
      case Smb4KCustomOptions::NoKerberos:
 
340
      {
 
341
        m_kerberos->setChecked( false );
 
342
        break;
 
343
      }
 
344
      default:
 
345
      {
 
346
        break;
 
347
      }
 
348
    }
 
349
  }
 
350
  
 
351
  editors_layout->addWidget( unc_label, 0, 0, 0 );
 
352
  editors_layout->addWidget( unc, 0, 1, 0 );
 
353
  editors_layout->addWidget( smb_label, 1, 0, 0 );
 
354
  editors_layout->addWidget( m_smb_port, 1, 1, 0 );
 
355
#ifndef Q_OS_FREEBSD
 
356
  editors_layout->addWidget( fs_label, 2, 0, 0 );
 
357
  editors_layout->addWidget( m_fs_port, 2, 1, 0 );
 
358
  editors_layout->addWidget( rw_label, 3, 0, 0 );
 
359
  editors_layout->addWidget( m_write_access, 3, 1, 0 );
 
360
  editors_layout->addWidget( protocol_label, 4, 0, 0 );
 
361
  editors_layout->addWidget( m_protocol_hint, 4, 1, 0 );
 
362
  editors_layout->addWidget( uid_label, 5, 0, 0 );
 
363
  editors_layout->addWidget( m_user_id, 5, 1, 0 );
 
364
  editors_layout->addWidget( gid_label, 6, 0, 0 );
 
365
  editors_layout->addWidget( m_group_id, 6, 1, 0 );
 
366
  editors_layout->addWidget( m_kerberos, 7, 0, 1, 2, 0 );
 
367
#else
 
368
  editors_layout->addWidget( protocol_label, 2, 0, 0 );
 
369
  editors_layout->addWidget( m_protocol_hint, 2, 1, 0 );
 
370
  editors_layout->addWidget( uid_label, 3, 0, 0 );
 
371
  editors_layout->addWidget( m_user_id, 3, 1, 0 );
 
372
  editors_layout->addWidget( gid_label, 4, 0, 0 );
 
373
  editors_layout->addWidget( m_group_id, 4, 1, 0 );
 
374
  editors_layout->addWidget( m_kerberos, 5, 0, 1, 2, 0 );
 
375
#endif
 
376
  
 
377
  layout->addWidget( description );
 
378
  layout->addWidget( editors );
 
379
  
 
380
  connect( m_smb_port, SIGNAL( valueChanged( int ) ), SLOT( slotCheckValues() ) );
 
381
#ifndef Q_OS_FREEBSD
 
382
  connect( m_fs_port, SIGNAL( valueChanged(int) ), SLOT( slotCheckValues() ) );
 
383
  connect( m_write_access, SIGNAL( currentIndexChanged( int ) ), SLOT( slotCheckValues() ) );
 
384
#endif
 
385
  connect( m_protocol_hint, SIGNAL( currentIndexChanged( int ) ), SLOT( slotCheckValues() ) );
 
386
  connect( m_user_id, SIGNAL( currentIndexChanged( int ) ), SLOT( slotCheckValues() ) );
 
387
  connect( m_group_id, SIGNAL( currentIndexChanged( int ) ), SLOT( slotCheckValues() ) );
 
388
  connect( m_kerberos, SIGNAL( toggled( bool ) ), SLOT( slotCheckValues() ) );
 
389
  
 
390
  enableButton( User1, !defaultValues() );
 
391
}
 
392
 
 
393
 
 
394
bool Smb4KCustomOptionsDialog::defaultValues()
 
395
{
 
396
  if ( m_smb_port->value() != Smb4KSettings::remoteSMBPort() )
 
397
  {
 
398
    return false;
 
399
  }
 
400
  else
 
401
  {
 
402
    // Do nothing
 
403
  }
 
404
  
 
405
#ifndef Q_OS_FREEBSD
 
406
 
 
407
  if ( m_fs_port->value() != Smb4KSettings::remoteFileSystemPort() )
 
408
  {
 
409
    return false;
 
410
  }
 
411
  else
 
412
  {
 
413
    // Do nothing
 
414
  }
 
415
  
 
416
  if ( QString::compare( m_write_access->currentText(), 
 
417
       Smb4KSettings::self()->writeAccessItem()->choices().value( Smb4KSettings::self()->writeAccess() ).label,
 
418
       Qt::CaseInsensitive ) != 0 )
 
419
  {
 
420
    return false;
 
421
  }
 
422
  else
 
423
  {
 
424
    // Do nothing
 
425
  }
 
426
#endif
 
427
 
 
428
  if ( QString::compare( m_protocol_hint->currentText(),
 
429
       Smb4KSettings::self()->protocolHintItem()->choices().value( Smb4KSettings::self()->protocolHint() ).label,
 
430
       Qt::CaseInsensitive ) != 0 )
 
431
  {
 
432
    return false;
 
433
  }
 
434
  else
 
435
  {
 
436
    // Do nothing
 
437
  }
 
438
  
 
439
  K_UID uid = (K_UID)m_user_id->itemData( m_user_id->currentIndex() ).toInt();
 
440
  
 
441
  if ( uid != (K_UID)Smb4KSettings::userID().toInt() )
 
442
  {
 
443
    return false;
 
444
  }
 
445
  else
 
446
  {
 
447
    // Do nothing
 
448
  }
 
449
  
 
450
  K_GID gid = (K_GID)m_group_id->itemData( m_group_id->currentIndex() ).toInt();
 
451
  
 
452
  if ( gid != (K_GID)Smb4KSettings::groupID().toInt() )
 
453
  {
 
454
    return false;
 
455
  }
 
456
  else
 
457
  {
 
458
    // Do nothing
 
459
  }
 
460
  
 
461
  if ( m_kerberos->isChecked() != Smb4KSettings::useKerberos() )
 
462
  {
 
463
    return false;
 
464
  }
 
465
  else
 
466
  {
 
467
    // Do nothing
 
468
  }
 
469
  
 
470
  return true;
 
471
}
 
472
 
 
473
 
 
474
void Smb4KCustomOptionsDialog::slotSetDefaultValues()
 
475
{
 
476
  m_smb_port->setValue( Smb4KSettings::remoteSMBPort() );
 
477
#ifndef Q_OS_FREEBSD
 
478
  m_fs_port->setValue( Smb4KSettings::remoteFileSystemPort() );
 
479
 
 
480
  switch ( Smb4KSettings::writeAccess() )
 
481
  {
 
482
    case Smb4KSettings::EnumWriteAccess::ReadWrite:
 
483
    {
 
484
      m_write_access->setCurrentIndex( 0 );
 
485
      break;
 
486
    }
 
487
    case Smb4KSettings::EnumWriteAccess::ReadOnly:
 
488
    {
 
489
      m_write_access->setCurrentIndex( 1 );
 
490
      break;
 
491
    }
 
492
    default:
 
493
    {
 
494
      break;
 
495
    }
 
496
  }
 
497
#endif
 
498
 
 
499
  switch ( Smb4KSettings::protocolHint() )
 
500
  {
 
501
    case Smb4KSettings::EnumProtocolHint::Automatic:
 
502
    {
 
503
      m_protocol_hint->setCurrentIndex( 0 );
 
504
      break;
 
505
    }
 
506
    case Smb4KSettings::EnumProtocolHint::RPC:
 
507
    {
 
508
      m_protocol_hint->setCurrentIndex( 1 );
 
509
      break;
 
510
    }
 
511
    case Smb4KSettings::EnumProtocolHint::RAP:
 
512
    {
 
513
      m_protocol_hint->setCurrentIndex( 2 );
 
514
      break;
 
515
    }
 
516
    case Smb4KSettings::EnumProtocolHint::ADS:
 
517
    {
 
518
      m_protocol_hint->setCurrentIndex( 3 );
 
519
      break;
 
520
    }
 
521
    default:
 
522
    {
 
523
      break;
 
524
    }
 
525
  }
 
526
  
 
527
  for ( int i = 0; i < m_user_id->count(); ++i )
 
528
  {
 
529
    if ( m_user_id->itemData( i ).toInt() == Smb4KSettings::userID().toInt() )
 
530
    {
 
531
      m_user_id->setCurrentIndex( i );
 
532
      break;
 
533
    }
 
534
    else
 
535
    {
 
536
      continue;
 
537
    }
 
538
  }
 
539
  
 
540
  for ( int i = 0; i < m_group_id->count(); ++i )
 
541
  {
 
542
    if ( m_group_id->itemData( i ).toInt() == Smb4KSettings::groupID().toInt() )
 
543
    {
 
544
      m_group_id->setCurrentIndex( i );
 
545
      break;
 
546
    }
 
547
    else
 
548
    {
 
549
      continue;
 
550
    }
 
551
  }
 
552
  
 
553
  m_kerberos->setChecked( Smb4KSettings::self()->useKerberos() );
 
554
}
 
555
 
 
556
 
 
557
void Smb4KCustomOptionsDialog::slotCheckValues()
 
558
{
 
559
  enableButton( User1, !defaultValues() );
 
560
}
 
561
 
 
562
 
 
563
void Smb4KCustomOptionsDialog::slotOKClicked()
 
564
{
 
565
  m_options->setSMBPort( m_smb_port->value() );
 
566
#ifndef Q_OS_FREEBSD
 
567
  m_options->setFileSystemPort( m_fs_port->value() );
 
568
  m_options->setWriteAccess( (Smb4KCustomOptions::WriteAccess)m_write_access->itemData( m_write_access->currentIndex() ).toInt() );
 
569
#endif
 
570
  m_options->setProtocolHint( (Smb4KCustomOptions::ProtocolHint)m_protocol_hint->itemData( m_protocol_hint->currentIndex() ).toInt() );
 
571
  m_options->setUID( m_user_id->itemData( m_user_id->currentIndex() ).toInt() );
 
572
  m_options->setGID( m_group_id->itemData( m_group_id->currentIndex() ).toInt() );
 
573
 
 
574
  if ( m_kerberos->isChecked() )
 
575
  {
 
576
    m_options->setUseKerberos( Smb4KCustomOptions::UseKerberos );
 
577
  }
 
578
  else
 
579
  {
 
580
    m_options->setUseKerberos( Smb4KCustomOptions::NoKerberos );
 
581
  }
 
582
  
 
583
  KConfigGroup group( Smb4KSettings::self()->config(), "CustomOptionsDialog" );
 
584
  saveDialogSize( group, KConfigGroup::Normal );
 
585
}
 
586
 
 
587
 
 
588
 
 
589
Smb4KCustomOptionsManagerPrivate::Smb4KCustomOptionsManagerPrivate()
 
590
{
 
591
}
 
592
 
 
593
 
 
594
Smb4KCustomOptionsManagerPrivate::~Smb4KCustomOptionsManagerPrivate()
 
595
{
 
596
}
 
597
 
 
598
#include "smb4kcustomoptionsmanager_p.moc"
 
599