On 04/04/2007 08:26, Enlightenment CVS wrote:
Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
e_config.c e_config.h e_int_config_clientlist.c e_int_config_clientlist.h e_int_menus.c

Log Message:


cedric's patches.

I don't know if this is important or not, but....

The patch below was something I sent in. However when it was committed it was noted as Cedric's. Worst case, if something goes wrong poeple may complain to the wrong person. So... dunno if anything needs to be done here. But I'd hate for Cedric to loose a cookie on my behalf. :P

Also, fwiw...
Attached is a patch for the patch.  :P
The E_CONFIG_FILE_GENERATION needs to be bumped as the original patch was against current cvs a month ago.


===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -3 -r1.233 -r1.234
--- e_config.c  25 Mar 2007 22:44:59 -0000      1.233
+++ e_config.c  4 Apr 2007 13:25:54 -0000       1.234
@@ -511,6 +511,7 @@
    E_CONFIG_VAL(D, T, clientlist_sort_by, INT);
    E_CONFIG_VAL(D, T, clientlist_separate_iconified_apps, INT);
    E_CONFIG_VAL(D, T, clientlist_warp_to_iconified_desktop, INT);
+   E_CONFIG_VAL(D, T, clientlist_max_caption_len, INT);
E_CONFIG_VAL(D, T, mouse_accel_numerator, INT);
    E_CONFIG_VAL(D, T, mouse_accel_denominator, INT);
@@ -1357,6 +1358,10 @@
if (!e_config->icon_theme) e_config->icon_theme = evas_stringshare_add("hicolor"); + IFCFG(0x111)
+   e_config->clientlist_max_caption_len = 0;
+   IFCFGEND;
+
e_config->config_version = E_CONFIG_FILE_VERSION; #if 0 /* example of new config */
@@ -1475,6 +1480,7 @@
    E_CONFIG_LIMIT(e_config->clientlist_sort_by, 0, 3);
    E_CONFIG_LIMIT(e_config->clientlist_separate_iconified_apps, 0, 2);
    E_CONFIG_LIMIT(e_config->clientlist_warp_to_iconified_desktop, 0, 1);
+   E_CONFIG_LIMIT(e_config->clientlist_max_caption_len, 0, 
E_CLIENTLIST_MAX_CAPTION_LEN);
E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 10);
    E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -3 -r1.147 -r1.148
--- e_config.h  25 Mar 2007 22:44:59 -0000      1.147
+++ e_config.h  4 Apr 2007 13:25:54 -0000       1.148
@@ -253,6 +253,7 @@
    int         clientlist_sort_by; // GUI
    int         clientlist_separate_iconified_apps; // GUI
    int         clientlist_warp_to_iconified_desktop; // GUI
+   int         clientlist_max_caption_len;
int mouse_accel_numerator; // GUI
    int         mouse_accel_denominator; // GUI
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_clientlist.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_int_config_clientlist.c   26 Mar 2007 17:13:57 -0000      1.5
+++ e_int_config_clientlist.c   4 Apr 2007 13:25:54 -0000       1.6
@@ -17,6 +17,7 @@
    int sort_by;
    int separate_iconified_apps;
    int warp_to_iconified_desktop;
+   int max_caption_len;
 };
EAPI E_Config_Dialog *
@@ -50,6 +51,7 @@
    cfdata->sort_by = e_config->clientlist_sort_by;
    cfdata->separate_iconified_apps = 
e_config->clientlist_separate_iconified_apps;
    cfdata->warp_to_iconified_desktop = 
e_config->clientlist_warp_to_iconified_desktop;
+   cfdata->max_caption_len = e_config->clientlist_max_caption_len;
 }
static void *
@@ -77,6 +79,7 @@
    e_config->clientlist_sort_by = cfdata->sort_by;
    e_config->clientlist_separate_iconified_apps = 
cfdata->separate_iconified_apps;
    e_config->clientlist_warp_to_iconified_desktop = 
cfdata->warp_to_iconified_desktop;
+   e_config->clientlist_max_caption_len = cfdata->max_caption_len;
    e_config_save_queue();
    return 1;
 }
@@ -136,6 +139,11 @@
    ob = e_widget_check_add(evas, _("Warp to owning desktop"), 
&(cfdata->warp_to_iconified_desktop));
    e_widget_framelist_object_append(of, ob);
    e_widget_table_object_append(ot, of, 1, 1, 1, 1, 1, 1, 1, 1);
+
+   of = e_widget_framelist_add(evas, _("Maximum Caption Length"), 0);
+   ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Chars"), 0.0, 
E_CLIENTLIST_MAX_CAPTION_LEN, 2.0, 0, NULL, &(cfdata->max_caption_len), 200);
+   e_widget_framelist_object_append(of, ob);
+   e_widget_table_object_append(ot, of, 0, 2, 2, 1, 1, 1, 1, 0);
e_widget_list_object_append(o, ot, 1, 1, 0.5); ===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_clientlist.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_int_config_clientlist.h   21 Feb 2007 00:05:27 -0000      1.1
+++ e_int_config_clientlist.h   4 Apr 2007 13:25:54 -0000       1.2
@@ -20,6 +20,8 @@
 #define E_CLIENTLIST_GROUPICONS_CURRENT 1
 #define E_CLIENTLIST_GROUPICONS_SEP 2
+#define E_CLIENTLIST_MAX_CAPTION_LEN 256
+
 EAPI E_Config_Dialog *e_int_config_clientlist(E_Container *con);
#endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_menus.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -3 -r1.207 -r1.208
--- e_int_menus.c       25 Mar 2007 22:45:00 -0000      1.207
+++ e_int_menus.c       4 Apr 2007 13:25:54 -0000       1.208
@@ -55,6 +55,7 @@
 static void _e_int_menus_clients_add_by_desk    (E_Desk *curr_desk, Evas_List 
*borders, E_Menu *m);
 static void _e_int_menus_clients_add_by_none    (Evas_List *borders, E_Menu 
*m);
 static void _e_int_menus_clients_menu_add_iconified  (Evas_List *borders, 
E_Menu *m);
+static const char *_e_int_menus_clients_title_abbrv (const char *title);
 static void _e_int_menus_virtuals_pre_cb     (void *data, E_Menu *m);
 static void _e_int_menus_virtuals_item_cb    (void *data, E_Menu *m, 
E_Menu_Item *mi);
 static void _e_int_menus_themes_about        (void *data, E_Menu *m, 
E_Menu_Item *mi);
@@ -1250,13 +1251,36 @@
    e_object_data_set(E_OBJECT(m), borders);
 }
+static const char *
+_e_int_menus_clients_title_abbrv(const char *title)
+{
+   char *abbv, *left, *right;
+   int max_len;
+
+   max_len = e_config->clientlist_max_caption_len;
+   if ((max_len != 0) && (strlen(title) > max_len))
+     {
+       abbv = calloc(E_CLIENTLIST_MAX_CAPTION_LEN+4, sizeof(char));
+       left = title;
+       right = title + (strlen(title) - (max_len/2));
+               
+       strncpy(abbv, left, max_len/2);
+       strncat(abbv, "...", 3);
+       strncat(abbv, right, max_len/2);
+
+       return abbv;
+     }
+   else
+     return title;
+}
+
 static void
 _e_int_menus_clients_item_create(E_Border *bd, E_Menu *m)
 {
    E_Menu_Item *mi;
    const char *title;
        
-   title = e_border_name_get(bd);
+   title = _e_int_menus_clients_title_abbrv(e_border_name_get(bd));
    mi = e_menu_item_new(m);
    e_menu_item_check_set(mi, 1);
    if ((title) && (title[0]))



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs




--
Regards,
Ravenlock
Index: e17/apps/e/src/bin/e_config.c
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.234
diff -u -r1.234 e_config.c
--- e17/apps/e/src/bin/e_config.c       4 Apr 2007 13:25:54 -0000       1.234
+++ e17/apps/e/src/bin/e_config.c       4 Apr 2007 15:22:17 -0000
@@ -1358,7 +1358,7 @@
 
    if (!e_config->icon_theme) e_config->icon_theme = 
evas_stringshare_add("hicolor");
 
-   IFCFG(0x111)
+   IFCFG(0x0113)
    e_config->clientlist_max_caption_len = 0;
    IFCFGEND;
 
Index: e17/apps/e/src/bin/e_config.h
===================================================================
RCS file: /var/cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.148
diff -u -r1.148 e_config.h
--- e17/apps/e/src/bin/e_config.h       4 Apr 2007 13:25:54 -0000       1.148
+++ e17/apps/e/src/bin/e_config.h       4 Apr 2007 15:22:17 -0000
@@ -52,7 +52,7 @@
 /* increment this whenever a new set of config values are added but the users
  * config doesn't need to be wiped - simply new values need to be put in
  */
-#define E_CONFIG_FILE_GENERATION 0x0112
+#define E_CONFIG_FILE_GENERATION 0x0113
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | 
E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to