Kaydet (Commit) 35003deb authored tarafından Nick Treleaven's avatar Nick Treleaven

Added Auto indentation and Line wrapping options to Preferences dialog; Split up…

Added Auto indentation and Line wrapping options to Preferences dialog; Split up Miscellaneous items into Display and Features; Renamed Change Selection and Run toolbutton.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@654 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 74e1d66c
2006-08-01 Nick Treleaven <nick.treleaven@btinternet.com>
* src/interface.c, src/utils.c, src/utils.h, src/callbacks.c,
src/keyfile.c, src/document.c, src/prefs.c, geany.glade:
Added Auto indentation and Line wrapping options to Preferences
dialog. Split up Miscellaneous items into Display and Features.
Renamed Change Selection and Run toolbutton.
2006-07-31 Enrico Tröger <enrico.troeger@uvena.de>
* src/keybindings.c, src/sci_cb.c:
......
This diff is collapsed.
......@@ -738,32 +738,14 @@ on_notebook1_switch_page (GtkNotebook *notebook,
if (idx >= 0 && app->opening_session_files == FALSE)
{
app->ignore_callback = TRUE;
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_line_breaking1")),
doc_list[idx].line_breaking);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_use_auto_indention1")),
doc_list[idx].use_auto_indention);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "set_file_readonly1")),
doc_list[idx].readonly);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_write_unicode_bom1")),
doc_list[idx].has_bom);
gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"),
utils_is_unicode_charset(doc_list[idx].encoding));
gtk_tree_model_foreach(GTK_TREE_MODEL(tv.store_openfiles), treeviews_find_node, GINT_TO_POINTER(idx));
document_set_text_changed(idx);
utils_document_show_hide(idx); //update the document menu
utils_build_show_hide(idx);
utils_update_statusbar(idx, -1);
utils_set_window_title(idx);
utils_update_tag_list(idx, FALSE);
app->ignore_callback = FALSE;
}
}
......
......@@ -184,8 +184,8 @@ void document_init_doclist(void)
{
doc_list[i].is_valid = FALSE;
doc_list[i].has_tags = FALSE;
doc_list[i].use_auto_indention = TRUE;
doc_list[i].line_breaking = TRUE;
doc_list[i].use_auto_indention = app->pref_editor_use_auto_indention;
doc_list[i].line_breaking = app->pref_editor_line_breaking;
doc_list[i].readonly = FALSE;
doc_list[i].tag_store = NULL;
doc_list[i].tag_tree = NULL;
......@@ -282,8 +282,8 @@ gint document_create_new_sci(const gchar *filename)
this->last_check = time(NULL);
this->do_overwrite = FALSE;
this->readonly = FALSE;
this->line_breaking = TRUE;
this->use_auto_indention = TRUE;
this->line_breaking = app->pref_editor_line_breaking;
this->use_auto_indention = app->pref_editor_use_auto_indention;
this->has_tags = FALSE;
this->is_valid = TRUE;
......@@ -366,6 +366,7 @@ void document_new_file(filetype *ft)
doc_list[idx].mtime = time(NULL);
doc_list[idx].changed = FALSE;
document_set_text_changed(idx);
utils_document_show_hide(idx); //update the document menu
#ifdef G_OS_WIN32
sci_set_eol_mode(doc_list[idx].sci, SC_EOL_CRLF);
#else
......@@ -604,26 +605,10 @@ int document_open_file(gint idx, const gchar *filename, gint pos, gboolean reado
sci_goto_pos(doc_list[idx].sci, pos, TRUE);
app->ignore_callback = TRUE;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
lookup_widget(app->window, "menu_write_unicode_bom1")), doc_list[idx].has_bom);
gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"),
utils_is_unicode_charset(doc_list[idx].encoding));
app->ignore_callback = FALSE;
if (! reload)
{
filetype *use_ft = (ft != NULL) ? ft : filetypes_get_from_filename(utf8_filename);
app->ignore_callback = TRUE;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "set_file_readonly1")),
readonly);
app->ignore_callback = FALSE;
doc_list[idx].readonly = readonly;
sci_set_readonly(doc_list[idx].sci, readonly);
......@@ -636,6 +621,7 @@ int document_open_file(gint idx, const gchar *filename, gint pos, gboolean reado
}
document_set_text_changed(idx);
utils_document_show_hide(idx); //update the document menu
g_free(data);
......
This diff is collapsed.
......@@ -247,21 +247,21 @@ gboolean configuration_load(void)
app->sidebar_openfiles_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_openfiles_visible", TRUE);
app->sidebar_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_visible", TRUE);
app->msgwindow_visible = utils_get_setting_boolean(config, PACKAGE, "msgwindow_visible", TRUE);
app->pref_editor_folding = utils_get_setting_boolean(config, PACKAGE, "use_folding", TRUE);
app->pref_editor_use_indicators = utils_get_setting_boolean(config, PACKAGE, "use_indicators", TRUE);
app->pref_editor_line_breaking = utils_get_setting_boolean(config, PACKAGE, "line_breaking", FALSE); //default is off for better performance
app->pref_editor_use_auto_indention = utils_get_setting_boolean(config, PACKAGE, "use_auto_indention", TRUE);
app->pref_editor_use_indicators = utils_get_setting_boolean(config, PACKAGE, "use_indicators", TRUE);
app->pref_editor_show_indent_guide = utils_get_setting_boolean(config, PACKAGE, "show_indent_guide", FALSE);
app->pref_editor_show_white_space = utils_get_setting_boolean(config, PACKAGE, "show_white_space", FALSE);
app->pref_editor_show_line_endings = utils_get_setting_boolean(config, PACKAGE, "show_line_endings", FALSE);
app->pref_editor_auto_close_xml_tags = utils_get_setting_boolean(config, PACKAGE, "auto_close_xml_tags", TRUE);
app->pref_editor_auto_complete_constructs = utils_get_setting_boolean(config, PACKAGE, "auto_complete_constructs", TRUE);
app->pref_editor_folding = utils_get_setting_boolean(config, PACKAGE, "use_folding", TRUE);
app->show_markers_margin = utils_get_setting_boolean(config, PACKAGE, "show_markers_margin", TRUE);
app->show_linenumber_margin = utils_get_setting_boolean(config, PACKAGE, "show_linenumber_margin", TRUE);
app->pref_editor_show_line_endings = utils_get_setting_boolean(config, PACKAGE, "show_line_endings", FALSE);
app->pref_editor_line_breaking = utils_get_setting_boolean(config, PACKAGE, "line_breaking", TRUE);
app->fullscreen = utils_get_setting_boolean(config, PACKAGE, "fullscreen", FALSE);
app->tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", FALSE);
app->brace_match_ltgt = utils_get_setting_boolean(config, PACKAGE, "brace_match_ltgt", FALSE);
app->switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE);
app->pref_editor_auto_close_xml_tags = utils_get_setting_boolean(config, PACKAGE, "auto_close_xml_tags", TRUE);
app->pref_editor_auto_complete_constructs = utils_get_setting_boolean(config, PACKAGE, "auto_complete_constructs", TRUE);
app->editor_font = utils_get_setting_string(config, PACKAGE, "editor_font", GEANY_DEFAULT_FONT_EDITOR);
app->tagbar_font = utils_get_setting_string(config, PACKAGE, "tagbar_font", GEANY_DEFAULT_FONT_SYMBOL_LIST);
app->msgwin_font = utils_get_setting_string(config, PACKAGE, "msgwin_font", GEANY_DEFAULT_FONT_MSG_WINDOW);
......
......@@ -215,12 +215,18 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_line_end");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_show_line_endings);
widget = lookup_widget(app->prefs_dialog, "check_xmltag");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_auto_close_xml_tags);
widget = lookup_widget(app->prefs_dialog, "check_auto_indent");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_use_auto_indention);
widget = lookup_widget(app->prefs_dialog, "check_line_wrapping");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_line_breaking);
widget = lookup_widget(app->prefs_dialog, "check_auto_complete");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_auto_complete_constructs);
widget = lookup_widget(app->prefs_dialog, "check_xmltag");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_auto_close_xml_tags);
widget = lookup_widget(app->prefs_dialog, "check_folding");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_folding);
......@@ -498,12 +504,18 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_line_end");
app->pref_editor_show_line_endings = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_xmltag");
app->pref_editor_auto_close_xml_tags = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_auto_indent");
app->pref_editor_use_auto_indention = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_line_wrapping");
app->pref_editor_line_breaking = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_auto_complete");
app->pref_editor_auto_complete_constructs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_xmltag");
app->pref_editor_auto_close_xml_tags = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_indicators");
app->pref_editor_use_indicators = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
......
......@@ -2506,3 +2506,29 @@ gboolean utils_is_unicode_charset(const gchar *string)
}
return FALSE;
}
void utils_document_show_hide(gint idx)
{
if (idx == -1 || ! doc_list[idx].is_valid) return;
app->ignore_callback = TRUE;
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_line_breaking1")),
doc_list[idx].line_breaking);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_use_auto_indention1")),
doc_list[idx].use_auto_indention);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "set_file_readonly1")),
doc_list[idx].readonly);
gtk_check_menu_item_set_active(
GTK_CHECK_MENU_ITEM(lookup_widget(app->window, "menu_write_unicode_bom1")),
doc_list[idx].has_bom);
gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"),
utils_is_unicode_charset(doc_list[idx].encoding));
app->ignore_callback = FALSE;
}
......@@ -225,4 +225,6 @@ gchar *utils_scan_unicode_bom(const gchar *string);
gboolean utils_is_unicode_charset(const gchar *string);
void utils_document_show_hide(gint idx);
#endif
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