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
54a75949
Commit
54a75949
authored
Feb 06, 2016
by
Ira Aspen
Browse files
Added confirmation dialogue when set added.
parent
c9143952
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/CMakeLists.txt
View file @
54a75949
...
...
@@ -7,6 +7,7 @@ PROJECT(cockatrice)
SET
(
cockatrice_SOURCES
src/abstractcounter.cpp
src/counter_general.cpp
src/dlg_add_set.cpp
src/dlg_creategame.cpp
src/dlg_filter_games.cpp
src/dlg_connect.cpp
...
...
cockatrice/src/dlg_add_set.cpp
0 → 100644
View file @
54a75949
#include
"dlg_add_set.h"
#include
<QDialogButtonBox>
#include
<QPushButton>
#include
<QVBoxLayout>
DlgAddSet
::
DlgAddSet
(
QWidget
*
parent
,
bool
success
)
:
QDialog
(
parent
)
{
status
=
new
QLabel
(
this
);
restart
=
new
QLabel
(
this
);
if
(
success
)
{
setWindowTitle
(
tr
(
"Success"
));
status
->
setText
(
QString
(
"Set added to Cockatrice."
));
restart
->
setText
(
QString
(
"You must restart to use your new set."
));
}
else
{
setWindowTitle
(
tr
(
"Failed"
));
status
->
setText
(
QString
(
"Set failed to import."
));
}
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
this
);
ok
=
new
QPushButton
(
tr
(
"Ok"
),
this
);
buttonBox
->
addButton
(
ok
,
QDialogButtonBox
::
AcceptRole
);
connect
(
ok
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
closeDialog
()));
QVBoxLayout
*
parentLayout
=
new
QVBoxLayout
(
this
);
parentLayout
->
addWidget
(
status
);
parentLayout
->
addWidget
(
restart
);
parentLayout
->
addWidget
(
buttonBox
);
setLayout
(
parentLayout
);
exec
();
}
void
DlgAddSet
::
closeDialog
()
{
accept
();
}
\ No newline at end of file
cockatrice/src/dlg_add_set.h
0 → 100644
View file @
54a75949
#ifndef DLG_ADD_SET_H
#define DLG_ADD_SET_H
#include
<QDialog>
#include
<QLabel>
class
DlgAddSet
:
public
QDialog
{
Q_OBJECT
public:
DlgAddSet
(
QWidget
*
parent
,
bool
success
);
private
slots
:
void
closeDialog
();
private:
QLabel
*
status
,
*
restart
;
QPushButton
*
ok
;
};
#endif
\ No newline at end of file
cockatrice/src/tab_deck_editor.cpp
View file @
54a75949
...
...
@@ -32,6 +32,7 @@
#include
"cardinfowidget.h"
#include
"dlg_load_deck_from_clipboard.h"
#include
"dlg_edit_tokens.h"
#include
"dlg_add_set.h"
#include
"main.h"
#include
"settingscache.h"
#include
"priceupdater.h"
...
...
@@ -904,6 +905,8 @@ void TabDeckEditor::actAddCustomSet()
fileName
,
dir
.
absolutePath
()
+
"/"
+
(
maxIndex
>
9
?
""
:
"0"
)
+
QString
::
number
(
maxIndex
)
+
"."
+
QFileInfo
(
fileName
).
fileName
()
);
DlgAddSet
dlg
(
this
,
res
);
}
void
TabDeckEditor
::
actEditSets
()
...
...
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