##// END OF EJS Templates
GUI improvments
Jeandet Alexis -
r11:e0f25227d628 default
parent child
Show More
@@ -0,0 +1,153
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 #include "qvpushbutton.h"
23 #include <QStylePainter>
24 #include <QMenu>
25
26 QVPushButton::QVPushButton(QWidget *parent) :
27 QPushButton(parent)
28 {
29 init();
30 }
31
32 QVPushButton::QVPushButton(const QString &text, QWidget *parent)
33 {
34 init();
35 }
36
37 QVPushButton::QVPushButton(const QIcon &icon, const QString &text, QWidget *parent):
38 QPushButton(parent)
39 {
40 init();
41 }
42
43 QVPushButton::~QVPushButton()
44 {
45
46 }
47
48 Qt::Orientation QVPushButton::orientation() const
49 {
50 return orientation_;
51 }
52
53 void QVPushButton::setOrientation(Qt::Orientation orientation)
54 {
55 orientation_ = orientation;
56 switch (orientation)
57 {
58 case Qt::Horizontal:
59 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
60 break;
61
62 case Qt::Vertical:
63 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
64 break;
65 }
66 }
67
68 bool QVPushButton::mirrored() const
69 {
70 return mirrored_;
71 }
72
73 void QVPushButton::setMirrored(bool mirrored)
74 {
75 mirrored_ = mirrored;
76 }
77
78 QSize QVPushButton::sizeHint() const
79 {
80 QSize size = QPushButton::sizeHint();
81 if (orientation_ == Qt::Vertical)
82 size.transpose();
83 return size;
84 }
85
86 void QVPushButton::paintEvent(QPaintEvent *event)
87 {
88 Q_UNUSED(event);
89 QStylePainter p(this);
90
91 switch (orientation_)
92 {
93 case Qt::Horizontal:
94 if (mirrored_)
95 {
96 p.rotate(180);
97 p.translate(-width(), -height());
98 }
99 break;
100
101 case Qt::Vertical:
102 if (mirrored_)
103 {
104 p.rotate(-90);
105 p.translate(-height(), 0);
106 }
107 else
108 {
109 p.rotate(90);
110 p.translate(0, -width());
111 }
112 break;
113 }
114
115 p.drawControl(QStyle::CE_PushButton, getStyleOption());
116 }
117
118 QStyleOptionButton QVPushButton::getStyleOption() const
119 {
120 QStyleOptionButton opt;
121 opt.initFrom(this);
122 if (orientation_ == Qt::Vertical)
123 {
124 QSize size = opt.rect.size();
125 size.transpose();
126 opt.rect.setSize(size);
127 }
128 opt.features = QStyleOptionButton::None;
129 if (isFlat())
130 opt.features |= QStyleOptionButton::Flat;
131 if (menu())
132 opt.features |= QStyleOptionButton::HasMenu;
133 if (autoDefault() || isDefault())
134 opt.features |= QStyleOptionButton::AutoDefaultButton;
135 if (isDefault())
136 opt.features |= QStyleOptionButton::DefaultButton;
137 if (isDown() || (menu() && menu()->isVisible()))
138 opt.state |= QStyle::State_Sunken;
139 if (isChecked())
140 opt.state |= QStyle::State_On;
141 if (!isFlat() && !isDown())
142 opt.state |= QStyle::State_Raised;
143 opt.text = text();
144 opt.icon = icon();
145 opt.iconSize = iconSize();
146 return opt;
147 }
148
149 void QVPushButton::init()
150 {
151 orientation_ = Qt::Horizontal;
152 mirrored_ = false;
153 }
@@ -0,0 +1,58
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 -- Copied from example http://www.qtcentre.org/wiki/index.php?title=OrientationButton
22 ----------------------------------------------------------------------------*/
23 #ifndef QVPUSHBUTTON_H
24 #define QVPUSHBUTTON_H
25
26 #include <QPushButton>
27 #include <QStyleOptionButton>
28
29 class QVPushButton : public QPushButton
30 {
31 Q_OBJECT
32 public:
33 explicit QVPushButton(QWidget *parent = 0);
34 QVPushButton(const QString& text, QWidget* parent = 0);
35 QVPushButton(const QIcon& icon, const QString& text, QWidget* parent = 0);
36 ~QVPushButton();
37
38 Qt::Orientation orientation() const;
39 void setOrientation(Qt::Orientation orientation);
40
41 bool mirrored() const;
42 void setMirrored(bool mirrored);
43
44 QSize sizeHint() const;
45
46 protected:
47 void paintEvent(QPaintEvent* event);
48
49 private:
50 QStyleOptionButton getStyleOption() const;
51 void init();
52
53 Qt::Orientation orientation_;
54 bool mirrored_;
55
56 };
57
58 #endif // QVPUSHBUTTON_H
@@ -0,0 +1,258
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!-- Created with Inkscape (http://www.inkscape.org/) -->
3 <svg
4 xmlns:dc="http://purl.org/dc/elements/1.1/"
5 xmlns:cc="http://web.resource.org/cc/"
6 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
7 xmlns:svg="http://www.w3.org/2000/svg"
8 xmlns="http://www.w3.org/2000/svg"
9 xmlns:xlink="http://www.w3.org/1999/xlink"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 inkscape:export-ydpi="90.000000"
13 inkscape:export-xdpi="90.000000"
14 inkscape:export-filename="/home/jimmac/Desktop/wi-fi.png"
15 width="48"
16 height="48"
17 id="svg11300"
18 sodipodi:version="0.32"
19 inkscape:version="0.45"
20 sodipodi:docbase="/home/dobey/Projects/gnome-icon-theme/scalable/emblems"
21 sodipodi:docname="emblem-unreadable.svg"
22 inkscape:output_extension="org.inkscape.output.svg.inkscape"
23 version="1.0">
24 <defs
25 id="defs3">
26 <linearGradient
27 inkscape:collect="always"
28 id="linearGradient7000">
29 <stop
30 style="stop-color:#ffffff;stop-opacity:1;"
31 offset="0"
32 id="stop7002" />
33 <stop
34 style="stop-color:#ffffff;stop-opacity:0;"
35 offset="1"
36 id="stop7004" />
37 </linearGradient>
38 <linearGradient
39 inkscape:collect="always"
40 id="linearGradient6964">
41 <stop
42 style="stop-color:#000000;stop-opacity:1;"
43 offset="0"
44 id="stop6966" />
45 <stop
46 style="stop-color:#000000;stop-opacity:0;"
47 offset="1"
48 id="stop6968" />
49 </linearGradient>
50 <linearGradient
51 id="linearGradient2790">
52 <stop
53 style="stop-color:white;stop-opacity:1;"
54 offset="0"
55 id="stop2792" />
56 <stop
57 id="stop2798"
58 offset="0.8108108"
59 style="stop-color:#d3d7cf;stop-opacity:1;" />
60 <stop
61 style="stop-color:#959e8b;stop-opacity:1;"
62 offset="1"
63 id="stop2794" />
64 </linearGradient>
65 <linearGradient
66 inkscape:collect="always"
67 xlink:href="#linearGradient2790"
68 id="linearGradient6945"
69 x1="4.3764215"
70 y1="0.068979882"
71 x2="19.255854"
72 y2="30.038462"
73 gradientUnits="userSpaceOnUse"
74 gradientTransform="matrix(1.7588235,0,0,1.7588235,6.032353,6.0323539)" />
75 <radialGradient
76 inkscape:collect="always"
77 xlink:href="#linearGradient6964"
78 id="radialGradient6970"
79 cx="-2"
80 cy="19.5"
81 fx="-2"
82 fy="19.5"
83 r="3"
84 gradientTransform="matrix(1,0,0,0.5,0,9.75)"
85 gradientUnits="userSpaceOnUse" />
86 <radialGradient
87 inkscape:collect="always"
88 xlink:href="#linearGradient6964"
89 id="radialGradient6972"
90 cx="-2"
91 cy="19.5"
92 fx="-2"
93 fy="19.5"
94 r="3"
95 gradientTransform="matrix(1,0,0,0.5,0,9.75)"
96 gradientUnits="userSpaceOnUse" />
97 <radialGradient
98 inkscape:collect="always"
99 xlink:href="#linearGradient6964"
100 id="radialGradient6976"
101 gradientUnits="userSpaceOnUse"
102 gradientTransform="matrix(1,0,0,0.5,0,9.75)"
103 cx="-2"
104 cy="19.5"
105 fx="-2"
106 fy="19.5"
107 r="3" />
108 <linearGradient
109 inkscape:collect="always"
110 xlink:href="#linearGradient7000"
111 id="linearGradient7006"
112 x1="17.838388"
113 y1="19.939341"
114 x2="39.418972"
115 y2="61.80806"
116 gradientUnits="userSpaceOnUse" />
117 <linearGradient
118 inkscape:collect="always"
119 xlink:href="#linearGradient7000"
120 id="linearGradient7010"
121 gradientUnits="userSpaceOnUse"
122 x1="17.838388"
123 y1="19.939341"
124 x2="27.044603"
125 y2="40.064526" />
126 </defs>
127 <sodipodi:namedview
128 stroke="#ef2929"
129 fill="#888a85"
130 id="base"
131 pagecolor="#ffffff"
132 bordercolor="#666666"
133 borderopacity="0.25490196"
134 inkscape:pageopacity="0.0"
135 inkscape:pageshadow="2"
136 inkscape:zoom="1"
137 inkscape:cx="118.89613"
138 inkscape:cy="30.767475"
139 inkscape:current-layer="layer1"
140 showgrid="false"
141 inkscape:grid-bbox="false"
142 inkscape:document-units="px"
143 inkscape:showpageshadow="false"
144 inkscape:window-width="908"
145 inkscape:window-height="924"
146 inkscape:window-x="573"
147 inkscape:window-y="126"
148 showborder="false"
149 width="48px"
150 height="48px"
151 borderlayer="true"
152 inkscape:grid-points="false"
153 inkscape:guide-bbox="true" />
154 <metadata
155 id="metadata4">
156 <rdf:RDF>
157 <cc:Work
158 rdf:about="">
159 <dc:format>image/svg+xml</dc:format>
160 <dc:type
161 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
162 <dc:creator>
163 <cc:Agent>
164 <dc:title>Lapo Calamandrei</dc:title>
165 </cc:Agent>
166 </dc:creator>
167 <dc:source />
168 <cc:license
169 rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
170 <dc:title>Read-only</dc:title>
171 <dc:subject>
172 <rdf:Bag>
173 <rdf:li>emblem</rdf:li>
174 <rdf:li>read-only</rdf:li>
175 <rdf:li>no-read</rdf:li>
176 <rdf:li>locked</rdf:li>
177 <rdf:li>lock</rdf:li>
178 </rdf:Bag>
179 </dc:subject>
180 </cc:Work>
181 <cc:License
182 rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
183 <cc:permits
184 rdf:resource="http://web.resource.org/cc/Reproduction" />
185 <cc:permits
186 rdf:resource="http://web.resource.org/cc/Distribution" />
187 <cc:requires
188 rdf:resource="http://web.resource.org/cc/Notice" />
189 <cc:permits
190 rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
191 <cc:requires
192 rdf:resource="http://web.resource.org/cc/ShareAlike" />
193 <cc:requires
194 rdf:resource="http://web.resource.org/cc/SourceCode" />
195 </cc:License>
196 </rdf:RDF>
197 </metadata>
198 <g
199 id="layer1"
200 inkscape:label="Layer 1"
201 inkscape:groupmode="layer">
202 <g
203 id="g6978"
204 style="opacity:0.7238806"
205 transform="matrix(1.8719362,0,0,1.5205944,5.0000002,10.484903)">
206 <path
207 transform="matrix(2.0312501,0,0,1.2946278,14.455805,-7.7591062)"
208 d="M 1 19.5 A 3 1.5 0 1 1 -5,19.5 A 3 1.5 0 1 1 1 19.5 z"
209 sodipodi:ry="1.5"
210 sodipodi:rx="3"
211 sodipodi:cy="19.5"
212 sodipodi:cx="-2"
213 id="path6974"
214 style="opacity:0.14179107;fill:url(#radialGradient6976);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
215 sodipodi:type="arc" />
216 <path
217 transform="matrix(1.6666667,0,0,1.2946278,8.3333333,-6.6568542)"
218 d="M 1 19.5 A 3 1.5 0 1 1 -5,19.5 A 3 1.5 0 1 1 1 19.5 z"
219 sodipodi:ry="1.5"
220 sodipodi:rx="3"
221 sodipodi:cy="19.5"
222 sodipodi:cx="-2"
223 id="path6960"
224 style="opacity:0.2;fill:url(#radialGradient6970);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
225 sodipodi:type="arc" />
226 <path
227 transform="matrix(1.6666667,0,0,1.2946278,19.333333,-6.6568542)"
228 d="M 1 19.5 A 3 1.5 0 1 1 -5,19.5 A 3 1.5 0 1 1 1 19.5 z"
229 sodipodi:ry="1.5"
230 sodipodi:rx="3"
231 sodipodi:cy="19.5"
232 sodipodi:cx="-2"
233 id="path6962"
234 style="opacity:0.2;fill:url(#radialGradient6972);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
235 sodipodi:type="arc" />
236 </g>
237 <path
238 style="fill:url(#linearGradient6945);fill-opacity:1;fill-rule:evenodd;stroke:#6f716b;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
239 d="M 14.82647,9.5500008 L 9.55,14.826471 L 19.22353,24.5 L 9.55,34.17353 L 14.82647,39.45 L 24.500002,29.776471 L 34.17352,39.45 L 39.45,34.17353 L 29.77647,24.5 L 39.45,14.826471 L 34.17352,9.5500008 L 24.500002,19.22353 L 14.82647,9.5500008 z "
240 id="path6930" />
241 <path
242 sodipodi:type="inkscape:offset"
243 inkscape:radius="-1.0514843"
244 inkscape:original="M 14.8125 8.5625 L 9.5625 13.8125 L 19.21875 23.5 L 9.5625 33.1875 L 14.8125 38.4375 L 24.5 28.78125 L 34.1875 38.4375 L 39.4375 33.1875 L 29.78125 23.5 L 39.4375 13.8125 L 34.1875 8.5625 L 24.5 18.21875 L 14.8125 8.5625 z "
245 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7006);stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
246 id="path6996"
247 d="M 14.8125,10.0625 L 11.0625,13.8125 L 19.96875,22.75 C 20.169915,22.947709 20.283223,23.217943 20.283223,23.5 C 20.283223,23.782057 20.169915,24.052291 19.96875,24.25 L 11.0625,33.1875 L 14.8125,36.9375 L 23.75,28.03125 C 23.947709,27.830085 24.217943,27.716777 24.5,27.716777 C 24.782057,27.716777 25.052291,27.830085 25.25,28.03125 L 34.1875,36.9375 L 37.9375,33.1875 L 29.03125,24.25 C 28.830085,24.052291 28.716777,23.782057 28.716777,23.5 C 28.716777,23.217943 28.830085,22.947709 29.03125,22.75 L 37.9375,13.8125 L 34.1875,10.0625 L 25.25,18.96875 C 25.052291,19.169915 24.782057,19.283223 24.5,19.283223 C 24.217943,19.283223 23.947709,19.169915 23.75,18.96875 L 14.8125,10.0625 z "
248 transform="translate(0,1)" />
249 <path
250 sodipodi:type="inkscape:offset"
251 inkscape:radius="-1.0514843"
252 inkscape:original="M 14.8125 8.5625 L 9.5625 13.8125 L 19.21875 23.5 L 9.5625 33.1875 L 14.8125 38.4375 L 24.5 28.78125 L 34.1875 38.4375 L 39.4375 33.1875 L 29.78125 23.5 L 39.4375 13.8125 L 34.1875 8.5625 L 24.5 18.21875 L 14.8125 8.5625 z "
253 style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient7010);stroke-width:1.10000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
254 id="path7008"
255 d="M 14.8125,10.0625 L 11.0625,13.8125 L 19.96875,22.75 C 20.169915,22.947709 20.283223,23.217943 20.283223,23.5 C 20.283223,23.782057 20.169915,24.052291 19.96875,24.25 L 11.0625,33.1875 L 14.8125,36.9375 L 23.75,28.03125 C 23.947709,27.830085 24.217943,27.716777 24.5,27.716777 C 24.782057,27.716777 25.052291,27.830085 25.25,28.03125 L 34.1875,36.9375 L 37.9375,33.1875 L 29.03125,24.25 C 28.830085,24.052291 28.716777,23.782057 28.716777,23.5 C 28.716777,23.217943 28.830085,22.947709 29.03125,22.75 L 37.9375,13.8125 L 34.1875,10.0625 L 25.25,18.96875 C 25.052291,19.169915 24.782057,19.283223 24.5,19.283223 C 24.217943,19.283223 23.947709,19.169915 23.75,18.96875 L 14.8125,10.0625 z "
256 transform="translate(0,1)" />
257 </g>
258 </svg>
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #include "filelist.h"
2 23 #include <QMimeData>
3 24 #include <QUrl>
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #ifndef FILELIST_H
2 23 #define FILELIST_H
3 24
@@ -2,5 +2,6
2 2 <qresource prefix="/img">
3 3 <file>ressources/Gnome-list-add.svg</file>
4 4 <file>ressources/Gnome-user-trash.svg</file>
5 <file>ressources/Gnome-emblem-unreadable.svg</file>
5 6 </qresource>
6 7 </RCC>
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #include "genericbinaryfilewidget.h"
2 23 #include "ui_genericbinaryfilewidget.h"
3 24 #include <QFileDialog>
@@ -15,10 +36,15 genericBinaryFileWidget::genericBinaryFi
15 36 ui(new Ui::genericBinaryFileWidget)
16 37 {
17 38 ui->setupUi(this);
39 ui->showFileListQpb->setOrientation(Qt::Vertical);
40 ui->showFileListWdgt->setHidden(true);
18 41 connect(this->ui->openFileQpb,SIGNAL(clicked()),this,SLOT(openFile()));
19 42 connect(this->ui->removeFileQpb,SIGNAL(clicked()),this,SLOT(removeFiles()));
20 43 connect(this->ui->fileList,SIGNAL(cellActivated(int,int)),this,SLOT(fileCellActivated(int,int)));
21 44 connect(this->ui->fileList,SIGNAL(openFiles(QStringList)),this,SLOT(openFile(QStringList)));
45 connect(this->ui->hideFileListQpb,SIGNAL(clicked()),this,SLOT(hideFileList()));
46 connect(this->ui->showFileListQpb,SIGNAL(clicked()),this,SLOT(showFileList()));
47
22 48 }
23 49
24 50 genericBinaryFileWidget::~genericBinaryFileWidget()
@@ -185,6 +211,18 void genericBinaryFileWidget::fileCellAc
185 211 }
186 212 }
187 213
214 void genericBinaryFileWidget::hideFileList()
215 {
216 this->ui->fileListGBox->setHidden(true);
217 this->ui->showFileListWdgt->setVisible(true);
218 }
219
220 void genericBinaryFileWidget::showFileList()
221 {
222 this->ui->fileListGBox->setVisible(true);
223 this->ui->showFileListWdgt->setHidden(true);
224 }
188 225
189 226
190 227
228
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #ifndef GENERICBINARYFILEWIDGET_H
2 23 #define GENERICBINARYFILEWIDGET_H
3 24
@@ -55,6 +76,8 public slots:
55 76 void updateFileList();
56 77 void removeFiles();
57 78 void fileCellActivated(int row, int column);
79 void hideFileList();
80 void showFileList();
58 81
59 82 private:
60 83 Ui::genericBinaryFileWidget *ui;
@@ -16,16 +16,172
16 16 <property name="windowTitle">
17 17 <string>Form</string>
18 18 </property>
19 <layout class="QGridLayout" name="gridLayout_2">
20 <item row="0" column="0">
19 <layout class="QHBoxLayout" name="horizontalLayout">
20 <property name="spacing">
21 <number>0</number>
22 </property>
23 <property name="leftMargin">
24 <number>0</number>
25 </property>
26 <property name="topMargin">
27 <number>2</number>
28 </property>
29 <property name="rightMargin">
30 <number>2</number>
31 </property>
32 <property name="bottomMargin">
33 <number>2</number>
34 </property>
35 <item>
36 <widget class="QWidget" name="showFileListWdgt" native="true">
37 <layout class="QVBoxLayout" name="verticalLayout">
38 <property name="margin">
39 <number>0</number>
40 </property>
41 <item>
42 <widget class="QVPushButton" name="showFileListQpb">
43 <property name="text">
44 <string>File list</string>
45 </property>
46 </widget>
47 </item>
48 <item>
49 <spacer name="showFileListVSpacer">
50 <property name="orientation">
51 <enum>Qt::Vertical</enum>
52 </property>
53 <property name="sizeHint" stdset="0">
54 <size>
55 <width>20</width>
56 <height>40</height>
57 </size>
58 </property>
59 </spacer>
60 </item>
61 </layout>
62 </widget>
63 </item>
64 <item>
21 65 <widget class="QSplitter" name="splitter">
22 66 <property name="orientation">
23 67 <enum>Qt::Horizontal</enum>
24 68 </property>
25 <widget class="QWidget" name="widget" native="true">
69 <widget class="QGroupBox" name="fileListGBox">
70 <property name="title">
71 <string>File list</string>
72 </property>
73 <layout class="QVBoxLayout" name="verticalLayout_2">
74 <property name="spacing">
75 <number>2</number>
76 </property>
77 <property name="margin">
78 <number>2</number>
79 </property>
80 <item>
81 <widget class="QWidget" name="fileListWdgt" native="true">
26 82 <layout class="QGridLayout" name="gridLayout">
27 <item row="1" column="0">
83 <property name="margin">
84 <number>2</number>
85 </property>
86 <property name="spacing">
87 <number>2</number>
88 </property>
89 <item row="1" column="3">
90 <widget class="QPushButton" name="hideFileListQpb">
91 <property name="minimumSize">
92 <size>
93 <width>16</width>
94 <height>16</height>
95 </size>
96 </property>
97 <property name="maximumSize">
98 <size>
99 <width>16</width>
100 <height>16</height>
101 </size>
102 </property>
103 <property name="text">
104 <string/>
105 </property>
106 <property name="icon">
107 <iconset resource="genericBinaryFiles.qrc">
108 <normaloff>:/img/ressources/Gnome-emblem-unreadable.svg</normaloff>:/img/ressources/Gnome-emblem-unreadable.svg</iconset>
109 </property>
110 </widget>
111 </item>
112 <item row="2" column="0" colspan="4">
113 <widget class="FileList" name="fileList">
114 <property name="dragEnabled">
115 <bool>false</bool>
116 </property>
117 <column>
118 <property name="text">
119 <string>File</string>
120 </property>
121 </column>
122 <column>
123 <property name="text">
124 <string>Type</string>
125 </property>
126 </column>
127 </widget>
128 </item>
129 <item row="1" column="0" colspan="3">
130 <spacer name="horizontalSpacer_2">
131 <property name="orientation">
132 <enum>Qt::Horizontal</enum>
133 </property>
134 <property name="sizeHint" stdset="0">
135 <size>
136 <width>40</width>
137 <height>20</height>
138 </size>
139 </property>
140 </spacer>
141 </item>
142 <item row="3" column="1">
143 <widget class="QPushButton" name="removeFileQpb">
144 <property name="minimumSize">
145 <size>
146 <width>32</width>
147 <height>32</height>
148 </size>
149 </property>
150 <property name="maximumSize">
151 <size>
152 <width>32</width>
153 <height>32</height>
154 </size>
155 </property>
156 <property name="text">
157 <string/>
158 </property>
159 <property name="icon">
160 <iconset resource="genericBinaryFiles.qrc">
161 <normaloff>:/img/ressources/Gnome-user-trash.svg</normaloff>:/img/ressources/Gnome-user-trash.svg</iconset>
162 </property>
163 <property name="iconSize">
164 <size>
165 <width>24</width>
166 <height>24</height>
167 </size>
168 </property>
169 </widget>
170 </item>
171 <item row="3" column="0">
28 172 <widget class="QPushButton" name="openFileQpb">
173 <property name="minimumSize">
174 <size>
175 <width>32</width>
176 <height>32</height>
177 </size>
178 </property>
179 <property name="maximumSize">
180 <size>
181 <width>32</width>
182 <height>32</height>
183 </size>
184 </property>
29 185 <property name="text">
30 186 <string/>
31 187 </property>
@@ -41,24 +197,7
41 197 </property>
42 198 </widget>
43 199 </item>
44 <item row="1" column="1">
45 <widget class="QPushButton" name="removeFileQpb">
46 <property name="text">
47 <string/>
48 </property>
49 <property name="icon">
50 <iconset resource="genericBinaryFiles.qrc">
51 <normaloff>:/img/ressources/Gnome-user-trash.svg</normaloff>:/img/ressources/Gnome-user-trash.svg</iconset>
52 </property>
53 <property name="iconSize">
54 <size>
55 <width>24</width>
56 <height>24</height>
57 </size>
58 </property>
59 </widget>
60 </item>
61 <item row="1" column="2">
200 <item row="3" column="2" colspan="2">
62 201 <spacer name="horizontalSpacer">
63 202 <property name="orientation">
64 203 <enum>Qt::Horizontal</enum>
@@ -71,21 +210,7
71 210 </property>
72 211 </spacer>
73 212 </item>
74 <item row="0" column="0" colspan="3">
75 <widget class="FileList" name="fileList">
76 <property name="dragEnabled">
77 <bool>false</bool>
78 </property>
79 <column>
80 <property name="text">
81 <string>File</string>
82 </property>
83 </column>
84 <column>
85 <property name="text">
86 <string>Type</string>
87 </property>
88 </column>
213 </layout>
89 214 </widget>
90 215 </item>
91 216 </layout>
@@ -111,6 +236,11
111 236 <extends>QTableWidget</extends>
112 237 <header>filelist.h</header>
113 238 </customwidget>
239 <customwidget>
240 <class>QVPushButton</class>
241 <extends>QPushButton</extends>
242 <header>qvpushbutton.h</header>
243 </customwidget>
114 244 </customwidgets>
115 245 <resources>
116 246 <include location="genericBinaryFiles.qrc"/>
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #include "qtablewidgetintitem.h"
2 23
3 24 QTableWidgetIntItem::QTableWidgetIntItem(const QString &text,int Type)
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SocExplorer Software
3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 22 #ifndef QTABLEWIDGETINTITEM_H
2 23 #define QTABLEWIDGETINTITEM_H
3 24
General Comments 0
You need to be logged in to leave comments. Login now