<commit_before>/* This file is part of the KDE project
   Copyright (C) 2008 <NAME>. <<EMAIL>>

   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.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include "restoreassistant.h"
#include "restore.h"

#include <QLabel>
#include <QPushButton>

#include <KAssistantDialog>
#include <KDebug>
#include <KFileDialog>
#include <KLocale>
#include <KVBox>

RestoreAssistant::RestoreAssistant( QWidget *parent ) : KAssistantDialog( parent )
{
    m_restore = new Restore( this );
    connect( m_restore, SIGNAL( completed( bool ) ), SLOT( slotRestoreComplete( bool ) ) );
    bool possible = m_restore->possible();

    KVBox *box1 = new KVBox( this );
    QLabel *label1 = new QLabel( box1 );
    label1->setWordWrap( true );
    if ( !possible ) {
        label1->setText( '\n' + i18n( "The backup can not be restored. Either the mysql application "
                                      "is not installed, or the bzip2 application is not found. "
                                      "Please install those and make sure they can be found in "
                                      "the current path. Restart this Assistant when this is fixed." ) );
    } else {
        label1->setText( '\n' + i18n( "Please select the file to restore. Note that restoring a "
                                      "backup will overwrite all existing data. You might want to "
                                      "make a backup first and please consider closing all Akonadi "
                                      "applications (but do not stop the akonadi server." ) + "\n\n" );

        m_selectFileButton = new QPushButton( i18n( "&Click here to select the file to restore..." ), box1 );
        connect( m_selectFileButton, SIGNAL( clicked( bool ) ), SLOT( slotSelectFile() ) );

        QLabel *label2 = new QLabel( "\n\n" + i18n( "Press 'Next' to start the Restore" ), box1 );
        label2->setWordWrap( true );
        label2->setAlignment( Qt::AlignRight );
    }
    m_page1 = new KPageWidgetItem( box1, i18n( "Welcome to the Restore Assistant" ) );
    setValid( m_page1, false );

    m_restoreProgressLabel = new QLabel( this );
    m_restoreProgressLabel->setWordWrap( true );
    m_page2 = new KPageWidgetItem( m_restoreProgressLabel, i18n( "Restoring" ) );
    setValid( m_page2, false );
<commit_msg>Missing ), spotted by mvillarino<commit_after>/* This file is part of the KDE project
   Copyright (C) 2008 <NAME>. <<EMAIL>>

   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.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include "restoreassistant.h"
#include "restore.h"

#include <QLabel>
#include <QPushButton>

#include <KAssistantDialog>
#include <KDebug>
#include <KFileDialog>
#include <KLocale>
#include <KVBox>

RestoreAssistant::RestoreAssistant( QWidget *parent ) : KAssistantDialog( parent )
{
    m_restore = new Restore( this );
    connect( m_restore, SIGNAL( completed( bool ) ), SLOT( slotRestoreComplete( bool ) ) );
    bool possible = m_restore->possible();

    KVBox *box1 = new KVBox( this );
    QLabel *label1 = new QLabel( box1 );
    label1->setWordWrap( true );
    if ( !possible ) {
        label1->setText( '\n' + i18n( "The backup can not be restored. Either the mysql application "
                                      "is not installed, or the bzip2 application is not found. "
                                      "Please install those and make sure they can be found in "
                                      "the current path. Restart this Assistant when this is fixed." ) );
    } else {
        label1->setText( '\n' + i18n( "Please select the file to restore. Note that restoring a "
                                      "backup will overwrite all existing data. You might want to "
                                      "make a backup first and please consider closing all Akonadi "
                                      "applications (but do not stop the akonadi server)." ) + "\n\n" );

        m_selectFileButton = new QPushButton( i18n( "&Click here to select the file to restore..." ), box1 );
        connect( m_selectFileButton, SIGNAL( clicked( bool ) ), SLOT( slotSelectFile() ) );

        QLabel *label2 = new QLabel( "\n\n" + i18n( "Press 'Next' to start the Restore" ), box1 );
        label2->setWordWrap( true );
        label2->setAlignment( Qt::AlignRight );
    }
    m_page1 = new KPageWidgetItem( box1, i18n( "Welcome to the Restore Assistant" ) );
    setValid( m_page1, false );

    m_restoreProgressLabel = new QLabel( this );
    m_restoreProgressLabel->setWordWrap( true );
    m_page2 = new KPageWidgetItem( m_restoreProgressLabel, i18n( "Restoring" ) );
    setValid( m_page2, false );

{'fraction_non_alphanumeric': 0.08896737302388161, 'fraction_numerical': 0.015136226034308779, 'mean_word_length': 2.6195982958003654, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6591868', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1619, 'n_words': 665}