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
4691f3e2
Commit
4691f3e2
authored
Apr 05, 2016
by
ctrlaltca
Browse files
Merge pull request #1906 from ctrlaltca/fix_1903
Token dialog: disable progressive loading
parents
2b138cce
2a3701b0
Changes
4
Show whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabasemodel.cpp
View file @
4691f3e2
...
...
@@ -236,3 +236,9 @@ bool TokenDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*so
return
info
->
getIsToken
();
}
int
TokenDisplayModel
::
rowCount
(
const
QModelIndex
&
parent
)
const
{
// always load all tokens at start
return
QSortFilterProxyModel
::
rowCount
(
parent
);
}
cockatrice/src/carddatabasemodel.h
View file @
4691f3e2
...
...
@@ -72,6 +72,7 @@ class TokenDisplayModel : public CardDatabaseDisplayModel {
Q_OBJECT
public:
TokenDisplayModel
(
QObject
*
parent
=
0
);
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
;
protected:
bool
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
;
};
...
...
cockatrice/src/dlg_create_token.cpp
View file @
4691f3e2
...
...
@@ -62,9 +62,8 @@ DlgCreateToken::DlgCreateToken(const QStringList &_predefinedTokens, QWidget *pa
tokenDataGroupBox
->
setLayout
(
grid
);
cardDatabaseModel
=
new
CardDatabaseModel
(
db
,
this
);
cardDatabaseDisplayModel
=
new
CardDatabase
DisplayModel
(
this
);
cardDatabaseDisplayModel
=
new
Token
DisplayModel
(
this
);
cardDatabaseDisplayModel
->
setSourceModel
(
cardDatabaseModel
);
cardDatabaseDisplayModel
->
setIsToken
(
CardDatabaseDisplayModel
::
ShowTrue
);
chooseTokenFromAllRadioButton
=
new
QRadioButton
(
tr
(
"Show &all tokens"
));
connect
(
chooseTokenFromAllRadioButton
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
actChooseTokenFromAll
(
bool
)));
...
...
cockatrice/src/dlg_create_token.h
View file @
4691f3e2
...
...
@@ -12,7 +12,7 @@ class QPushButton;
class
QRadioButton
;
class
DeckList
;
class
CardDatabaseModel
;
class
CardDatabase
DisplayModel
;
class
Token
DisplayModel
;
class
DlgCreateToken
:
public
QDialog
{
Q_OBJECT
...
...
@@ -30,7 +30,7 @@ private slots:
void
actOk
();
private:
CardDatabaseModel
*
cardDatabaseModel
;
CardDatabase
DisplayModel
*
cardDatabaseDisplayModel
;
Token
DisplayModel
*
cardDatabaseDisplayModel
;
QStringList
predefinedTokens
;
QLabel
*
nameLabel
,
*
colorLabel
,
*
ptLabel
,
*
annotationLabel
;
QComboBox
*
colorEdit
;
...
...
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