Revision: 3237
http://geany.svn.sourceforge.net/geany/?rev=3237&view=rev
Author: eht16
Date: 2008-11-16 17:53:55 +0000 (Sun, 16 Nov 2008)
Log Message:
-----------
Add and use ui_combo_box_prepend_text_once() to add project's base_path to the Find in Files dialog even if another project was opened.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
trunk/src/ui_utils.c
trunk/src/ui_utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-16 17:53:33 UTC (rev 3236)
+++ trunk/ChangeLog 2008-11-16 17:53:55 UTC (rev 3237)
@@ -7,6 +7,10 @@
when a Find in Files search fails.
Add the project's base_path to the directory list in the Find in
Files dialog if a project is open.
+ * src/search.c, src/ui_utils.c, src/ui_utils.h:
+ Add and use ui_combo_box_prepend_text_once() to add project's
+ base_path to the Find in Files dialog even if another project was
+ opened.
2008-11-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2008-11-16 17:53:33 UTC (rev 3236)
+++ trunk/src/search.c 2008-11-16 17:53:55 UTC (rev 3237)
@@ -744,7 +744,6 @@
gchar *sel = NULL;
gchar *cur_dir = NULL;
GeanyEncodingIndex enc_idx = GEANY_ENCODING_UTF_8;
- static gboolean project_basepath_added = FALSE;
if (widgets.find_in_files_dialog == NULL)
{
@@ -762,11 +761,10 @@
/* add project's base path directory to the dir list, we do this here once
* (in create_fif_dialog() it would fail if a project is opened after dialog creation) */
- if (app->project != NULL && NZV(app->project->base_path) && ! project_basepath_added)
+ if (app->project != NULL && NZV(app->project->base_path))
{
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(find_in_files.dir_combo),
+ ui_combo_box_prepend_text_once(GTK_COMBO_BOX(find_in_files.dir_combo),
app->project->base_path);
- project_basepath_added = TRUE;
}
entry = GTK_BIN(find_in_files.dir_combo)->child;
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2008-11-16 17:53:33 UTC (rev 3236)
+++ trunk/src/ui_utils.c 2008-11-16 17:53:55 UTC (rev 3237)
@@ -1259,6 +1259,33 @@
}
+/* Same as gtk_combo_box_prepend_text(), except that text is only prepended if it not already
+ * exists in the combo's model. */
+void ui_combo_box_prepend_text_once(GtkComboBox *combo, const gchar *text)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gchar *combo_text;
+ gboolean found = FALSE;
+
+ model = gtk_combo_box_get_model(combo);
+ if (gtk_tree_model_get_iter_first(model, &iter))
+ {
+ do
+ {
+ gtk_tree_model_get(model, &iter, 0, &combo_text, -1);
+ found = utils_str_equal(combo_text, text);
+ g_free(combo_text);
+ }
+ while (!found && gtk_tree_model_iter_next(model, &iter));
+ }
+ if (found)
+ return; /* don't prepend duplicate */
+
+ gtk_combo_box_prepend_text(combo, text);
+}
+
+
/* Changes the color of the notebook tab text and open files items according to
* document status. */
void ui_update_tab_status(GeanyDocument *doc)
Modified: trunk/src/ui_utils.h
===================================================================
--- trunk/src/ui_utils.h 2008-11-16 17:53:33 UTC (rev 3236)
+++ trunk/src/ui_utils.h 2008-11-16 17:53:55 UTC (rev 3237)
@@ -154,6 +154,8 @@
void ui_combo_box_add_to_history(GtkComboBox *combo, const gchar *text);
+void ui_combo_box_prepend_text_once(GtkComboBox *combo, const gchar *text);
+
GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry);
void ui_setup_open_button_callback(GtkWidget *open_btn, const gchar *title,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3236
http://geany.svn.sourceforge.net/geany/?rev=3236&view=rev
Author: eht16
Date: 2008-11-16 17:53:33 +0000 (Sun, 16 Nov 2008)
Log Message:
-----------
Add the project's base_path to the directory list in the Find in Files dialog if a project is open.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-16 17:53:13 UTC (rev 3235)
+++ trunk/ChangeLog 2008-11-16 17:53:33 UTC (rev 3236)
@@ -5,6 +5,8 @@
* src/search.c:
Capture command's stderr and log it into the Debug messages window
when a Find in Files search fails.
+ Add the project's base_path to the directory list in the Find in
+ Files dialog if a project is open.
2008-11-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2008-11-16 17:53:13 UTC (rev 3235)
+++ trunk/src/search.c 2008-11-16 17:53:33 UTC (rev 3236)
@@ -39,6 +39,7 @@
#include "ui_utils.h"
#include "editor.h"
#include "encodings.h"
+#include "project.h"
#include <unistd.h>
#include <string.h>
@@ -743,6 +744,7 @@
gchar *sel = NULL;
gchar *cur_dir = NULL;
GeanyEncodingIndex enc_idx = GEANY_ENCODING_UTF_8;
+ static gboolean project_basepath_added = FALSE;
if (widgets.find_in_files_dialog == NULL)
{
@@ -758,6 +760,15 @@
gtk_entry_set_text(GTK_ENTRY(entry), sel);
g_free(sel);
+ /* add project's base path directory to the dir list, we do this here once
+ * (in create_fif_dialog() it would fail if a project is opened after dialog creation) */
+ if (app->project != NULL && NZV(app->project->base_path) && ! project_basepath_added)
+ {
+ gtk_combo_box_prepend_text(GTK_COMBO_BOX(find_in_files.dir_combo),
+ app->project->base_path);
+ project_basepath_added = TRUE;
+ }
+
entry = GTK_BIN(find_in_files.dir_combo)->child;
if (NZV(dir))
cur_dir = g_strdup(dir); /* custom directory argument passed */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3233
http://geany.svn.sourceforge.net/geany/?rev=3233&view=rev
Author: eht16
Date: 2008-11-16 17:52:38 +0000 (Sun, 16 Nov 2008)
Log Message:
-----------
Add note about set permissions to the API docs of utils_mkdir().
Modified Paths:
--------------
trunk/src/utils.c
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2008-11-15 16:51:05 UTC (rev 3232)
+++ trunk/src/utils.c 2008-11-16 17:52:38 UTC (rev 3233)
@@ -1232,6 +1232,7 @@
/**
* Create a directory if it doesn't already exist.
* Create intermediate parent directories as needed, too.
+ * The permissions of the created directory are set 0700.
*
* @param path The path of the directory to create, in locale encoding.
* @param create_parent_dirs Whether to create intermediate parent directories if necessary.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3232
http://geany.svn.sourceforge.net/geany/?rev=3232&view=rev
Author: eht16
Date: 2008-11-15 16:51:05 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Change the default values for selection fore- and background colour to some sane values.
Modified Paths:
--------------
trunk/ChangeLog
trunk/data/filetypes.common
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-15 15:53:40 UTC (rev 3231)
+++ trunk/ChangeLog 2008-11-15 16:51:05 UTC (rev 3232)
@@ -6,6 +6,9 @@
Fix possible crash when using the Find in Files dialog.
Clear previously set search indicators before when using 'Mark' in
the Find dialog.
+ * data/filetypes.common:
+ Change the default values for selection fore- and background colour
+ to some sane values.
2008-11-14 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/data/filetypes.common
===================================================================
--- trunk/data/filetypes.common 2008-11-15 15:53:40 UTC (rev 3231)
+++ trunk/data/filetypes.common 2008-11-15 16:51:05 UTC (rev 3232)
@@ -5,7 +5,7 @@
# 3rd selection argument is true to override default foreground
# 4th selection argument is true to override default background
-selection=0xc0c0c0;0x7f0000;false;false
+selection=0x000000;0xc0c0c0;false;false
# style for a matching brace
brace_good=0x0000ff;0xFFFFFF;true;false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3231
http://geany.svn.sourceforge.net/geany/?rev=3231&view=rev
Author: eht16
Date: 2008-11-15 15:53:40 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Clear previously set search indicators before when using 'Mark' in the Find dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-15 15:53:05 UTC (rev 3230)
+++ trunk/ChangeLog 2008-11-15 15:53:40 UTC (rev 3231)
@@ -4,6 +4,8 @@
Fix wrong highlighting of search results when using 'Mark' in
the Find dialog.
Fix possible crash when using the Find in Files dialog.
+ Clear previously set search indicators before when using 'Mark' in
+ the Find dialog.
2008-11-14 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2008-11-15 15:53:05 UTC (rev 3230)
+++ trunk/src/search.c 2008-11-15 15:53:40 UTC (rev 3231)
@@ -846,6 +846,9 @@
g_return_val_if_fail(doc != NULL, 0);
+ /* clear previous search indicators */
+ editor_clear_indicators_full(doc->editor, GEANY_INDICATOR_SEARCH);
+
len = strlen(search_text);
ttf.chrg.cpMin = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3230
http://geany.svn.sourceforge.net/geany/?rev=3230&view=rev
Author: eht16
Date: 2008-11-15 15:53:05 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
Fix possible crash when using the Find in Files dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-11-15 15:52:36 UTC (rev 3229)
+++ trunk/ChangeLog 2008-11-15 15:53:05 UTC (rev 3230)
@@ -3,6 +3,7 @@
* src/search.c:
Fix wrong highlighting of search results when using 'Mark' in
the Find dialog.
+ Fix possible crash when using the Find in Files dialog.
2008-11-14 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2008-11-15 15:52:36 UTC (rev 3229)
+++ trunk/src/search.c 2008-11-15 15:53:05 UTC (rev 3230)
@@ -1357,11 +1357,13 @@
{
if (condition & (G_IO_IN | G_IO_PRI))
{
- gchar *msg, *utf8_msg = NULL;
+ gchar *msg, *utf8_msg;
gchar *enc = data;
while (g_io_channel_read_line(source, &msg, NULL, NULL, NULL) && msg)
{
+ utf8_msg = NULL;
+
g_strstrip(msg);
if (! g_utf8_validate(msg, -1, NULL))
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.