ark
extractiondialog.cpp
Go to the documentation of this file.00001 /* 00002 * ark -- archiver for the KDE project 00003 * 00004 * Copyright (C) 2007 Henrique Pinto <henrique.pinto@kdemail.net> 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 */ 00021 #include "extractiondialog.h" 00022 #include "settings.h" 00023 00024 #include <KLocale> 00025 #include <KIconLoader> 00026 00027 #include <QDir> 00028 00029 ExtractionDialogUI::ExtractionDialogUI( QWidget *parent ) 00030 : QFrame( parent ) 00031 { 00032 setupUi( this ); 00033 } 00034 00035 ExtractionDialog::ExtractionDialog( QWidget *parent ) 00036 : KDialog( parent ) 00037 { 00038 m_ui = new ExtractionDialogUI( this ); 00039 setMainWidget( m_ui ); 00040 setButtons( Ok | Cancel ); 00041 setCaption( i18n( "Extract" ) ); 00042 m_ui->iconLabel->setPixmap( DesktopIcon( "archive-extract" ) ); 00043 m_ui->iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); 00044 00045 m_ui->filesToExtractGroupBox->hide(); 00046 m_ui->allFilesButton->setChecked( true ); 00047 m_ui->extractAllLabel->show(); 00048 00049 m_ui->destDirRequester->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly ); 00050 00051 if ( ArkSettings::lastExtractionFolder().isEmpty() ) 00052 { 00053 m_ui->destDirRequester->setPath( QDir::currentPath() ); 00054 } 00055 else 00056 { 00057 m_ui->destDirRequester->setPath( ArkSettings::lastExtractionFolder() ); 00058 } 00059 00060 m_ui->openFolderCheckBox->setChecked( ArkSettings::openDestinationFolderAfterExtraction() ); 00061 } 00062 00063 ExtractionDialog::~ExtractionDialog() 00064 { 00065 delete m_ui; 00066 m_ui = 0; 00067 } 00068 00069 void ExtractionDialog::showSelectedFilesOption() 00070 { 00071 m_ui->filesToExtractGroupBox->show(); 00072 m_ui->selectedFilesButton->setChecked( true ); 00073 m_ui->extractAllLabel->hide(); 00074 } 00075 00076 bool ExtractionDialog::extractAllFiles() 00077 { 00078 return m_ui->allFilesButton->isChecked(); 00079 } 00080 00081 bool ExtractionDialog::openDestinationAfterExtraction() 00082 { 00083 return m_ui->openFolderCheckBox->isChecked(); 00084 } 00085 00086 KUrl ExtractionDialog::destinationDirectory() 00087 { 00088 return m_ui->destDirRequester->url(); 00089 } 00090 00091 #include "extractiondialog.moc"
KDE 4.0 API Reference