context_app_rename,
context_app_cpuspeed,
context_app_run,
+ context_app_notes1,
+ context_app_notes2,
+ context_app_notes3,
context_menu_max
};
"Recategorize subcategory", // recategorize
"Change displayed title", // rename
"Set CPU speed for launch", // cpuspeed
- "Run application" // run
+ "Run application", // run
+ "Edit notes line 1", // notes1
+ "Edit notes line 2", // notes2
+ "Edit notes line 3", // notes3
};
unsigned short int menu [ context_menu_max ];
menu [ menumax ] = context_file_info; menustring [ menumax++ ] = verbiage [ context_file_info ];
menu [ menumax ] = context_file_delete; menustring [ menumax++ ] = verbiage [ context_file_delete ];
} else {
+
+ if ( a -> ref -> object_type == pnd_object_type_directory ) {
+ return; // don't do anything if the guy is a subcat-as-folder
+ }
+
//menu [ menumax ] = context_app_info; menustring [ menumax++ ] = verbiage [ context_app_info ];
menu [ menumax ] = context_app_run; menustring [ menumax++ ] = verbiage [ context_app_run ];
menu [ menumax ] = context_app_hide; menustring [ menumax++ ] = verbiage [ context_app_hide ];
menu [ menumax ] = context_app_recategorize_sub; menustring [ menumax++ ] = verbiage [ context_app_recategorize_sub ];
menu [ menumax ] = context_app_rename; menustring [ menumax++ ] = verbiage [ context_app_rename ];
menu [ menumax ] = context_app_cpuspeed; menustring [ menumax++ ] = verbiage [ context_app_cpuspeed ];
+ menu [ menumax ] = context_app_notes1; menustring [ menumax++ ] = verbiage [ context_app_notes1 ];
+ menu [ menumax ] = context_app_notes2; menustring [ menumax++ ] = verbiage [ context_app_notes2 ];
+ menu [ menumax ] = context_app_notes3; menustring [ menumax++ ] = verbiage [ context_app_notes3 ];
}
// operate the menu
ui_push_exec();
break;
+ case context_app_notes1:
+ case context_app_notes2:
+ case context_app_notes3:
+ {
+ char namebuf [ 101 ] = "";
+
+ char key [ 501 ];
+ unsigned char notenum;
+
+ // which note line?
+ if ( menu [ sel ] == context_app_notes1 ) {
+ notenum = 1;
+ } else if ( menu [ sel ] == context_app_notes2 ) {
+ notenum = 2;
+ } else if ( menu [ sel ] == context_app_notes3 ) {
+ notenum = 3;
+ }
+
+ // figure out key for looking up existing, and for storing replacement
+ snprintf ( key, 500, "Application-%u.note-%u", a -> ref -> subapp_number, notenum );
+
+ // do we have existing value?
+ if ( a -> ovrh ) {
+ char *existing = pnd_conf_get_as_char ( a -> ovrh, key );
+ if ( existing ) {
+ strncpy ( namebuf, existing, 100 );
+ }
+ }
+
+ unsigned char changed;
+
+ changed = ui_menu_get_text_line ( "Enter replacement note", "Use keyboard; Enter when done.",
+ namebuf, namebuf, 30, 0 /* not-numeric-forced */ );
+
+ if ( changed ) {
+ ovr_replace_or_add ( a, strchr ( key, '.' ) + 1, namebuf );
+ rescan_apps++;
+ }
+
+ }
+ break;
+
default:
return;
bzero ( rects, sizeof(SDL_Rect) * 40 );
if ( initialvalue ) {
- strncpy ( r_buffer, initialvalue, maxlen );
+ if ( initialvalue == r_buffer ) {
+ // already good to go
+ } else {
+ strncpy ( r_buffer, initialvalue, maxlen );
+ }
} else {
bzero ( r_buffer, maxlen );
}