diff --git a/cmake/sciqlop_tests.cmake b/cmake/sciqlop_tests.cmake index 2b09088..1210c7b 100644 --- a/cmake/sciqlop_tests.cmake +++ b/cmake/sciqlop_tests.cmake @@ -3,3 +3,9 @@ macro(declare_test testname testexe sources libraries) target_link_libraries(${testexe} ${libraries}) add_test(NAME ${testname} COMMAND ${testexe}) endmacro(declare_test) + + +macro(declare_manual_test testname testexe sources libraries) + add_executable(${testexe} ${sources}) + target_link_libraries(${testexe} ${libraries}) +endmacro(declare_manual_test) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 23f40ef..1c3bef7 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -10,6 +10,7 @@ include/SidePane/SqpSidePane.h include/Catalogue2/eventsmodel.h include/Catalogue2/eventstreeview.h + include/Catalogue2/repositoriestreeview.h include/Catalogue2/repositoriesmodel.h # include/Catalogue/CatalogueActionManager.h # include/Catalogue/CatalogueTreeModel.h @@ -79,6 +80,7 @@ src/SidePane/SqpSidePane.cpp src/Catalogue2/eventsmodel.cpp src/Catalogue2/eventstreeview.cpp + src/Catalogue2/repositoriestreeview.cpp src/Catalogue2/repositoriesmodel.cpp #src/Catalogue/CatalogueEventsWidget.cpp #src/Catalogue/CatalogueSideBarWidget.cpp diff --git a/gui/include/Catalogue2/eventsmodel.h b/gui/include/Catalogue2/eventsmodel.h index 88bbc73..c94cd35 100644 --- a/gui/include/Catalogue2/eventsmodel.h +++ b/gui/include/Catalogue2/eventsmodel.h @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #ifndef EVENTSMODEL_H #define EVENTSMODEL_H #include diff --git a/gui/include/Catalogue2/eventstreeview.h b/gui/include/Catalogue2/eventstreeview.h index e5e7581..a8bf1f1 100644 --- a/gui/include/Catalogue2/eventstreeview.h +++ b/gui/include/Catalogue2/eventstreeview.h @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #ifndef EVENTSTREEVIEW_H #define EVENTSTREEVIEW_H diff --git a/gui/include/Catalogue2/repositoriesmodel.h b/gui/include/Catalogue2/repositoriesmodel.h index f6b4069..73744fe 100644 --- a/gui/include/Catalogue2/repositoriesmodel.h +++ b/gui/include/Catalogue2/repositoriesmodel.h @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #ifndef REPOSITORIESMODEL_H #define REPOSITORIESMODEL_H #include diff --git a/gui/include/Catalogue2/repositoriestreeview.h b/gui/include/Catalogue2/repositoriestreeview.h new file mode 100644 index 0000000..b71a4b1 --- /dev/null +++ b/gui/include/Catalogue2/repositoriestreeview.h @@ -0,0 +1,41 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ +#ifndef REPOSITORIESTREEVIEW_H +#define REPOSITORIESTREEVIEW_H + +#include +#include +#include + +class RepositoriesTreeView : public QTreeView +{ + Q_OBJECT +public: + RepositoriesTreeView(QWidget* parent = nullptr); + +public slots: + void refresh() + { + static_cast(model())->refresh(); + } + +signals: + void repositorySelected(const QString& repository); + +}; + +#endif // REPOSITORIESTREEVIEW_H diff --git a/gui/src/Catalogue2/eventsmodel.cpp b/gui/src/Catalogue2/eventsmodel.cpp index 98d7ea6..12a5c86 100644 --- a/gui/src/Catalogue2/eventsmodel.cpp +++ b/gui/src/Catalogue2/eventsmodel.cpp @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #include "Catalogue2/eventsmodel.h" #include diff --git a/gui/src/Catalogue2/eventstreeview.cpp b/gui/src/Catalogue2/eventstreeview.cpp index 1fa2a42..32e22ad 100644 --- a/gui/src/Catalogue2/eventstreeview.cpp +++ b/gui/src/Catalogue2/eventstreeview.cpp @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #include #include diff --git a/gui/src/Catalogue2/repositoriesmodel.cpp b/gui/src/Catalogue2/repositoriesmodel.cpp index 4f30e2d..52a1ab3 100644 --- a/gui/src/Catalogue2/repositoriesmodel.cpp +++ b/gui/src/Catalogue2/repositoriesmodel.cpp @@ -1,3 +1,19 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ #include #include #include diff --git a/gui/src/Catalogue2/repositoriestreeview.cpp b/gui/src/Catalogue2/repositoriestreeview.cpp new file mode 100644 index 0000000..2df079e --- /dev/null +++ b/gui/src/Catalogue2/repositoriestreeview.cpp @@ -0,0 +1,27 @@ +/* + This file is part of SciQLop. + + SciQLop 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 3 of the License, or + (at your option) any later version. + + SciQLop 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 SciQLop. If not, see . +*/ +#include +#include + +RepositoriesTreeView::RepositoriesTreeView(QWidget* parent) : QTreeView(parent) +{ + auto m = model(); + this->setModel(new RepositoriesModel(this)); + delete m; +} + + diff --git a/gui/tests/CMakeLists.txt b/gui/tests/CMakeLists.txt index 27b6dc0..2a159a4 100644 --- a/gui/tests/CMakeLists.txt +++ b/gui/tests/CMakeLists.txt @@ -1,6 +1,7 @@ +include(sciqlop_tests) subdirs(GUITestUtils) declare_test(simple_graph simple_graph simple_graph/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") declare_test(multiple_sync_graph multiple_sync_graph multiple_sync_graph/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") -declare_test(event_list event_list catalogue/event_list/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") -declare_test(repository_list repository_list catalogue/repository_list/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") +declare_manual_test(event_list event_list catalogue/event_list/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") +declare_manual_test(repository_list repository_list catalogue/repository_list/main.cpp "sciqlopgui;TestUtils;GUITestUtils;Qt5::Test") diff --git a/gui/tests/catalogue/repository_list/main.cpp b/gui/tests/catalogue/repository_list/main.cpp index b2b20aa..5f5f983 100644 --- a/gui/tests/catalogue/repository_list/main.cpp +++ b/gui/tests/catalogue/repository_list/main.cpp @@ -14,10 +14,7 @@ #include #include -//#include - -#include -#include +#include class An_EventList : public QObject @@ -52,14 +49,13 @@ int main(int argc, char* argv[]) QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); SqpApplication a { argc, argv }; - QTreeView w; + RepositoriesTreeView w; sqpApp->catalogueController().add("test"); sqpApp->catalogueController().add("stuff"); sqpApp->catalogueController().add("default"); sqpApp->catalogueController().add("new catalogue", "default"); sqpApp->catalogueController().add("new catalogue2", "default"); - RepositoriesModel* model = new RepositoriesModel(); - w.setModel(model); w.show(); + w.refresh(); return a.exec(); }