Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
ae41194e
Commit
ae41194e
authored
Jun 18, 2010
by
Max-Wilhelm Bruker
Browse files
forgot to add some files :)
parent
df4af668
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/dlg_create_token.cpp
0 → 100644
View file @
ae41194e
#include
<QtGui>
#include
"dlg_create_token.h"
DlgCreateToken
::
DlgCreateToken
(
QWidget
*
parent
)
:
QDialog
(
parent
)
{
nameLabel
=
new
QLabel
(
tr
(
"&Name:"
));
nameEdit
=
new
QLineEdit
;
nameLabel
->
setBuddy
(
nameEdit
);
colorLabel
=
new
QLabel
(
tr
(
"C&olor:"
));
colorEdit
=
new
QComboBox
;
colorEdit
->
addItem
(
tr
(
"white"
),
"w"
);
colorEdit
->
addItem
(
tr
(
"blue"
),
"u"
);
colorEdit
->
addItem
(
tr
(
"black"
),
"b"
);
colorEdit
->
addItem
(
tr
(
"red"
),
"r"
);
colorEdit
->
addItem
(
tr
(
"green"
),
"g"
);
colorEdit
->
addItem
(
tr
(
"multicolor"
),
"m"
);
colorEdit
->
addItem
(
tr
(
"colorless"
),
""
);
colorLabel
->
setBuddy
(
colorEdit
);
ptLabel
=
new
QLabel
(
tr
(
"&P/T:"
));
ptEdit
=
new
QLineEdit
;
ptLabel
->
setBuddy
(
ptEdit
);
annotationLabel
=
new
QLabel
(
tr
(
"&Annotation:"
));
annotationEdit
=
new
QLineEdit
;
annotationLabel
->
setBuddy
(
annotationEdit
);
okButton
=
new
QPushButton
(
tr
(
"&OK"
));
okButton
->
setDefault
(
true
);
cancelButton
=
new
QPushButton
(
tr
(
"&Cancel"
));
QGridLayout
*
grid
=
new
QGridLayout
;
grid
->
addWidget
(
nameLabel
,
0
,
0
);
grid
->
addWidget
(
nameEdit
,
0
,
1
);
grid
->
addWidget
(
colorLabel
,
1
,
0
);
grid
->
addWidget
(
colorEdit
,
1
,
1
);
grid
->
addWidget
(
ptLabel
,
2
,
0
);
grid
->
addWidget
(
ptEdit
,
2
,
1
);
grid
->
addWidget
(
annotationLabel
,
3
,
0
);
grid
->
addWidget
(
annotationEdit
,
3
,
1
);
QHBoxLayout
*
buttonLayout
=
new
QHBoxLayout
;
buttonLayout
->
addStretch
();
buttonLayout
->
addWidget
(
okButton
);
buttonLayout
->
addWidget
(
cancelButton
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
mainLayout
->
addLayout
(
grid
);
mainLayout
->
addLayout
(
buttonLayout
);
setLayout
(
mainLayout
);
setWindowTitle
(
tr
(
"Create token"
));
setFixedHeight
(
sizeHint
().
height
());
setMinimumWidth
(
300
);
connect
(
okButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
actOk
()));
connect
(
cancelButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
reject
()));
}
void
DlgCreateToken
::
actOk
()
{
accept
();
}
QString
DlgCreateToken
::
getName
()
const
{
return
nameEdit
->
text
();
}
QString
DlgCreateToken
::
getColor
()
const
{
return
colorEdit
->
itemData
(
colorEdit
->
currentIndex
()).
toString
();
}
QString
DlgCreateToken
::
getPT
()
const
{
return
ptEdit
->
text
();
}
QString
DlgCreateToken
::
getAnnotation
()
const
{
return
annotationEdit
->
text
();
}
cockatrice/src/dlg_create_token.h
0 → 100644
View file @
ae41194e
#ifndef DLG_CREATETOKEN_H
#define DLG_CREATETOKEN_H
#include
<QDialog>
#include
<QLineEdit>
class
QLabel
;
class
QComboBox
;
class
QPushButton
;
class
DlgCreateToken
:
public
QDialog
{
Q_OBJECT
public:
DlgCreateToken
(
QWidget
*
parent
=
0
);
QString
getName
()
const
;
QString
getColor
()
const
;
QString
getPT
()
const
;
QString
getAnnotation
()
const
;
private
slots
:
void
actOk
();
private:
QLabel
*
nameLabel
,
*
colorLabel
,
*
ptLabel
,
*
annotationLabel
;
QComboBox
*
colorEdit
;
QLineEdit
*
nameEdit
,
*
ptEdit
,
*
annotationEdit
;
QPushButton
*
okButton
,
*
cancelButton
;
};
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment