📄 packguibase.cpp
字号:
/*************************************************************************** packguibase.cpp ------------------- copyright : (C) 2000 by Shie Erlich & Rafi Yanai e-mail : krusader@users.sourceforge.net web site : http://krusader.sourceforge.net --------------------------------------------------------------------------- Description *************************************************************************** A db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88,8P 88oobY' 88 88 `8bo. 88ooo88 88 88 88ooooo 88oobY' 88`8b 88`8b 88 88 `Y8b. 88~~~88 88 88 88~~~~~ 88`8b 88 `88. 88 `88. 88b d88 db 8D 88 88 88 .8D 88. 88 `88. YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD S o u r c e F i l e *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#include "packguibase.h"#include <qcheckbox.h>#include <qcombobox.h>#include <qlabel.h>#include <qlineedit.h>#include <qpushbutton.h>#include <qtoolbutton.h>#include <qlayout.h>#include <qvariant.h>#include <qtooltip.h>#include <qwhatsthis.h>#include <qimage.h>#include <qpixmap.h>#include <qspinbox.h>#include <qslider.h>#include <qhbox.h>#include <qvbox.h>#include <kiconloader.h>#include <kglobalsettings.h>#include <kcombobox.h>#include <kmessagebox.h>#include <kio/global.h>#include "../krusader.h"/* * Constructs a PackGUIBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */PackGUIBase::PackGUIBase( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ), expanded( false ){ if ( !name ) setName( "PackGUIBase" ); resize( 430, 140 ); setCaption( i18n( "Pack" ) ); grid = new QGridLayout( this ); grid->setSpacing( 6 ); grid->setMargin( 11 ); hbox = new QHBoxLayout; hbox->setSpacing( 6 ); hbox->setMargin( 0 ); TextLabel3 = new QLabel( this, "TextLabel3" ); TextLabel3->setText( i18n( "To archive" ) ); hbox->addWidget( TextLabel3 ); nameData = new QLineEdit( this, "nameData" ); hbox->addWidget( nameData ); typeData = new QComboBox( FALSE, this, "typeData" ); typeData->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0 ) ); connect( typeData, SIGNAL( activated( const QString & ) ), this, SLOT( checkConsistency() ) ); connect( typeData, SIGNAL( highlighted( const QString & ) ), this, SLOT( checkConsistency() ) ); hbox->addWidget( typeData ); grid->addLayout( hbox, 1, 0 ); hbox_2 = new QHBoxLayout; hbox_2->setSpacing( 6 ); hbox_2->setMargin( 0 ); TextLabel5 = new QLabel( this, "TextLabel5" ); TextLabel5->setText( i18n( "In directory" ) ); hbox_2->addWidget( TextLabel5 ); dirData = new QLineEdit( this, "dirData" ); hbox_2->addWidget( dirData ); browseButton = new QToolButton( this, "browseButton" ); browseButton->setIconSet( SmallIcon( "fileopen" ) ); hbox_2->addWidget( browseButton ); QSpacerItem* spacer = new QSpacerItem( 48, 20, QSizePolicy::Fixed, QSizePolicy::Fixed ); hbox_2->addItem( spacer ); grid->addLayout( hbox_2, 2, 0 ); hbox_3 = new QHBoxLayout; hbox_3->setSpacing( 6 ); hbox_3->setMargin( 0 ); PixmapLabel1 = new QLabel( this, "PixmapLabel1" ); PixmapLabel1->setPixmap( krLoader->loadIcon("package", KIcon::Desktop, 32) ); PixmapLabel1->setScaledContents( TRUE ); PixmapLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0 ) ); hbox_3->addWidget( PixmapLabel1 ); TextLabel1 = new QLabel( this, "TextLabel1" ); TextLabel1->setText( i18n( "Pack" ) ); hbox_3->addWidget( TextLabel1 ); grid->addLayout( hbox_3, 0, 0 ); hbox_4 = new QHBoxLayout; hbox_4->setSpacing( 6 ); hbox_4->setMargin( 0 ); QSpacerItem* spacer_3 = new QSpacerItem( 20, 26, QSizePolicy::Fixed, QSizePolicy::Expanding ); hbox_4->addItem( spacer_3 ); grid->addLayout( hbox_4, 3, 0 ); advancedWidget = new QWidget( this, "advancedWidget" ); hbox_5 = new QGridLayout( advancedWidget ); hbox_5->setSpacing( 6 ); hbox_5->setMargin( 0 ); QVBoxLayout *compressLayout = new QVBoxLayout; compressLayout->setSpacing( 6 ); compressLayout->setMargin( 0 ); multipleVolume = new QCheckBox( i18n( "Multiple volume archive" ), advancedWidget, "multipleVolume" ); connect( multipleVolume, SIGNAL( toggled( bool ) ), this, SLOT( checkConsistency() ) ); compressLayout->addWidget( multipleVolume, 0, 0 ); QHBoxLayout * volumeHbox = new QHBoxLayout; QSpacerItem* spacer_5 = new QSpacerItem( 20, 26, QSizePolicy::Fixed, QSizePolicy::Fixed ); volumeHbox->addItem( spacer_5 ); TextLabel7 = new QLabel( i18n("Size:" ), advancedWidget, "TextLabel7" ); volumeHbox->addWidget( TextLabel7 ); volumeSpinBox = new QSpinBox( advancedWidget, "volumeSpinBox" ); volumeSpinBox->setMinValue( 1 ); volumeSpinBox->setMaxValue( 9999 ); volumeSpinBox->setValue( 1440 ); volumeHbox->addWidget( volumeSpinBox ); volumeUnitCombo = new QComboBox( FALSE, advancedWidget, "volumeUnitCombo" ); volumeUnitCombo->insertItem( "B" ); volumeUnitCombo->insertItem( "KB" ); volumeUnitCombo->insertItem( "MB" ); volumeUnitCombo->setCurrentItem( 1 ); volumeHbox->addWidget( volumeUnitCombo ); compressLayout->addLayout ( volumeHbox ); setCompressionLevel = new QCheckBox( i18n( "Set compression level" ), advancedWidget, "multipleVolume" ); connect( setCompressionLevel, SIGNAL( toggled( bool ) ), this, SLOT( checkConsistency() ) ); compressLayout->addWidget( setCompressionLevel, 0, 0 ); QHBoxLayout * sliderHbox = new QHBoxLayout; QSpacerItem* spacer_6 = new QSpacerItem( 20, 26, QSizePolicy::Fixed, QSizePolicy::Fixed ); sliderHbox->addItem( spacer_6 ); QVBox * sliderVBox = new QVBox( advancedWidget ); compressionSlider = new QSlider( 1, 9, 1, 5, Qt::Horizontal, sliderVBox, "compressionSlider" ); compressionSlider->setTickmarks( QSlider::Below ); QHBox * minmaxHBox = new QHBox( sliderVBox ); minLabel = new QLabel( i18n("MIN"), minmaxHBox ); maxLabel = new QLabel( i18n("MAX"), minmaxHBox ); maxLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); sliderHbox->addWidget( sliderVBox ); compressLayout->addLayout( sliderHbox ); compressLayout->addStretch( 0 ); hbox_5->addLayout( compressLayout, 0, 0 ); QFrame *vline = new QFrame( advancedWidget, "vline" ); vline->setFrameStyle( QFrame::VLine | QFrame::Sunken ); vline->setMinimumWidth( 20 ); hbox_5->addWidget( vline, 0, 1 ); QGridLayout * passwordGrid = new QGridLayout; passwordGrid->setSpacing( 6 ); passwordGrid->setMargin( 0 ); TextLabel4 = new QLabel( advancedWidget, "TextLabel4" ); TextLabel4->setText( i18n( "Password" ) ); passwordGrid->addWidget( TextLabel4, 0, 0 ); password = new QLineEdit( advancedWidget, "password" ); password->setEchoMode( QLineEdit::Password ); connect( password, SIGNAL( textChanged ( const QString & ) ), this, SLOT( checkConsistency() ) ); passwordGrid->addWidget( password, 0, 1 ); TextLabel6 = new QLabel( advancedWidget, "TextLabel6" ); TextLabel6->setText( i18n( "Again" ) ); passwordGrid->addWidget( TextLabel6, 1, 0 ); passwordAgain = new QLineEdit( advancedWidget, "password" ); passwordAgain->setEchoMode( QLineEdit::Password ); connect( passwordAgain, SIGNAL( textChanged ( const QString & ) ), this, SLOT( checkConsistency() ) ); passwordGrid->addWidget( passwordAgain, 1, 1 ); QHBoxLayout *consistencyHbox = new QHBoxLayout; QSpacerItem* spacer_cons = new QSpacerItem( 48, 20, QSizePolicy::Expanding, QSizePolicy::Fixed ); consistencyHbox->addItem( spacer_cons ); passwordConsistencyLabel = new QLabel( advancedWidget, "passwordConsistencyLabel" );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -