Skip to content

Commit d776793

Browse files
committed
Ware migration workflow in DevStudio
* added dedicated progress dialog for ware migration with corresponding listener * added setup dialog to confirm ware migration and options
1 parent 919e3b6 commit d776793

10 files changed

+748
-39
lines changed

CMake.in.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SET(OFBUILD_CUSTOM_CMAKE_VERSION "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.
2323
SET(OPENFLUID_VERSION_MAJOR 2)
2424
SET(OPENFLUID_VERSION_MINOR 2)
2525
SET(OPENFLUID_VERSION_PATCH 0)
26-
SET(OPENFLUID_VERSION_STATUS "alpha87") # example: SET(OPENFLUID_VERSION_STATUS "rc1")
26+
SET(OPENFLUID_VERSION_STATUS "alpha88") # example: SET(OPENFLUID_VERSION_STATUS "rc1")
2727

2828
SET(OPENFLUID_VERSION_FULL "${OPENFLUID_VERSION_MAJOR}.${OPENFLUID_VERSION_MINOR}.${OPENFLUID_VERSION_PATCH}")
2929

src/openfluid/ui/waresdev/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ SET(OPENFLUID_UI_WARESDEV_CPP WareSrcUIContainer.cpp
2020
WorkspaceDevBuildWorker.cpp WorkspaceDevCheckWorker.cpp WorkspaceDevPurgeWorker.cpp
2121
WorkspaceDevDashboardDialog.cpp WorkspaceDevWaresWidget.cpp WorkspaceDevGitWidget.cpp WorkspaceDevActionsWidget.cpp
2222
WorkspaceDevProcessDialog.cpp
23-
CompletionProvider.cpp)
23+
CompletionProvider.cpp
24+
MigrationSetupDialog.cpp)
2425

2526
SET(OPENFLUID_UI_WARESDEV_HPP WareSrcUIContainer.hpp
2627
WareSrcMsgStream.hpp
@@ -44,15 +45,18 @@ SET(OPENFLUID_UI_WARESDEV_HPP WareSrcUIContainer.hpp
4445
WorkspaceDevBuildWorker.hpp WorkspaceDevCheckWorker.hpp WorkspaceDevPurgeWorker.hpp
4546
WorkspaceDevDashboardDialog.hpp WorkspaceDevWaresWidget.hpp WorkspaceDevGitWidget.hpp WorkspaceDevActionsWidget.hpp
4647
WorkspaceDevProcessDialog.hpp
47-
CompletionProvider.hpp)
48+
CompletionProvider.hpp
49+
SignalMigrationListener.hpp
50+
MigrationSetupDialog.hpp)
4851

4952
QT5_WRAP_UI(OPENFLUID_UI_WARESDEV_UI WareSrcWidget.ui WareExplorerDialog.ui WareBuildOptionsWidget.ui WareBuildOptionsDialog.ui
5053
EmptyPage.ui CppPage.ui CMakeConfigPage.ui
5154
NewWareDialog.ui FindReplaceDialog.ui
5255
WaresSrcExportDialog.ui WaresSrcImportDialog.ui FragmentsSrcImportDialog.ui FragmentCreationDialog.ui WaresSrcIOProgressDialog.ui
5356
WaresImportFilterWidget.ui WareGitDialog.ui WareshubJsonEditor.ui WareshubIssueDialog.ui
5457
WorkspaceDevProcessDialog.ui
55-
WorkspaceDevDashboardDialog.ui WorkspaceDevWaresWidget.ui WorkspaceDevGitWidget.ui)
58+
WorkspaceDevDashboardDialog.ui WorkspaceDevWaresWidget.ui WorkspaceDevGitWidget.ui
59+
MigrationSetupDialog.ui)
5660

5761

5862
#QT5_ADD_RESOURCES(OPENFLUID_UI_WARESDEV_RC resources/openfluiduiwaresdev.qrc)

src/openfluid/ui/waresdev/GitUIProxy.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,20 @@ bool GitUIProxy::clone(const QString& FromUrl, const QString& ToPath,
346346
// =====================================================================
347347

348348

349-
bool GitUIProxy::checkout(const QString& Path, const QString& BranchName)
349+
bool GitUIProxy::checkout(const QString& Path, const QString& BranchName, bool New)
350350
{
351351
//TOIMPL test this function?
352-
QStringList Args = {"checkout", BranchName, "--progress"};
353-
launchLocalCommand(Path, Args);
352+
353+
if (New)
354+
{
355+
QStringList Args = {"checkout", "-b", BranchName, "--progress"};
356+
launchLocalCommand(Path, Args);
357+
}
358+
else
359+
{
360+
QStringList Args = {"checkout", BranchName, "--progress"};
361+
launchLocalCommand(Path, Args);
362+
}
354363
QString Out = launchLocalCommand(Path, {"branch", "--show-current"}).second;
355364
QString CurrentBranch = Out.section("\n", 0, 0).section(" ", -1);
356365
return (CurrentBranch == BranchName);

src/openfluid/ui/waresdev/GitUIProxy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class OPENFLUID_API GitUIProxy : public QObject, public openfluid::utils::GitPro
134134
const QString& Username = "", const QString& Password = "",
135135
bool SslNoVerify = false, const QString& LocalGitRepoPath = "", bool WithoutVersioning = false);
136136

137-
bool checkout(const QString& Path, const QString& BranchName);
137+
bool checkout(const QString& Path, const QString& BranchName, bool New=false);
138138

139139
TreeStatusInfo status(const QString& Path);
140140

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
3+
This file is part of OpenFLUID software
4+
Copyright(c) 2007, INRA - Montpellier SupAgro
5+
6+
7+
== GNU General Public License Usage ==
8+
9+
OpenFLUID is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
OpenFLUID is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21+
22+
23+
== Other Usage ==
24+
25+
Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26+
license, and requires a written agreement between You and INRA.
27+
Licensees for Other Usage of OpenFLUID may use this file in accordance
28+
with the terms contained in the written agreement between You and INRA.
29+
30+
*/
31+
32+
33+
/**
34+
@file MigrationSetupDialog.cpp
35+
36+
@author Armel THÖNI <armel.thoni@inrae.fr>
37+
*/
38+
39+
40+
#include <openfluid/ui/waresdev/MigrationSetupDialog.hpp>
41+
#include <openfluid/ui/waresdev/StatusButtonMessageWidget.hpp>
42+
43+
#include "ui_MigrationSetupDialog.h"
44+
45+
46+
namespace openfluid { namespace ui { namespace waresdev {
47+
48+
49+
MigrationSetupDialog::MigrationSetupDialog(QWidget* Parent):
50+
QDialog(Parent), ui(new Ui::MigrationSetupDialog)
51+
{
52+
ui->setupUi(this);
53+
}
54+
55+
56+
// =====================================================================
57+
// =====================================================================
58+
59+
60+
MigrationSetupDialog::~MigrationSetupDialog()
61+
{
62+
delete ui;
63+
}
64+
65+
66+
// =====================================================================
67+
// =====================================================================
68+
69+
70+
bool MigrationSetupDialog::isNewBranchChecked() // TOIMPL use this data for checkout
71+
{
72+
return ui->checkoutCheckbox->isChecked();
73+
}
74+
75+
76+
// =====================================================================
77+
// =====================================================================
78+
79+
80+
bool MigrationSetupDialog::isVerbose()
81+
{
82+
return ui->verbosityCheckbox->isChecked();
83+
}
84+
85+
86+
} } } // namespaces
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
3+
This file is part of OpenFLUID software
4+
Copyright(c) 2007, INRA - Montpellier SupAgro
5+
6+
7+
== GNU General Public License Usage ==
8+
9+
OpenFLUID is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU General Public License as published by
11+
the Free Software Foundation, either version 3 of the License, or
12+
(at your option) any later version.
13+
14+
OpenFLUID is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Public License for more details.
18+
19+
You should have received a copy of the GNU General Public License
20+
along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21+
22+
23+
== Other Usage ==
24+
25+
Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26+
license, and requires a written agreement between You and INRA.
27+
Licensees for Other Usage of OpenFLUID may use this file in accordance
28+
with the terms contained in the written agreement between You and INRA.
29+
30+
*/
31+
32+
33+
/**
34+
@file MigrationSetupDialog.hpp
35+
36+
@author Armel THÖNI <armel.thoni@inrae.fr>
37+
*/
38+
39+
40+
#ifndef __OPENFLUID_UIWARESDEV_MIGRATIONSETUPDIALOG_HPP__
41+
#define __OPENFLUID_UIWARESDEV_MIGRATIONSETUPDIALOG_HPP__
42+
43+
44+
#include <QDialog>
45+
46+
47+
namespace Ui
48+
{
49+
class MigrationSetupDialog;
50+
}
51+
52+
53+
namespace openfluid { namespace ui { namespace waresdev {
54+
55+
class MigrationSetupDialog : public QDialog
56+
{
57+
Q_OBJECT;
58+
59+
private:
60+
61+
Ui::MigrationSetupDialog* ui;
62+
63+
64+
public:
65+
66+
MigrationSetupDialog(QWidget* Parent = nullptr);
67+
68+
~MigrationSetupDialog();
69+
70+
bool isNewBranchChecked();
71+
72+
bool isVerbose();
73+
74+
};
75+
76+
77+
} } } // namespaces
78+
79+
80+
#endif /* __OPENFLUID_UIWARESDEV_MIGRATIONSETUPDIALOG_HPP__ */
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>MigrationSetupDialog</class>
4+
<widget class="QDialog" name="MigrationSetupDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>363</width>
10+
<height>141</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Ware migration</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout_2">
17+
<item>
18+
<widget class="QLabel" name="MigrationLabel">
19+
<property name="text">
20+
<string>Do you want to migrate this ware to be compatible with OpenFLUID 2.2?</string>
21+
</property>
22+
<property name="wordWrap">
23+
<bool>true</bool>
24+
</property>
25+
</widget>
26+
</item>
27+
<item>
28+
<widget class="QCheckBox" name="checkoutCheckbox">
29+
<property name="text">
30+
<string>Try to checkout a new git branch 'openfluid-2.2'</string>
31+
</property>
32+
<property name="checked">
33+
<bool>true</bool>
34+
</property>
35+
</widget>
36+
</item>
37+
<item>
38+
<widget class="QCheckBox" name="verbosityCheckbox">
39+
<property name="text">
40+
<string>Verbose output</string>
41+
</property>
42+
</widget>
43+
</item>
44+
<item>
45+
<widget class="QDialogButtonBox" name="buttonBox">
46+
<property name="orientation">
47+
<enum>Qt::Horizontal</enum>
48+
</property>
49+
<property name="standardButtons">
50+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
51+
</property>
52+
</widget>
53+
</item>
54+
</layout>
55+
</widget>
56+
<resources/>
57+
<connections>
58+
<connection>
59+
<sender>buttonBox</sender>
60+
<signal>accepted()</signal>
61+
<receiver>MigrationSetupDialog</receiver>
62+
<slot>accept()</slot>
63+
<hints>
64+
<hint type="sourcelabel">
65+
<x>248</x>
66+
<y>254</y>
67+
</hint>
68+
<hint type="destinationlabel">
69+
<x>157</x>
70+
<y>274</y>
71+
</hint>
72+
</hints>
73+
</connection>
74+
<connection>
75+
<sender>buttonBox</sender>
76+
<signal>rejected()</signal>
77+
<receiver>MigrationSetupDialog</receiver>
78+
<slot>reject()</slot>
79+
<hints>
80+
<hint type="sourcelabel">
81+
<x>316</x>
82+
<y>260</y>
83+
</hint>
84+
<hint type="destinationlabel">
85+
<x>286</x>
86+
<y>274</y>
87+
</hint>
88+
</hints>
89+
</connection>
90+
</connections>
91+
</ui>

0 commit comments

Comments
 (0)