digiKam
dbmigrationdlg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-11-14
7  * Description : database migration dialog
8  *
9  * Copyright (C) 2009-2010 by Holger Foerster <Hamsi2k at freenet dot de>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_DB_MIGRATION_DLG_H
26 #define DIGIKAM_DB_MIGRATION_DLG_H
27 
28 // QT includes
29 
30 #include <QThread>
31 #include <QProgressBar>
32 #include <QDialog>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "dbsettingswidget.h"
38 #include "coredbbackend.h"
39 #include "coredbcopymanager.h"
40 
41 namespace Digikam
42 {
43 
44 class DatabaseCopyThread : public QThread
45 {
46  Q_OBJECT
47 
48 public:
49 
50  explicit DatabaseCopyThread(QWidget* const parent);
51  ~DatabaseCopyThread() override;
52 
53  void init(const DbEngineParameters& fromDatabaseSettingsWidget,
54  const DbEngineParameters& toDatabaseSettingsWidget);
55  void run() override;
56 
57 public:
58 
60 
61 private:
62 
63  class Private;
64  Private* const d;
65 };
66 
67 // --------------------------------------------------------------------
68 
69 class DIGIKAM_GUI_EXPORT DatabaseMigrationDialog : public QDialog
70 {
71  Q_OBJECT
72 
73 public:
74 
75  explicit DatabaseMigrationDialog(QWidget* const parent);
76  ~DatabaseMigrationDialog() override;
77 
78 private Q_SLOTS:
79 
80  void slotPerformCopy();
81  void slotUnlockInputFields();
82  void slotLockInputFields();
83 
84  void slotHandleFinish(int finishState, const QString& errorMsg);
85  void slotHandleStepStarted(const QString& stepName);
86  void slotHandleSmallStepStarted(int currValue, int maxValue);
87 
88 private:
89 
90  void setupMainArea();
91  void dataInit();
92 
93 private:
94 
95  class Private;
96  Private* const d;
97 };
98 
99 } // namespace Digikam
100 
101 #endif // DIGIKAM_DB_MIGRATION_DLG_H
Definition: coredbcopymanager.h:41
Definition: dbmigrationdlg.h:45
void init(const DbEngineParameters &fromDatabaseSettingsWidget, const DbEngineParameters &toDatabaseSettingsWidget)
Definition: dbmigrationdlg.cpp:90
void run() override
Definition: dbmigrationdlg.cpp:85
~DatabaseCopyThread() override
Definition: dbmigrationdlg.cpp:80
DatabaseCopyThread(QWidget *const parent)
Definition: dbmigrationdlg.cpp:74
CoreDbCopyManager m_copyManager
Definition: dbmigrationdlg.h:59
Definition: dbmigrationdlg.h:70
Definition: dbengineparameters.h:49
Definition: datefolderview.cpp:43