[SCM] Kaboom - Debian KDE 3->4 migration tool branch, master, updated. master/0.9.1-47-g7d24464

Modestas Vainius modax-guest at alioth.debian.org
Sun Apr 5 14:16:36 UTC 2009


The following commit has been merged in the master branch:
commit 48efacf0cc5a8170d06dfe1e11ee3ef41b7d7f94
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Sun Apr 5 17:11:33 2009 +0300

    Fix a few issues with migrationpage.
    
    * Trigger resize of the wizard as soon as there are error messages.
    * Fix a few issue with Back.
    * Fix bogus text where wizard completes with errors.
    
    Signed-off-by: Modestas Vainius <modestas at vainius.eu>

diff --git a/diroperations/progresswidget.cpp b/diroperations/progresswidget.cpp
index 22741e6..9906e42 100644
--- a/diroperations/progresswidget.cpp
+++ b/diroperations/progresswidget.cpp
@@ -52,3 +52,9 @@ void ProgressWidget::setValue(quint64 value)
     m_progressBar->setValue(static_cast<int>(value));
 }
 
+void ProgressWidget::reset()
+{
+    m_label->setText(QString::null);
+    m_progressBar->reset();
+}
+
diff --git a/diroperations/progresswidget.h b/diroperations/progresswidget.h
index 2de13c7..ede3de0 100644
--- a/diroperations/progresswidget.h
+++ b/diroperations/progresswidget.h
@@ -31,6 +31,9 @@ public:
     virtual void setMaximum(quint64 max);
     virtual void setValue(quint64 value);
 
+public slots:
+    virtual void reset();
+
 private:
     QLabel *m_label;
     QProgressBar *m_progressBar;
diff --git a/migrationpage.cpp b/migrationpage.cpp
index 76dbeee..f47b596 100644
--- a/migrationpage.cpp
+++ b/migrationpage.cpp
@@ -47,8 +47,7 @@ MigrationPagePrivate::MigrationPagePrivate(MigrationPage* parent)
   error->setPalette(pal);
 
   QLabel *warning = new QLabel;
-  warning->setText(tr("WARNING: depending on the severity of the errors above, it might not be safe "
-                      "to go back and you may need to resolve problems manually!"));
+  warning->setText(tr("WARNING: if you go back, migration process will restarted over current state."));
   warning->setWordWrap(true);
   warning->setAlignment(Qt::AlignJustify);
 
@@ -128,23 +127,23 @@ void MigrationPagePrivate::doMagic()
       case MigrationTool::Migrate:
         progress->setMaximum(1); //fake the progress bar progress.
         progress->setValue(1);
-        qDebug() << "do nothing, let kconf_update do magic";
+        qDebug() << "operation: do nothing, let kconf_update do magic";
         break;
       case MigrationTool::Merge:
         job = RecursiveDirJob::recursiveCpDir(KaboomSettings::instance().kde4homeDir().canonicalPath(),
                                               KaboomSettings::instance().kdehomeDir().canonicalPath(),
                                               RecursiveDirJob::OverWrite);
-        qDebug() << "do magic experimental merge";
+        qDebug() << "operation: do magic experimental merge";
         break;
       case MigrationTool::Clean:
-        qDebug() << "do recursive rm of .kde dir if exists";
+        qDebug() << "operation: do recursive rm of .kde dir if exists";
         job = RecursiveDirJob::recursiveRmDir(KaboomSettings::instance().kdehomeDir().path());
         break;
       case MigrationTool::Move:
         job = RecursiveDirJob::recursiveCpDir(KaboomSettings::instance().kde4homeDir().canonicalPath(),
                                               KaboomSettings::instance().kdehomeDir().path(),
                                               RecursiveDirJob::RemoveDestination);
-        qDebug() << "move .kde4 over .kde";
+        qDebug() << "operation: copymove .kde4 over .kde";
         break;
   }
 
@@ -154,11 +153,12 @@ void MigrationPagePrivate::doMagic()
     delete job;
   }
 
-  if (!error->toPlainText().isEmpty()) // if errors, ...
+  if (errorbox->isVisible()) // if errors, ...
   {
     q->wizard()->setOptions(q->wizard()->options() & ~QWizard::DisabledBackButtonOnLastPage); //allow people going back now.>
+    text->setText(tr("Completed with errors."));
   } else {
-      text->setText(tr("Completed successfully."));
+    text->setText(tr("Completed successfully."));
   }
   complete=true;
   emit q->completeChanged();
@@ -173,7 +173,12 @@ void MigrationPagePrivate::errorhandling(const QString& err)
   } else {
       error->append(err);
   }
-  errorbox->setVisible(!err.isEmpty());
+  bool isHidden = errorbox->isHidden();
+  if (isHidden != err.isEmpty()) {
+    errorbox->setVisible(!err.isEmpty());
+    // trigger updateLayout
+    q->wizard()->setTitleFormat(q->wizard()->titleFormat());
+  }
 }
 
 MigrationPage::MigrationPage(QWidget *parent) : QWizardPage(parent)
@@ -213,6 +218,7 @@ void MigrationPage::initializePage()
   d->complete=false;
   emit completeChanged();
   d->start->setEnabled(true);
+  d->progress->reset();
 
   // Initialize error handling and reenable Cancel button
   d->errorhandling();

-- 
Kaboom - Debian KDE 3->4 migration tool



More information about the pkg-kde-commits mailing list