8 this file is part of the project scolasync
10 Copyright (C) 2010 Georges Khaznadar <georgesk@ofset.org>
12 This program is free software: you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
41 def __init__(self, parent, percent, total=0, used=0, title="Disk"):
42 QMainWindow.__init__(self)
43 QWidget.__init__(self, parent)
44 from Ui_diskFull
import Ui_MainWindow
45 self.
ui = Ui_MainWindow()
47 self.setWindowTitle(title)
48 self.
v=self.ui.graphicsView
50 self.
used=self.ui.label_used
52 self.total.setText(QApplication.translate(
"diskFull",
"Place totale : {size} kilo-octets",
None, QApplication.UnicodeUTF8).format(size=total))
53 self.used.setText(QApplication.translate(
"diskFull",
"Place utilisée : {size} kilo-octets",
None, QApplication.UnicodeUTF8).format(size=used))
63 scene=QGraphicsScene(parent)
64 scene.addEllipse ( rect, QPen(), QBrush(QColor(
"lightyellow")) )
65 usedEllipse=scene.addEllipse (rect, QPen(), QBrush(QColor(
"slateblue")) )
66 usedEllipse.setStartAngle(0)
67 usedEllipse.setSpanAngle(360 * 16 * percent / 100)