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
72c5b4eb
Commit
72c5b4eb
authored
Jun 24, 2010
by
Max-Wilhelm Bruker
Browse files
minor oracle importer improvement
parent
d884e72a
Changes
2
Hide whitespace changes
Inline
Side-by-side
oracle/src/window_main.cpp
View file @
72c5b4eb
...
@@ -27,11 +27,21 @@ WindowMain::WindowMain(QWidget *parent)
...
@@ -27,11 +27,21 @@ WindowMain::WindowMain(QWidget *parent)
checkboxArea
->
setWidget
(
checkboxFrame
);
checkboxArea
->
setWidget
(
checkboxFrame
);
checkboxArea
->
setWidgetResizable
(
true
);
checkboxArea
->
setWidgetResizable
(
true
);
checkAllButton
=
new
QPushButton
(
tr
(
"&Check all"
));
connect
(
checkAllButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
actCheckAll
()));
uncheckAllButton
=
new
QPushButton
(
tr
(
"&Uncheck all"
));
connect
(
uncheckAllButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
actUncheckAll
()));
QHBoxLayout
*
checkAllButtonLayout
=
new
QHBoxLayout
;
checkAllButtonLayout
->
addWidget
(
checkAllButton
);
checkAllButtonLayout
->
addWidget
(
uncheckAllButton
);
startButton
=
new
QPushButton
(
tr
(
"&Start download"
));
startButton
=
new
QPushButton
(
tr
(
"&Start download"
));
connect
(
startButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
actStart
()));
connect
(
startButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
actStart
()));
QVBoxLayout
*
settingsLayout
=
new
QVBoxLayout
;
QVBoxLayout
*
settingsLayout
=
new
QVBoxLayout
;
settingsLayout
->
addWidget
(
checkboxArea
);
settingsLayout
->
addWidget
(
checkboxArea
);
settingsLayout
->
addLayout
(
checkAllButtonLayout
);
settingsLayout
->
addWidget
(
startButton
);
settingsLayout
->
addWidget
(
startButton
);
totalLabel
=
new
QLabel
(
tr
(
"Total progress:"
));
totalLabel
=
new
QLabel
(
tr
(
"Total progress:"
));
...
@@ -155,12 +165,28 @@ void WindowMain::updateFileProgress(int bytesRead, int totalBytes)
...
@@ -155,12 +165,28 @@ void WindowMain::updateFileProgress(int bytesRead, int totalBytes)
fileProgressBar
->
setValue
(
bytesRead
);
fileProgressBar
->
setValue
(
bytesRead
);
}
}
void
WindowMain
::
actCheckAll
()
{
for
(
int
i
=
0
;
i
<
checkBoxList
.
size
();
++
i
)
checkBoxList
[
i
]
->
setChecked
(
true
);
}
void
WindowMain
::
actUncheckAll
()
{
for
(
int
i
=
0
;
i
<
checkBoxList
.
size
();
++
i
)
checkBoxList
[
i
]
->
setChecked
(
false
);
}
void
WindowMain
::
actStart
()
void
WindowMain
::
actStart
()
{
{
startButton
->
setEnabled
(
false
);
int
setsCount
=
importer
->
startDownload
();
if
(
!
setsCount
)
{
QMessageBox
::
critical
(
this
,
tr
(
"Error"
),
tr
(
"No sets to download selected."
));
return
;
}
for
(
int
i
=
0
;
i
<
checkBoxList
.
size
();
++
i
)
for
(
int
i
=
0
;
i
<
checkBoxList
.
size
();
++
i
)
checkBoxList
[
i
]
->
setEnabled
(
false
);
checkBoxList
[
i
]
->
setEnabled
(
false
);
int
setsCount
=
importer
->
startDownload
(
);
startButton
->
setEnabled
(
false
);
totalProgressBar
->
setMaximum
(
setsCount
);
totalProgressBar
->
setMaximum
(
setsCount
);
}
}
...
...
oracle/src/window_main.h
View file @
72c5b4eb
...
@@ -25,7 +25,7 @@ private:
...
@@ -25,7 +25,7 @@ private:
QMenu
*
fileMenu
;
QMenu
*
fileMenu
;
QAction
*
aLoadSetsFile
,
*
aDownloadSetsFile
,
*
aExit
;
QAction
*
aLoadSetsFile
,
*
aDownloadSetsFile
,
*
aExit
;
QPushButton
*
startButton
;
QPushButton
*
checkAllButton
,
*
uncheckAllButton
,
*
startButton
;
QLabel
*
totalLabel
,
*
fileLabel
,
*
nextSetLabel1
,
*
nextSetLabel2
;
QLabel
*
totalLabel
,
*
fileLabel
,
*
nextSetLabel1
,
*
nextSetLabel2
;
QProgressBar
*
totalProgressBar
,
*
fileProgressBar
;
QProgressBar
*
totalProgressBar
,
*
fileProgressBar
;
QTextEdit
*
messageLog
;
QTextEdit
*
messageLog
;
...
@@ -37,6 +37,8 @@ private slots:
...
@@ -37,6 +37,8 @@ private slots:
void
updateTotalProgress
(
int
cardsImported
,
int
setIndex
,
const
QString
&
nextSetName
);
void
updateTotalProgress
(
int
cardsImported
,
int
setIndex
,
const
QString
&
nextSetName
);
void
updateFileProgress
(
int
bytesRead
,
int
totalBytes
);
void
updateFileProgress
(
int
bytesRead
,
int
totalBytes
);
void
updateSetList
();
void
updateSetList
();
void
actCheckAll
();
void
actUncheckAll
();
void
actStart
();
void
actStart
();
void
actLoadSetsFile
();
void
actLoadSetsFile
();
void
actDownloadSetsFile
();
void
actDownloadSetsFile
();
...
...
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