Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
05f5ae1e
Commit
05f5ae1e
authored
Jan 16, 2015
by
Denis Khachko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Course cosmetic fixes.
parent
1236be55
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
19 deletions
+40
-19
src/plugins/coursemanager/coursemanager_plugin.cpp
src/plugins/coursemanager/coursemanager_plugin.cpp
+1
-0
src/plugins/coursemanager/coursemanager_plugin.h
src/plugins/coursemanager/coursemanager_plugin.h
+1
-1
src/plugins/coursemanager/task/mainwindow.cpp
src/plugins/coursemanager/task/mainwindow.cpp
+37
-18
src/plugins/coursemanager/task/mainwindow.h
src/plugins/coursemanager/task/mainwindow.h
+1
-0
No files found.
src/plugins/coursemanager/coursemanager_plugin.cpp
View file @
05f5ae1e
...
...
@@ -262,6 +262,7 @@ void Plugin::setEnabled(bool value)
{
}
bool
Plugin
::
isSafeToQuit
(){
return
MW
->
safeToQuit
();};
void
Plugin
::
setTestingResult
(
ProgramRunStatus
status
,
int
value
)
{
...
...
src/plugins/coursemanager/coursemanager_plugin.h
View file @
05f5ae1e
...
...
@@ -47,7 +47,7 @@ public:
return
mySettings
()
->
value
(
"Courses/LastFiles"
,
""
).
toString
().
split
(
";"
,
QString
::
SkipEmptyParts
);
}
void
rebuildRescentMenu
();
bool
isSafeToQuit
();
public
slots
:
void
setEnabled
(
bool
value
);
void
setTestingResult
(
ProgramRunStatus
status
,
int
value
);
...
...
src/plugins/coursemanager/task/mainwindow.cpp
View file @
05f5ae1e
...
...
@@ -830,29 +830,48 @@ void MainWindowTask::closeEvent(QCloseEvent *event)
qDebug
()
<<
"CLOSE TASK WINDOW"
;
if
(
!
course
)
return
;
qDebug
()
<<
"START CLOSE TASK WINDOW"
;
if
(
!
cursWorkFile
.
exists
())
{
QMessageBox
::
StandardButton
ans
;
ans
=
QMessageBox
::
question
(
this
,
trUtf8
(
"Курсы"
),
trUtf8
(
"Вы хотите сохранить работу?"
),
QMessageBox
::
Yes
|
QMessageBox
::
No
,
QMessageBox
::
Yes
);
if
(
ans
==
QMessageBox
::
No
)
{
event
->
accept
();
if
(
course
)
delete
course
;
course
=
NULL
;
return
;
};
if
(
ans
==
QMessageBox
::
Cancel
){
event
->
ignore
();
return
;};
saveCourse
();
}
markProgChange
();
qDebug
()
<<
"CLOSE TASK WINDOW"
;
event
->
accept
();
close
();
};
bool
MainWindowTask
::
safeToQuit
()
{
if
(
!
course
)
return
true
;
if
(
!
cursWorkFile
.
exists
())
{
QMessageBox
msgBoxCreateWorkbook
(
QMessageBox
::
Question
,
trUtf8
(
"Практикум"
),
trUtf8
(
"Вы хотите сохранить работу?"
),
QMessageBox
::
Yes
|
QMessageBox
::
No
|
QMessageBox
::
Cancel
,
this
);
msgBoxCreateWorkbook
.
button
(
QMessageBox
::
Yes
)
->
setText
(
trUtf8
(
"Да"
));
msgBoxCreateWorkbook
.
button
(
QMessageBox
::
No
)
->
setText
(
trUtf8
(
"Нет"
));
msgBoxCreateWorkbook
.
button
(
QMessageBox
::
Cancel
)
->
setText
(
trUtf8
(
"Отмена"
));
int
ans
=
msgBoxCreateWorkbook
.
exec
();
// ans = QMessageBox::question(this, trUtf8("Практикум"), trUtf8("Вы хотите создать тетрадь?"),
// QMessageBox::Yes | QMessageBox::No , QMessageBox::Yes);
if
(
ans
==
QMessageBox
::
Yes
)
{
saveCourse
();
return
true
;
};
if
(
ans
==
QMessageBox
::
No
)
{
return
true
;
}
if
(
ans
==
QMessageBox
::
Cancel
)
{
return
false
;
}
}
return
true
;
};
void
MainWindowTask
::
returnTested
()
{
interface
->
setPreProgram
(
QVariant
(
course
->
getUserTestedText
(
curTaskIdx
.
internalId
())));
...
...
src/plugins/coursemanager/task/mainwindow.h
View file @
05f5ae1e
...
...
@@ -100,6 +100,7 @@ Q_SIGNALS:
void
activateRequest
();
public
slots
:
bool
safeToQuit
();
void
aboutToQuit
();
void
openRescent
();
void
loadCourse
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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