##// END OF EJS Templates
Small GUI fix, show full names in repository tree view...
jeandet -
r1461:021e7c505ad4
parent child
Show More
@@ -1,101 +1,98
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "MainWindow.h"
22 #include "MainWindow.h"
23 #include <QProcessEnvironment>
23 #include <QProcessEnvironment>
24 #include <QThread>
24 #include <QThread>
25 #include <SqpApplication.h>
25 #include <SqpApplication.h>
26 #include <qglobal.h>
26 #include <qglobal.h>
27
27
28 #include <PluginManager/PluginManager.h>
28 #include <PluginManager/PluginManager.h>
29 #include <QDir>
29 #include <QDir>
30 #include <QtPlugin>
30 #include <QtPlugin>
31
31
32 #include <QLoggingCategory>
32 #include <QLoggingCategory>
33
33
34 Q_LOGGING_CATEGORY(LOG_Main, "Main")
34 Q_LOGGING_CATEGORY(LOG_Main, "Main")
35
35
36 namespace
36 namespace
37 {
37 {
38
38
39 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
39 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
40
40
41
41
42 } // namespace
42 } // namespace
43
43
44 int main(int argc, char* argv[])
44 int main(int argc, char* argv[])
45 {
45 {
46 #ifdef QT_STATICPLUGIN
46 #ifdef QT_STATICPLUGIN
47 #ifndef SQP_NO_PLUGINS
47 #ifndef SQP_NO_PLUGINS
48 //Q_IMPORT_PLUGIN(MockPlugin)
49 Q_IMPORT_PLUGIN(PythonProviders)
48 Q_IMPORT_PLUGIN(PythonProviders)
50 Q_INIT_RESOURCE(python_providers);
49 Q_INIT_RESOURCE(python_providers);
51 // Q_IMPORT_PLUGIN(AmdaPlugin)
52 // Q_INIT_RESOURCE(amdaresources);
53 #endif
50 #endif
54 #endif
51 #endif
55 Q_INIT_RESOURCE(sqpguiresources);
52 Q_INIT_RESOURCE(sqpguiresources);
56
53
57 SqpApplication::setOrganizationName("LPP");
54 SqpApplication::setOrganizationName("LPP");
58 SqpApplication::setOrganizationDomain("lpp.fr");
55 SqpApplication::setOrganizationDomain("lpp.fr");
59 SqpApplication::setApplicationName("SciQLop");
56 SqpApplication::setApplicationName("SciQLop");
60
57
61 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
58 QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
62
59
63 SqpApplication a { argc, argv };
60 SqpApplication a { argc, argv };
64
61
65 MainWindow w;
62 MainWindow w;
66 w.show();
63 w.show();
67
64
68 // Loads plugins
65 // Loads plugins
69 auto pluginDir = QDir { a.applicationDirPath() };
66 auto pluginDir = QDir { a.applicationDirPath() };
70 auto pluginLookupPath = {
67 auto pluginLookupPath = {
71 #if _WIN32 || _WIN64
68 #if _WIN32 || _WIN64
72 a.applicationDirPath() + "/SciQLop"
69 a.applicationDirPath() + "/SciQLop"
73 #else
70 #else
74 a.applicationDirPath() + "/../lib64/SciQLop",
71 a.applicationDirPath() + "/../lib64/SciQLop",
75 a.applicationDirPath() + "/../lib64/sciqlop",
72 a.applicationDirPath() + "/../lib64/sciqlop",
76 a.applicationDirPath() + "/../lib/SciQLop",
73 a.applicationDirPath() + "/../lib/SciQLop",
77 a.applicationDirPath() + "/../lib/sciqlop",
74 a.applicationDirPath() + "/../lib/sciqlop",
78 #endif
75 #endif
79 };
76 };
80
77
81 #if _WIN32 || _WIN64
78 #if _WIN32 || _WIN64
82 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
79 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
83 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
80 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
84 #endif
81 #endif
85
82
86 PluginManager pluginManager {};
83 PluginManager pluginManager {};
87
84
88 for (auto&& path : pluginLookupPath)
85 for (auto&& path : pluginLookupPath)
89 {
86 {
90 QDir directory { path };
87 QDir directory { path };
91 if (directory.exists())
88 if (directory.exists())
92 {
89 {
93 qCDebug(LOG_Main())
90 qCDebug(LOG_Main())
94 << QObject::tr("Plugin directory: %1").arg(directory.absolutePath());
91 << QObject::tr("Plugin directory: %1").arg(directory.absolutePath());
95 pluginManager.loadPlugins(directory);
92 pluginManager.loadPlugins(directory);
96 }
93 }
97 }
94 }
98 pluginManager.loadStaticPlugins();
95 pluginManager.loadStaticPlugins();
99
96
100 return a.exec();
97 return a.exec();
101 }
98 }
@@ -1,218 +1,224
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
2 <ui version="4.0">
3 <class>Browser</class>
3 <class>Browser</class>
4 <widget class="QWidget" name="Browser">
4 <widget class="QWidget" name="Browser">
5 <property name="geometry">
5 <property name="geometry">
6 <rect>
6 <rect>
7 <x>0</x>
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
9 <width>708</width>
9 <width>708</width>
10 <height>461</height>
10 <height>461</height>
11 </rect>
11 </rect>
12 </property>
12 </property>
13 <property name="windowTitle">
13 <property name="windowTitle">
14 <string>Catalogues Browser</string>
14 <string>Catalogues Browser</string>
15 </property>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_4">
16 <layout class="QVBoxLayout" name="verticalLayout_4">
17 <item>
17 <item>
18 <widget class="QSplitter" name="splitter">
18 <widget class="QSplitter" name="splitter">
19 <property name="orientation">
19 <property name="orientation">
20 <enum>Qt::Horizontal</enum>
20 <enum>Qt::Horizontal</enum>
21 </property>
21 </property>
22 <widget class="RepositoriesTreeView" name="repositories">
22 <widget class="RepositoriesTreeView" name="repositories">
23 <property name="sizePolicy">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
24 <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
25 <horstretch>1</horstretch>
25 <horstretch>1</horstretch>
26 <verstretch>0</verstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
27 </sizepolicy>
28 </property>
28 </property>
29 <property name="tabKeyNavigation">
30 <bool>true</bool>
31 </property>
29 <property name="rootIsDecorated">
32 <property name="rootIsDecorated">
30 <bool>true</bool>
33 <bool>true</bool>
31 </property>
34 </property>
32 <property name="animated">
35 <property name="animated">
33 <bool>true</bool>
36 <bool>true</bool>
34 </property>
37 </property>
35 <property name="headerHidden">
38 <property name="headerHidden">
36 <bool>true</bool>
39 <bool>true</bool>
37 </property>
40 </property>
41 <attribute name="headerCascadingSectionResizes">
42 <bool>true</bool>
43 </attribute>
38 <attribute name="headerStretchLastSection">
44 <attribute name="headerStretchLastSection">
39 <bool>false</bool>
45 <bool>true</bool>
40 </attribute>
46 </attribute>
41 </widget>
47 </widget>
42 <widget class="QWidget" name="rightPane" native="true">
48 <widget class="QWidget" name="rightPane" native="true">
43 <property name="sizePolicy">
49 <property name="sizePolicy">
44 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
50 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
45 <horstretch>3</horstretch>
51 <horstretch>3</horstretch>
46 <verstretch>0</verstretch>
52 <verstretch>0</verstretch>
47 </sizepolicy>
53 </sizepolicy>
48 </property>
54 </property>
49 <layout class="QVBoxLayout" name="verticalLayout">
55 <layout class="QVBoxLayout" name="verticalLayout">
50 <item>
56 <item>
51 <widget class="EventsTreeView" name="events">
57 <widget class="EventsTreeView" name="events">
52 <property name="sizePolicy">
58 <property name="sizePolicy">
53 <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
59 <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
54 <horstretch>0</horstretch>
60 <horstretch>0</horstretch>
55 <verstretch>0</verstretch>
61 <verstretch>0</verstretch>
56 </sizepolicy>
62 </sizepolicy>
57 </property>
63 </property>
58 </widget>
64 </widget>
59 </item>
65 </item>
60 <item>
66 <item>
61 <widget class="QStackedWidget" name="Infos">
67 <widget class="QStackedWidget" name="Infos">
62 <property name="sizePolicy">
68 <property name="sizePolicy">
63 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
69 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
64 <horstretch>0</horstretch>
70 <horstretch>0</horstretch>
65 <verstretch>0</verstretch>
71 <verstretch>0</verstretch>
66 </sizepolicy>
72 </sizepolicy>
67 </property>
73 </property>
68 <property name="currentIndex">
74 <property name="currentIndex">
69 <number>2</number>
75 <number>2</number>
70 </property>
76 </property>
71 <widget class="QWidget" name="Repository">
77 <widget class="QWidget" name="Repository">
72 <property name="sizePolicy">
78 <property name="sizePolicy">
73 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
79 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
74 <horstretch>0</horstretch>
80 <horstretch>0</horstretch>
75 <verstretch>0</verstretch>
81 <verstretch>0</verstretch>
76 </sizepolicy>
82 </sizepolicy>
77 </property>
83 </property>
78 <layout class="QVBoxLayout" name="verticalLayout_2">
84 <layout class="QVBoxLayout" name="verticalLayout_2">
79 <item>
85 <item>
80 <widget class="QGroupBox" name="groupBox">
86 <widget class="QGroupBox" name="groupBox">
81 <property name="sizePolicy">
87 <property name="sizePolicy">
82 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
88 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
83 <horstretch>0</horstretch>
89 <horstretch>0</horstretch>
84 <verstretch>0</verstretch>
90 <verstretch>0</verstretch>
85 </sizepolicy>
91 </sizepolicy>
86 </property>
92 </property>
87 <property name="title">
93 <property name="title">
88 <string>Repository information</string>
94 <string>Repository information</string>
89 </property>
95 </property>
90 <layout class="QGridLayout" name="gridLayout">
96 <layout class="QGridLayout" name="gridLayout">
91 <item row="0" column="1">
97 <item row="0" column="1">
92 <layout class="QFormLayout" name="formLayout">
98 <layout class="QFormLayout" name="formLayout">
93 <item row="0" column="0">
99 <item row="0" column="0">
94 <widget class="QLabel" name="label">
100 <widget class="QLabel" name="label">
95 <property name="text">
101 <property name="text">
96 <string>Catalogues</string>
102 <string>Catalogues</string>
97 </property>
103 </property>
98 </widget>
104 </widget>
99 </item>
105 </item>
100 <item row="0" column="1">
106 <item row="0" column="1">
101 <widget class="QLabel" name="catalogues_count">
107 <widget class="QLabel" name="catalogues_count">
102 <property name="text">
108 <property name="text">
103 <string/>
109 <string/>
104 </property>
110 </property>
105 </widget>
111 </widget>
106 </item>
112 </item>
107 <item row="1" column="0">
113 <item row="1" column="0">
108 <widget class="QLabel" name="label_3">
114 <widget class="QLabel" name="label_3">
109 <property name="text">
115 <property name="text">
110 <string>Events</string>
116 <string>Events</string>
111 </property>
117 </property>
112 </widget>
118 </widget>
113 </item>
119 </item>
114 <item row="1" column="1">
120 <item row="1" column="1">
115 <widget class="QLabel" name="rep_events_count">
121 <widget class="QLabel" name="rep_events_count">
116 <property name="text">
122 <property name="text">
117 <string/>
123 <string/>
118 </property>
124 </property>
119 </widget>
125 </widget>
120 </item>
126 </item>
121 </layout>
127 </layout>
122 </item>
128 </item>
123 </layout>
129 </layout>
124 </widget>
130 </widget>
125 </item>
131 </item>
126 </layout>
132 </layout>
127 </widget>
133 </widget>
128 <widget class="QWidget" name="Catalogue">
134 <widget class="QWidget" name="Catalogue">
129 <property name="sizePolicy">
135 <property name="sizePolicy">
130 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
136 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
131 <horstretch>0</horstretch>
137 <horstretch>0</horstretch>
132 <verstretch>0</verstretch>
138 <verstretch>0</verstretch>
133 </sizepolicy>
139 </sizepolicy>
134 </property>
140 </property>
135 <layout class="QGridLayout" name="gridLayout_2">
141 <layout class="QGridLayout" name="gridLayout_2">
136 <item row="0" column="0">
142 <item row="0" column="0">
137 <widget class="QGroupBox" name="groupBox_2">
143 <widget class="QGroupBox" name="groupBox_2">
138 <property name="sizePolicy">
144 <property name="sizePolicy">
139 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
145 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
140 <horstretch>0</horstretch>
146 <horstretch>0</horstretch>
141 <verstretch>0</verstretch>
147 <verstretch>0</verstretch>
142 </sizepolicy>
148 </sizepolicy>
143 </property>
149 </property>
144 <property name="title">
150 <property name="title">
145 <string>Catalogue</string>
151 <string>Catalogue</string>
146 </property>
152 </property>
147 <layout class="QGridLayout" name="gridLayout_3">
153 <layout class="QGridLayout" name="gridLayout_3">
148 <item row="0" column="0">
154 <item row="0" column="0">
149 <layout class="QFormLayout" name="formLayout_2">
155 <layout class="QFormLayout" name="formLayout_2">
150 <item row="0" column="0">
156 <item row="0" column="0">
151 <widget class="QLabel" name="label_2">
157 <widget class="QLabel" name="label_2">
152 <property name="text">
158 <property name="text">
153 <string>Name</string>
159 <string>Name</string>
154 </property>
160 </property>
155 </widget>
161 </widget>
156 </item>
162 </item>
157 <item row="0" column="1">
163 <item row="0" column="1">
158 <widget class="QLineEdit" name="lineEdit"/>
164 <widget class="QLineEdit" name="lineEdit"/>
159 </item>
165 </item>
160 <item row="1" column="0">
166 <item row="1" column="0">
161 <widget class="QLabel" name="label_4">
167 <widget class="QLabel" name="label_4">
162 <property name="text">
168 <property name="text">
163 <string>Events</string>
169 <string>Events</string>
164 </property>
170 </property>
165 </widget>
171 </widget>
166 </item>
172 </item>
167 <item row="1" column="1">
173 <item row="1" column="1">
168 <widget class="QLabel" name="cat_events_count">
174 <widget class="QLabel" name="cat_events_count">
169 <property name="text">
175 <property name="text">
170 <string/>
176 <string/>
171 </property>
177 </property>
172 </widget>
178 </widget>
173 </item>
179 </item>
174 </layout>
180 </layout>
175 </item>
181 </item>
176 </layout>
182 </layout>
177 </widget>
183 </widget>
178 </item>
184 </item>
179 </layout>
185 </layout>
180 </widget>
186 </widget>
181 <widget class="EventEditor" name="Event">
187 <widget class="EventEditor" name="Event">
182 <property name="sizePolicy">
188 <property name="sizePolicy">
183 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
189 <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
184 <horstretch>0</horstretch>
190 <horstretch>0</horstretch>
185 <verstretch>0</verstretch>
191 <verstretch>0</verstretch>
186 </sizepolicy>
192 </sizepolicy>
187 </property>
193 </property>
188 <layout class="QGridLayout" name="gridLayout_4"/>
194 <layout class="QGridLayout" name="gridLayout_4"/>
189 </widget>
195 </widget>
190 </widget>
196 </widget>
191 </item>
197 </item>
192 </layout>
198 </layout>
193 </widget>
199 </widget>
194 </widget>
200 </widget>
195 </item>
201 </item>
196 </layout>
202 </layout>
197 </widget>
203 </widget>
198 <customwidgets>
204 <customwidgets>
199 <customwidget>
205 <customwidget>
200 <class>RepositoriesTreeView</class>
206 <class>RepositoriesTreeView</class>
201 <extends>QTreeView</extends>
207 <extends>QTreeView</extends>
202 <header location="global">Catalogue2/repositoriestreeview.h</header>
208 <header location="global">Catalogue2/repositoriestreeview.h</header>
203 </customwidget>
209 </customwidget>
204 <customwidget>
210 <customwidget>
205 <class>EventsTreeView</class>
211 <class>EventsTreeView</class>
206 <extends>QTreeView</extends>
212 <extends>QTreeView</extends>
207 <header location="global">Catalogue2/eventstreeview.h</header>
213 <header location="global">Catalogue2/eventstreeview.h</header>
208 </customwidget>
214 </customwidget>
209 <customwidget>
215 <customwidget>
210 <class>EventEditor</class>
216 <class>EventEditor</class>
211 <extends>QWidget</extends>
217 <extends>QWidget</extends>
212 <header location="global">Catalogue2/eventeditor.h</header>
218 <header location="global">Catalogue2/eventeditor.h</header>
213 <container>1</container>
219 <container>1</container>
214 </customwidget>
220 </customwidget>
215 </customwidgets>
221 </customwidgets>
216 <resources/>
222 <resources/>
217 <connections/>
223 <connections/>
218 </ui>
224 </ui>
General Comments 0
You need to be logged in to leave comments. Login now