-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.py
More file actions
160 lines (153 loc) · 10.2 KB
/
Copy pathmainwindow.py
File metadata and controls
160 lines (153 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Fri Dec 02 20:27:41 2016
# by: PyQt4 UI code generator 4.9.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(308, 228)
MainWindow.setMinimumSize(QtCore.QSize(308, 228))
MainWindow.setMaximumSize(QtCore.QSize(308, 228))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8("dice_icon.jpg")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.diceCount = QtGui.QSpinBox(self.centralwidget)
self.diceCount.setGeometry(QtCore.QRect(40, 60, 42, 22))
self.diceCount.setAlignment(QtCore.Qt.AlignCenter)
self.diceCount.setMinimum(1)
self.diceCount.setMaximum(9)
self.diceCount.setObjectName(_fromUtf8("diceCount"))
self.diceDM = QtGui.QSpinBox(self.centralwidget)
self.diceDM.setGeometry(QtCore.QRect(170, 60, 42, 22))
self.diceDM.setAlignment(QtCore.Qt.AlignCenter)
self.diceDM.setMinimum(-9)
self.diceDM.setMaximum(9)
self.diceDM.setObjectName(_fromUtf8("diceDM"))
self.diceType = QtGui.QComboBox(self.centralwidget)
self.diceType.setGeometry(QtCore.QRect(100, 60, 51, 22))
self.diceType.setMaxVisibleItems(9)
self.diceType.setMaxCount(9)
self.diceType.setObjectName(_fromUtf8("diceType"))
self.label = QtGui.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(150, 60, 16, 16))
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.label_2 = QtGui.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(210, 60, 16, 16))
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.diceRoll = QtGui.QLabel(self.centralwidget)
self.diceRoll.setGeometry(QtCore.QRect(230, 50, 46, 41))
font = QtGui.QFont()
font.setFamily(_fromUtf8("Blade Runner Movie Font"))
font.setPointSize(20)
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.diceRoll.setFont(font)
self.diceRoll.setFrameShape(QtGui.QFrame.Box)
self.diceRoll.setFrameShadow(QtGui.QFrame.Sunken)
self.diceRoll.setText(_fromUtf8(""))
self.diceRoll.setAlignment(QtCore.Qt.AlignCenter)
self.diceRoll.setObjectName(_fromUtf8("diceRoll"))
self.countLabel = QtGui.QLabel(self.centralwidget)
self.countLabel.setGeometry(QtCore.QRect(40, 30, 46, 13))
self.countLabel.setAlignment(QtCore.Qt.AlignCenter)
self.countLabel.setObjectName(_fromUtf8("countLabel"))
self.typeLabel = QtGui.QLabel(self.centralwidget)
self.typeLabel.setGeometry(QtCore.QRect(100, 30, 46, 13))
self.typeLabel.setAlignment(QtCore.Qt.AlignCenter)
self.typeLabel.setObjectName(_fromUtf8("typeLabel"))
self.dmLabel = QtGui.QLabel(self.centralwidget)
self.dmLabel.setGeometry(QtCore.QRect(170, 30, 46, 13))
self.dmLabel.setAlignment(QtCore.Qt.AlignCenter)
self.dmLabel.setObjectName(_fromUtf8("dmLabel"))
self.rollLabel = QtGui.QLabel(self.centralwidget)
self.rollLabel.setGeometry(QtCore.QRect(230, 30, 46, 13))
self.rollLabel.setAlignment(QtCore.Qt.AlignCenter)
self.rollLabel.setObjectName(_fromUtf8("rollLabel"))
self.rollButton = QtGui.QPushButton(self.centralwidget)
self.rollButton.setGeometry(QtCore.QRect(40, 120, 75, 23))
self.rollButton.setObjectName(_fromUtf8("rollButton"))
self.clearButton = QtGui.QPushButton(self.centralwidget)
self.clearButton.setGeometry(QtCore.QRect(120, 120, 75, 23))
self.clearButton.setObjectName(_fromUtf8("clearButton"))
self.quitButton = QtGui.QPushButton(self.centralwidget)
self.quitButton.setGeometry(QtCore.QRect(200, 120, 75, 23))
self.quitButton.setObjectName(_fromUtf8("quitButton"))
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 308, 21))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menuMenu = QtGui.QMenu(self.menubar)
self.menuMenu.setObjectName(_fromUtf8("menuMenu"))
self.menuHelp = QtGui.QMenu(self.menubar)
self.menuHelp.setObjectName(_fromUtf8("menuHelp"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setSizeGripEnabled(False)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.actionRoll_Dice = QtGui.QAction(MainWindow)
self.actionRoll_Dice.setObjectName(_fromUtf8("actionRoll_Dice"))
self.actionClear_All = QtGui.QAction(MainWindow)
self.actionClear_All.setObjectName(_fromUtf8("actionClear_All"))
self.actionQuit = QtGui.QAction(MainWindow)
self.actionQuit.setObjectName(_fromUtf8("actionQuit"))
self.actionAbout_Dice_Roll = QtGui.QAction(MainWindow)
self.actionAbout_Dice_Roll.setObjectName(_fromUtf8("actionAbout_Dice_Roll"))
self.menuMenu.addAction(self.actionRoll_Dice)
self.menuMenu.addAction(self.actionClear_All)
self.menuMenu.addSeparator()
self.menuMenu.addAction(self.actionQuit)
self.menuHelp.addAction(self.actionAbout_Dice_Roll)
self.menubar.addAction(self.menuMenu.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.diceCount, self.diceType)
MainWindow.setTabOrder(self.diceType, self.diceDM)
MainWindow.setTabOrder(self.diceDM, self.rollButton)
MainWindow.setTabOrder(self.rollButton, self.clearButton)
MainWindow.setTabOrder(self.clearButton, self.quitButton)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Dice Roll", None, QtGui.QApplication.UnicodeUTF8))
self.diceCount.setToolTip(QtGui.QApplication.translate("MainWindow", "Dice count", None, QtGui.QApplication.UnicodeUTF8))
self.diceDM.setToolTip(QtGui.QApplication.translate("MainWindow", "Dice modifier", None, QtGui.QApplication.UnicodeUTF8))
self.diceType.setToolTip(QtGui.QApplication.translate("MainWindow", "Dice type", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("MainWindow", "+", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("MainWindow", "=", None, QtGui.QApplication.UnicodeUTF8))
self.diceRoll.setToolTip(QtGui.QApplication.translate("MainWindow", "Roll result", None, QtGui.QApplication.UnicodeUTF8))
self.countLabel.setText(QtGui.QApplication.translate("MainWindow", "Count", None, QtGui.QApplication.UnicodeUTF8))
self.typeLabel.setText(QtGui.QApplication.translate("MainWindow", "Type", None, QtGui.QApplication.UnicodeUTF8))
self.dmLabel.setText(QtGui.QApplication.translate("MainWindow", "Modifier", None, QtGui.QApplication.UnicodeUTF8))
self.rollLabel.setText(QtGui.QApplication.translate("MainWindow", "Roll", None, QtGui.QApplication.UnicodeUTF8))
self.rollButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Roll the dice", None, QtGui.QApplication.UnicodeUTF8))
self.rollButton.setText(QtGui.QApplication.translate("MainWindow", "Roll Dice", None, QtGui.QApplication.UnicodeUTF8))
self.clearButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Clear all fields", None, QtGui.QApplication.UnicodeUTF8))
self.clearButton.setText(QtGui.QApplication.translate("MainWindow", "Clear All", None, QtGui.QApplication.UnicodeUTF8))
self.quitButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Quit this program", None, QtGui.QApplication.UnicodeUTF8))
self.quitButton.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
self.menuMenu.setTitle(QtGui.QApplication.translate("MainWindow", "Menu", None, QtGui.QApplication.UnicodeUTF8))
self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
self.actionRoll_Dice.setText(QtGui.QApplication.translate("MainWindow", "Roll Dice", None, QtGui.QApplication.UnicodeUTF8))
self.actionRoll_Dice.setStatusTip(QtGui.QApplication.translate("MainWindow", "Roll the dice", None, QtGui.QApplication.UnicodeUTF8))
self.actionRoll_Dice.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
self.actionClear_All.setText(QtGui.QApplication.translate("MainWindow", "Clear All", None, QtGui.QApplication.UnicodeUTF8))
self.actionClear_All.setStatusTip(QtGui.QApplication.translate("MainWindow", "Clear all fields", None, QtGui.QApplication.UnicodeUTF8))
self.actionClear_All.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setStatusTip(QtGui.QApplication.translate("MainWindow", "Quit this program", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
self.actionAbout_Dice_Roll.setText(QtGui.QApplication.translate("MainWindow", "About Dice Roll", None, QtGui.QApplication.UnicodeUTF8))
self.actionAbout_Dice_Roll.setStatusTip(QtGui.QApplication.translate("MainWindow", "About Dice Roll", None, QtGui.QApplication.UnicodeUTF8))