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
faacac9d
Commit
faacac9d
authored
Sep 03, 2013
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GUI part of Courses Start page implementation
parent
df53a98f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
share/kumir2/coregui/startpage/russian/actions.js
share/kumir2/coregui/startpage/russian/actions.js
+2
-1
src/plugins/coregui/plugin.cpp
src/plugins/coregui/plugin.cpp
+15
-3
src/plugins/coregui/plugin.h
src/plugins/coregui/plugin.h
+2
-2
No files found.
share/kumir2/coregui/startpage/russian/actions.js
View file @
faacac9d
...
...
@@ -64,6 +64,7 @@ function loadHelpContents()
function
loadCourseContents
()
{
var
contents
=
gui
.
coursesList
();
var
paths
=
gui
.
coursesList
();
var
block
=
document
.
getElementById
(
"
courses_list
"
);
block
.
innerHTML
=
""
;
for
(
var
i
=
0
;
i
<
contents
.
length
;
i
++
)
{
...
...
@@ -74,7 +75,7 @@ function loadCourseContents()
if
(
i
==
contents
.
length
-
1
)
{
clazz
+=
"
last
"
;
}
var
onClick
=
'
gui.showCoursesWindow(
'
+
i
+
'
)
'
;
var
onClick
=
'
gui.showCoursesWindow(
"
'
+
paths
[
i
]
+
'
"
)
'
;
var
text
=
contents
[
i
];
var
line
=
"
<button class='
"
+
clazz
+
"
' onclick='
"
+
onClick
+
"
'>
"
+
text
+
"
</button>
\n
"
;
block
.
innerHTML
+=
line
;
...
...
src/plugins/coregui/plugin.cpp
View file @
faacac9d
...
...
@@ -502,16 +502,28 @@ void Plugin::startTesting()
kumirProgram_
->
testingRun
();
}
void
Plugin
::
showCoursesWindow
(
int
index
)
void
Plugin
::
showCoursesWindow
(
const
QString
&
id
)
{
if
(
courseManager_
&&
!
id
.
isEmpty
())
{
courseManager_
->
activateCourseFromList
(
id
);
}
if
(
coursesWindow_
)
{
coursesWindow_
->
activate
();
}
}
QStringList
Plugin
::
coursesList
()
const
QStringList
Plugin
::
coursesList
(
bool
fullPaths
)
const
{
return
QStringList
();
const
QStringList
files
=
courseManager_
->
getListOfCourses
();
if
(
fullPaths
)
return
files
;
else
{
QStringList
result
;
for
(
int
i
=
0
;
i
<
files
.
size
();
i
++
)
{
result
<<
QFileInfo
(
files
[
i
]).
fileName
();
}
return
result
;
}
}
void
Plugin
::
showHelpWindow
(
int
index
)
...
...
src/plugins/coregui/plugin.h
View file @
faacac9d
...
...
@@ -57,8 +57,8 @@ public slots:
bool
showWorkspaceChooseDialog
();
// for JavaScript
void
showCoursesWindow
(
int
index
);
QStringList
coursesList
()
const
;
void
showCoursesWindow
(
const
QString
&
id
);
QStringList
coursesList
(
bool
fullPaths
)
const
;
void
showHelpWindow
(
int
index
);
QStringList
helpList
()
const
;
...
...
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