Commit 704bcf28 authored by Andy Piper's avatar Andy Piper

updated message strings added newline at end to avoid compile warning

* launcher/anjuta_launcher.c: updated message strings
* src/message-manager-dock.c: added newline at end to avoid compile warning
* src/project_dbase.c: corrected spelling of include (noted by Biswa)
* src/controls.c, src/main_menubar.c, src/main_menubar.h, src/main_menubar_def.h, src/mainmenu_callbacks.c, src/mainmenu_callbacks.h: added some new Insert menu entries for username and Python-style GPL notice
* HACKING: added info on files to change to update Insert menu
parent 9dde01bf
2002-01-08 Andy Piper <andy.piper@freeuk.com>
* launcher/anjuta_launcher.c: updated message strings
* src/message-manager-dock.c: added newline at end to avoid compile warning
* src/project_dbase.c: corrected spelling of include (noted by Biswa)
* src/controls.c, src/main_menubar.c, src/main_menubar.h, src/main_menubar_def.h,
src/mainmenu_callbacks.c, src/mainmenu_callbacks.h: added some new Insert menu
entries for username and Python-style GPL notice
* HACKING: added info on files to change to update Insert menu
2002-01-08 Naba Kumar <kh_naba@users.sourceforge.net>
* src/project_dbase.c,
......
......@@ -181,6 +181,21 @@ internally to manage the children.
----------------------------------------------
FIXME.
2a) How to add new menu items in the Edit->Insert menu:
-------------------------------------------------------
There are 6 files which need to be updated.
* main_menubar_def.h - update inserttext1_submenu_uiinfo to add the item, help text
and name of the callback function.
* main_menubar.h - update struct _EditSubMenu with the name of the menu widget
* main_menubar.c - update the array of items referenced around mb->edit.insert_*
* mainmenu_callbacks.h, mainmenu_callbacks.c - declare the name of the new callback
function in the header file, and add the new function itself based on the
existing on_insert_*() functions
* controls.c - update the list of gtk_widget_set_sensitive calls with a new entry for
the menu widget em->insert_* (as specified in main_menubar.h)
3) How to add new toolbar items in the Toolbars:
------------------------------------------------
FIXME.
......
......@@ -44,7 +44,7 @@ main (int argc, char **argv)
if (strcmp (argv[1], "--version") == 0)
{
printf ("anjuta_launcher version 0.1.1\n");
printf ("anjuta_launcher version 0.1.2\n");
exit (0);
}
if (strcmp (argv[1], "--__debug_terminal") == 0)
......@@ -67,7 +67,7 @@ main (int argc, char **argv)
if ((pid = fork ()) == 0)
{
execlp ("sh", "sh", "-c", cmd, NULL);
g_error ("Hey! what is this? I can not execute sh.");
g_error ("Unable to execute sh");
}
g_free (cmd);
if (pid < 0)
......@@ -115,7 +115,7 @@ main (int argc, char **argv)
if ((pid = fork ()) == 0)
{
execvp (argv[1], arg_v);
g_error ("Couldn't execute the command (not found)\n");
g_error ("Unable to execute the command (not found)\n");
}
if (pid < 0)
{
......@@ -137,7 +137,7 @@ main (int argc, char **argv)
} else if (WIFEXITED (status))
printf ("Program exited successfully with errcode (%d)\n", WEXITSTATUS (status));
}
printf ("Press any key to close this terminal ... \n");
printf ("Press the Enter key to close this terminal ... \n");
getchar ();
return WEXITSTATUS (status);
}
......@@ -292,7 +292,9 @@ update_main_menubar ()
gtk_widget_set_sensitive (em->convert, F);
gtk_widget_set_sensitive (em->insert_c_gpl, F);
gtk_widget_set_sensitive (em->insert_cpp_gpl, F);
gtk_widget_set_sensitive (em->insert_datetime, F);
gtk_widget_set_sensitive (em->insert_py_gpl, F);
gtk_widget_set_sensitive (em->insert_username, F);
gtk_widget_set_sensitive (em->insert_datetime, F);
gtk_widget_set_sensitive (em->insert_header_template, F);
gtk_widget_set_sensitive (em->select_all, F);
gtk_widget_set_sensitive (em->select_brace, F);
......
......@@ -79,9 +79,11 @@ create_main_menubar (GtkWidget * ap, MainMenuBar * mb)
mb->edit.insert_c_gpl = inserttext1_submenu_uiinfo[0].widget;
mb->edit.insert_cpp_gpl = inserttext1_submenu_uiinfo[1].widget;
mb->edit.insert_datetime = inserttext1_submenu_uiinfo[2].widget;
mb->edit.insert_header_template = inserttext1_submenu_uiinfo[3].widget;
for (i = 0; i < 4; i++)
mb->edit.insert_py_gpl = inserttext1_submenu_uiinfo[2].widget;
mb->edit.insert_username = inserttext1_submenu_uiinfo[3].widget;
mb->edit.insert_datetime = inserttext1_submenu_uiinfo[4].widget;
mb->edit.insert_header_template = inserttext1_submenu_uiinfo[5].widget;
for (i = 0; i < 6; i++)
{
gtk_widget_ref (inserttext1_submenu_uiinfo[i].widget);
gtk_accel_group_attach(GNOME_APP(ap)->accel_group, GTK_OBJECT(inserttext1_submenu_uiinfo[i].widget));
......@@ -110,7 +112,7 @@ create_main_menubar (GtkWidget * ap, MainMenuBar * mb)
mb->edit.goto_next_mesg = goto1_submenu_uiinfo[5].widget;
mb->edit.repeat_find = edit1_menu_uiinfo[18].widget;
mb->edit.edit_app_gui = edit1_menu_uiinfo[22].widget;
for (i = 0; i < NUM_EDIT_MENUES ; i++)
for (i = 0; i < NUM_EDIT_MENUS ; i++)
{
gtk_widget_ref (edit1_menu_uiinfo[i].widget);
gtk_accel_group_attach(GNOME_APP(ap)->accel_group, GTK_OBJECT(edit1_menu_uiinfo[i].widget));
......@@ -382,9 +384,9 @@ main_menu_unref ()
gtk_widget_unref (select1_submenu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (goto1_submenu_uiinfo[i].widget);
for (i = 0; i < 3; i++)
for (i = 0; i < 6; i++)
gtk_widget_unref (inserttext1_submenu_uiinfo[i].widget);
for (i = 0; i < NUM_EDIT_MENUES ; i++)
for (i = 0; i < NUM_EDIT_MENUS ; i++)
gtk_widget_unref (edit1_menu_uiinfo[i].widget);
for (i = 0; i < 11; i++)
gtk_widget_unref (toolbar1_submenu_uiinfo[i].widget);
......
......@@ -68,6 +68,8 @@ struct _EditSubMenu
GtkWidget *convert;
GtkWidget *insert_c_gpl;
GtkWidget *insert_cpp_gpl;
GtkWidget *insert_py_gpl;
GtkWidget *insert_username;
GtkWidget *insert_datetime;
GtkWidget *insert_header_template;
......
......@@ -201,6 +201,18 @@ static GnomeUIInfo inserttext1_submenu_uiinfo[] = {
on_insert_cpp_gpl_notice, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
GNOME_APP_UI_ITEM, N_("# GPL Notice"),
N_("Insert GPL notice with Python style comments"),
on_insert_py_gpl_notice, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
GNOME_APP_UI_ITEM, N_("Current Username"),
N_("Insert name of current user"),
on_insert_username, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
GNOME_APP_UI_ITEM, N_("Current Date & Time"),
N_("Insert current date & time"),
......@@ -258,9 +270,9 @@ static GnomeUIInfo goto1_submenu_uiinfo[] = {
};
#define NUM_EDIT_MENUES (24)
#define NUM_EDIT_MENUS (24)
static GnomeUIInfo edit1_menu_uiinfo[NUM_EDIT_MENUES+1] = {
static GnomeUIInfo edit1_menu_uiinfo[NUM_EDIT_MENUS+1] = {
{/*0*/
GNOME_APP_UI_ITEM, N_("U_ndo"),
N_("Undo the last action"),
......
......@@ -473,6 +473,68 @@ on_insert_cpp_gpl_notice(GtkMenuItem * menuitem, gpointer user_data)
aneditor_command (te->editor_id, ANE_INSERTTEXT, -1, (long)GPLNotice);
}
void
on_insert_py_gpl_notice(GtkMenuItem * menuitem, gpointer user_data)
{
TextEditor *te;
char *GPLNotice =
"# This program is free software; you can redistribute it and/or modify\n"
"# it under the terms of the GNU General Public License as published by\n"
"# the Free Software Foundation; either version 2 of the License, or\n"
"# (at your option) any later version.\n"
"#\n"
"# This program is distributed in the hope that it will be useful,\n"
"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
"# GNU Library General Public License for more details.\n"
"#\n"
"# You should have received a copy of the GNU General Public License\n"
"# along with this program; if not, write to the Free Software\n"
"# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
"\n";
te = anjuta_get_current_text_editor ();
if (te == NULL)
return;
aneditor_command (te->editor_id, ANE_INSERTTEXT, -1, (long)GPLNotice);
}
void
on_insert_username(GtkMenuItem * menuitem, gpointer user_data)
{
TextEditor *te;
char *Username;
Username = getenv("USERNAME");
te = anjuta_get_current_text_editor ();
if (te == NULL)
return;
aneditor_command (te->editor_id, ANE_INSERTTEXT, -1, (long)Username);
}
void
on_insert_changelog_entry(GtkMenuItem * menuitem, gpointer user_data)
{
/* TODO: this function should insert a string of the form yyyy-mm-dd<tab>name<tab>e-mail */
/* it will require preferences to specify a name and e-mail address */
/* NB the name should be the user's personal name "Albert Einstein" since we */
/* can get USERNAME from the environment (see above) */
/* suggest the default should be getenv("USERNAME") plus the machine hostname */
/*
TextEditor *te;
char *CLEntry;
.... some code to build the changelog entry string in CLEntry ....
create the date string (build from ctime?)
read the name and e-mail from prefs
te = anjuta_get_current_text_editor ();
if (te == NULL)
return;
aneditor_command (te->editor_id, ANE_INSERTTEXT, -1, (long)CLEntry);
*/
}
void
on_insert_date_time(GtkMenuItem * menuitem, gpointer user_data)
......
......@@ -672,11 +672,20 @@ on_insert_c_gpl_notice(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_cpp_gpl_notice(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_py_gpl_notice(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_date_time(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_changelog_entry(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_header_template(GtkMenuItem * menuitem, gpointer user_data);
void
on_insert_username(GtkMenuItem * menuitem, gpointer user_data);
void
on_save_build_messages_activate (GtkMenuItem * menuitem, gpointer user_data);
......
......@@ -94,4 +94,4 @@ static gboolean on_delete_event(GtkWidget* widget, GdkEvent* event, gpointer dat
Preferences* get_preferences()
{
return app->preferences;
}
\ No newline at end of file
}
......@@ -113,7 +113,7 @@ gchar *project_target_type_map[]=
gchar *module_map[]=
{
"incude",
"include",
"source",
"pixmap",
"data",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment