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
0da2647a
Commit
0da2647a
authored
Jan 08, 2014
by
Daenyth
Browse files
Merge pull request #26 from jfreake/master
Deck Load Mods and Movable Tabs
parents
95c6058d
504a56cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/deck_loader.cpp
View file @
0da2647a
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#include
"decklist.h"
#include
"decklist.h"
const
QStringList
DeckLoader
::
fileNameFilters
=
QStringList
()
const
QStringList
DeckLoader
::
fileNameFilters
=
QStringList
()
<<
QObject
::
tr
(
"All files (*.*)"
)
<<
QObject
::
tr
(
"Cockatrice decks (*.cod)"
)
<<
QObject
::
tr
(
"Cockatrice decks (*.cod)"
)
<<
QObject
::
tr
(
"Plain text decks (*.dec *.mwDeck)"
)
<<
QObject
::
tr
(
"Plain text decks (*.dec *.mwDeck)"
);
<<
QObject
::
tr
(
"All files (*.*)"
);
DeckLoader
::
DeckLoader
()
DeckLoader
::
DeckLoader
()
:
DeckList
(),
:
DeckList
(),
...
@@ -94,8 +94,8 @@ bool DeckLoader::saveToFile(const QString &fileName, FileFormat fmt)
...
@@ -94,8 +94,8 @@ bool DeckLoader::saveToFile(const QString &fileName, FileFormat fmt)
DeckLoader
::
FileFormat
DeckLoader
::
getFormatFromNameFilter
(
const
QString
&
selectedNameFilter
)
DeckLoader
::
FileFormat
DeckLoader
::
getFormatFromNameFilter
(
const
QString
&
selectedNameFilter
)
{
{
switch
(
fileNameFilters
.
indexOf
(
selectedNameFilter
))
{
switch
(
fileNameFilters
.
indexOf
(
selectedNameFilter
))
{
case
0
:
return
CockatriceFormat
;
case
1
:
return
CockatriceFormat
;
case
1
:
return
PlainTextFormat
;
case
2
:
return
PlainTextFormat
;
}
}
return
PlainTextFormat
;
return
PlainTextFormat
;
}
}
cockatrice/src/tab_supervisor.cpp
View file @
0da2647a
...
@@ -80,6 +80,7 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QWidget *parent)
...
@@ -80,6 +80,7 @@ TabSupervisor::TabSupervisor(AbstractClient *_client, QWidget *parent)
{
{
tabChangedIcon
=
new
QIcon
(
":/resources/icon_tab_changed.svg"
);
tabChangedIcon
=
new
QIcon
(
":/resources/icon_tab_changed.svg"
);
setElideMode
(
Qt
::
ElideRight
);
setElideMode
(
Qt
::
ElideRight
);
setMovable
(
true
);
setIconSize
(
QSize
(
15
,
15
));
setIconSize
(
QSize
(
15
,
15
));
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
updateCurrent
(
int
)));
connect
(
this
,
SIGNAL
(
currentChanged
(
int
)),
this
,
SLOT
(
updateCurrent
(
int
)));
...
...
common/decklist.cpp
View file @
0da2647a
...
@@ -449,8 +449,12 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
...
@@ -449,8 +449,12 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
line
.
remove
(
rx
);
line
.
remove
(
rx
);
rx
.
setPattern
(
"
\\
(.*
\\
)"
);
rx
.
setPattern
(
"
\\
(.*
\\
)"
);
line
.
remove
(
rx
);
line
.
remove
(
rx
);
//Filter out post card name editions
rx
.
setPattern
(
"
\\
|.*$"
);
line
.
remove
(
rx
);
line
=
line
.
simplified
();
line
=
line
.
simplified
();
int
i
=
line
.
indexOf
(
' '
);
int
i
=
line
.
indexOf
(
' '
);
bool
ok
;
bool
ok
;
int
number
=
line
.
left
(
i
).
toInt
(
&
ok
);
int
number
=
line
.
left
(
i
).
toInt
(
&
ok
);
...
...
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