antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright gtkshell/Makefile gtkshell/dialog_opt...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright gtkshell/Makefile gtkshell/dialog_opt...
Date: Mon, 02 Apr 2007 18:31:41 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/04/02 18:31:41

Modified files:
        gtkshell       : Makefile dialog_options.c gtkshell.h 
        libantiright   : pipe.c pipe.h 
Added files:
        gtkshell       : about_dialog.c about_dialog.h 

Log message:
        Split out about dialog code to a separate file.
        Display entire license in license section of dialog.  Split out
        static functions.  Added utility function to retrieve text
        from named file, rather than just the file pointer.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dialog_options.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/about_dialog.c?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/about_dialog.h?cvsroot=antiright&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.h?cvsroot=antiright&r1=1.4&r2=1.5

Patches:
Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- gtkshell/Makefile   24 Mar 2007 04:17:13 -0000      1.18
+++ gtkshell/Makefile   2 Apr 2007 18:31:41 -0000       1.19
@@ -37,7 +37,7 @@
        updated_options.o add_options.o option_options.o dialog_options.o\
        file_dialog.o row.o containers.o geometry.o font.o dragdrop.o\
        image_button.o terminal.o terminal_options.o\
-       guidl_util.o
+       guidl_util.o about_dialog.o
 
 program=main.o 
 

Index: gtkshell/dialog_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/dialog_options.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/dialog_options.c   24 Mar 2007 04:17:13 -0000      1.12
+++ gtkshell/dialog_options.c   2 Apr 2007 18:31:41 -0000       1.13
@@ -40,16 +40,11 @@
 gsh_color_dialog() __attribute__((noreturn));
 
 static void
-gsh_about_dialog() __attribute__((noreturn));
-
-
-static void
 gsh_message_dialog(struct GSH * gsh, GtkMessageType type, char *text)
 {
        GtkWidget *dialog;
 
-       dialog = gtk_message_dialog_new(
-                                       GTK_WINDOW(gsh->window),
+       dialog = gtk_message_dialog_new(GTK_WINDOW(gsh->window),
                                        GTK_DIALOG_DESTROY_WITH_PARENT,
                                        type,
                                        GTK_BUTTONS_CLOSE,
@@ -109,40 +104,6 @@
        exit(0);
 }
 
-static void
-gsh_about_dialog()
-{
-       const GtkWidget *dialog;
-       const gchar *authors[] =
-       {"Jeffrey E. Bedard <address@hidden>",
-       NULL};
-
-       dialog = gtk_about_dialog_new();
-
-       gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog),
-                                    PACKAGE_STRING);
-
-       gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog),
-                           "Copyright 2002-2007, Jeffrey E. Bedard");
-
-       gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog),
-                                  "http://www.nongnu.org/antiright";);
-
-       gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog),
-                          "This software is licensed under the terms"
-                              " of the GNU General Public License.");
-
-       gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog),
-                                    authors);
-
-       gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog),
-                               "The desktop scripting environment.");
-
-       gtk_dialog_run(GTK_DIALOG(dialog));
-
-       exit(0);
-}
-
 void
 gsh_handle_dialog_arguments(struct GSH * gsh, int argc, char **argv,
                            int *counter)

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- gtkshell/gtkshell.h 24 Mar 2007 04:17:13 -0000      1.28
+++ gtkshell/gtkshell.h 2 Apr 2007 18:31:41 -0000       1.29
@@ -92,6 +92,7 @@
 #include "terminal_options.h"
 #include "terminal.h"
 #include "guidl_util.h"
+#include "about_dialog.h"
 
 void
 gsh_stack_init(struct GSH * gsh, int *argc, char ***argv);

Index: libantiright/pipe.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libantiright/pipe.c 2 Mar 2007 19:12:01 -0000       1.7
+++ libantiright/pipe.c 2 Apr 2007 18:31:41 -0000       1.8
@@ -43,6 +43,19 @@
        return text;
 }
 
+gchar *
+antiright_read_named_file(gchar * filename)
+{
+       FILE * file;
+       gchar * contents;
+
+       file=fopen(filename, "r");
+       contents=antiright_read_file(file);
+       fclose(file);
+
+       return contents;
+}
+
 /* Make sure that you free the returned string.  */
 char *
 antiright_pipe_read(char *command_string)

Index: libantiright/pipe.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libantiright/pipe.h 2 Mar 2007 03:56:07 -0000       1.4
+++ libantiright/pipe.h 2 Apr 2007 18:31:41 -0000       1.5
@@ -26,6 +26,9 @@
 gchar *
 antiright_read_file(FILE *file);
 
+gchar *
+antiright_read_named_file(gchar * filename);
+
 /* void */
 /* antiright_pipe_write(char *command_string, char* data); */
 /* void */

Index: gtkshell/about_dialog.c
===================================================================
RCS file: gtkshell/about_dialog.c
diff -N gtkshell/about_dialog.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/about_dialog.c     2 Apr 2007 18:31:41 -0000       1.1
@@ -0,0 +1,79 @@
+/*
+  AntiRight
+  (c) 2007 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  AntiRight is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#include "gtkshell.h"
+
+static void
+setup_about_license(GtkWidget * dialog)
+{
+       gchar * text;
+       gchar * filename;
+       ar_asprintf(&filename, "%s/%s/antiright/COPYING",
+                       PREFIX, "share/doc");
+       text=antiright_read_named_file(filename);
+       g_free(filename);
+       gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog),
+                       text);
+       g_free(text);
+
+}
+
+static void
+setup_about_fields(GtkWidget * dialog)
+{
+       const gchar *authors[] =
+       {
+               "Jeffrey E. Bedard <address@hidden>",
+                NULL
+       };
+
+       gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog),
+                                    PACKAGE_STRING);
+
+       gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog),
+                           "Copyright 2002-2007, Jeffrey E. Bedard");
+
+       gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog),
+                                  "http://www.nongnu.org/antiright";);
+
+       setup_about_license(dialog);
+       
+       gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog),
+                                    authors);
+
+       gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog),
+                               "The desktop scripting environment.");
+}
+
+void
+gsh_about_dialog()
+{
+       GtkWidget * dialog;
+
+       dialog = gtk_about_dialog_new();
+       setup_about_fields(dialog);
+       gtk_dialog_run(GTK_DIALOG(dialog));
+
+       exit(0);
+}
+
+

Index: gtkshell/about_dialog.h
===================================================================
RCS file: gtkshell/about_dialog.h
diff -N gtkshell/about_dialog.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/about_dialog.h     2 Apr 2007 18:31:41 -0000       1.1
@@ -0,0 +1,29 @@
+/*
+  AntiRight
+  (c) 2007 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  AntiRight is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#ifndef GSH_ABOUT_DIALOG_H
+#define GSH_ABOUT_DIALOG_H
+
+void
+gsh_about_dialog() __attribute__((noreturn));
+
+#endif /* GSH_ABOUT_DIALOG_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]