Package: tilda
Version: 0.09.6-1
Severity: important

It's very inconvenient to select file path in tilda by double click
because tilda doesn't change the default word characters of libvte.
Many terminal emulators support word characters setting, I think it's
absolutely a required feature of a modern terminal emulator.

See the attachment for a patch to supply this feature.

-- System Information:
Debian Release: lenny/sid
  APT prefers intrepid-updates
  APT policy: (500, 'intrepid-updates'), (500, 'intrepid-security'), (500, 
'intrepid')
Architecture: i386 (i686)

Kernel: Linux 2.6.27-7-generic (SMP w/2 CPU cores)
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tilda depends on:
ii  libatk1.0-0     1.24.0-0ubuntu1          The ATK accessibility toolkit
ii  libc6           2.8~20080505-0ubuntu7    GNU C Library: Shared libraries
ii  libcairo2       1.8.0-0ubuntu1           The Cairo 2D vector graphics libra
ii  libconfuse0     2.6-2                    Library for parsing configuration 
ii  libfontconfig1  2.6.0-1ubuntu4           generic font configuration library
ii  libfreetype6    2.3.7-2ubuntu1           FreeType 2 font engine, shared lib
ii  libglade2-0     1:2.6.3-0ubuntu1         library to load .glade files at ru
ii  libglib2.0-0    2.18.2-0ubuntu2          The GLib library of C routines
ii  libgtk2.0-0     2.14.4-0ubuntu1          The GTK+ graphical user interface 
ii  libpango1.0-0   1.22.2-0ubuntu1          Layout and rendering of internatio
ii  libvte9         1:0.17.4-0ubuntu1        Terminal emulator widget for GTK+ 
ii  libx11-6        2:1.1.5-2ubuntu1         X11 client-side library
ii  libxft2         2.1.12-3ubuntu1          FreeType-based font drawing librar
ii  libxml2         2.6.32.dfsg-4ubuntu1.1   GNOME XML library
ii  zlib1g          1:1.2.3.3.dfsg-12ubuntu1 compression library - runtime

tilda recommends no packages.

-- no debconf information
>From 1bded0ce9cb3ff6ae5e33825845ad487ee3d87e2 Mon Sep 17 00:00:00 2001
From: Liu Yubao <[EMAIL PROTECTED]>
Date: Tue, 18 Nov 2008 00:36:00 +0800
Subject: [PATCH] add word characters setting support

This patch adds word characters setting support for tilda-0.09.6-1 in
Ubuntu 8.10, the default word characters are selected to make file path
selection by double click rather convenient.

The po/tilda.pot isn't updated because it will generate a big patch.

Signed-off-by: Liu Yubao <[EMAIL PROTECTED]>
---
 src/configsys.c      |    1 +
 src/configsys.h      |    2 +
 src/tilda_terminal.c |    7 +++++
 src/wizard.c         |   20 +++++++++++++++
 tilda.glade          |   66 +++++++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/src/configsys.c b/src/configsys.c
index 52796d1..6ee010c 100644
--- a/src/configsys.c
+++ b/src/configsys.c
@@ -29,6 +29,7 @@ static cfg_opt_t config_opts[] = {
     CFG_STR("background_color", "white", CFGF_NONE),
     CFG_STR("working_dir", NULL, CFGF_NONE),
     CFG_STR("web_browser", "firefox", CFGF_NONE),
+    CFG_STR("word_chars", DEFAULT_WORD_CHARS, CFGF_NONE),
 
     /* ints */
     CFG_INT("lines", 100, CFGF_NONE),
diff --git a/src/configsys.h b/src/configsys.h
index 0cc2d98..9af6ead 100644
--- a/src/configsys.h
+++ b/src/configsys.h
@@ -5,6 +5,8 @@
 
 #include <glib.h>
 
+#define DEFAULT_WORD_CHARS  "-A-Za-z0-9,./?%&#:_"
+
 /* Initialize and free the config system's private variables */
 gint config_init (const gchar *config_file);
 gint config_free (const gchar *config_file);
diff --git a/src/tilda_terminal.c b/src/tilda_terminal.c
index 7708984..cfd6c2f 100644
--- a/src/tilda_terminal.c
+++ b/src/tilda_terminal.c
@@ -486,6 +486,7 @@ static gint tilda_term_config_defaults (tilda_term *tt)
 
     gdouble transparency_level = 0.0;
     GdkColor fg, bg /*, tint, highlight, cursor, black */;
+    gchar* word_chars;
 
 
     /** Colors **/
@@ -497,8 +498,14 @@ static gint tilda_term_config_defaults (tilda_term *tt)
     fg.green =    config_getint ("text_green");
     fg.blue  =    config_getint ("text_blue");
 
+    word_chars =  config_getstr ("word_chars");
+    if (NULL == word_chars || '\0' == word_chars)
+        word_chars = DEFAULT_WORD_CHARS;
+
     vte_terminal_set_colors (VTE_TERMINAL(tt->vte_term), &fg, &bg, NULL, 0);
 
+    vte_terminal_set_word_chars (VTE_TERMINAL(tt->vte_term), word_chars);
+
     /** Bells **/
     vte_terminal_set_audible_bell (VTE_TERMINAL(tt->vte_term), config_getbool ("bell"));
     vte_terminal_set_visible_bell (VTE_TERMINAL(tt->vte_term), config_getbool ("bell"));
diff --git a/src/wizard.c b/src/wizard.c
index c8ce9a0..1f38df9 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -510,6 +510,24 @@ static void entry_web_browser_changed (GtkWidget *w)
     config_setstr ("web_browser", web_browser);
 }
 
+static void entry_word_chars_changed (GtkWidget *w)
+{
+    gint i;
+    tilda_term *tt;
+    const gchar *word_chars = gtk_entry_get_text (GTK_ENTRY(w));
+
+    /* restore to default value if user clears this setting */
+    if (NULL == word_chars || '\0' == word_chars[0])
+        word_chars = DEFAULT_WORD_CHARS;
+
+    config_setstr ("word_chars", word_chars);
+
+    for (i=0; i<g_list_length (tw->terms); i++) {
+        tt = g_list_nth_data (tw->terms, i);
+        vte_terminal_set_word_chars (VTE_TERMINAL(tt->vte_term), word_chars);
+    }
+}
+
 /*
  * Prototypes for the next 4 functions. Since they depend on each other,
  * this is pretty much necessary.
@@ -1097,6 +1115,7 @@ static void set_wizard_state_from_config ()
     SET_SENSITIVE_BY_CONFIG_BOOL ("label_custom_command", "run_command");
 
     TEXT_ENTRY ("entry_web_browser", "web_browser");
+    TEXT_ENTRY ("entry_word_chars", "word_chars");
 
     /* Appearance Tab */
     SPIN_BUTTON_SET_RANGE ("spin_height_percentage", 0, 100);
@@ -1191,6 +1210,7 @@ static void connect_wizard_signals ()
     CONNECT_SIGNAL ("combo_command_exit","changed",combo_command_exit_changed_cb);
 
     CONNECT_SIGNAL ("entry_web_browser","changed",entry_web_browser_changed);
+    CONNECT_SIGNAL ("entry_word_chars","changed",entry_word_chars_changed);
 
     /* Appearance Tab */
     CONNECT_SIGNAL ("spin_height_percentage","value-changed",spin_height_percentage_value_changed_cb);
diff --git a/tilda.glade b/tilda.glade
index 4a8ae19..cdfd882 100644
--- a/tilda.glade
+++ b/tilda.glade
@@ -366,9 +366,73 @@ Right</property>
             <child>
               <widget class="GtkTable" id="table_tc">
                 <property name="visible">True</property>
-                <property name="n_rows">3</property>
+                <property name="n_rows">4</property>
                 <property name="n_columns">1</property>
                 <child>
+                  <widget class="GtkFrame" id="frame_word_chars">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="label_xalign">0</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment14">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkTable" id="table7">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="n_rows">1</property>
+                            <property name="n_columns">2</property>
+                            <child>
+                              <widget class="GtkEntry" id="entry_word_chars">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                              </widget>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="x_padding">4</property>
+                                <property name="y_padding">4</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkLabel" id="label20">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label" translatable="yes">Word Characters</property>
+                              </widget>
+                              <packing>
+                                <property name="x_padding">4</property>
+                                <property name="y_padding">4</property>
+                              </packing>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label22">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Select by Word&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="y_options"></property>
+                    <property name="x_padding">4</property>
+                    <property name="y_padding">4</property>
+                  </packing>
+                </child>
+                <child>
                   <widget class="GtkFrame" id="frame_url">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-- 
1.5.6.3

Reply via email to