27 #include <KLocalizedString>
28 #include <KComponentData>
30 #include <KTemporaryFile>
34 #include <QRadioButton>
37 using namespace Nepomuk2;
42 setPixmap(LogoPixmap, KIcon(QLatin1String(
"nepomuk")).pixmap(32, 32));
43 setWindowIcon( KIcon(QLatin1String(
"nepomuk")) );
44 setWindowTitle( KGlobal::activeComponent().aboutData()->shortDescription() );
46 setOption( HaveFinishButtonOnEarlyPages,
false );
47 setOption( HaveNextButtonOnLastPage,
false );
50 QList<QWizard::WizardButton> layout;
51 layout << QWizard::Stretch << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton;
52 setButtonLayout( layout );
65 setField(QLatin1String(
"errorMessage"), error);
75 setTitle( i18n(
"Nepomuk Data Migration") );
77 QLabel* label =
new QLabel(
this );
78 label->setTextFormat( Qt::RichText );
79 label->setWordWrap(
true );
80 label->setText( i18n(
"With this new release Nepomuk has migrated its internal data format. "
81 "You have launched this wizard because you wish to migrate your data and "
82 "not go with the recommended method of backup and restore. "
83 "This migration can take several hours") );
85 QVBoxLayout* layout =
new QVBoxLayout(
this );
86 layout->addWidget( label );
107 setTitle( i18n(
"The internal data is being migrated") );
108 setSubTitle( i18n(
"This process could take a while") );
110 QVBoxLayout* layout =
new QVBoxLayout(
this );
111 m_progressBar =
new QProgressBar(
this );
112 m_progressBar->setMaximum( 100 );
114 layout->addWidget( m_progressBar );
116 m_storageService =
new StorageService( QLatin1String(
"org.kde.NepomukStorage"),
117 QLatin1String(
"/nepomukstorage"),
118 QDBusConnection::sessionBus(),
this);
119 connect( m_storageService, SIGNAL(migrateGraphsDone()),
this, SLOT(slotMigrationDone()) );
120 connect( m_storageService, SIGNAL(migrateGraphsPercent(
int)),
this, SLOT(slotMigrationPercent(
int)) );
122 m_storageService->migrateGraphs();
126 void MigrationPage::slotMigrationDone()
129 emit completeChanged();
134 void MigrationPage::slotMigrationPercent(
int percent)
137 m_progressBar->setValue( percent );
158 setTitle( i18n(
"Data has been successfully migrated") );
174 m_labelPixmap->setPixmap(KIcon(QLatin1String(
"dialog-error")).pixmap(48,48));
175 registerField( QLatin1String(
"errorMessage"),
this,
"errorMessage" );
180 return m_labelMessage->text();
185 m_labelMessage->setText(s);
189 #include "wizard.moc"
ErrorPage(QWidget *parent=0)
FinishPage(QWidget *parent=0)
virtual bool isComplete() const
virtual int nextId() const
virtual void initializePage()
void setMessage(const QString &s)
MainPage(QWidget *parent=0)
virtual int nextId() const
virtual int nextId() const
org::kde::nepomuk::Storage StorageService
void showError(const QString &error)
MigrationPage(QWidget *parent=0)
MigrationWizard(QWidget *parent=0, Qt::WindowFlags flags=0)