anjuta r3901 - in trunk: . libanjuta plugins/document-manager
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r3901 - in trunk: . libanjuta plugins/document-manager
- Date: Wed, 30 Apr 2008 16:08:36 +0100 (BST)
Author: jhs
Date: Wed Apr 30 15:08:35 2008
New Revision: 3901
URL: http://svn.gnome.org/viewvc/anjuta?rev=3901&view=rev
Log:
2008-04-30 Johannes Schmid <jhs gnome org>
* libanjuta/anjuta-status.c (anjuta_status_set_title):
* plugins/document-manager/anjuta-docman.c
(anjuta_docman_update_page_label):
* plugins/document-manager/plugin.c (update_title),
(on_document_update_save_ui):
#530033 â Have window title like gedit
Also add the dirty char (*) at the beginning of the filename to match HIG
Modified:
trunk/ChangeLog
trunk/libanjuta/anjuta-status.c
trunk/plugins/document-manager/anjuta-docman.c
trunk/plugins/document-manager/plugin.c
Modified: trunk/libanjuta/anjuta-status.c
==============================================================================
--- trunk/libanjuta/anjuta-status.c (original)
+++ trunk/libanjuta/anjuta-status.c Wed Apr 30 15:08:35 2008
@@ -515,7 +515,7 @@
const gchar *app_name = g_get_application_name();
if (title)
{
- gchar* str = g_strconcat (app_name, " - ", title, NULL);
+ gchar* str = g_strconcat (title, " - ", app_name, NULL);
gtk_window_set_title (status->priv->window, str);
g_free (str);
}
Modified: trunk/plugins/document-manager/anjuta-docman.c
==============================================================================
--- trunk/plugins/document-manager/anjuta-docman.c (original)
+++ trunk/plugins/document-manager/anjuta-docman.c Wed Apr 30 15:08:35 2008
@@ -1496,7 +1496,7 @@
if (!ianjuta_file_savable_is_dirty(IANJUTA_FILE_SAVABLE (doc), NULL))
{
- dirty_char = NULL;
+ dirty_char = "";
}
else
{
@@ -1507,7 +1507,7 @@
if (uri)
{
basename = g_path_get_basename (uri);
- label = g_strconcat(basename, dirty_char, NULL);
+ label = g_strconcat(dirty_char, basename, NULL);
gtk_label_set_text (GTK_LABEL (page->label), label);
gtk_label_set_text (GTK_LABEL (page->menu_label), label);
g_free (label);
@@ -1516,7 +1516,7 @@
}
else if ((doc_filename = ianjuta_document_get_filename (doc, NULL)) != NULL)
{
- label = g_strconcat (doc_filename, dirty_char, NULL);
+ label = g_strconcat (dirty_char, doc_filename, NULL);
gtk_label_set_text (GTK_LABEL (page->label), label);
gtk_label_set_text (GTK_LABEL (page->menu_label), label);
g_free (label);
Modified: trunk/plugins/document-manager/plugin.c
==============================================================================
--- trunk/plugins/document-manager/plugin.c (original)
+++ trunk/plugins/document-manager/plugin.c Wed Apr 30 15:08:35 2008
@@ -470,12 +470,14 @@
}
else
filename = NULL;
- }
+ }
else
filename = NULL;
+
if (filename && doc_plugin->project_name)
{
gchar *display_filename = NULL;
+ const gchar *home = g_get_home_dir();
if (doc_plugin->project_path)
{
if (g_str_has_prefix (filename, doc_plugin->project_path))
@@ -484,9 +486,15 @@
display_filename = filename + strlen (doc_plugin->project_path) + 1;
}
}
+ if (!display_filename &&
+ g_str_has_prefix (filename, home))
+ {
+ filename[strlen (home) - 1] = '~';
+ display_filename = filename + strlen (home) - 1;
+ }
if (!display_filename)
display_filename = filename;
- title = g_strconcat (doc_plugin->project_name, " - ", display_filename, NULL);
+ title = g_strconcat (display_filename, " - ", doc_plugin->project_name, NULL);
}
else if (filename)
{
@@ -499,6 +507,14 @@
else
title = NULL;
+ if (title && doc &&
+ ianjuta_file_savable_is_dirty(IANJUTA_FILE_SAVABLE (doc), NULL))
+ {
+ gchar* dirty_title = g_strconcat ("*", title, NULL);
+ g_free(title);
+ title = dirty_title;
+ }
+
status = anjuta_shell_get_status (ANJUTA_PLUGIN (doc_plugin)->shell, NULL);
/* NULL title is ok */
anjuta_status_set_title (status, title);
@@ -864,6 +880,7 @@
AnjutaPlugin *plugin)
{
update_document_ui_save_items (plugin, doc);
+ update_title(ANJUTA_PLUGIN_DOCMAN (plugin));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]