Revision: 2159
http://geany.svn.sourceforge.net/geany/?rev=2159&view=rev
Author: ntrel
Date: 2008-01-11 05:07:57 -0800 (Fri, 11 Jan 2008)
Log Message:
-----------
Add "recent projects menu" item, clarify make commands item.
Modified Paths:
--------------
trunk/TODO
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-01-10 17:11:19 UTC (rev 2158)
+++ trunk/TODO 2008-01-11 13:07:57 UTC (rev 2159)
@@ -10,11 +10,13 @@
o documentation: list and explain filetype modes
o documentation: preferences
- o line breaking mode to limit words on a line for e.g. XML content.
+ o line breaking mode to limit words on a line for e.g. XML content
o common default highlighting styles configurable for all
programming languages
o basic support for adding custom filetypes?
- o configurable default and project make commands
+ o configurable filetype and project make commands (e.g. using
+ bud for D)
+ o recent projects menu
o project indentation settings support
o plugin keybindings
o (DBUS)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2157
http://geany.svn.sourceforge.net/geany/?rev=2157&view=rev
Author: ntrel
Date: 2008-01-10 05:41:58 -0800 (Thu, 10 Jan 2008)
Log Message:
-----------
Add comment to remind me not to use GTK_WIDGET_IS_SENSITIVE for menu items.
Modified Paths:
--------------
trunk/src/keybindings.c
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2008-01-10 13:27:26 UTC (rev 2156)
+++ trunk/src/keybindings.c 2008-01-10 13:41:58 UTC (rev 2157)
@@ -985,6 +985,9 @@
default:
item = NULL;
}
+ /* Note: For Build menu items it's OK (at the moment) to assume they are in the correct
+ * sensitive state, but some other menus don't update the sensitive status until
+ * they are redrawn. */
if (item && GTK_WIDGET_IS_SENSITIVE(item))
gtk_menu_item_activate(GTK_MENU_ITEM(item));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2155
http://geany.svn.sourceforge.net/geany/?rev=2155&view=rev
Author: ntrel
Date: 2008-01-09 10:05:09 -0800 (Wed, 09 Jan 2008)
Log Message:
-----------
Edit base path entry tooltip for clarity.
Use stock close button in close project prompt.
Allow the base path to be empty, so that users can use the current
file's directory for the Make command (but still use project session
support). In future, perhaps it would be good to have a separate Make
path setting for projects.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/project.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-01-09 15:40:22 UTC (rev 2154)
+++ trunk/ChangeLog 2008-01-09 18:05:09 UTC (rev 2155)
@@ -1,3 +1,14 @@
+2008-01-09 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/project.c:
+ Edit base path entry tooltip for clarity.
+ Use stock close button in close project prompt.
+ Allow the base path to be empty, so that users can use the current
+ file's directory for the Make command (but still use project session
+ support). In future, perhaps it would be good to have a separate Make
+ path setting for projects.
+
+
2008-01-09 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* geany.glade, src/geanywraplabel.c, src/geanywraplabel.h,
Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c 2008-01-09 15:40:22 UTC (rev 2154)
+++ trunk/src/project.c 2008-01-09 18:05:09 UTC (rev 2155)
@@ -157,8 +157,8 @@
e->base_path = gtk_entry_new();
gtk_tooltips_set_tip(tooltips, e->base_path,
_("Base directory of all files that make up the project. "
- "This can be a new path, or an existing directory tree absolute "
- "or relative to the project filename."), NULL);
+ "This can be a new path, or an existing directory tree. "
+ "You can use paths relative to the project filename."), NULL);
bbox = ui_path_box_new(_("Choose Project Base Path"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(e->base_path));
@@ -412,8 +412,8 @@
e->base_path = gtk_entry_new();
gtk_tooltips_set_tip(tooltips, e->base_path,
_("Base directory of all files that make up the project. "
- "This can be a new path, or an existing directory tree absolute "
- "or relative to the project filename."), NULL);
+ "This can be a new path, or an existing directory tree. "
+ "You can use paths relative to the project filename."), NULL);
bbox = ui_path_box_new(_("Choose Project Base Path"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(e->base_path));
gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 3, 4,
@@ -523,7 +523,7 @@
{
if (app->project != NULL)
{
- if (dialogs_show_question_full(NULL, GTK_STOCK_OK, GTK_STOCK_CANCEL,
+ if (dialogs_show_question_full(NULL, GTK_STOCK_CLOSE, GTK_STOCK_CANCEL,
_("Do you want to close it before proceeding?"),
_("The '%s' project is already open."), app->project->name))
{
@@ -584,6 +584,8 @@
}
base_path = gtk_entry_get_text(GTK_ENTRY(e->base_path));
+ /* For now, the base path can be empty, so that Make uses the current directory.
+ * In future, it would be best to add a Make path setting for projects. */
if (NZV(base_path))
{ // check whether the given directory actually exists
gchar *locale_path = utils_get_locale_from_utf8(base_path);
@@ -629,7 +631,7 @@
p->file_name = g_strdup(file_name);
if (p->base_path != NULL) g_free(p->base_path);
- p->base_path = g_strdup(NZV(base_path) ? base_path : "./"); // use "." if base_path is empty
+ p->base_path = g_strdup(base_path);
if (! new_project) // save properties specific fields
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2153
http://geany.svn.sourceforge.net/geany/?rev=2153&view=rev
Author: eht16
Date: 2008-01-09 05:36:22 -0800 (Wed, 09 Jan 2008)
Log Message:
-----------
Add workaround for display problem in Message window:
Truncate displayed string at 1024 bytes if it is longer.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/msgwindow.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-01-09 13:24:36 UTC (rev 2152)
+++ trunk/ChangeLog 2008-01-09 13:36:22 UTC (rev 2153)
@@ -6,6 +6,9 @@
Add GeanyWrapLabel (subclass of GtkLabel) to wrap text at any width.
Use GeanyWrapLabel in preferences dialog and plugin manager dialog
to save a lot of space and improve layout of descriptive texts.
+ * src/msgwindow.c:
+ Add workaround for display problem in Message window:
+ Truncate displayed string at 1024 bytes if it is longer.
2008-01-06 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2008-01-09 13:24:36 UTC (rev 2152)
+++ trunk/src/msgwindow.c 2008-01-09 13:36:22 UTC (rev 2153)
@@ -275,13 +275,24 @@
{
GtkTreeIter iter;
const GdkColor *color = get_color(msg_color);
+ gchar *tmp;
if (! ui_prefs.msgwindow_visible) msgwin_show_hide(TRUE);
+ // work around a strange problem when adding very long lines(greater than 4000 bytes)
+ // cut the string to a maximum of 1024 bytes and discard the rest
+ /// TODO find the real cause for the display problem / if it is GtkTreeView file a bug report
+ if (strlen(string) > 1024)
+ tmp = g_strndup(string, 1024);
+ else
+ tmp = g_strdup(string);
+
gtk_list_store_append(msgwindow.store_msg, &iter);
- gtk_list_store_set(msgwindow.store_msg, &iter, 0, line, 1, idx, 2, color, 3, string, -1);
+ gtk_list_store_set(msgwindow.store_msg, &iter, 0, line, 1, idx, 2, color, 3, tmp, -1);
gtk_widget_set_sensitive(lookup_widget(app->window, "next_message1"), TRUE);
+
+ g_free(tmp);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2151
http://geany.svn.sourceforge.net/geany/?rev=2151&view=rev
Author: eht16
Date: 2008-01-06 11:59:01 -0800 (Sun, 06 Jan 2008)
Log Message:
-----------
Add utils_is_file_writeable().
Improve checks for write permission of files and directories.
Don't overwrite maybe existing project files when trying to create new project and checking for project file's write permission (thanks to Yura Siamashka for reporting and his patch).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/project.c
trunk/src/utils.c
trunk/src/utils.h
trunk/src/win32.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-01-06 18:11:57 UTC (rev 2150)
+++ trunk/ChangeLog 2008-01-06 19:59:01 UTC (rev 2151)
@@ -4,6 +4,12 @@
po/intl_stats.sh, plugins/*, src/*, tagmanager/rest.c:
Update copyright information and change format of email addresses in
source files.
+ * src/project.c, src/utils.c, src/utils.h, src/win32:
+ Add utils_is_file_writeable().
+ Improve checks for write permission of files and directories.
+ Don't overwrite maybe existing project files when trying to create
+ new project and checking for project file's write permission
+ (thanks to Yura Siamashka for reporting and his patch).
2008-01-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c 2008-01-06 18:11:57 UTC (rev 2150)
+++ trunk/src/project.c 2008-01-06 19:59:01 UTC (rev 2151)
@@ -545,6 +545,7 @@
const gchar *name, *file_name, *base_path;
gchar *locale_filename;
gint name_len;
+ gint err_code;
gboolean new_project = FALSE;
GeanyProject *p;
@@ -575,9 +576,9 @@
// finally test whether the given project file can be written
locale_filename = utils_get_locale_from_utf8(file_name);
- if (utils_write_file(file_name, "") != 0)
+ if ((err_code = utils_is_file_writeable(locale_filename)) != 0)
{
- SHOW_ERR(_("Project file could not be written."));
+ SHOW_ERR1(_("Project file could not be written (%s)."), g_strerror(err_code));
gtk_widget_grab_focus(e->file_name);
return FALSE;
}
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2008-01-06 18:11:57 UTC (rev 2150)
+++ trunk/src/utils.c 2008-01-06 19:59:01 UTC (rev 2151)
@@ -716,7 +716,39 @@
}
+/* Checks whether the given file can be written. locale_filename is expected in locale encoding.
+ * Returns 0 if it can be written, otherwise it returns errno */
+gint utils_is_file_writeable(const gchar *locale_filename)
+{
+ gchar *file;
+ gint ret;
+
+ if (! g_file_test(locale_filename, G_FILE_TEST_EXISTS) &&
+ ! g_file_test(locale_filename, G_FILE_TEST_IS_DIR))
+ // get the file's directory to check for write permission if it doesn't yet exist
+ file = g_path_get_dirname(locale_filename);
+ else
+ file = g_strdup(locale_filename);
+
#ifdef G_OS_WIN32
+ // use _waccess on Windows, access() doesn't accept special characters
+ ret = win32_check_write_permission(file);
+#else
+
+ // access set also errno to "FILE NOT FOUND" even if locale_filename is writeable, so use
+ // errno only when access() explicitly returns an error
+ if (access(file, R_OK | W_OK) != 0)
+ ret = errno;
+ else
+ ret = 0;
+
+ g_free(file);
+ return ret;
+#endif
+}
+
+
+#ifdef G_OS_WIN32
# define DIR_SEP "\\" // on Windows we need an additional dir separator
#else
# define DIR_SEP ""
@@ -740,15 +772,7 @@
if (saved_errno == 0 && ! g_file_test(conf_file, G_FILE_TEST_EXISTS))
{ // check whether geany.conf can be written
-#ifdef G_OS_WIN32
- // use _waccess on Windows, access() doesn't accept special characters
- saved_errno = win32_check_write_permission(app->configdir);
-#else
- // access set also errno to "FILE NOT FOUND" even if app->configdir is writeable, so use
- // errno only when access() explicitly returns an error
- if (access(app->configdir, R_OK | W_OK) != 0)
- saved_errno = errno;
-#endif
+ saved_errno = utils_is_file_writeable(app->configdir);
}
// make subdir for filetype definitions
Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h 2008-01-06 18:11:57 UTC (rev 2150)
+++ trunk/src/utils.h 2008-01-06 19:59:01 UTC (rev 2151)
@@ -172,4 +172,6 @@
gboolean utils_str_has_upper(const gchar *str);
+gint utils_is_file_writeable(const gchar *locale_filename);
+
#endif
Modified: trunk/src/win32.c
===================================================================
--- trunk/src/win32.c 2008-01-06 18:11:57 UTC (rev 2150)
+++ trunk/src/win32.c 2008-01-06 19:59:01 UTC (rev 2151)
@@ -560,10 +560,11 @@
gint win32_check_write_permission(const gchar *dir)
{
static wchar_t w_dir[512];
- errno = 0; // to get sure it is clean
MultiByteToWideChar(CP_UTF8, 0, dir, -1, w_dir, sizeof w_dir);
- _waccess(w_dir, R_OK | W_OK);
- return errno;
+ if (_waccess_s(w_dir, R_OK | W_OK) != 0)
+ return errno;
+ else
+ return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.