GUI : update the display of the about windows to use gtk:about

This commit is contained in:
Edouard Dupin 2011-09-01 15:56:27 +02:00
parent 88b76c074d
commit a497b028ca
2 changed files with 35 additions and 49 deletions

View File

@ -53,9 +53,9 @@ DEBUG:=1
### Compilation Define ### ### Compilation Define ###
############################################################################### ###############################################################################
ifeq ("$(DEBUG)", "0") ifeq ("$(DEBUG)", "0")
DEFINE= -DEDN_DEBUG_LEVEL=1 -DNDEBUG -DVERSION_TAG_NAME="\"$(VERSION_TAG)-debug\"" DEFINE= -DEDN_DEBUG_LEVEL=1 -DNDEBUG -DVERSION_TAG_NAME="\"$(VERSION_TAG)-release\""
else else
DEFINE= -DEDN_DEBUG_LEVEL=3 -DVERSION_TAG_NAME="\"$(VERSION_TAG)-release\"" DEFINE= -DEDN_DEBUG_LEVEL=3 -DVERSION_TAG_NAME="\"$(VERSION_TAG)-debug\""
endif endif
DEFINE+= -DVERSION_BUILD_TIME="\"$(VERSION_BUILD_TIME)\"" DEFINE+= -DVERSION_BUILD_TIME="\"$(VERSION_BUILD_TIME)\""

View File

@ -155,54 +155,40 @@ void WindowsManager::OnMessage(int32_t id, int32_t dataID)
break; break;
case EDN_MSG__GUI_SHOW_ABOUT: case EDN_MSG__GUI_SHOW_ABOUT:
{ {
// dlg to confirm the quit event : GtkWidget *myDialog = gtk_about_dialog_new();
GtkWidget *myDialog = gtk_dialog_new_with_buttons("About", gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(myDialog), "Edn");
NULL, gtk_about_dialog_set_version( GTK_ABOUT_DIALOG(myDialog), VERSION_TAG_NAME);
GTK_DIALOG_MODAL, gtk_about_dialog_set_comments( GTK_ABOUT_DIALOG(myDialog), "Editeur De N'ours\n"
GTK_STOCK_QUIT, GTK_RESPONSE_NO, "L'Editeur Desoxyribo-Nucleique.\n"
NULL); "Source Code Editor\n"
// this element did not apear in the miniature of the windows "Build Time : " VERSION_BUILD_TIME);
gtk_window_set_skip_pager_hint(GTK_WINDOW(myDialog), TRUE); gtk_about_dialog_set_copyright( GTK_ABOUT_DIALOG(myDialog), "Copyright 2010 Edouard DUPIN, all right reserved");
GtkWidget *myContentArea = gtk_dialog_get_content_area( GTK_DIALOG(myDialog)); gtk_about_dialog_set_license( GTK_ABOUT_DIALOG(myDialog), "This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY\n\n"
GtkWidget *myLabel = gtk_label_new(""); "You can:\n"
gtk_label_set_markup (GTK_LABEL (myLabel),
"<b>Name :</b> Edn\n"
"<b>Version :</b> " VERSION_TAG_NAME "\n"
"<b>Build Time :</b> " VERSION_BUILD_TIME "\n\n"
"<b>Description :</b> Editeur De N'ours, l'Editeur Desoxyribo-Nucleique\n"
" Source Code Editor\n\n"
"<b>Copyright 2010 Edouard DUPIN, all right reserved</b>\n\n"
"<b>Terms of license : </b>\n"
"This software is distributed in the hope that it will be useful, but \n"
"WITHOUT ANY WARRANTY\n"
" <b>You can:</b>\n"
" * Redistribute the sources code and binaries.\n" " * Redistribute the sources code and binaries.\n"
" * Modify the Sources code.\n" " * Modify the Sources code.\n"
" * Use a part of the sources (less than 50%) in an other software,\n" " * Use a part of the sources (less than 50%) in an other software, just write somewhere \"Edn is great\" visible by the user (on your product or on your website with a link to my page).\n"
" just write somewhere \"Edn is great\" visible by the user (on \n"
" your product or on your website with a link to my page).\n"
" * Redistribute the modification only if you want.\n" " * Redistribute the modification only if you want.\n"
" * Send me the bug-fix (it could be great).\n" " * Send me the bug-fix (it could be great).\n"
" * Pay me a beer or some other things.\n" " * Pay me a beer or some other things.\n"
" Print the source code on WC paper ...\n" " * Print the source code on WC paper ...\n\n"
" <b>You can NOT:</b>\n" "You can NOT:\n"
" * Earn money with this Software (But I can).\n" " * Earn money with this Software (But I can).\n"
" * Add malware in the Sources.\n" " * Add malware in the Sources.\n"
" * Do something bad with the sources.\n" " * Do something bad with the sources.\n"
" * Use it to travel in the space with a toaster.\n" " * Use it to travel in the space with a toaster.\n\n"
"I reserve the right to change this licence. If it change the version of \n" "I reserve the right to change this licence. If it change the version of the copy you have keep its own license.");
"the copy you have keep its own license.\n\n" gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(myDialog), true);
"<b>Sources : </b> git://github.com/HeeroYui/edn.git "); # if USE_GTK_VERSION_3_0
gtk_box_pack_start(GTK_BOX(myContentArea), myLabel, TRUE, TRUE, 0); gtk_about_dialog_set_license_type(GTK_ABOUT_DIALOG(myDialog), GTK_LICENSE_CUSTOM);
# endif
gtk_widget_show_all(myContentArea); gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(myDialog), "http://HeeroYui.github.com/edn");
int32_t result = gtk_dialog_run (GTK_DIALOG (myDialog)); gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(myDialog), "Edn on github");
const char * listAutor[] = {"Edouard DUPIN", NULL};
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(myDialog), listAutor);
// Display About
gtk_dialog_run(GTK_DIALOG(myDialog));
gtk_widget_destroy(myDialog); gtk_widget_destroy(myDialog);
switch (result)
{
case GTK_RESPONSE_NO:
break;
}
} }
break; break;
case EDN_MSG__GUI_SHOW_GOTO_LINE: case EDN_MSG__GUI_SHOW_GOTO_LINE: