In 'reveal hidden tab' menu, now shows 'catname [parent catname]' format, to be more...
authorskeezix <skeezix@flotsam-vm.(none)>
Wed, 26 Jan 2011 20:18:06 +0000 (15:18 -0500)
committerskeezix <skeezix@flotsam-vm.(none)>
Wed, 26 Jan 2011 20:18:06 +0000 (15:18 -0500)
minimenu/mmcat.c
minimenu/mmui.c

index e96aa23..689521f 100644 (file)
@@ -296,7 +296,9 @@ mm_category_t *category_map_query ( char *cat ) {
 
 unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep ) {
   mm_category_t *cat;
 
 unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep ) {
   mm_category_t *cat;
+#if 0 // prepending
   char catnamebuffer [ 512 ] = "";
   char catnamebuffer [ 512 ] = "";
+#endif
 
   if ( ! catname ) {
     return ( 1 ); // fine, just nada
 
   if ( ! catname ) {
     return ( 1 ); // fine, just nada
@@ -342,10 +344,12 @@ unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco
   } // good cats only?
 
   // if invisible, and a parent category name is known, prepend it for ease of use
   } // good cats only?
 
   // if invisible, and a parent category name is known, prepend it for ease of use
+#if 0 // prepending
   if ( ! visiblep && parentcatname ) {
     snprintf ( catnamebuffer, 500, "%s.%s", parentcatname, catname );
     catname = catnamebuffer;
   }
   if ( ! visiblep && parentcatname ) {
     snprintf ( catnamebuffer, 500, "%s.%s", parentcatname, catname );
     catname = catnamebuffer;
   }
+#endif
 
   // do we honour cat mapping at all?
   if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_on", 0 ) ) {
 
   // do we honour cat mapping at all?
   if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_on", 0 ) ) {
index 2b34fa5..a4d0246 100644 (file)
@@ -1044,8 +1044,16 @@ void ui_process_input ( unsigned char block_p ) {
     case SDL_USEREVENT:
       // update something
 
     case SDL_USEREVENT:
       // update something
 
+      // the user-defined SDL events are all for threaded/delayed previews (and icons, which
+      // generally are not used); if we're in wide mode, we can skip previews
+      // to avoid slowing things down when they're not shown.
+
       if ( event.user.code == sdl_user_ticker ) {
 
       if ( event.user.code == sdl_user_ticker ) {
 
+       if ( ui_detail_hidden ) {
+         break; // skip building previews when not showing them
+       }
+
        // timer went off, time to load something
        if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_previews_later", 0 ) ) {
 
        // timer went off, time to load something
        if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_previews_later", 0 ) ) {
 
@@ -2937,6 +2945,7 @@ void ui_revealscreen ( void ) {
   char *labels [ 500 ];
   unsigned int labelmax = 0;
   unsigned int i;
   char *labels [ 500 ];
   unsigned int labelmax = 0;
   unsigned int i;
+  char fulllabel [ 200 ];
 
   if ( ! category_count ( CFHIDDEN ) ) {
     return; // nothing to do
 
   if ( ! category_count ( CFHIDDEN ) ) {
     return; // nothing to do
@@ -2947,7 +2956,14 @@ void ui_revealscreen ( void ) {
 
   // build up labels to show in menu
   for ( i = 0; i < g_categorycount; i++ ) {
 
   // build up labels to show in menu
   for ( i = 0; i < g_categorycount; i++ ) {
-    labels [ labelmax++ ] = g_categories [ i ] -> catname;
+
+    if ( g_categories [ i ] -> parent_catname ) {
+      sprintf ( fulllabel, "%s [%s]", g_categories [ i ] -> catname, g_categories [ i ] -> parent_catname );
+    } else {
+      sprintf ( fulllabel, "%s", g_categories [ i ] -> catname );
+    }
+
+    labels [ labelmax++ ] = strdup ( fulllabel );
   }
 
   // show menu
   }
 
   // show menu
@@ -2987,6 +3003,10 @@ void ui_revealscreen ( void ) {
     render_mask |= CHANGED_CATEGORY;
   }
 
     render_mask |= CHANGED_CATEGORY;
   }
 
+  for ( i = 0; i < g_categorycount; i++ ) {
+    free ( labels [ i ] );
+  }
+
   return;
 }
 
   return;
 }