lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
August 2006
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
3 participants
123 discussions
Start a n
N
ew thread
SF.net SVN: geany: [736] trunk/src
by ntrel@users.sourceforge.net
18 Aug '06
18 Aug '06
Revision: 736 Author: ntrel Date: 2006-08-18 10:22:57 -0700 (Fri, 18 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=736&view=rev
Log Message: ----------- Add dialogs_show_question_full for custom buttons and extra text; Don't show message dialogs in the window manager taskbar Modified Paths: -------------- trunk/src/dialogs.c trunk/src/dialogs.h Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-08-18 16:17:38 UTC (rev 735) +++ trunk/src/dialogs.c 2006-08-18 17:22:57 UTC (rev 736) @@ -223,7 +223,7 @@ win32_message_dialog(GTK_MESSAGE_INFO, string); #else - dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", string); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); @@ -247,7 +247,7 @@ #ifdef G_OS_WIN32 win32_message_dialog(GTK_MESSAGE_ERROR, string); #else - dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", string); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); @@ -1384,30 +1384,69 @@ } -gboolean dialogs_show_question(const gchar *text, ...) +static gboolean +show_question(const gchar *yes_btn, const gchar *no_btn, const gchar *question_text, + const gchar *extra_text) { -#ifndef G_OS_WIN32 + gboolean ret = FALSE; +#ifdef G_OS_WIN32 + gchar *string = (extra_text == NULL) ? g_strdup(question_text) : + g_strconcat(question_text, "\n\n", extra_text, NULL); + + ret = win32_message_dialog(GTK_MESSAGE_QUESTION, string); + g_free(string); +#else GtkWidget *dialog; + + dialog = gtk_message_dialog_new(GTK_WINDOW(app->window), + GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, "%s", question_text); + // question_text will be in bold if optional extra_text used + if (extra_text != NULL) + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", extra_text); + + // For a cancel button, use cancel reponse so user can press escape to cancel + gtk_dialog_add_button(GTK_DIALOG(dialog), no_btn, + g_str_equal(no_btn, GTK_STOCK_CANCEL) ? GTK_RESPONSE_CANCEL : GTK_RESPONSE_NO); + gtk_dialog_add_button(GTK_DIALOG(dialog), yes_btn, GTK_RESPONSE_YES); + + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) + ret = TRUE; + gtk_widget_destroy(dialog); #endif + return ret; +} + + +gboolean dialogs_show_question(const gchar *text, ...) +{ + gboolean ret = FALSE; gchar *string = g_malloc(512); - gboolean ret = FALSE; va_list args; va_start(args, text); g_vsnprintf(string, 511, text, args); va_end(args); + ret = show_question(GTK_STOCK_YES, GTK_STOCK_NO, string, NULL); + g_free(string); + return ret; +} -#ifdef G_OS_WIN32 - ret = win32_message_dialog(GTK_MESSAGE_QUESTION, string); -#else - dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", string); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) - ret = TRUE; - gtk_widget_destroy(dialog); -#endif + +/* extra_text can be NULL; otherwise it is displayed below main_text. */ +gboolean dialogs_show_question_full(const gchar *yes_btn, const gchar *no_btn, + const gchar *extra_text, const gchar *main_text, ...) +{ + gboolean ret = FALSE; + gchar *string = g_malloc(512); + va_list args; + + va_start(args, main_text); + g_vsnprintf(string, 511, main_text, args); + va_end(args); + ret = show_question(yes_btn, no_btn, string, extra_text); g_free(string); - return ret; } Modified: trunk/src/dialogs.h =================================================================== --- trunk/src/dialogs.h 2006-08-18 16:17:38 UTC (rev 735) +++ trunk/src/dialogs.h 2006-08-18 17:22:57 UTC (rev 736) @@ -63,6 +63,10 @@ gboolean dialogs_show_question(const gchar *text, ...); +/* extra_text can be NULL; otherwise it is displayed below main_text. */ +gboolean dialogs_show_question_full(const gchar *yes_btn, const gchar *no_btn, + const gchar *extra_text, const gchar *main_text, ...); + void dialogs_show_keyboard_shortcuts(void); #endif This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [735] trunk
by ntrel@users.sourceforge.net
18 Aug '06
18 Aug '06
Revision: 735 Author: ntrel Date: 2006-08-18 09:17:38 -0700 (Fri, 18 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=735&view=rev
Log Message: ----------- Fix building on win32 - thanks to C?\225?\187?\167 V?\196?\131n Chu?\225?\187?\145i Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-18 11:46:35 UTC (rev 734) +++ trunk/ChangeLog 2006-08-18 16:17:38 UTC (rev 735) @@ -2,6 +2,7 @@ * src/keyfile.c: Fix a small memory leak in configuration_load. * src/dialogs.c: Change Don't save button icon and add mnemonic. + * src/main.c: Fix building on win32 - thanks to Củ Văn Chuối. 2006-08-17 Nick Treleaven <nick.treleaven(a)btinternet.com> Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2006-08-18 11:46:35 UTC (rev 734) +++ trunk/src/main.c 2006-08-18 16:17:38 UTC (rev 735) @@ -569,10 +569,8 @@ config_dir_result = setup_config_dir(); // handle fifo - app->fifo_ioc = NULL; #ifdef HAVE_FIFO - if (! ignore_fifo) - app->fifo_ioc = create_fifo(argc, argv, app->configdir); + app->fifo_ioc = (ignore_fifo) ? NULL : create_fifo(argc, argv, app->configdir); #endif gtk_init(&argc, &argv); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [734] trunk
by ntrel@users.sourceforge.net
18 Aug '06
18 Aug '06
Revision: 734 Author: ntrel Date: 2006-08-18 04:46:35 -0700 (Fri, 18 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=734&view=rev
Log Message: ----------- Change Don't save button icon and add mnemonic Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-18 11:23:58 UTC (rev 733) +++ trunk/ChangeLog 2006-08-18 11:46:35 UTC (rev 734) @@ -1,6 +1,7 @@ 2006-08-18 Nick Treleaven <nick.treleaven(a)btinternet.com> * src/keyfile.c: Fix a small memory leak in configuration_load. + * src/dialogs.c: Change Don't save button icon and add mnemonic. 2006-08-17 Nick Treleaven <nick.treleaven(a)btinternet.com> Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-08-18 11:23:58 UTC (rev 733) +++ trunk/src/dialogs.c 2006-08-18 11:46:35 UTC (rev 734) @@ -285,8 +285,8 @@ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); button = gtk_button_new(); - label = gtk_label_new(_("Don't save")); - image = gtk_image_new_from_stock(GTK_STOCK_NO, GTK_ICON_SIZE_BUTTON); + label = gtk_label_new_with_mnemonic(_("_Don't save")); + image = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON); hbox = gtk_hbox_new(FALSE, 2); align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [733] trunk
by ntrel@users.sourceforge.net
18 Aug '06
18 Aug '06
Revision: 733 Author: ntrel Date: 2006-08-18 04:23:58 -0700 (Fri, 18 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=733&view=rev
Log Message: ----------- Fix a small memory leak in configuration_load Modified Paths: -------------- trunk/ChangeLog trunk/src/keyfile.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-17 20:38:09 UTC (rev 732) +++ trunk/ChangeLog 2006-08-18 11:23:58 UTC (rev 733) @@ -1,3 +1,8 @@ +2006-08-18 Nick Treleaven <nick.treleaven(a)btinternet.com> + + * src/keyfile.c: Fix a small memory leak in configuration_load. + + 2006-08-17 Nick Treleaven <nick.treleaven(a)btinternet.com> * src/callbacks.c, src/callbacks.h, src/main.c: Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2006-08-17 20:38:09 UTC (rev 732) +++ trunk/src/keyfile.c 2006-08-18 11:23:58 UTC (rev 733) @@ -220,7 +220,7 @@ { gboolean config_exists; guint i, geo_len; - gint *geo = g_malloc(sizeof(gint) * 4); + gint *geo; gsize len = 0; gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL); gchar *entry = g_malloc(14); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [732] trunk
by ntrel@users.sourceforge.net
17 Aug '06
17 Aug '06
Revision: 732 Author: ntrel Date: 2006-08-17 13:38:09 -0700 (Thu, 17 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=732&view=rev
Log Message: ----------- ensure FIF dir is set Modified Paths: -------------- trunk/ChangeLog trunk/src/msgwindow.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-17 16:12:04 UTC (rev 731) +++ trunk/ChangeLog 2006-08-17 20:38:09 UTC (rev 732) @@ -6,7 +6,7 @@ Move main_init command line settings to parse_command_line_options. Use setup_paths, locale_init, parse_command_line_options, setup_config_dir in main(). - * src/msgwindow.c: Reorder widget lookup. + * src/msgwindow.c: Reorder widget lookup; ensure FIF dir is set. * src/main.c: Fix Show messages window checkbox state when -m used. Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2006-08-17 16:12:04 UTC (rev 731) +++ trunk/src/msgwindow.c 2006-08-17 20:38:09 UTC (rev 732) @@ -503,6 +503,7 @@ *filename = NULL; *line = -1; + g_return_if_fail(msgwindow.find_in_files_dir != NULL); if (string == NULL) return; // conflict:3:conflicting types for `foo' This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [731] trunk
by ntrel@users.sourceforge.net
17 Aug '06
17 Aug '06
Revision: 731 Author: ntrel Date: 2006-08-17 09:12:04 -0700 (Thu, 17 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=731&view=rev
Log Message: ----------- Fix Show messages window checkbox state when -m used Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-17 16:08:25 UTC (rev 730) +++ trunk/ChangeLog 2006-08-17 16:12:04 UTC (rev 731) @@ -7,6 +7,7 @@ Use setup_paths, locale_init, parse_command_line_options, setup_config_dir in main(). * src/msgwindow.c: Reorder widget lookup. + * src/main.c: Fix Show messages window checkbox state when -m used. 2006-08-15 Nick Treleaven <nick.treleaven(a)btinternet.com> Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2006-08-17 16:08:25 UTC (rev 730) +++ trunk/src/main.c 2006-08-17 16:12:04 UTC (rev 731) @@ -121,7 +121,7 @@ gtk_widget_hide(app->toolbar); app->ignore_callback = FALSE; } - if (! app->msgwindow_visible || no_msgwin) + if (! app->msgwindow_visible) { app->ignore_callback = TRUE; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_show_messages_window1")), FALSE); @@ -582,16 +582,19 @@ gtk_widget_set_size_request(app->window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT); gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT); encodings_init(); + configuration_load(); - keybindings_init(); - notebook_init(); - templates_init(); - document_init_doclist(); // do this here to let cmdline options overwrite configuration settings #ifdef HAVE_VTE app->have_vte = app->load_vte; if (no_vte) app->have_vte = FALSE; #endif + if (no_msgwin) app->msgwindow_visible = FALSE; + + keybindings_init(); + notebook_init(); + templates_init(); + document_init_doclist(); filetypes_init_types(); if (generate_datafiles) { This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [730] trunk
by ntrel@users.sourceforge.net
17 Aug '06
17 Aug '06
Revision: 730 Author: ntrel Date: 2006-08-17 09:08:25 -0700 (Thu, 17 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=730&view=rev
Log Message: ----------- Reorder widget lookup Modified Paths: -------------- trunk/ChangeLog trunk/src/msgwindow.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-17 14:40:43 UTC (rev 729) +++ trunk/ChangeLog 2006-08-17 16:08:25 UTC (rev 730) @@ -6,6 +6,7 @@ Move main_init command line settings to parse_command_line_options. Use setup_paths, locale_init, parse_command_line_options, setup_config_dir in main(). + * src/msgwindow.c: Reorder widget lookup. 2006-08-15 Nick Treleaven <nick.treleaven(a)btinternet.com> Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2006-08-17 14:40:43 UTC (rev 729) +++ trunk/src/msgwindow.c 2006-08-17 16:08:25 UTC (rev 730) @@ -53,10 +53,10 @@ void msgwin_init() { + msgwindow.notebook = lookup_widget(app->window, "notebook_info"); msgwindow.tree_status = lookup_widget(app->window, "treeview3"); msgwindow.tree_msg = lookup_widget(app->window, "treeview4"); msgwindow.tree_compiler = lookup_widget(app->window, "treeview5"); - msgwindow.notebook = lookup_widget(app->window, "notebook_info"); msgwindow.find_in_files_dir = NULL; } This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [729] trunk
by ntrel@users.sourceforge.net
17 Aug '06
17 Aug '06
Revision: 729 Author: ntrel Date: 2006-08-17 07:40:43 -0700 (Thu, 17 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=729&view=rev
Log Message: ----------- Move signal_cb to main.c; Move main_init command line settings to parse_command_line_options; Use setup_paths, locale_init, parse_command_line_options, setup_config_dir in main() Modified Paths: -------------- trunk/ChangeLog trunk/src/main.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-17 14:38:57 UTC (rev 728) +++ trunk/ChangeLog 2006-08-17 14:40:43 UTC (rev 729) @@ -1,3 +1,13 @@ +2006-08-17 Nick Treleaven <nick.treleaven(a)btinternet.com> + + * src/callbacks.c, src/callbacks.h, src/main.c: + Move signal_cb to main.c. + * src/main.c: + Move main_init command line settings to parse_command_line_options. + Use setup_paths, locale_init, parse_command_line_options, + setup_config_dir in main(). + + 2006-08-15 Nick Treleaven <nick.treleaven(a)btinternet.com> * tagmanager/c.c: Backported calltips workspace support for C-like Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2006-08-17 14:38:57 UTC (rev 728) +++ trunk/src/main.c 2006-08-17 14:40:43 UTC (rev 729) @@ -207,21 +207,6 @@ static void main_init(void) { // inits - app = g_new0(MyApp, 1); -#ifdef GEANY_DEBUG - geany_debug("debug mode built in (can't be disabled)"); -#endif - app->debug_mode = debug_mode; - geany_debug("GTK+ runtime version: %u.%u.%u", - gtk_major_version, gtk_minor_version, gtk_micro_version); - - if (alternate_config) - { - geany_debug("alternate config: %s", alternate_config); - app->configdir = alternate_config; - } - else - app->configdir = g_strconcat(GEANY_HOME_DIR, G_DIR_SEPARATOR_S, ".", PACKAGE, NULL); app->window = NULL; app->open_fontsel = NULL; app->open_colorsel = NULL; @@ -233,13 +218,6 @@ app->tab_order_ltr = FALSE; app->quitting = FALSE; app->ignore_callback = FALSE; -#ifdef HAVE_FIFO - app->ignore_fifo = ignore_fifo; -#endif -#ifdef HAVE_VTE - app->lib_vte = lib_vte; -#endif - app->ignore_global_tags = ignore_global_tags; app->tm_workspace = tm_get_workspace(); app->recent_queue = g_queue_new(); app->opening_session_files = FALSE; @@ -449,19 +427,10 @@ #endif -gint main(gint argc, gchar **argv) +static void setup_paths() { - GError *error = NULL; - GOptionContext *context; -#ifdef HAVE_FIFO - GIOChannel *ioc = NULL; -#endif - gint mkdir_result = 0; - gint idx; - gchar *config_dir; gchar *data_dir; gchar *doc_dir; - gchar *locale_dir; // set paths #ifdef G_OS_WIN32 @@ -471,12 +440,25 @@ data_dir = g_strconcat(install_dir, "\\data", NULL); // e.g. C:\Program Files\geany\data doc_dir = g_strconcat(install_dir, "\\doc", NULL); - locale_dir = g_strdup(data_dir); g_free(install_dir); #else data_dir = g_strdup(PACKAGE_DATA_DIR "/" PACKAGE "/"); // e.g. /usr/share/geany doc_dir = g_strdup(PACKAGE_DATA_DIR "/doc/" PACKAGE "/html/"); +#endif + + app->datadir = data_dir; + app->docdir = doc_dir; +} + + +static void locale_init() +{ + gchar *locale_dir = NULL; + +#ifdef G_OS_WIN32 + locale_dir = g_strdup(app->datadir); +#else locale_dir = g_strdup(PACKAGE_LOCALE_DIR); #endif @@ -486,12 +468,19 @@ textdomain(GETTEXT_PACKAGE); #endif g_free(locale_dir); +} + +static void parse_command_line_options(gint *argc, gchar ***argv) +{ + GOptionContext *context; + GError *error = NULL; + context = g_option_context_new(_(" - A fast and lightweight IDE")); g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE); g_option_group_set_translation_domain(g_option_context_get_main_group(context), GETTEXT_PACKAGE); g_option_context_add_group(context, gtk_get_option_group(TRUE)); - g_option_context_parse(context, &argc, &argv, &error); + g_option_context_parse(context, argc, argv, &error); g_option_context_free(context); if (show_version) @@ -502,21 +491,40 @@ GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("\n"); - return (0); + exit(0); } - gtk_set_locale(); + app->debug_mode = debug_mode; +#ifdef GEANY_DEBUG + geany_debug("debug mode built in (can't be disabled)"); +#endif + geany_debug("GTK+ runtime version: %u.%u.%u", + gtk_major_version, gtk_minor_version, gtk_micro_version); - signal(SIGTERM, signal_cb); -#ifdef G_OS_UNIX - /* ignore SIGPIPE signal for preventing sudden death of program */ - signal(SIGPIPE, SIG_IGN); + if (alternate_config) + { + geany_debug("alternate config: %s", alternate_config); + app->configdir = alternate_config; + } + else + app->configdir = g_strconcat(GEANY_HOME_DIR, G_DIR_SEPARATOR_S, ".", PACKAGE, NULL); + +#ifdef HAVE_FIFO + app->ignore_fifo = ignore_fifo; #endif +#ifdef HAVE_VTE + app->lib_vte = lib_vte; +#endif + app->ignore_global_tags = ignore_global_tags; +} - if (alternate_config) config_dir = g_strdup(alternate_config); - else config_dir = g_strconcat(GEANY_HOME_DIR, G_DIR_SEPARATOR_S, ".", PACKAGE, NULL); - mkdir_result = utils_make_settings_dir(config_dir, data_dir, doc_dir); +// Returns 0 if config dir is OK. +static gint setup_config_dir() +{ + gint mkdir_result = 0; + + mkdir_result = utils_make_settings_dir(app->configdir, app->datadir, app->docdir); if (mkdir_result != 0) { if (! dialogs_show_question( @@ -524,22 +532,53 @@ "using Geany without a configuration directory.\nStart Geany anyway?"), g_strerror(mkdir_result))) { - g_free(config_dir); - return (0); + exit(0); } } + return mkdir_result; +} + +static void signal_cb(gint sig) +{ + if (sig == SIGTERM) + { + on_exit_clicked(NULL, NULL); + } +} + + +gint main(gint argc, gchar **argv) +{ + gint idx; + gint config_dir_result; + + app = g_new0(MyApp, 1); + + setup_paths(); + locale_init(); + parse_command_line_options(&argc, &argv); + + gtk_set_locale(); + + signal(SIGTERM, signal_cb); +#ifdef G_OS_UNIX + /* ignore SIGPIPE signal for preventing sudden death of program */ + signal(SIGPIPE, SIG_IGN); +#endif + + config_dir_result = setup_config_dir(); + // handle fifo + app->fifo_ioc = NULL; #ifdef HAVE_FIFO - if (! ignore_fifo) ioc = create_fifo(argc, argv, config_dir); + if (! ignore_fifo) + app->fifo_ioc = create_fifo(argc, argv, app->configdir); #endif - g_free(config_dir); gtk_init(&argc, &argv); // inits main_init(); - app->datadir = data_dir; - app->docdir = doc_dir; gtk_widget_set_size_request(app->window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT); gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT); encodings_init(); @@ -553,9 +592,6 @@ app->have_vte = app->load_vte; if (no_vte) app->have_vte = FALSE; #endif -#ifdef HAVE_FIFO - app->fifo_ioc = ioc; -#endif filetypes_init_types(); if (generate_datafiles) { @@ -588,8 +624,9 @@ utils_create_insert_menu_items(); msgwin_status_add(_("This is Geany %s."), VERSION); - if (mkdir_result != 0) - msgwin_status_add(_("Configuration directory could not be created (%s)."), g_strerror(mkdir_result)); + if (config_dir_result != 0) + msgwin_status_add(_("Configuration directory could not be created (%s)."), + g_strerror(config_dir_result)); // apply all configuration options apply_settings(); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [728] trunk/src
by ntrel@users.sourceforge.net
17 Aug '06
17 Aug '06
Revision: 728 Author: ntrel Date: 2006-08-17 07:38:57 -0700 (Thu, 17 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=728&view=rev
Log Message: ----------- Move signal_cb to main.c Modified Paths: -------------- trunk/src/callbacks.c trunk/src/callbacks.h Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-08-15 21:00:43 UTC (rev 727) +++ trunk/src/callbacks.c 2006-08-17 14:38:57 UTC (rev 728) @@ -26,7 +26,6 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> -#include <signal.h> #include <gdk/gdkkeysyms.h> #include "callbacks.h" @@ -79,15 +78,6 @@ static gint clickpos; -void signal_cb(gint sig) -{ - if (sig == SIGTERM) - { - on_exit_clicked(NULL, NULL); - } -} - - // real exit function gint destroyapp(GtkWidget *widget, gpointer gdata) { Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2006-08-15 21:00:43 UTC (rev 727) +++ trunk/src/callbacks.h 2006-08-17 14:38:57 UTC (rev 728) @@ -22,9 +22,6 @@ extern gchar current_word[]; //needed for popup menu keybindings access -void -signal_cb (gint sig); - gint destroyapp (GtkWidget *widget, gpointer gdata); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
SF.net SVN: geany: [727] trunk
by ntrel@users.sourceforge.net
15 Aug '06
15 Aug '06
Revision: 727 Author: ntrel Date: 2006-08-15 14:00:43 -0700 (Tue, 15 Aug 2006) ViewCVS:
http://svn.sourceforge.net/geany/?rev=727&view=rev
Log Message: ----------- Return to showing calltips after successful autocompletion; Use separate functions for html and tag autocompletion Modified Paths: -------------- trunk/ChangeLog trunk/src/keybindings.c trunk/src/sci_cb.c trunk/src/sci_cb.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-08-15 19:41:12 UTC (rev 726) +++ trunk/ChangeLog 2006-08-15 21:00:43 UTC (rev 727) @@ -2,6 +2,9 @@ * tagmanager/c.c: Backported calltips workspace support for C-like user files from Anjuta. + * src/keybindings.c, src/sci_cb.c, src/sci_cb.h: + Return to showing calltips after successful autocompletion. + Use separate functions for html and tag autocompletion. 2006-08-15 Enrico Tröger <enrico.troeger(a)uvena.de> Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2006-08-15 19:41:12 UTC (rev 726) +++ trunk/src/keybindings.c 2006-08-15 21:00:43 UTC (rev 727) @@ -724,8 +724,7 @@ { gint idx = document_get_cur_idx(); if (idx == -1 || ! doc_list[idx].is_valid) return; - sci_cb_start_auto_complete(doc_list[idx].sci, - sci_get_current_position(doc_list[idx].sci), idx, TRUE); + sci_cb_start_auto_complete(idx, sci_get_current_position(doc_list[idx].sci), TRUE); } static void cb_func_edit_calltip(void) Modified: trunk/src/sci_cb.c =================================================================== --- trunk/src/sci_cb.c 2006-08-15 19:41:12 UTC (rev 726) +++ trunk/src/sci_cb.c 2006-08-15 21:00:43 UTC (rev 727) @@ -32,6 +32,12 @@ #include "sciwrappers.h" #include "utils.h" +static struct +{ + gchar *text; + gboolean set; +} calltip = {NULL, FALSE}; + static gchar indent[100]; @@ -157,6 +163,9 @@ { SSM(sci, SCI_CALLTIPCANCEL, 0, 0); } + g_free(calltip.text); + calltip.text = NULL; + calltip.set = FALSE; break; } case ' ': @@ -176,7 +185,7 @@ if (doc_list[idx].use_auto_indention) sci_cb_close_block(sci, pos - 1); break; } - default: sci_cb_start_auto_complete(sci, pos, idx, FALSE); + default: sci_cb_start_auto_complete(idx, pos, FALSE); } break; } @@ -198,6 +207,22 @@ } break; } + case SCN_AUTOCSELECTION: + { + // now that autocomplete is finishing, reshow calltips if they were showing + if (calltip.set) + { + gint pos = sci_get_current_position(sci); + SSM(sci, SCI_CALLTIPSHOW, pos, (sptr_t) calltip.text); + // now autocompletion has been cancelled, so do it manually + sci_set_selection_start(sci, nt->lParam); + sci_set_selection_end(sci, pos); + sci_replace_sel(sci, ""); // clear root of word + SSM(sci, SCI_INSERTTEXT, nt->lParam, (sptr_t) nt->text); + sci_goto_pos(sci, nt->lParam + strlen(nt->text), FALSE); + } + break; + } /* case SCN_STYLENEEDED: { geany_debug("style"); @@ -393,30 +418,97 @@ tags = tm_workspace_find(word, tm_tag_max_t, NULL, FALSE, doc_list[idx].file_type->lang); if (tags->len == 1 && TM_TAG(tags->pdata[0])->atts.entry.arglist) { - gchar *calltip; tag = TM_TAG(tags->pdata[0]); + g_free(calltip.text); // free the old calltip + calltip.set = TRUE; if (tag->atts.entry.var_type) - calltip = g_strconcat(tag->atts.entry.var_type, " ", tag->name, + calltip.text = g_strconcat(tag->atts.entry.var_type, " ", tag->name, " ", tag->atts.entry.arglist, NULL); else - calltip = g_strconcat(tag->name, " ", tag->atts.entry.arglist, NULL); + calltip.text = g_strconcat(tag->name, " ", tag->atts.entry.arglist, NULL); - utils_wrap_string(calltip, -1); - SSM(sci, SCI_CALLTIPSHOW, orig_pos, (sptr_t) calltip); - g_free(calltip); + utils_wrap_string(calltip.text, -1); + SSM(sci, SCI_CALLTIPSHOW, orig_pos, (sptr_t) calltip.text); } return TRUE; } -gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx, gboolean force) +static void show_autocomplete(ScintillaObject *sci, gint rootlen, const gchar *words) { + // store whether a calltip is showing, so we can reshow it after autocompletion + calltip.set = SSM(sci, SCI_CALLTIPACTIVE, 0, 0); + SSM(sci, SCI_AUTOCSHOW, rootlen, (sptr_t) words); +} + + +static gboolean +autocomplete_html(ScintillaObject *sci, const gchar *root, gsize rootlen) +{ // HTML entities auto completion + guint i, j = 0; + GString *words; + + if (*root != '&') return FALSE; + if (html_entities == NULL) return FALSE; + + words = g_string_sized_new(500); + for (i = 0; ; i++) + { + if (html_entities[i] == NULL) break; + else if (html_entities[i][0] == '#') continue; + + if (! strncmp(html_entities[i], root, rootlen)) + { + if (j++ > 0) g_string_append_c(words, ' '); + g_string_append(words, html_entities[i]); + } + } + if (words->len > 0) show_autocomplete(sci, rootlen, words->str); + g_string_free(words, TRUE); + return TRUE; +} + + +static gboolean +autocomplete_tags(gint idx, gchar *root, gsize rootlen) +{ // PHP, LaTeX, C and C++ tag autocompletion + TMTagAttrType attrs[] = { tm_tag_attr_name_t, 0 }; + const GPtrArray *tags; + ScintillaObject *sci; + + if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL) + return FALSE; + sci = doc_list[idx].sci; + + tags = tm_workspace_find(root, tm_tag_max_t, attrs, TRUE, doc_list[idx].file_type->lang); + if (NULL != tags && tags->len > 0) + { + GString *words = g_string_sized_new(150); + guint j; + + for (j = 0; ((j < tags->len) && (j < GEANY_MAX_AUTOCOMPLETE_WORDS)); ++j) + { + if (j > 0) g_string_append_c(words, ' '); + g_string_append(words, ((TMTag *) tags->pdata[j])->name); + } + show_autocomplete(sci, rootlen, words->str); + //geany_debug("string size: %d", words->len); + g_string_free(words, TRUE); + } + return TRUE; +} + + +gboolean sci_cb_start_auto_complete(gint idx, gint pos, gboolean force) +{ gint line, line_start, line_len, line_pos, current, rootlen, startword, lexer, style; gchar *linebuf, *root; - const GPtrArray *tags; + ScintillaObject *sci; + gboolean ret = FALSE; - if (sci == NULL) return FALSE; + if (idx < 0 || ! doc_list[idx].is_valid || doc_list[idx].sci == NULL) return FALSE; + sci = doc_list[idx].sci; line = sci_get_line_from_position(sci, pos); line_start = sci_get_position_from_line(sci, line); @@ -442,68 +534,17 @@ root = linebuf + startword; rootlen = current - startword; - if (*root == '&' && lexer == SCLEX_HTML) - { // HTML entities auto completion - guint i, j = 0; - GString *words; - - if (html_entities == NULL) return FALSE; - - words = g_string_sized_new(500); - for (i = 0; ; i++) - { - if (html_entities[i] == NULL) break; - else if (html_entities[i][0] == '#') continue; - - if (! strncmp(html_entities[i], root, rootlen)) - { - if (j++ > 0) g_string_append_c(words, ' '); - g_string_append(words, html_entities[i]); - } - } - if (words->len > 0) SSM(sci, SCI_AUTOCSHOW, rootlen, (sptr_t) words->str); - g_string_free(words, TRUE); + if (lexer == SCLEX_HTML) + ret = autocomplete_html(sci, root, rootlen); + else + { + // force is set when called by keyboard shortcut, otherwise start at the 4th char + if (force || rootlen >= 4) + ret = autocomplete_tags(idx, root, rootlen); } - else - { // PHP, LaTeX, C and C++ tag autocompletion - gint i = 0; - TMTagAttrType attrs[] = { tm_tag_attr_name_t, 0 }; - if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL) - { - g_free(linebuf); - return FALSE; - } - - if (! force) - { // force is set when called by keyboard shortcut, otherwise start after at third char - /// TODO g_ascii_isspace is not the best choise because it allows öprin... - while ((line_pos - i >= 0) && ! g_ascii_isspace(linebuf[line_pos - i])) i++; - if (i < 4) - { // go home if typed less than 4 chars - g_free(linebuf); - return FALSE; - } - } - - tags = tm_workspace_find(root, tm_tag_max_t, attrs, TRUE, doc_list[idx].file_type->lang); - if (NULL != tags && tags->len > 0) - { - GString *words = g_string_sized_new(150); - guint j; - - for (j = 0; ((j < tags->len) && (j < GEANY_MAX_AUTOCOMPLETE_WORDS)); ++j) - { - if (j > 0) g_string_append_c(words, ' '); - g_string_append(words, ((TMTag *) tags->pdata[j])->name); - } - SSM(sci, SCI_AUTOCSHOW, rootlen, (sptr_t) words->str); - //geany_debug("string size: %d", words->len); - g_string_free(words, TRUE); - } - } g_free(linebuf); - return TRUE; + return ret; } Modified: trunk/src/sci_cb.h =================================================================== --- trunk/src/sci_cb.h 2006-08-15 19:41:12 UTC (rev 726) +++ trunk/src/sci_cb.h 2006-08-15 21:00:43 UTC (rev 727) @@ -29,7 +29,7 @@ // callback func called by all editors when a signals arises void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data); -gboolean sci_cb_start_auto_complete(ScintillaObject *sci, gint pos, gint idx, gboolean force); +gboolean sci_cb_start_auto_complete(gint idx, gint pos, gboolean force); void sci_cb_get_indent(ScintillaObject *sci, gint pos, gboolean use_this_line); This was sent by the
SourceForge.net
collaborative development platform, the world's largest Open Source development site.
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
13
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
Results per page:
10
25
50
100
200