~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/Dialogs/packguibase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2009-04-04 13:47:12 UTC
  • mfrom: (1.2.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20090404134712-cjyw31gz2mxtyd3p
Tags: 2.0~svn6249-0ubuntu1
* New svn snapshot to commit 6249
  - Additional bug fixes
  - Fixes to build with Qt 4.5
* Update debian/copyright to use © instead of (c) throughouht

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 *   (at your option) any later version.                                   *
28
28
 *                                                                         *
29
29
 ***************************************************************************/
 
30
#include "../defaults.h"
30
31
#include "packguibase.h"
31
32
 
32
33
#include <qcheckbox.h>
63
64
PackGUIBase::PackGUIBase( QWidget* parent )
64
65
    : QDialog( parent ), expanded( false )
65
66
{
 
67
    KConfigGroup group( krConfig, "Archives");
 
68
 
66
69
    setModal( true );
67
70
    resize( 430, 140 );
68
71
    setWindowTitle( i18n( "Pack" ) );
171
174
 
172
175
    compressLayout->addLayout ( volumeHbox );
173
176
 
 
177
    int level = group.readEntry( "Compression level", _defaultCompressionLevel );
174
178
    setCompressionLevel = new QCheckBox( i18n( "Set compression level" ), advancedWidget );
 
179
    if ( level != _defaultCompressionLevel )
 
180
        setCompressionLevel->setChecked( true );
175
181
    connect( setCompressionLevel, SIGNAL( toggled( bool ) ), this, SLOT( checkConsistency() ) );
176
182
    compressLayout->addWidget( setCompressionLevel, 0, 0 );
177
183
 
187
193
    compressionSlider->setMinimum(1);
188
194
    compressionSlider->setMaximum(9);
189
195
    compressionSlider->setPageStep(1);
190
 
    compressionSlider->setValue(5);
 
196
    compressionSlider->setValue( level );
191
197
    compressionSlider->setTickPosition( QSlider::TicksBelow );
192
198
    sliderVBox->addWidget( compressionSlider );
193
199
 
268
274
    commandLineSwitches = new KHistoryComboBox( advancedWidget );
269
275
    commandLineSwitches->setMaxCount(25);  // remember 25 items
270
276
    commandLineSwitches->setDuplicatesEnabled(false);
271
 
    KConfigGroup group( krConfig, "Archives");
272
277
    QStringList list = group.readEntry("Command Line Switches", QStringList() );
273
278
    commandLineSwitches->setHistoryItems(list);
274
279
 
389
394
bool PackGUIBase::extraProperties( QMap<QString,QString> & inMap ) {
390
395
    inMap.clear();
391
396
 
 
397
    KConfigGroup group( krConfig, "Archives");
 
398
 
392
399
    if( password->isEnabled() && passwordAgain->isEnabled() ) {
393
400
      if( password->text() != passwordAgain->text() ) {
394
401
        KMessageBox::error( this, i18n( "Cannot pack! The passwords are different!" ) );
428
435
 
429
436
    if( setCompressionLevel->isEnabled() && setCompressionLevel->isChecked() ) {
430
437
      inMap[ "CompressionLevel" ] = QString("%1").arg( compressionSlider->value() );
 
438
      int level = compressionSlider->value();
 
439
      group.writeEntry( "Compression level", level );
431
440
    }
432
441
 
433
442
    QString cmdArgs = commandLineSwitches->currentText().trimmed();
472
481
 
473
482
      commandLineSwitches->addToHistory( cmdArgs );
474
483
      QStringList list = commandLineSwitches->historyItems();
475
 
      KConfigGroup group( krConfig, "Archives");
476
484
      group.writeEntry("Command Line Switches", list);
477
485
 
478
486
      inMap[ "CommandLineSwitches" ] = cmdArgs;