1 # Copyright (c) 2005 Fredrik Kuivinen <freku045@student.liu.se>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License version 2 as
5 # published by the Free Software Foundation.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program; if not, write to the Free Software
14 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 qconnect
= qt
.QObject
.connect
21 class CommitDialog(qt
.QDialog
):
22 def __init__(self
, mergeMsg
, commitMsg
, files
):
23 qt
.QDialog
.__init
__(self
)
25 self
.setCaption('Confirm Commit - ' + applicationName
)
26 self
.layout
= qt
.QVBoxLayout(self
)
27 self
.layout
.setAutoAdd(True)
28 self
.layout
.setMargin(10)
29 self
.layout
.setSpacing(10)
31 self
.msgL1
= qt
.QLabel('<qt><p>' + mergeMsg
+ '</p>' + \
32 '<p>Do you want to commit the following file(s):</p></qt>', self
)
33 self
.fileList
= qt
.QListBox(self
)
34 self
.fileList
.setSelectionMode(qt
.QListBox
.NoSelection
)
36 self
.fileList
.insertItem(f
)
37 self
.fileList
.setMinimumSize(self
.fileList
.width(),
38 self
.fileList
.itemHeight()*10)
41 qt
.QLabel('<qt><p>with the commit message:</p>' + \
42 '<blockquote><pre>' + unicode(qt
.QStyleSheet
.escape(commitMsg
)) + '</pre></blockquote></qt>',
45 self
.buttonL
= qt
.QHBox(self
)
46 self
.yes
= qt
.QPushButton("&Yes", self
.buttonL
)
47 self
.no
= qt
.QPushButton("&No", self
.buttonL
)
48 qconnect(self
.yes
, qt
.SIGNAL("clicked()"), self
.accept
)
49 qconnect(self
.no
, qt
.SIGNAL("clicked()"), self
.reject
)
53 def paintEvent(self
, e
):
54 qt
.QDialog
.paintEvent(self
, e
)