anjuta r4666 - in trunk: . plugins/language-support-cpp-java plugins/sourceview
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4666 - in trunk: . plugins/language-support-cpp-java plugins/sourceview
- Date: Sun, 1 Feb 2009 15:15:12 +0000 (UTC)
Author: jhs
Date: Sun Feb 1 15:15:11 2009
New Revision: 4666
URL: http://svn.gnome.org/viewvc/anjuta?rev=4666&view=rev
Log:
2009-02-01 Johannes Schmid <jhs gnome org>
* plugins/language-support-cpp-java/cpp-java-assist.c
(cpp_java_assist_create_word_completion_cache):
Make auto-completion working for non-local project symbol. Still depends
on a better search interface for the symbol-db to also show local symbols
* plugins/sourceview/anjuta-editor-sourceview.glade:
* plugins/sourceview/sourceview-io.c (sourceview_io_save_as):
#561094 â Creation of backup files can't be disabled using gtksourceview
Modified:
trunk/ChangeLog
trunk/plugins/language-support-cpp-java/cpp-java-assist.c
trunk/plugins/sourceview/anjuta-editor-sourceview.glade
trunk/plugins/sourceview/sourceview-io.c
Modified: trunk/plugins/language-support-cpp-java/cpp-java-assist.c
==============================================================================
--- trunk/plugins/language-support-cpp-java/cpp-java-assist.c (original)
+++ trunk/plugins/language-support-cpp-java/cpp-java-assist.c Sun Feb 1 15:15:11 2009
@@ -530,7 +530,7 @@
IANJUTA_SYMBOL_TYPE_MAX,
TRUE,
IANJUTA_SYMBOL_FIELD_SIMPLE|IANJUTA_SYMBOL_FIELD_TYPE,
- assist->priv->pre_word, TRUE, FALSE, FALSE, -1, -1, NULL);
+ assist->priv->pre_word, TRUE, TRUE, FALSE, -1, -1, NULL);
IAnjutaIterable* iter_globals =
ianjuta_symbol_manager_search (assist->priv->isymbol_manager,
Modified: trunk/plugins/sourceview/anjuta-editor-sourceview.glade
==============================================================================
--- trunk/plugins/sourceview/anjuta-editor-sourceview.glade (original)
+++ trunk/plugins/sourceview/anjuta-editor-sourceview.glade Sun Feb 1 15:15:11 2009
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<glade-interface>
- <requires-version lib="gtk+" version="2.12"/>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="preferences_dialog">
<property name="title">window1</property>
<child>
@@ -18,7 +19,7 @@
<property name="border_width">5</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="vbox1111">
<property name="visible">True</property>
@@ -31,39 +32,12 @@
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:use.tabs">
+ <property name="label" translatable="yes">Use tabs for indentation</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Use tabs for indentation</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -130,10 +104,38 @@
<property name="y_options">GTK_EXPAND</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -171,7 +173,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="vbox1120">
<property name="visible">True</property>
@@ -179,25 +181,26 @@
<property name="spacing">5</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.syntax.highlight">
+ <property name="label" translatable="yes">Highlight syntax</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Highlight syntax</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview.brackets.highlight">
+ <property name="label" translatable="yes">Highlight matching brackets</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Highlight matching brackets</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -207,7 +210,19 @@
</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.backup">
+ <property name="label" translatable="yes">Create backup files</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
</child>
<child>
<placeholder/>
@@ -232,11 +247,13 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -248,7 +265,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
@@ -256,25 +273,26 @@
<property name="spacing">5</property>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:0:0:sourceview.currentline.highlight">
+ <property name="label" translatable="yes">Highlight current line</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Highlight current line</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin.linenumber.visible">
+ <property name="label" translatable="yes">Show line numbers</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show line numbers</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -285,11 +303,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:margin.marker.visible">
+ <property name="label" translatable="yes">Show marks</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show marks</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -300,11 +318,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.rightmargin.visible">
+ <property name="label" translatable="yes">Show right margin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Show right margin</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -321,12 +339,6 @@
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkLabel" id="label19">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -352,6 +364,12 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -374,6 +392,7 @@
</widget>
<packing>
<property name="expand">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -410,7 +429,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
@@ -428,7 +447,7 @@
<widget class="GtkFontButton" id="preferences_font:font:Monospace 12:0:sourceview.font">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="response_id">0</property>
+ <property name="receives_default">False</property>
</widget>
<packing>
<property name="right_attach">2</property>
@@ -439,11 +458,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:sourceview.font.use_theme">
+ <property name="label" translatable="yes">Use theme font</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Use theme font</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -480,7 +499,7 @@
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
@@ -498,6 +517,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
@@ -549,25 +569,21 @@
<property name="border_width">5</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
<widget class="GtkTable" id="table17">
<property name="visible">True</property>
<property name="border_width">10</property>
<property name="n_rows">6</property>
- <property name="n_columns">1</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.header">
+ <property name="label" translatable="yes">Print page header</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Print page header</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -579,11 +595,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.footer">
+ <property name="label" translatable="yes">Print page footer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Print page footer</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -593,11 +609,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.linenumbers">
+ <property name="label" translatable="yes">Print Linenumbers</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Print Linenumbers</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -609,11 +625,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.highlight">
+ <property name="label" translatable="yes">Highlight syntax</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Highlight syntax</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -625,11 +641,11 @@
</child>
<child>
<widget class="GtkCheckButton" id="preferences_toggle:bool:1:0:print.linewrap">
+ <property name="label" translatable="yes">Wrap long lines to fit on paper</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="label" translatable="yes">Wrap long lines to fit on paper</property>
+ <property name="receives_default">False</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
@@ -639,6 +655,9 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
Modified: trunk/plugins/sourceview/sourceview-io.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-io.c (original)
+++ trunk/plugins/sourceview/sourceview-io.c Sun Feb 1 15:15:11 2009
@@ -18,10 +18,10 @@
*/
#include "sourceview-io.h"
+#include "sourceview-private.h"
#include <libanjuta/interfaces/ianjuta-editor.h>
#include <libanjuta/anjuta-convert.h>
#include <libanjuta/anjuta-encodings.h>
-#include <sourceview-private.h>
#define READ_SIZE 4096
#define RATE_LIMIT 5000 /* Use a big rate limit to avoid duplicates */
@@ -280,30 +280,22 @@
{
GFileOutputStream* output_stream;
GError* err = NULL;
+ gboolean backup = TRUE;
+
g_return_if_fail (file != NULL);
cancel_monitor (sio);
- output_stream = g_file_create (file, G_FILE_CREATE_NONE, NULL, &err);
+ backup = anjuta_preferences_get_int_with_default (sio->sv->priv->prefs,
+ "sourceview.backup", TRUE);
+
+ output_stream = g_file_replace (file, NULL, backup, G_FILE_CREATE_NONE,
+ NULL, NULL);
if (!output_stream)
{
- if (err->code != G_IO_ERROR_EXISTS)
- {
- g_signal_emit_by_name (sio, "save-failed", err);
- g_error_free (err);
- return;
- }
- else
- {
- output_stream = g_file_replace (file, NULL, TRUE, G_FILE_CREATE_NONE,
- NULL, NULL);
- if (!output_stream)
- {
- g_signal_emit_by_name (sio, "save-failed", err);
- g_error_free (err);
- return;
- }
- }
+ g_signal_emit_by_name (sio, "save-failed", err);
+ g_error_free (err);
+ return;
}
if (sio->last_encoding == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]