Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Csuper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Dalan94
Csuper
Commits
29988f69
Verified
Commit
29988f69
authored
Oct 01, 2017
by
Rémi BERTHO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge all scripts
parent
ad1c40ac
Changes
102
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
102 changed files
with
1683 additions
and
1433 deletions
+1683
-1433
CMakeLists.txt
CMakeLists.txt
+6
-14
Changelog.md
Changelog.md
+7
-6
Man/csuper-cli.1.gz
Man/csuper-cli.1.gz
+0
-0
Man/csuper-gtk.1.gz
Man/csuper-gtk.1.gz
+0
-0
Sources/csuper-cli/cin.h
Sources/csuper-cli/cin.h
+2
-2
Sources/csuper-cli/command_line_option.h
Sources/csuper-cli/command_line_option.h
+2
-2
Sources/csuper-cli/main.cpp
Sources/csuper-cli/main.cpp
+27
-21
Sources/csuper-cli/menu.cpp
Sources/csuper-cli/menu.cpp
+4
-4
Sources/csuper-cli/menu.h
Sources/csuper-cli/menu.h
+2
-2
Sources/csuper-cli/play_game.h
Sources/csuper-cli/play_game.h
+4
-4
Sources/csuper-cli/text_style.h
Sources/csuper-cli/text_style.h
+2
-2
Sources/csuper-gtk/about.h
Sources/csuper-gtk/about.h
+2
-2
Sources/csuper-gtk/change_distributor_dialog.h
Sources/csuper-gtk/change_distributor_dialog.h
+2
-2
Sources/csuper-gtk/chart_grid.cpp
Sources/csuper-gtk/chart_grid.cpp
+16
-17
Sources/csuper-gtk/chart_grid.h
Sources/csuper-gtk/chart_grid.h
+6
-6
Sources/csuper-gtk/chart_points_grid.h
Sources/csuper-gtk/chart_points_grid.h
+3
-3
Sources/csuper-gtk/chart_total_points_grid.h
Sources/csuper-gtk/chart_total_points_grid.h
+3
-3
Sources/csuper-gtk/csu_application.cpp
Sources/csuper-gtk/csu_application.cpp
+1
-1
Sources/csuper-gtk/csu_application.h
Sources/csuper-gtk/csu_application.h
+8
-8
Sources/csuper-gtk/csu_widget.h
Sources/csuper-gtk/csu_widget.h
+2
-2
Sources/csuper-gtk/delete_turn_dialog.h
Sources/csuper-gtk/delete_turn_dialog.h
+2
-2
Sources/csuper-gtk/display_dialog.h
Sources/csuper-gtk/display_dialog.h
+2
-2
Sources/csuper-gtk/display_preferences.h
Sources/csuper-gtk/display_preferences.h
+2
-2
Sources/csuper-gtk/edit_turn_dialog.h
Sources/csuper-gtk/edit_turn_dialog.h
+2
-2
Sources/csuper-gtk/exportation_preferences.h
Sources/csuper-gtk/exportation_preferences.h
+2
-2
Sources/csuper-gtk/file_properties_dialog.h
Sources/csuper-gtk/file_properties_dialog.h
+2
-2
Sources/csuper-gtk/game_configuration_window.h
Sources/csuper-gtk/game_configuration_window.h
+2
-2
Sources/csuper-gtk/game_information_view.h
Sources/csuper-gtk/game_information_view.h
+2
-2
Sources/csuper-gtk/game_over_dialog.h
Sources/csuper-gtk/game_over_dialog.h
+2
-2
Sources/csuper-gtk/html_preferences.h
Sources/csuper-gtk/html_preferences.h
+2
-2
Sources/csuper-gtk/import_export_game_configuration_dialog.h
Sources/csuper-gtk/import_export_game_configuration_dialog.h
+2
-2
Sources/csuper-gtk/main.cpp
Sources/csuper-gtk/main.cpp
+5
-5
Sources/csuper-gtk/main_window.cpp
Sources/csuper-gtk/main_window.cpp
+2
-2
Sources/csuper-gtk/main_window.h
Sources/csuper-gtk/main_window.h
+2
-2
Sources/csuper-gtk/menu_display.h
Sources/csuper-gtk/menu_display.h
+4
-4
Sources/csuper-gtk/menu_edit.h
Sources/csuper-gtk/menu_edit.h
+2
-2
Sources/csuper-gtk/menu_file.cpp
Sources/csuper-gtk/menu_file.cpp
+2
-2
Sources/csuper-gtk/menu_file.h
Sources/csuper-gtk/menu_file.h
+4
-4
Sources/csuper-gtk/new_file_assistant.h
Sources/csuper-gtk/new_file_assistant.h
+2
-2
Sources/csuper-gtk/new_file_assistant_page_1.h
Sources/csuper-gtk/new_file_assistant_page_1.h
+2
-2
Sources/csuper-gtk/new_file_assistant_page_2.h
Sources/csuper-gtk/new_file_assistant_page_2.h
+2
-2
Sources/csuper-gtk/new_file_assistant_page_3.h
Sources/csuper-gtk/new_file_assistant_page_3.h
+2
-2
Sources/csuper-gtk/new_game_configuration_dialog.h
Sources/csuper-gtk/new_game_configuration_dialog.h
+2
-2
Sources/csuper-gtk/open_dialog.h
Sources/csuper-gtk/open_dialog.h
+2
-2
Sources/csuper-gtk/players_names_view.h
Sources/csuper-gtk/players_names_view.h
+2
-2
Sources/csuper-gtk/points_view.h
Sources/csuper-gtk/points_view.h
+2
-2
Sources/csuper-gtk/preferences_window.h
Sources/csuper-gtk/preferences_window.h
+2
-2
Sources/csuper-gtk/ranking_view.h
Sources/csuper-gtk/ranking_view.h
+2
-2
Sources/csuper-gtk/save_dialog.h
Sources/csuper-gtk/save_dialog.h
+2
-2
Sources/csuper-gtk/statistics_grid.h
Sources/csuper-gtk/statistics_grid.h
+2
-2
Sources/libcsuper/abstract_preference.cpp
Sources/libcsuper/abstract_preference.cpp
+24
-24
Sources/libcsuper/abstract_preference.h
Sources/libcsuper/abstract_preference.h
+26
-26
Sources/libcsuper/calculator.h
Sources/libcsuper/calculator.h
+2
-2
Sources/libcsuper/exception_list.cpp
Sources/libcsuper/exception_list.cpp
+23
-23
Sources/libcsuper/exception_list.h
Sources/libcsuper/exception_list.h
+23
-23
Sources/libcsuper/exceptions.cpp
Sources/libcsuper/exceptions.cpp
+23
-23
Sources/libcsuper/exceptions.h
Sources/libcsuper/exceptions.h
+51
-51
Sources/libcsuper/game.cpp
Sources/libcsuper/game.cpp
+2
-2
Sources/libcsuper/game.h
Sources/libcsuper/game.h
+4
-4
Sources/libcsuper/game_configuration.h
Sources/libcsuper/game_configuration.h
+2
-2
Sources/libcsuper/libcsuper.h
Sources/libcsuper/libcsuper.h
+23
-23
Sources/libcsuper/list_game_configuration.cpp
Sources/libcsuper/list_game_configuration.cpp
+5
-5
Sources/libcsuper/list_game_configuration.h
Sources/libcsuper/list_game_configuration.h
+2
-2
Sources/libcsuper/pdf_exportation.cpp
Sources/libcsuper/pdf_exportation.cpp
+32
-32
Sources/libcsuper/pdf_exportation.h
Sources/libcsuper/pdf_exportation.h
+25
-25
Sources/libcsuper/player.h
Sources/libcsuper/player.h
+2
-2
Sources/libcsuper/preferences.cpp
Sources/libcsuper/preferences.cpp
+25
-25
Sources/libcsuper/preferences.h
Sources/libcsuper/preferences.h
+35
-35
Sources/libcsuper/preferences_chart_exportation.cpp
Sources/libcsuper/preferences_chart_exportation.cpp
+23
-23
Sources/libcsuper/preferences_chart_exportation.h
Sources/libcsuper/preferences_chart_exportation.h
+29
-29
Sources/libcsuper/preferences_difference_between_player.cpp
Sources/libcsuper/preferences_difference_between_player.cpp
+23
-23
Sources/libcsuper/preferences_difference_between_player.h
Sources/libcsuper/preferences_difference_between_player.h
+29
-29
Sources/libcsuper/preferences_directory.h
Sources/libcsuper/preferences_directory.h
+4
-4
Sources/libcsuper/preferences_export_pdf.h
Sources/libcsuper/preferences_export_pdf.h
+13
-13
Sources/libcsuper/preferences_main_window_display.cpp
Sources/libcsuper/preferences_main_window_display.cpp
+23
-23
Sources/libcsuper/preferences_main_window_display.h
Sources/libcsuper/preferences_main_window_display.h
+28
-28
Sources/libcsuper/preferences_main_window_size.h
Sources/libcsuper/preferences_main_window_size.h
+6
-6
Sources/libcsuper/preferences_main_window_title_bar.h
Sources/libcsuper/preferences_main_window_title_bar.h
+5
-5
Sources/libcsuper/preferences_score_display.h
Sources/libcsuper/preferences_score_display.h
+6
-6
Sources/libcsuper/preferences_version.cpp
Sources/libcsuper/preferences_version.cpp
+23
-23
Sources/libcsuper/preferences_version.h
Sources/libcsuper/preferences_version.h
+27
-27
Sources/libcsuper/share.cpp
Sources/libcsuper/share.cpp
+11
-11
Sources/libcsuper/share.h
Sources/libcsuper/share.h
+3
-3
Sources/libcsuper/undo_redo_manager.h
Sources/libcsuper/undo_redo_manager.h
+2
-2
Sources/libcsuper/version.h
Sources/libcsuper/version.h
+2
-2
Translations/csuper-cli/fr.po
Translations/csuper-cli/fr.po
+6
-6
Translations/csuper-cli/messages.pot
Translations/csuper-cli/messages.pot
+6
-6
Translations/csuper-gtk/fr.po
Translations/csuper-gtk/fr.po
+325
-281
Translations/csuper-gtk/messages.pot
Translations/csuper-gtk/messages.pot
+325
-281
Translations/libcsuper/fr.po
Translations/libcsuper/fr.po
+4
-4
Translations/libcsuper/messages.pot
Translations/libcsuper/messages.pot
+4
-4
compile_translations
compile_translations
+0
-11
create_doc.sh
create_doc.sh
+0
-5
install_csuper-cli
install_csuper-cli
+0
-7
install_csuper-gtk
install_csuper-gtk
+0
-12
install_libcsuper
install_libcsuper
+0
-11
uninstall_csuper-cli
uninstall_csuper-cli
+0
-5
uninstall_csuper-gtk
uninstall_csuper-gtk
+0
-9
uninstall_libcsuper
uninstall_libcsuper
+0
-9
update_man_pages
update_man_pages
+0
-7
update_translations
update_translations
+0
-21
utility.sh
utility.sh
+261
-0
No files found.
CMakeLists.txt
View file @
29988f69
...
...
@@ -76,11 +76,9 @@ link_directories(
)
IF
(
UNIX
)
add_custom_target
(
translation
COMMAND sh
${
CMAKE_CURRENT_SOURCE_DIR
}
/compile_translations
${
CMAKE_CURRENT_SOURCE_DIR
}
)
ENDIF
()
#Unix
add_custom_target
(
all_updates
COMMAND bash
${
CMAKE_CURRENT_SOURCE_DIR
}
/utility.sh -a
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_subdirectory
(
"Externals_libraries/AsynchronousExecution"
)
...
...
@@ -136,9 +134,7 @@ IF(NOT (LIB MATCHES "FALSE"))
PRIVATE cxx_range_for cxx_generic_lambdas
)
IF
(
UNIX
)
add_dependencies
(
csuper translation
)
ENDIF
()
#Unix
add_dependencies
(
csuper all_updates
)
install
(
TARGETS csuper RUNTIME DESTINATION bin LIBRARY DESTINATION lib
)
install
(
FILES
${
headers_files_libcsuper
}
DESTINATION include/libcsuper
)
...
...
@@ -202,9 +198,7 @@ IF(NOT (CLI MATCHES "FALSE"))
PRIVATE cxx_range_for cxx_generic_lambdas
)
IF
(
UNIX
)
add_dependencies
(
csuper translation
)
ENDIF
()
#Unix
add_dependencies
(
csuper all_updates
)
install
(
TARGETS csuper-cli DESTINATION share/csuper
)
install
(
FILES Locales/fr_FR/LC_MESSAGES/csuper-cli.mo DESTINATION share/csuper/Locales/fr_FR/LC_MESSAGES
)
...
...
@@ -275,9 +269,7 @@ IF(NOT (GTK MATCHES "FALSE"))
PRIVATE cxx_range_for cxx_generic_lambdas
)
IF
(
UNIX
)
add_dependencies
(
csuper translation
)
ENDIF
()
#Unix
add_dependencies
(
csuper all_updates
)
install
(
TARGETS csuper-gtk DESTINATION share/csuper
)
install
(
FILES Locales/fr_FR/LC_MESSAGES/csuper-gtk.mo DESTINATION share/csuper/Locales/fr_FR/LC_MESSAGES
)
...
...
Changelog.md
View file @
29988f69
Libcsuper
=========
#Libcsuper
4.
3.2
...
...
@@ -7,6 +6,7 @@ Libcsuper
*
Improve XML
*
Add export to markdown
*
Add logs
*
Upgrade slope
4.
3.1
...
...
@@ -58,8 +58,7 @@ Libcsuper
*
Add the possibility to import and export game configurations
Csuper-cli
==========
#Csuper-cli
4.
3.2
...
...
@@ -97,14 +96,16 @@ Csuper-cli
*
Add the possibility to import and export game configurations
Csuper-gtk
==========
#Csuper-gtk
4.
3.2
*
Add save and export file asynchronous
*
Add export to markdown
*
Add logs
*
Merge statistics and charts windows
*
Upgrade slope
*
Improve HTML version
4.
3.0
...
...
Man/csuper-cli.1.gz
View file @
29988f69
No preview for this file type
Man/csuper-gtk.1.gz
View file @
29988f69
No preview for this file type
Sources/csuper-cli/cin.h
View file @
29988f69
...
...
@@ -37,8 +37,8 @@
#include <glibmm.h>
/*! \class Cin
* \brief This class is for Cin
*/
* \brief This class is for Cin
*/
class
Cin
{
public:
...
...
Sources/csuper-cli/command_line_option.h
View file @
29988f69
...
...
@@ -37,8 +37,8 @@
#include <glibmm.h>
/*! \class CommandLineOption
* \brief This class is used to retrieve the command line option
*/
* \brief This class is used to retrieve the command line option
*/
class
CommandLineOption
{
///////////////////////////////////////////////////////////////////////////////////
...
...
Sources/csuper-cli/main.cpp
View file @
29988f69
...
...
@@ -60,30 +60,30 @@ void terminateFunction()
#ifdef GLIB_AVAILABLE_IN_2_50
GLogWriterOutput
logWriterFunction
(
GLogLevelFlags
log_level
,
const
GLogField
*
fields
,
gsize
n_fields
,
gpointer
user_data
)
#else
void
logWriterFunction
(
const
gchar
*
log_domain
,
GLogLevelFlags
log_level
,
const
gchar
*
message
,
gpointer
user_data
)
void
logWriterFunction
(
const
gchar
*
log_domain
,
GLogLevelFlags
log_level
,
const
gchar
*
message
,
gpointer
user_data
)
#endif
{
map
<
ustring
,
ustring
>
str_fields
;
DateTime
current_time
=
DateTime
::
create_now_local
();
ostringstream
log_message
;
ofstream
log_file
;
ustring
log_filename
;
auto
print_log_level
=
static_cast
<
CommandLineOption
::
LogLevel
>
(
reinterpret_cast
<
uintptr_t
>
(
user_data
));
DateTime
current_time
=
DateTime
::
create_now_local
();
ostringstream
log_message
;
ofstream
log_file
;
ustring
log_filename
;
auto
print_log_level
=
static_cast
<
CommandLineOption
::
LogLevel
>
(
reinterpret_cast
<
uintptr_t
>
(
user_data
));
// Check if log need to be written
if
(((
print_log_level
==
CommandLineOption
::
WARNING
)
&&
(
log_level
>
G_LOG_LEVEL_WARNING
))
||
((
print_log_level
==
CommandLineOption
::
INFO
)
&&
(
log_level
>
G_LOG_LEVEL_INFO
)))
{
#ifdef GLIB_AVAILABLE_IN_2_50
#ifdef GLIB_AVAILABLE_IN_2_50
return
G_LOG_WRITER_HANDLED
;
#else
#else
return
;
#endif
#endif
}
// Convert to map
// Convert to map
#ifdef GLIB_AVAILABLE_IN_2_50
for
(
guint
i
=
0
;
i
<
n_fields
;
i
++
)
for
(
guint
i
=
0
;
i
<
n_fields
;
i
++
)
str_fields
[
fields
[
i
].
key
]
=
(
char
*
)
fields
[
i
].
value
;
#else
str_fields
[
"MESSAGE"
]
=
message
;
...
...
@@ -198,16 +198,22 @@ int main(int argc, char* argv[])
// Set error and log functions
set_terminate
(
terminateFunction
);
#ifdef GLIB_AVAILABLE_IN_2_50
#ifdef GLIB_AVAILABLE_IN_2_50
g_log_set_writer_func
(
&
logWriterFunction
,
reinterpret_cast
<
gpointer
>
(
clo
.
getLogLevel
()),
NULL
);
g_log_structured
(
G_LOG_DOMAIN
,
G_LOG_LEVEL_DEBUG
,
"MESSAGE"
,
"Csuper-cli start"
);
#else
g_log_set_handler
(
"libcsuper"
,
(
GLogLevelFlags
)
(
G_LOG_LEVEL_DEBUG
|
G_LOG_LEVEL_INFO
|
G_LOG_LEVEL_WARNING
|
G_LOG_LEVEL_ERROR
|
G_LOG_FLAG_FATAL
|
G_LOG_FLAG_RECURSION
),
&
logWriterFunction
,
reinterpret_cast
<
gpointer
>
(
clo
.
getLogLevel
()));
g_log_set_handler
(
"csuper-cli"
,
(
GLogLevelFlags
)
(
G_LOG_LEVEL_DEBUG
|
G_LOG_LEVEL_INFO
|
G_LOG_LEVEL_WARNING
|
G_LOG_LEVEL_ERROR
|
G_LOG_FLAG_FATAL
|
G_LOG_FLAG_RECURSION
),
&
logWriterFunction
,
reinterpret_cast
<
gpointer
>
(
clo
.
getLogLevel
()));
#else
g_log_set_handler
(
"libcsuper"
,
(
GLogLevelFlags
)(
G_LOG_LEVEL_DEBUG
|
G_LOG_LEVEL_INFO
|
G_LOG_LEVEL_WARNING
|
G_LOG_LEVEL_ERROR
|
G_LOG_FLAG_FATAL
|
G_LOG_FLAG_RECURSION
),
&
logWriterFunction
,
reinterpret_cast
<
gpointer
>
(
clo
.
getLogLevel
()));
g_log_set_handler
(
"csuper-cli"
,
(
GLogLevelFlags
)(
G_LOG_LEVEL_DEBUG
|
G_LOG_LEVEL_INFO
|
G_LOG_LEVEL_WARNING
|
G_LOG_LEVEL_ERROR
|
G_LOG_FLAG_FATAL
|
G_LOG_FLAG_RECURSION
),
&
logWriterFunction
,
reinterpret_cast
<
gpointer
>
(
clo
.
getLogLevel
()));
g_debug
(
"Csuper-cli start"
);
#endif
#endif
// Initialization of csuper
try
...
...
@@ -430,11 +436,11 @@ int main(int argc, char* argv[])
break
;
}
#ifdef GLIB_AVAILABLE_IN_2_50
#ifdef GLIB_AVAILABLE_IN_2_50
g_log_structured
(
G_LOG_DOMAIN
,
G_LOG_LEVEL_DEBUG
,
"MESSAGE"
,
"Csuper-cli end"
);
#else
#else
g_debug
(
"Csuper-cli end"
);
#endif
#endif
return
EXIT_SUCCESS
;
}
Sources/csuper-cli/menu.cpp
View file @
29988f69
...
...
@@ -331,7 +331,7 @@ void Menu::loadGame() const
}
catch
(
Glib
::
Exception
&
e
)
{
g_info
(
"%s"
,
e
.
what
().
c_str
());
g_info
(
"%s"
,
e
.
what
().
c_str
());
cout
<<
e
.
what
()
<<
endl
;
systemPause
();
return
;
...
...
@@ -366,7 +366,7 @@ void Menu::listFile() const
}
catch
(
Glib
::
Error
&
e
)
{
g_warning
(
"%s"
,
e
.
what
().
c_str
());
g_warning
(
"%s"
,
e
.
what
().
c_str
());
}
systemPause
();
}
...
...
@@ -415,7 +415,7 @@ void Menu::checkForUpdate(const bool auto_check)
}
catch
(
Glib
::
Exception
&
e
)
{
g_warning
(
"%s"
,
e
.
what
().
c_str
());
g_warning
(
"%s"
,
e
.
what
().
c_str
());
if
(
!
auto_check
)
cout
<<
ustring
(
_
(
"Cannot access to the latest version file on the internet"
))
<<
endl
<<
endl
;
}
...
...
@@ -448,7 +448,7 @@ void Menu::displayFile() const
}
catch
(
Glib
::
Exception
&
e
)
{
g_info
(
"%s"
,
e
.
what
().
c_str
());
g_info
(
"%s"
,
e
.
what
().
c_str
());
cout
<<
e
.
what
()
<<
endl
;
}
...
...
Sources/csuper-cli/menu.h
View file @
29988f69
...
...
@@ -36,8 +36,8 @@
#include "libcsuper/libcsuper.h"
/*! \class Menu
* \brief This class is used for the main menu
*/
* \brief This class is used for the main menu
*/
class
Menu
{
private:
...
...
Sources/csuper-cli/play_game.h
View file @
29988f69
...
...
@@ -36,8 +36,8 @@
#include "game_cli.h"
/*! \class PlayGame
* \brief This class is used to play a game
*/
* \brief This class is used to play a game
*/
class
PlayGame
{
private:
...
...
@@ -47,8 +47,8 @@ private:
/*!
* Ask and save the new points
*/
* Ask and save the new points
*/
void
playersPoints
()
const
;
/*!
...
...
Sources/csuper-cli/text_style.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
/*! \class TextStyle
* \brief This class is used to set a text style in a terminal
*/
* \brief This class is used to set a text style in a terminal
*/
class
TextStyle
{
public:
...
...
Sources/csuper-gtk/about.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class About
* \brief This class represent the about dialog
*/
* \brief This class represent the about dialog
*/
class
About
:
public
CsuWidget
,
public
Gtk
::
AboutDialog
{
protected:
...
...
Sources/csuper-gtk/change_distributor_dialog.h
View file @
29988f69
...
...
@@ -39,8 +39,8 @@
#include "csu_widget.h"
/*! \class ChangeDistributorDialog
* \brief This class represent the change distributor dialog
*/
* \brief This class represent the change distributor dialog
*/
class
ChangeDistributorDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
protected:
...
...
Sources/csuper-gtk/chart_grid.cpp
View file @
29988f69
...
...
@@ -91,7 +91,7 @@ void ChartGrid::freeSlope()
}
if
(
slope_figure
!=
nullptr
)
{
//slope_figure_destroy(slope_figure);
//
slope_figure_destroy(slope_figure);
slope_figure
=
nullptr
;
}
if
(
slope_items
!=
nullptr
)
...
...
@@ -101,7 +101,7 @@ void ChartGrid::freeSlope()
}
if
(
slope_scale
!=
nullptr
)
{
//slope_scale_destroy(slope_scale);
//
slope_scale_destroy(slope_scale);
slope_figure
=
nullptr
;
}
...
...
@@ -138,15 +138,15 @@ void ChartGrid::update(const bool total_points)
slope_points
=
new
double
*
[
app
()
->
game
()
->
nbPlayer
()];
slope_items
=
(
SlopeItem
**
)
malloc
(
sizeof
(
SlopeItem
*
)
*
app
()
->
game
()
->
nbPlayer
());
slope_scale
=
slope_xyscale_new_axis
(
_
(
"Turns"
),
_
(
"Points"
),
title
.
c_str
());
SlopeItem
*
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_BOTTOM
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_DEFAULT_DOWN_GRID
);
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_LEFT
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_DEFAULT_DOWN_GRID
);
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_TOP
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_LINE
|
SLOPE_XYAXIS_TITLE
);
slope_scale
=
slope_xyscale_new_axis
(
_
(
"Turns"
),
_
(
"Points"
),
title
.
c_str
());
SlopeItem
*
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_BOTTOM
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_DEFAULT_DOWN_GRID
);
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_LEFT
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_DEFAULT_DOWN_GRID
);
axis
=
slope_xyscale_get_axis
(
SLOPE_XYSCALE
(
slope_scale
),
SLOPE_XYSCALE_AXIS_TOP
);
slope_xyaxis_set_components
(
SLOPE_XYAXIS
(
axis
),
SLOPE_XYAXIS_LINE
|
SLOPE_XYAXIS_TITLE
);
for
(
i
=
0
;
i
<=
app
()
->
game
()
->
maxNbTurn
();
i
++
)
for
(
i
=
0
;
i
<=
app
()
->
game
()
->
maxNbTurn
();
i
++
)
slope_turn
[
i
]
=
i
;
// Create the slope chart
...
...
@@ -155,16 +155,15 @@ void ChartGrid::update(const bool total_points)
slope_points
[
i
]
=
new
double
[
app
()
->
game
()
->
nbTurn
(
i
)
+
1
];
if
(
!
(
total_points_
))
{
for
(
j
=
0
;
j
<=
app
()
->
game
()
->
nbTurn
(
i
);
j
++
)
for
(
j
=
0
;
j
<=
app
()
->
game
()
->
nbTurn
(
i
);
j
++
)
slope_points
[
i
][
j
]
=
app
()
->
game
()
->
points
(
i
,
j
);
}
else
{
for
(
j
=
0
;
j
<=
app
()
->
game
()
->
nbTurn
(
i
);
j
++
)
for
(
j
=
0
;
j
<=
app
()
->
game
()
->
nbTurn
(
i
);
j
++
)
slope_points
[
i
][
j
]
=
app
()
->
game
()
->
totalPoints
(
i
,
j
);
}
slope_items
[
i
]
=
slope_xyseries_new_filled
(
app
()
->
game
()
->
playerName
(
i
).
c_str
(),
slope_items
[
i
]
=
slope_xyseries_new_filled
(
app
()
->
game
()
->
playerName
(
i
).
c_str
(),
slope_turn
,
slope_points
[
i
],
app
()
->
game
()
->
nbTurn
(
i
)
+
1
,
...
...
@@ -308,9 +307,9 @@ bool ChartGrid::drawChart(const Cairo::RefPtr<Cairo::Context>& cr)
chart_height
=
chart_
->
get_allocated_height
();
SlopeRect
rect
;
rect
.
x
=
0.0
;
rect
.
y
=
0.0
;
rect
.
width
=
(
double
)
chart_width
;
rect
.
x
=
0.0
;
rect
.
y
=
0.0
;
rect
.
width
=
(
double
)
chart_width
;
rect
.
height
=
(
double
)
chart_height
;
slope_figure_draw
(
slope_figure
,
&
rect
,
cr
->
cobj
());
...
...
Sources/csuper-gtk/chart_grid.h
View file @
29988f69
...
...
@@ -39,8 +39,8 @@
#include "csu_widget.h"
/*! \class ChartWidget
* \brief This class represent the chart widget
*/
* \brief This class represent the chart widget
*/
class
ChartGrid
:
public
CsuWidget
,
public
Gtk
::
Grid
{
///////////////////////////////////////////////////////////////////////////////////
...
...
@@ -55,10 +55,10 @@ protected:
Gtk
::
DrawingArea
*
chart_
;
/*!< The chart */
Gtk
::
Grid
*
players_grid_
=
nullptr
;
/*!< The player grid */
bool
total_points_
;
/*!< True if we draw total points, false otherwise */
SlopeFigure
*
slope_figure
=
nullptr
;
/*!< The slope figure */
double
*
slope_turn
=
nullptr
;
/*!< The turns used by slope */
double
**
slope_points
=
nullptr
;
/*!< The points used by slope */
bool
total_points_
;
/*!< True if we draw total points, false otherwise */
SlopeFigure
*
slope_figure
=
nullptr
;
/*!< The slope figure */
double
*
slope_turn
=
nullptr
;
/*!< The turns used by slope */
double
**
slope_points
=
nullptr
;
/*!< The points used by slope */
SlopeItem
**
slope_items
=
nullptr
;
/*!< The slope items */
SlopeScale
*
slope_scale
=
nullptr
;
/*!< The slope scale */
...
...
Sources/csuper-gtk/chart_points_grid.h
View file @
29988f69
...
...
@@ -39,8 +39,8 @@
/*! \class ChartPointsGrid
* \brief This class represent the chart widget
*/
* \brief This class represent the chart widget
*/
class
ChartPointsGrid
:
public
ChartGrid
{
///////////////////////////////////////////////////////////////////////////////////
...
...
@@ -60,7 +60,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Function //////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
public:
public:
/*!
* \brief Show the widget properties
*/
...
...
Sources/csuper-gtk/chart_total_points_grid.h
View file @
29988f69
...
...
@@ -39,8 +39,8 @@
/*! \class ChartTotalPointsGrid
* \brief This class represent the chart widget
*/
* \brief This class represent the chart widget
*/
class
ChartTotalPointsGrid
:
public
ChartGrid
{
///////////////////////////////////////////////////////////////////////////////////
...
...
@@ -59,7 +59,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Function //////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
public:
public:
/*!
* \brief Show the widget properties
*/
...
...
Sources/csuper-gtk/csu_application.cpp
View file @
29988f69
...
...
@@ -302,7 +302,7 @@ void CsuApplication::onQuit()
MESSAGE_QUESTION
,
BUTTONS_YES_NO
,
true
);
result
=
quitDialog
->
run
();
result
=
quitDialog
->
run
();
quitDialog
->
hide
();
delete
quitDialog
;
...
...
Sources/csuper-gtk/csu_application.h
View file @
29988f69
...
...
@@ -66,8 +66,8 @@ class DisplayDialog;
/*! \class CsuApplication
* \brief This class represent the Application
*/
* \brief This class represent the Application
*/
class
CsuApplication
:
public
Gtk
::
Application
{
///////////////////////////////////////////////////////////////////////////////////
...
...
@@ -524,16 +524,16 @@ public:
///////////////////////////////////////////////////////////////////////////////////
public:
/*!
* \brief Set a new Game
* \param game the new Game
*/
* \brief Set a new Game
* \param game the new Game
*/
void
setGame
(
csuper
::
GamePtr
game
);
/*!
* \brief Set a new filename
* \param filename the new filename
*/
* \brief Set a new filename
* \param filename the new filename
*/
void
setFilename
(
const
Glib
::
ustring
&
filename
);
};
...
...
Sources/csuper-gtk/csu_widget.h
View file @
29988f69
...
...
@@ -37,8 +37,8 @@
class
CsuApplication
;
/*! \class CsuWidget
* \brief This class is a CsuWidget
*/
* \brief This class is a CsuWidget
*/
class
CsuWidget
{
private:
...
...
Sources/csuper-gtk/delete_turn_dialog.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class DeleteTurnDialog
* \brief This class represent the delete turn dialog
*/
* \brief This class represent the delete turn dialog
*/
class
DeleteTurnDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
protected:
...
...
Sources/csuper-gtk/display_dialog.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class DisplayDialog
* \brief This class represent the display dialog
*/
* \brief This class represent the display dialog
*/
class
DisplayDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
///////////////////////////////////////////////////////////////////////////////////
...
...
Sources/csuper-gtk/display_preferences.h
View file @
29988f69
...
...
@@ -41,8 +41,8 @@
/*! \class DisplayPreferences
* \brief This class represent the display preferences scrolled window
*/
* \brief This class represent the display preferences scrolled window
*/
class
DisplayPreferences
:
public
CsuWidget
,
public
Gtk
::
ScrolledWindow
{
protected:
...
...
Sources/csuper-gtk/edit_turn_dialog.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class EditTurnDialog
* \brief This class represent the edit turn dialog
*/
* \brief This class represent the edit turn dialog
*/
class
EditTurnDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
protected:
...
...
Sources/csuper-gtk/exportation_preferences.h
View file @
29988f69
...
...
@@ -39,8 +39,8 @@
#include "csu_widget.h"
/*! \class ExportationPreferences
* \brief This class represent the exportation preferences scrolled window
*/
* \brief This class represent the exportation preferences scrolled window
*/
class
ExportationPreferences
:
public
CsuWidget
,
public
Gtk
::
ScrolledWindow
{
protected:
...
...
Sources/csuper-gtk/file_properties_dialog.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class FilePropertiesDialog
* \brief This class represent the file properties dialog
*/
* \brief This class represent the file properties dialog
*/
class
FilePropertiesDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
protected:
...
...
Sources/csuper-gtk/game_configuration_window.h
View file @
29988f69
...
...
@@ -40,8 +40,8 @@
#include "csu_widget.h"
/*! \class GameConfigurationWindow
* \brief This class represent the game configuration window
*/
* \brief This class represent the game configuration window
*/
class
GameConfigurationWindow
:
public
CsuWidget
,
public
Gtk
::
ApplicationWindow
{
///////////////////////////////////////////////////////////////////////////////////
...
...
Sources/csuper-gtk/game_information_view.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class GameInformationView
* \brief This class represent the game information view
*/
* \brief This class represent the game information view
*/
class
GameInformationView
:
public
CsuWidget
,
public
Gtk
::
Box
{
///////////////////////////////////////////////////////////////////////////////////
...
...
Sources/csuper-gtk/game_over_dialog.h
View file @
29988f69
...
...
@@ -38,8 +38,8 @@
#include "csu_widget.h"
/*! \class GameOverDialog
* \brief This class represent the game over dialog
*/
* \brief This class represent the game over dialog
*/
class
GameOverDialog
:
public
CsuWidget
,
public
Gtk
::
Dialog
{
protected:
...
...