Commit f545bde1 authored by Henrique Pinto's avatar Henrique Pinto
Browse files

* Small adjustments to the extraction dialog

svn path=/branches/work/libarchive-based-ark/ark/; revision=689911
parent bc7736d2
......@@ -45,6 +45,7 @@ class ArchiveModel: public QAbstractItemModel
int columnCount( const QModelIndex &parent = QModelIndex() ) const;
void setArchive( Arch *archive );
Arch *archive() const { return m_archive; }
ArchiveEntry entryForIndex( const QModelIndex &index );
......
......@@ -38,6 +38,9 @@ ExtractionDialog::ExtractionDialog( QWidget *parent )
setCaption( i18n( "Extract" ) );
m_ui->iconLabel->setPixmap( DesktopIcon( "ark-extract" ) );
m_ui->iconLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum );
m_ui->filesToExtractGroupBox->hide();
m_ui->extractAllLabel->show();
}
ExtractionDialog::~ExtractionDialog()
......@@ -46,4 +49,10 @@ ExtractionDialog::~ExtractionDialog()
m_ui = 0;
}
void ExtractionDialog::showSelectedFilesOption()
{
m_ui->filesToExtractGroupBox->show();
m_ui->extractAllLabel->hide();
}
#include "extractiondialog.moc"
......@@ -38,6 +38,8 @@ class ExtractionDialog: public KDialog
ExtractionDialog( QWidget *parent = 0 );
~ExtractionDialog();
void showSelectedFilesOption();
private:
ExtractionDialogUI *m_ui;
};
......
......@@ -60,6 +60,12 @@
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="extractAllLabel" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&lt;font size=+2>&lt;b>Extract All Files&lt;/b>&lt;/font></string>
</property>
......@@ -88,6 +94,9 @@
<property name="text" >
<string>Selected Files Only</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
......
......@@ -106,6 +106,7 @@ void Part::setupActions()
void Part::updateActions()
{
m_previewAction->setEnabled( m_view->selectionModel()->currentIndex().isValid() );
m_extractFilesAction->setEnabled( m_model->archive() );
}
void Part::selectionChanged()
......@@ -123,6 +124,7 @@ bool Part::openFile()
Arch *archive = Arch::factory( localFilePath() );
m_model->setArchive( archive );
m_infoPanel->setEntry( ArchiveEntry() );
updateActions();
return ( archive != 0 );
}
......@@ -202,7 +204,13 @@ void Part::slotExtractFiles()
const ArchiveEntry & entry = m_model->entryForIndex( index );
kDebug( 1601 ) << k_funcinfo << "Entry: " << entry[ FileName ].toString() << endl;
}
ExtractionDialog dialog;
if ( m_view->selectionModel()->selectedRows().count() > 0 )
{
dialog.showSelectedFilesOption();
}
if ( dialog.exec() )
{
kDebug( 1601 ) << k_funcinfo << "implement me!" << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment