Index: trunk/src/build_run.c
===================================================================
--- trunk/src/build_run.c (revision 6432)
+++ trunk/src/build_run.c (revision 6433)
@@ -3,6 +3,7 @@
*
* PCB, interactive printed circuit board design
* Copyright (C) 1994,1995,1996,2006 Thomas Nau
+ * pcb-rnd Copyright (C) 2017 Alain Vigne
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,10 +35,10 @@
#include "plug_io.h"
#include "compat_misc.h"
-/* ---------------------------------------------------------------------------
- * quits application
+extern void pcb_main_uninit(void);
+/** pcb_quit_app:
+ * Quits application
*/
-extern void pcb_main_uninit(void);
void pcb_quit_app(void)
{
/*
@@ -58,45 +59,107 @@
pcb_gui->do_exit(pcb_gui);
}
-/* ---------------------------------------------------------------------------
- * Returns a string that has a bunch of information about the program.
- * Can be used for things like "about" dialog boxes.
+/** pcb_get_info_program:
+ * Returns a string that has a bunch of information about this program.
*/
-
-char *pcb_get_infostr(void)
+char *pcb_get_info_program(void)
{
- pcb_hid_t **hids;
- int i;
static gds_t info;
static int first_time = 1;
-#define TAB " "
-
if (first_time) {
first_time = 0;
gds_init(&info);
- gds_append_str(&info, "This is PCB-rnd " VERSION " (" REVISION ")" "\n an interactive\n");
+ gds_append_str(&info, "This is PCB-rnd " VERSION " (" REVISION ")" "\n an interactive ");
gds_append_str(&info, "printed circuit board editor\n");
gds_append_str(&info, "pcb-rnd forked from gEDA/PCB.");
gds_append_str(&info, "\n\n" "PCB is by harry eaton and others\n\n");
- gds_append_str(&info, "\npcb-rnd is a refactored version\n");
- gds_append_str(&info, "with many new features and improvements.\n");
- gds_append_str(&info, "\n");
+ gds_append_str(&info, "pcb-rnd is a refactored version ");
+ gds_append_str(&info, "with many new features and improvements.\n\n");
+ }
+ return info.array;
+}
+
+/** pcb_get_info_copyright:
+ * Returns a string that has a bunch of information about the copyrights.
+ */
+char *pcb_get_info_copyright(void)
+{
+ static gds_t info;
+ static int first_time = 1;
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
gds_append_str(&info, "Copyright (C) Thomas Nau 1994, 1995, 1996, 1997\n");
gds_append_str(&info, "Copyright (C) harry eaton 1998-2007\n");
gds_append_str(&info, "Copyright (C) C. Scott Ananian 2001\n");
gds_append_str(&info, "Copyright (C) DJ Delorie 2003, 2004, 2005, 2006, 2007, 2008\n");
gds_append_str(&info, "Copyright (C) Dan McMahill 2003, 2004, 2005, 2006, 2007, 2008\n\n");
- gds_append_str(&info, "Copyright (C) Tibor Palinkas 2013-2017 (pcb-rnd patches)\n\n");
- gds_append_str(&info, "It is licensed under the terms of the GNU\n");
- gds_append_str(&info, "General Public License version 2\n");
- gds_append_str(&info, "See the LICENSE file for more information\n\n");
- gds_append_str(&info, "For more information see:\n\n");
+ gds_append_str(&info, "Copyright (C) Tibor Palinkas 2013-2017 (pcb-rnd patches)");
+ }
+ return info.array;
+}
+
+/** pcb_get_info_websites:
+ * Returns a string that has a bunch of information about the websites.
+ */
+char *pcb_get_info_websites(void)
+{
+ static gds_t info;
+ static int first_time = 1;
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
+
+ gds_append_str(&info, "For more information see:\n");
gds_append_str(&info, "PCB-rnd homepage: http://repo.hu/projects/pcb-rnd\n");
gds_append_str(&info, "PCB homepage: http://pcb.geda-project.org\n");
gds_append_str(&info, "gEDA homepage: http://www.geda-project.org\n");
gds_append_str(&info, "gEDA Wiki: http://wiki.geda-project.org\n\n");
+ }
+ return info.array;
+}
+/** pcb_get_info_comments:
+ * Returns a string as the concatenation of pcb_get_info_program() and pcb_get_info_websites()
+ */
+char *pcb_get_info_comments(void)
+{
+ static gds_t info;
+ static int first_time = 1;
+ char *tmp;
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
+
+ tmp = pcb_get_info_program();
+ gds_append_str(&info, tmp);
+ tmp = pcb_get_info_websites();
+ gds_append_str(&info, tmp);
+ }
+ return info.array;
+}
+
+
+/** pcb_get_info_compile_options:
+ * Returns a string that has a bunch of information about the options selected at compile time.
+ */
+char *pcb_get_info_compile_options(void)
+{
+ pcb_hid_t **hids;
+ int i;
+ static gds_t info;
+ static int first_time = 1;
+
+#define TAB " "
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
+
gds_append_str(&info, "----- Compile Time Options -----\n");
hids = pcb_hid_enumerate();
gds_append_str(&info, "GUI:\n");
@@ -136,6 +199,37 @@
return info.array;
}
+/** pcb_get_infostr:
+ * Returns a string that has a bunch of information about this copy of pcb.
+ * Can be used for things like "about" dialog boxes.
+ */
+char *pcb_get_infostr(void)
+{
+ static gds_t info;
+ static int first_time = 1;
+ char *tmp;
+
+ if (first_time) {
+ first_time = 0;
+ gds_init(&info);
+
+ tmp = pcb_get_info_program();
+ gds_append_str(&info, tmp);
+ tmp = pcb_get_info_copyright();
+ gds_append_str(&info, tmp);
+ gds_append_str(&info, "\n\n");
+ gds_append_str(&info, "It is licensed under the terms of the GNU\n");
+ gds_append_str(&info, "General Public License version 2\n");
+ gds_append_str(&info, "See the LICENSE file for more information\n\n");
+ tmp = pcb_get_info_websites();
+ gds_append_str(&info, tmp);
+
+ tmp = pcb_get_info_compile_options();
+ gds_append_str(&info, tmp);
+ }
+ return info.array;
+}
+
const char *pcb_author(void)
{
if (conf_core.design.fab_author && conf_core.design.fab_author[0])
@@ -144,6 +238,9 @@
return pcb_get_user_name();
}
+/** pcb_catch_signal:
+ * Catches signals which abort the program.
+ */
void pcb_catch_signal(int Signal)
{
const char *s;
Index: trunk/src/build_run.h
===================================================================
--- trunk/src/build_run.h (revision 6432)
+++ trunk/src/build_run.h (revision 6433)
@@ -24,14 +24,16 @@
*
*/
-/* build info and run control */
-
void pcb_quit_app(void);
-/* Returns a string with info about this copy of pcb. */
+char *pcb_get_info_program(void);
+char *pcb_get_info_copyright(void);
+char *pcb_get_info_websites(void);
+char *pcb_get_info_comments(void);
+char *pcb_get_info_compile_options(void);
+
char *pcb_get_infostr(void);
const char *pcb_author(void);
-/* catches signals which abort the program */
void pcb_catch_signal(int Signal);
Index: trunk/src_plugins/lib_gtk_common/dlg_about.c
===================================================================
--- trunk/src_plugins/lib_gtk_common/dlg_about.c (revision 6432)
+++ trunk/src_plugins/lib_gtk_common/dlg_about.c (revision 6433)
@@ -3,7 +3,7 @@
*
* PCB, interactive printed circuit board design
* Copyright (C) 1994,1995,1996 Thomas Nau
- * pcb-rnd Copyright (C) 2017 Tibor 'Igor2' Palinkas, Alain Vigne
+ * pcb-rnd Copyright (C) 2017 Alain Vigne
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,8 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program. If not, see .
*
* Contact addresses for paper mail and Email:
* Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
@@ -31,11 +30,19 @@
#include "compat_nls.h"
#include "build_run.h"
+/** pcb_gtk_dlg_about:
+ * Display and run the modal About dialog
+ */
void pcb_gtk_dlg_about(GtkWidget * top_window)
{
GtkWidget *w = gtk_about_dialog_new();
GtkAboutDialog *about = GTK_ABOUT_DIALOG(w);
- char *s_info = pcb_get_infostr();
+ gtk_dialog_add_button(GTK_DIALOG(about), "Options", 5);
+ /*TODO: If button is clicked, open another window with the compile options text:
+ pcb_get_info_compile_options()
+ */
+
+ /*FIXME: find a proper way to include authors ... */
const gchar *authors[] = { "Igor2", "Alain", NULL };
gtk_about_dialog_set_program_name(about, "pcb-rnd");
@@ -43,12 +50,26 @@
/*FIXME: pcb_author() not good here because gchar ** expected : */
/*gtk_about_dialog_set_authors (about, pcb_author()); */
gtk_about_dialog_set_authors(about, authors);
- gtk_about_dialog_set_copyright (about, "FIXME : text of the license ...");
+
+ gtk_about_dialog_set_copyright(about, pcb_get_info_copyright());
+
+ /*TODO: Find a proper way to include the COPYING file and/or display this info :
+ gds_append_str(&info, "It is licensed under the terms of the GNU\n");
+ gds_append_str(&info, "General Public License version 2\n");
+ gds_append_str(&info, "See the LICENSE file for more information\n\n");
+ */
+
+ gtk_about_dialog_set_license(about,
+ "It is licensed under the terms of the GNU\n" "General Public License version 2\n"
+ "See the COPYING file for more information\n\n");
/* in GTK3:
- gtk_about_dialog_set_license_type(about, GTK_LICENSE_GPL_2_0);*/
+ gtk_about_dialog_set_license_type(about, GTK_LICENSE_GPL_2_0); */
/*FIXME: Refactor the string w.r.t. the dialog */
- gtk_about_dialog_set_comments(about, s_info);
+
+ gtk_about_dialog_set_comments(about, pcb_get_info_comments());
+
gtk_about_dialog_set_website(about, "http://repo.hu/projects/pcb-rnd/");
+ gtk_about_dialog_set_website_label(about, "Visit the PCB-rnd website");
gtk_about_dialog_set_documenters(about, authors);
gtk_about_dialog_set_translator_credits(about, _("translator-credits"));
Index: trunk/src_plugins/lib_gtk_common/dlg_about.h
===================================================================
--- trunk/src_plugins/lib_gtk_common/dlg_about.h (revision 6432)
+++ trunk/src_plugins/lib_gtk_common/dlg_about.h (revision 6433)
@@ -1,5 +1,3 @@
#include
-/* Display and run the modal About dialog */
-void pcb_gtk_dlg_about(GtkWidget *top_window);
-
+void pcb_gtk_dlg_about(GtkWidget * top_window);