#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './kdarcreatewizarddlg.ui'
**
** Created: Sun Jul 10 12:14:16 2005
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kdarcreatewizarddlg.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qwidget.h>
#include <qframe.h>
#include <qlabel.h>
#include <kurlrequester.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a kdarCreateWizardDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The wizard will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal wizard.
 */
kdarCreateWizardDlg::kdarCreateWizardDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
    : KWizard( parent, name, modal, fl )
{
    if ( !name )
	setName( "kdarCreateWizardDlg" );
    setEnabled( TRUE );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );

    restoreProfilePage = new QWidget( this, "restoreProfilePage" );
    restoreProfilePageLayout = new QVBoxLayout( restoreProfilePage, 11, 6, "restoreProfilePageLayout"); 

    frame3 = new QFrame( restoreProfilePage, "frame3" );
    frame3->setFrameShape( QFrame::StyledPanel );
    frame3->setFrameShadow( QFrame::Raised );
    frame3Layout = new QVBoxLayout( frame3, 11, 6, "frame3Layout"); 

    textLabel1_3 = new QLabel( frame3, "textLabel1_3" );
    textLabel1_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1_3->sizePolicy().hasHeightForWidth() ) );
    textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    frame3Layout->addWidget( textLabel1_3 );

    layout10 = new QHBoxLayout( 0, 0, 6, "layout10"); 
    spacer15 = new QSpacerItem( 91, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10->addItem( spacer15 );

    restoreProfilePushButton = new QPushButton( frame3, "restoreProfilePushButton" );
    layout10->addWidget( restoreProfilePushButton );
    spacer11 = new QSpacerItem( 110, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10->addItem( spacer11 );
    frame3Layout->addLayout( layout10 );
    restoreProfilePageLayout->addWidget( frame3 );

    textLabel2_3 = new QLabel( restoreProfilePage, "textLabel2_3" );
    textLabel2_3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel2_3->sizePolicy().hasHeightForWidth() ) );
    textLabel2_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    restoreProfilePageLayout->addWidget( textLabel2_3 );
    spacer14 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    restoreProfilePageLayout->addItem( spacer14 );
    addPage( restoreProfilePage, QString("") );

    ArchiveName = new QWidget( this, "ArchiveName" );
    ArchiveNameLayout = new QVBoxLayout( ArchiveName, 11, 6, "ArchiveNameLayout"); 

    textLabel2 = new QLabel( ArchiveName, "textLabel2" );
    textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel2->sizePolicy().hasHeightForWidth() ) );
    textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    ArchiveNameLayout->addWidget( textLabel2 );
    spacer16_2 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Fixed );
    ArchiveNameLayout->addItem( spacer16_2 );

    layout27 = new QHBoxLayout( 0, 0, 6, "layout27"); 

    archiveNameLabel = new QLabel( ArchiveName, "archiveNameLabel" );
    archiveNameLabel->setEnabled( TRUE );
    layout27->addWidget( archiveNameLabel );

    archiveNameKURLRequester = new KURLRequester( ArchiveName, "archiveNameKURLRequester" );
    archiveNameKURLRequester->setEnabled( TRUE );
    layout27->addWidget( archiveNameKURLRequester );
    ArchiveNameLayout->addLayout( layout27 );
    spacer32 = new QSpacerItem( 20, 90, QSizePolicy::Minimum, QSizePolicy::Expanding );
    ArchiveNameLayout->addItem( spacer32 );
    addPage( ArchiveName, QString("") );

    ArchiveRoot = new QWidget( this, "ArchiveRoot" );
    ArchiveRootLayout = new QVBoxLayout( ArchiveRoot, 11, 6, "ArchiveRootLayout"); 

    textLabel1 = new QLabel( ArchiveRoot, "textLabel1" );
    textLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
    textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    ArchiveRootLayout->addWidget( textLabel1 );
    spacer16 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Fixed );
    ArchiveRootLayout->addItem( spacer16 );

    layout26 = new QHBoxLayout( 0, 0, 6, "layout26"); 

    rootDirectoryLabel = new QLabel( ArchiveRoot, "rootDirectoryLabel" );
    layout26->addWidget( rootDirectoryLabel );

    rootDirectoryKURLRequester = new KURLRequester( ArchiveRoot, "rootDirectoryKURLRequester" );
    layout26->addWidget( rootDirectoryKURLRequester );
    ArchiveRootLayout->addLayout( layout26 );
    spacer35 = new QSpacerItem( 21, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
    ArchiveRootLayout->addItem( spacer35 );
    addPage( ArchiveRoot, QString("") );

    ReferenceArchive = new QWidget( this, "ReferenceArchive" );
    ReferenceArchiveLayout = new QVBoxLayout( ReferenceArchive, 11, 6, "ReferenceArchiveLayout"); 

    textLabel3 = new QLabel( ReferenceArchive, "textLabel3" );
    textLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );
    textLabel3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    ReferenceArchiveLayout->addWidget( textLabel3 );
    spacer16_3 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Fixed );
    ReferenceArchiveLayout->addItem( spacer16_3 );

    layout28 = new QHBoxLayout( 0, 0, 6, "layout28"); 

    diffBackupCheckBox = new QCheckBox( ReferenceArchive, "diffBackupCheckBox" );
    diffBackupCheckBox->setEnabled( TRUE );
    layout28->addWidget( diffBackupCheckBox );
    spacer1_2 = new QSpacerItem( 226, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout28->addItem( spacer1_2 );
    ReferenceArchiveLayout->addLayout( layout28 );

    layout34 = new QHBoxLayout( 0, 0, 6, "layout34"); 
    spacer2_3 = new QSpacerItem( 40, 38, QSizePolicy::Maximum, QSizePolicy::Minimum );
    layout34->addItem( spacer2_3 );

    referenceArchiveLabel = new QLabel( ReferenceArchive, "referenceArchiveLabel" );
    referenceArchiveLabel->setEnabled( FALSE );
    layout34->addWidget( referenceArchiveLabel );

    referenceArchiveKURLRequester = new KURLRequester( ReferenceArchive, "referenceArchiveKURLRequester" );
    referenceArchiveKURLRequester->setEnabled( FALSE );
    layout34->addWidget( referenceArchiveKURLRequester );
    ReferenceArchiveLayout->addLayout( layout34 );
    spacer36 = new QSpacerItem( 21, 130, QSizePolicy::Minimum, QSizePolicy::Expanding );
    ReferenceArchiveLayout->addItem( spacer36 );
    addPage( ReferenceArchive, QString("") );

    configureSettingsPage = new QWidget( this, "configureSettingsPage" );
    configureSettingsPageLayout = new QVBoxLayout( configureSettingsPage, 11, 6, "configureSettingsPageLayout"); 

    textLabel1_2 = new QLabel( configureSettingsPage, "textLabel1_2" );
    textLabel1_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1_2->sizePolicy().hasHeightForWidth() ) );
    textLabel1_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    configureSettingsPageLayout->addWidget( textLabel1_2 );

    layout10_2 = new QHBoxLayout( 0, 0, 6, "layout10_2"); 
    spacer23 = new QSpacerItem( 51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10_2->addItem( spacer23 );

    configureCreationSettingsPushButton = new QPushButton( configureSettingsPage, "configureCreationSettingsPushButton" );
    layout10_2->addWidget( configureCreationSettingsPushButton );
    spacer24 = new QSpacerItem( 31, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10_2->addItem( spacer24 );
    configureSettingsPageLayout->addLayout( layout10_2 );
    spacer16_3_3 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Fixed );
    configureSettingsPageLayout->addItem( spacer16_3_3 );

    textLabel2_4 = new QLabel( configureSettingsPage, "textLabel2_4" );
    textLabel2_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel2_4->sizePolicy().hasHeightForWidth() ) );
    textLabel2_4->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    configureSettingsPageLayout->addWidget( textLabel2_4 );
    spacer21 = new QSpacerItem( 21, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    configureSettingsPageLayout->addItem( spacer21 );
    addPage( configureSettingsPage, QString("") );

    WizardPage = new QWidget( this, "WizardPage" );
    WizardPageLayout = new QVBoxLayout( WizardPage, 11, 6, "WizardPageLayout"); 

    frame4 = new QFrame( WizardPage, "frame4" );
    frame4->setFrameShape( QFrame::StyledPanel );
    frame4->setFrameShadow( QFrame::Raised );
    frame4Layout = new QVBoxLayout( frame4, 11, 6, "frame4Layout"); 

    textLabel1_3_2 = new QLabel( frame4, "textLabel1_3_2" );
    textLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1_3_2->sizePolicy().hasHeightForWidth() ) );
    textLabel1_3_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    frame4Layout->addWidget( textLabel1_3_2 );

    layout10_2_2 = new QHBoxLayout( 0, 0, 6, "layout10_2_2"); 
    spacer15_2 = new QSpacerItem( 91, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10_2_2->addItem( spacer15_2 );

    saveProfilePushButton = new QPushButton( frame4, "saveProfilePushButton" );
    layout10_2_2->addWidget( saveProfilePushButton );
    spacer11_2 = new QSpacerItem( 110, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout10_2_2->addItem( spacer11_2 );
    frame4Layout->addLayout( layout10_2_2 );

    textLabel1_5 = new QLabel( frame4, "textLabel1_5" );
    textLabel1_5->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    frame4Layout->addWidget( textLabel1_5 );

    layout9 = new QHBoxLayout( 0, 0, 6, "layout9"); 
    spacer22 = new QSpacerItem( 61, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout9->addItem( spacer22 );

    exportDarCommandButton = new QPushButton( frame4, "exportDarCommandButton" );
    layout9->addWidget( exportDarCommandButton );
    spacer23_2 = new QSpacerItem( 51, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout9->addItem( spacer23_2 );
    frame4Layout->addLayout( layout9 );
    WizardPageLayout->addWidget( frame4 );
    spacer16_2_2 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Fixed );
    WizardPageLayout->addItem( spacer16_2_2 );

    textLabel3_2 = new QLabel( WizardPage, "textLabel3_2" );
    textLabel3_2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    WizardPageLayout->addWidget( textLabel3_2 );

    layout23 = new QHBoxLayout( 0, 0, 6, "layout23"); 
    spacer34 = new QSpacerItem( 81, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout23->addItem( spacer34 );

    dryRunCheckBox = new QCheckBox( WizardPage, "dryRunCheckBox" );
    layout23->addWidget( dryRunCheckBox );
    spacer35_2 = new QSpacerItem( 101, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    layout23->addItem( spacer35_2 );
    WizardPageLayout->addLayout( layout23 );

    textLabel1_4 = new QLabel( WizardPage, "textLabel1_4" );
    textLabel1_4->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, textLabel1_4->sizePolicy().hasHeightForWidth() ) );
    textLabel1_4->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
    WizardPageLayout->addWidget( textLabel1_4 );
    spacer20 = new QSpacerItem( 21, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
    WizardPageLayout->addItem( spacer20 );
    addPage( WizardPage, QString("") );
    languageChange();
    resize( QSize(520, 566).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( archiveNameKURLRequester, SIGNAL( textChanged(const QString&) ), this, SLOT( changeNextButtonState(const QString&) ) );
    connect( rootDirectoryKURLRequester, SIGNAL( textChanged(const QString&) ), this, SLOT( changeNextButtonState(const QString&) ) );
    connect( diffBackupCheckBox, SIGNAL( toggled(bool) ), referenceArchiveLabel, SLOT( setEnabled(bool) ) );
    connect( diffBackupCheckBox, SIGNAL( toggled(bool) ), referenceArchiveKURLRequester, SLOT( setEnabled(bool) ) );
    connect( archiveNameKURLRequester, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChooseArchiveName(const QString&) ) );
    connect( archiveNameKURLRequester, SIGNAL( returnPressed(const QString&) ), this, SLOT( slotChooseArchiveName(const QString&) ) );
    connect( rootDirectoryKURLRequester, SIGNAL( textChanged(const QString&) ), this, SLOT( slotChooseRootDirectory(const QString&) ) );
    connect( rootDirectoryKURLRequester, SIGNAL( returnPressed(const QString&) ), this, SLOT( slotChooseRootDirectory(const QString&) ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
kdarCreateWizardDlg::~kdarCreateWizardDlg()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void kdarCreateWizardDlg::languageChange()
{
    setCaption( tr2i18n( "Create Archive Wizard" ) );
    textLabel1_3->setText( tr2i18n( "If you have previously saved a creation \"profile\", you can restore it now by clicking the \"Restore profile\" button. A profile contains all of the creation settings from a previous backup, and you can use it to make new backups quickly and easily." ) );
    restoreProfilePushButton->setText( tr2i18n( "&Restore profile", "Button text for restoring a creation profile" ) );
    restoreProfilePushButton->setAccel( QKeySequence( tr2i18n( "Alt+R" ) ) );
    textLabel2_3->setText( tr2i18n( "If you restored a profile, the rest of this wizard's settings will already be filled in. Otherwise you will have to fill them in as you go. In either case, you can click \"Back\" and \"Next\" to change settings as necessary.\n"
"\n"
"Click \"Next\" to continue with the creation process." ) );
    setTitle( restoreProfilePage, tr2i18n( "Restore profile?" ) );
    textLabel2->setText( tr2i18n( "Choose a name for this archive. It is a good idea to make it descriptive. For example, you might try  \"icecube_full_040313\", which has the computer's name, the type of backup, and the date.\n"
"\n"
"Don't include the \".1.dar\" at the end. KDar will automatically add this for each archive slice.\n"
"\n"
"To override the default archive storage directory, include a full path in the archive name." ) );
    archiveNameLabel->setText( tr2i18n( "Archive name" ) );
    setTitle( ArchiveName, tr2i18n( "Archive name" ) );
    textLabel1->setText( tr2i18n( "Specify the top-level directory which you want to backup. This directory is known as the \"root\" directory. KDar will consider all of the files below this directory for backup. For example, set the root directory to \"/\" to make KDar do a full backup.\n"
"\n"
"Click on the folder icon to bring up a directory selection dialog." ) );
    rootDirectoryLabel->setText( tr2i18n( "Root directory" ) );
    setTitle( ArchiveRoot, tr2i18n( "Archive root directory" ) );
    textLabel3->setText( tr2i18n( "If you want to do a differential backup, click on the checkbox below, and choose the reference archive name. When KDar does a differential backup, it only saves new files and files which have changed since the reference archive was made." ) );
    diffBackupCheckBox->setText( tr2i18n( "&differential backup" ) );
    diffBackupCheckBox->setAccel( QKeySequence( tr2i18n( "Alt+D" ) ) );
    referenceArchiveLabel->setText( tr2i18n( "Reference archive" ) );
    setTitle( ReferenceArchive, tr2i18n( "Reference archive" ) );
    textLabel1_2->setText( tr2i18n( "You can customize the creation process to suit your needs. For example, KDar has powerful directory and file filtering mechanisms which allow you to fine-tune which directories and files to include in the archive. You can also specify which types of file to exclude from the compression process.\n"
"\n"
"To configure these settings, click \"Configure creation options\"." ) );
    configureCreationSettingsPushButton->setText( tr2i18n( "Configure creation &options" ) );
    configureCreationSettingsPushButton->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
    textLabel2_4->setText( tr2i18n( "Otherwise, the default settings will be used." ) );
    setTitle( configureSettingsPage, tr2i18n( "Configure settings" ) );
    textLabel1_3_2->setText( tr2i18n( "If you would like to save the current settings in a \"creation profile\", you can do it now by clicking the \"Save profile\" button. Later on you can use this profile to make new backups quickly and easily." ) );
    saveProfilePushButton->setText( tr2i18n( "&Save profile" ) );
    saveProfilePushButton->setAccel( QKeySequence( tr2i18n( "Alt+S" ) ) );
    textLabel1_5->setText( tr2i18n( "If you want to export an equivalent dar command for creating this archive, click the \"Export\" button." ) );
    exportDarCommandButton->setText( tr2i18n( "&Export dar command" ) );
    exportDarCommandButton->setAccel( QKeySequence( tr2i18n( "Alt+E" ) ) );
    textLabel3_2->setText( tr2i18n( "Check \"Dry run\"  if you want do a practice run:" ) );
    dryRunCheckBox->setText( tr2i18n( "&Dry run", "An option for trying the archive operation without writing anything to disk" ) );
    dryRunCheckBox->setAccel( QKeySequence( tr2i18n( "Alt+D" ) ) );
    textLabel1_4->setText( tr2i18n( "To begin creating the archive, click on \"Finish\" below." ) );
    setTitle( WizardPage, tr2i18n( "Save profile?" ) );
}

void kdarCreateWizardDlg::changeNextButtonState(const QString&)
{
    qWarning( "kdarCreateWizardDlg::changeNextButtonState(const QString&): Not implemented yet" );
}

void kdarCreateWizardDlg::slotChooseArchiveName(const QString&)
{
    qWarning( "kdarCreateWizardDlg::slotChooseArchiveName(const QString&): Not implemented yet" );
}

void kdarCreateWizardDlg::slotChooseRootDirectory(const QString&)
{
    qWarning( "kdarCreateWizardDlg::slotChooseRootDirectory(const QString&): Not implemented yet" );
}

#include "kdarcreatewizarddlg.moc"
