"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ui_utils.c" between
geany-1.35.tar.bz2 and geany-1.36.tar.bz2

About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...).

ui_utils.c  (geany-1.35.tar.bz2):ui_utils.c  (geany-1.36.tar.bz2)
skipping to change at line 39 skipping to change at line 39
#include "ui_utils.h" #include "ui_utils.h"
#include "app.h" #include "app.h"
#include "callbacks.h" #include "callbacks.h"
#include "dialogs.h" #include "dialogs.h"
#include "documentprivate.h" #include "documentprivate.h"
#include "encodingsprivate.h" #include "encodingsprivate.h"
#include "filetypes.h" #include "filetypes.h"
#include "geanymenubuttonaction.h" #include "geanymenubuttonaction.h"
#include "keyfile.h" #include "keyfile.h"
#include "keybindings.h"
#include "main.h" #include "main.h"
#include "msgwindow.h" #include "msgwindow.h"
#include "prefs.h" #include "prefs.h"
#include "project.h" #include "project.h"
#include "sciwrappers.h" #include "sciwrappers.h"
#include "sidebar.h" #include "sidebar.h"
#include "stash.h" #include "stash.h"
#include "support.h" #include "support.h"
#include "symbols.h" #include "symbols.h"
#include "toolbar.h" #include "toolbar.h"
skipping to change at line 2016 skipping to change at line 2017
ft = filetypes[GEANY_FILETYPES_CONF]; ft = filetypes[GEANY_FILETYPES_CONF];
if (g_file_test(file_name, G_FILE_TEST_EXISTS)) if (g_file_test(file_name, G_FILE_TEST_EXISTS))
document_open_file(file_name, FALSE, ft, NULL); document_open_file(file_name, FALSE, ft, NULL);
else else
{ {
gchar *utf8_filename = utils_get_utf8_from_locale(file_name); gchar *utf8_filename = utils_get_utf8_from_locale(file_name);
gchar *global_file; gchar *global_file;
gchar *base_name = NULL; gchar *base_name = NULL;
gchar *global_content = NULL; gchar *global_content = NULL;
GeanyDocument *doc = NULL;
/* get the path inside app->configdir - can contain subdirectorie s */ /* get the path inside app->configdir - can contain subdirectorie s */
if (g_str_has_prefix(file_name, app->configdir)) if (g_str_has_prefix(file_name, app->configdir))
{ {
gsize len = strlen(app->configdir); gsize len = strlen(app->configdir);
if (file_name[len] == G_DIR_SEPARATOR) if (file_name[len] == G_DIR_SEPARATOR)
base_name = g_strdup(file_name + len + 1); base_name = g_strdup(file_name + len + 1);
} }
if (!base_name) if (!base_name)
base_name = g_path_get_basename(file_name); base_name = g_path_get_basename(file_name);
global_file = g_build_filename(app->datadir, base_name, NULL); global_file = g_build_filename(app->datadir, base_name, NULL);
/* if the requested file doesn't exist in the user's config dir, try loading the file /* if the requested file doesn't exist in the user's config dir, try loading the file
* from the global data directory and use its contents for the ne wly created file */ * from the global data directory and use its contents for the ne wly created file */
if (g_file_test(global_file, G_FILE_TEST_EXISTS)) if (g_file_test(global_file, G_FILE_TEST_EXISTS))
g_file_get_contents(global_file, &global_content, NULL, N ULL); g_file_get_contents(global_file, &global_content, NULL, N ULL);
document_new_file(utf8_filename, ft, global_content); doc = document_new_file(utf8_filename, ft, global_content);
if (global_content)
{
sci_select_all(doc->editor->sci);
keybindings_send_command(GEANY_KEY_GROUP_FORMAT,
GEANY_KEYS_FORMAT_COMMENTLINETOGGLE);
sci_set_current_line(doc->editor->sci, 0);
document_set_text_changed(doc, FALSE);
sci_empty_undo_buffer(doc->editor->sci);
ui_document_show_hide(doc); /* update the document menu *
/
}
utils_free_pointers(4, utf8_filename, base_name, global_file, glo bal_content, NULL); utils_free_pointers(4, utf8_filename, base_name, global_file, glo bal_content, NULL);
} }
} }
static void free_on_closure_notify(gpointer data, GClosure *closure) static void free_on_closure_notify(gpointer data, GClosure *closure)
{ {
g_free(data); g_free(data);
} }
/* @note You should connect to the "document-save" signal yourself to detect /* @note You should connect to the "document-save" signal yourself to detect
skipping to change at line 2230 skipping to change at line 2241
} }
} }
/* Currently ui_init() is called before keyfile.c stash group code is initialize d, /* Currently ui_init() is called before keyfile.c stash group code is initialize d,
* so this is called after that's done. */ * so this is called after that's done. */
void ui_init_prefs(void) void ui_init_prefs(void)
{ {
StashGroup *group = stash_group_new(PACKAGE); StashGroup *group = stash_group_new(PACKAGE);
/* various prefs */ /* various prefs */
configuration_add_various_pref_group(group); configuration_add_various_pref_group(group, "interface");
stash_group_add_boolean(group, &interface_prefs.show_symbol_list_expander s, stash_group_add_boolean(group, &interface_prefs.show_symbol_list_expander s,
"show_symbol_list_expanders", TRUE); "show_symbol_list_expanders", TRUE);
stash_group_add_boolean(group, &interface_prefs.compiler_tab_autoscroll, stash_group_add_boolean(group, &interface_prefs.compiler_tab_autoscroll,
"compiler_tab_autoscroll", TRUE); "compiler_tab_autoscroll", TRUE);
stash_group_add_boolean(group, &ui_prefs.allow_always_save,
"allow_always_save", FALSE);
stash_group_add_string(group, &ui_prefs.statusbar_template, stash_group_add_string(group, &ui_prefs.statusbar_template,
"statusbar_template", _(DEFAULT_STATUSBAR_TEMPLATE)); "statusbar_template", _(DEFAULT_STATUSBAR_TEMPLATE));
stash_group_add_boolean(group, &ui_prefs.new_document_after_close, stash_group_add_boolean(group, &ui_prefs.new_document_after_close,
"new_document_after_close", FALSE); "new_document_after_close", FALSE);
stash_group_add_boolean(group, &interface_prefs.msgwin_status_visible, stash_group_add_boolean(group, &interface_prefs.msgwin_status_visible,
"msgwin_status_visible", TRUE); "msgwin_status_visible", TRUE);
stash_group_add_boolean(group, &interface_prefs.msgwin_compiler_visible, stash_group_add_boolean(group, &interface_prefs.msgwin_compiler_visible,
"msgwin_compiler_visible", TRUE); "msgwin_compiler_visible", TRUE);
stash_group_add_boolean(group, &interface_prefs.msgwin_messages_visible, stash_group_add_boolean(group, &interface_prefs.msgwin_messages_visible,
"msgwin_messages_visible", TRUE); "msgwin_messages_visible", TRUE);
 End of changes. 5 change blocks. 
5 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)