Menu: rename functions.

menu_entry_create -> menu_entry_new
menu_separator_create -> menu_separator_new
create_menu -> menu_new
destroy_menu -> menu_free
find_menubar -> menubar_find

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2023-03-18 09:32:45 +03:00
parent a242e8b91f
commit fd2d5b49ac
5 changed files with 191 additions and 210 deletions

View File

@ -641,7 +641,7 @@ menubar_refresh (WMenuBar * menubar)
static inline void
menubar_free_menu (WMenuBar * menubar)
{
g_clear_list (&menubar->menu, (GDestroyNotify) destroy_menu);
g_clear_list (&menubar->menu, (GDestroyNotify) menu_free);
}
/* --------------------------------------------------------------------------------------------- */
@ -883,7 +883,7 @@ menubar_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
/* --------------------------------------------------------------------------------------------- */
menu_entry_t *
menu_entry_create (const char *name, long command)
menu_entry_new (const char *name, long command)
{
menu_entry_t *entry;
@ -912,7 +912,7 @@ menu_entry_free (menu_entry_t * entry)
/* --------------------------------------------------------------------------------------------- */
menu_t *
create_menu (const char *name, GList * entries, const char *help_node)
menu_new (const char *name, GList * entries, const char *help_node)
{
menu_t *menu;
@ -940,7 +940,7 @@ menu_set_name (menu_t * menu, const char *name)
/* --------------------------------------------------------------------------------------------- */
void
destroy_menu (menu_t * menu)
menu_free (menu_t * menu)
{
hotkey_free (menu->text);
g_list_free_full (menu->entries, (GDestroyNotify) menu_entry_free);
@ -1053,7 +1053,7 @@ menubar_arrange (WMenuBar * menubar)
/** Find MenuBar widget in the dialog */
WMenuBar *
find_menubar (const WDialog * h)
menubar_find (const WDialog * h)
{
return MENUBAR (widget_find_by_type (CONST_WIDGET (h), menubar_callback));
}

View File

@ -13,7 +13,7 @@
#define MENUBAR(x) ((WMenuBar *)(x))
#define menu_separator_create() NULL
#define menu_separator_new() NULL
/*** enums ***************************************************************************************/
@ -42,19 +42,19 @@ extern const global_keymap_t *menu_map;
/*** declarations of public functions ************************************************************/
menu_entry_t *menu_entry_create (const char *name, long command);
menu_entry_t *menu_entry_new (const char *name, long command);
void menu_entry_free (menu_entry_t * me);
menu_t *create_menu (const char *name, GList * entries, const char *help_node);
menu_t *menu_new (const char *name, GList * entries, const char *help_node);
void menu_set_name (menu_t * menu, const char *name);
void destroy_menu (menu_t * menu);
void menu_free (menu_t * menu);
WMenuBar *menubar_new (GList * menu);
void menubar_set_menu (WMenuBar * menubar, GList * menu);
void menubar_add_menu (WMenuBar * menubar, menu_t * menu);
void menubar_arrange (WMenuBar * menubar);
WMenuBar *find_menubar (const WDialog * h);
WMenuBar *menubar_find (const WDialog * h);
void menubar_activate (WMenuBar * menubar, gboolean dropped, int which);

View File

@ -73,22 +73,22 @@ create_file_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Open file..."), CK_EditFile));
entries = g_list_prepend (entries, menu_entry_create (_("&New"), CK_EditNew));
entries = g_list_prepend (entries, menu_entry_create (_("&Close"), CK_Close));
entries = g_list_prepend (entries, menu_entry_create (_("&History..."), CK_History));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Save"), CK_Save));
entries = g_list_prepend (entries, menu_entry_create (_("Save &as..."), CK_SaveAs));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Insert file..."), CK_InsertFile));
entries = g_list_prepend (entries, menu_entry_create (_("Cop&y to file..."), CK_BlockSave));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&User menu..."), CK_UserMenu));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("A&bout..."), CK_About));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Quit"), CK_Quit));
entries = g_list_prepend (entries, menu_entry_new (_("&Open file..."), CK_EditFile));
entries = g_list_prepend (entries, menu_entry_new (_("&New"), CK_EditNew));
entries = g_list_prepend (entries, menu_entry_new (_("&Close"), CK_Close));
entries = g_list_prepend (entries, menu_entry_new (_("&History..."), CK_History));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Save"), CK_Save));
entries = g_list_prepend (entries, menu_entry_new (_("Save &as..."), CK_SaveAs));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Insert file..."), CK_InsertFile));
entries = g_list_prepend (entries, menu_entry_new (_("Cop&y to file..."), CK_BlockSave));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&User menu..."), CK_UserMenu));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("A&bout..."), CK_About));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Quit"), CK_Quit));
return g_list_reverse (entries);
}
@ -100,27 +100,26 @@ create_edit_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Undo"), CK_Undo));
entries = g_list_prepend (entries, menu_entry_create (_("&Redo"), CK_Redo));
entries = g_list_prepend (entries, menu_separator_create ());
entries =
g_list_prepend (entries, menu_entry_create (_("&Toggle ins/overw"), CK_InsertOverwrite));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("To&ggle mark"), CK_Mark));
entries = g_list_prepend (entries, menu_entry_create (_("&Mark columns"), CK_MarkColumn));
entries = g_list_prepend (entries, menu_entry_create (_("Mark &all"), CK_MarkAll));
entries = g_list_prepend (entries, menu_entry_create (_("Unmar&k"), CK_Unmark));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("Cop&y"), CK_Copy));
entries = g_list_prepend (entries, menu_entry_create (_("Mo&ve"), CK_Move));
entries = g_list_prepend (entries, menu_entry_create (_("&Delete"), CK_Remove));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("Co&py to clipfile"), CK_Store));
entries = g_list_prepend (entries, menu_entry_create (_("&Cut to clipfile"), CK_Cut));
entries = g_list_prepend (entries, menu_entry_create (_("Pa&ste from clipfile"), CK_Paste));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Beginning"), CK_Top));
entries = g_list_prepend (entries, menu_entry_create (_("&End"), CK_Bottom));
entries = g_list_prepend (entries, menu_entry_new (_("&Undo"), CK_Undo));
entries = g_list_prepend (entries, menu_entry_new (_("&Redo"), CK_Redo));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Toggle ins/overw"), CK_InsertOverwrite));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("To&ggle mark"), CK_Mark));
entries = g_list_prepend (entries, menu_entry_new (_("&Mark columns"), CK_MarkColumn));
entries = g_list_prepend (entries, menu_entry_new (_("Mark &all"), CK_MarkAll));
entries = g_list_prepend (entries, menu_entry_new (_("Unmar&k"), CK_Unmark));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("Cop&y"), CK_Copy));
entries = g_list_prepend (entries, menu_entry_new (_("Mo&ve"), CK_Move));
entries = g_list_prepend (entries, menu_entry_new (_("&Delete"), CK_Remove));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("Co&py to clipfile"), CK_Store));
entries = g_list_prepend (entries, menu_entry_new (_("&Cut to clipfile"), CK_Cut));
entries = g_list_prepend (entries, menu_entry_new (_("Pa&ste from clipfile"), CK_Paste));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Beginning"), CK_Top));
entries = g_list_prepend (entries, menu_entry_new (_("&End"), CK_Bottom));
return g_list_reverse (entries);
}
@ -132,14 +131,14 @@ create_search_replace_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Search..."), CK_Search));
entries = g_list_prepend (entries, menu_entry_create (_("Search &again"), CK_SearchContinue));
entries = g_list_prepend (entries, menu_entry_create (_("&Replace..."), CK_Replace));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Toggle bookmark"), CK_Bookmark));
entries = g_list_prepend (entries, menu_entry_create (_("&Next bookmark"), CK_BookmarkNext));
entries = g_list_prepend (entries, menu_entry_create (_("&Prev bookmark"), CK_BookmarkPrev));
entries = g_list_prepend (entries, menu_entry_create (_("&Flush bookmarks"), CK_BookmarkFlush));
entries = g_list_prepend (entries, menu_entry_new (_("&Search..."), CK_Search));
entries = g_list_prepend (entries, menu_entry_new (_("Search &again"), CK_SearchContinue));
entries = g_list_prepend (entries, menu_entry_new (_("&Replace..."), CK_Replace));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Toggle bookmark"), CK_Bookmark));
entries = g_list_prepend (entries, menu_entry_new (_("&Next bookmark"), CK_BookmarkNext));
entries = g_list_prepend (entries, menu_entry_new (_("&Prev bookmark"), CK_BookmarkPrev));
entries = g_list_prepend (entries, menu_entry_new (_("&Flush bookmarks"), CK_BookmarkFlush));
return g_list_reverse (entries);
}
@ -151,49 +150,45 @@ create_command_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Go to line..."), CK_Goto));
entries = g_list_prepend (entries, menu_entry_create (_("&Toggle line state"), CK_ShowNumbers));
entries = g_list_prepend (entries, menu_entry_new (_("&Go to line..."), CK_Goto));
entries = g_list_prepend (entries, menu_entry_new (_("&Toggle line state"), CK_ShowNumbers));
entries =
g_list_prepend (entries, menu_entry_create (_("Go to matching &bracket"), CK_MatchBracket));
g_list_prepend (entries, menu_entry_new (_("Go to matching &bracket"), CK_MatchBracket));
entries =
g_list_prepend (entries,
menu_entry_create (_("Toggle s&yntax highlighting"), CK_SyntaxOnOff));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Find declaration"), CK_Find));
entries =
g_list_prepend (entries, menu_entry_create (_("Back from &declaration"), CK_FilePrev));
entries =
g_list_prepend (entries, menu_entry_create (_("For&ward to declaration"), CK_FileNext));
g_list_prepend (entries, menu_entry_new (_("Toggle s&yntax highlighting"), CK_SyntaxOnOff));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Find declaration"), CK_Find));
entries = g_list_prepend (entries, menu_entry_new (_("Back from &declaration"), CK_FilePrev));
entries = g_list_prepend (entries, menu_entry_new (_("For&ward to declaration"), CK_FileNext));
#ifdef HAVE_CHARSET
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("Encod&ing..."), CK_SelectCodepage));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("Encod&ing..."), CK_SelectCodepage));
#endif
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Refresh screen"), CK_Refresh));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Refresh screen"), CK_Refresh));
entries = g_list_prepend (entries, menu_separator_new ());
entries =
g_list_prepend (entries,
menu_entry_create (_("&Start/Stop record macro"), CK_MacroStartStopRecord));
entries = g_list_prepend (entries, menu_entry_create (_("Delete macr&o..."), CK_MacroDelete));
menu_entry_new (_("&Start/Stop record macro"), CK_MacroStartStopRecord));
entries = g_list_prepend (entries, menu_entry_new (_("Delete macr&o..."), CK_MacroDelete));
entries =
g_list_prepend (entries,
menu_entry_create (_("Record/Repeat &actions"), CK_RepeatStartStopRecord));
entries = g_list_prepend (entries, menu_separator_create ());
menu_entry_new (_("Record/Repeat &actions"), CK_RepeatStartStopRecord));
entries = g_list_prepend (entries, menu_separator_new ());
#ifdef HAVE_ASPELL
if (strcmp (spell_language, "NONE") != 0)
{
entries = g_list_prepend (entries, menu_entry_create (_("S&pell check"), CK_SpellCheck));
entries = g_list_prepend (entries, menu_entry_new (_("S&pell check"), CK_SpellCheck));
entries =
g_list_prepend (entries, menu_entry_new (_("C&heck word"), CK_SpellCheckCurrentWord));
entries =
g_list_prepend (entries,
menu_entry_create (_("C&heck word"), CK_SpellCheckCurrentWord));
entries =
g_list_prepend (entries,
menu_entry_create (_("Change spelling &language..."),
menu_entry_new (_("Change spelling &language..."),
CK_SpellCheckSelectLang));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_separator_new ());
}
#endif /* HAVE_ASPELL */
entries = g_list_prepend (entries, menu_entry_create (_("&Mail..."), CK_EditMail));
entries = g_list_prepend (entries, menu_entry_new (_("&Mail..."), CK_EditMail));
return g_list_reverse (entries);
@ -206,17 +201,14 @@ create_format_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_new (_("Insert &literal..."), CK_InsertLiteral));
entries = g_list_prepend (entries, menu_entry_new (_("Insert &date/time"), CK_Date));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Format paragraph"), CK_ParagraphFormat));
entries = g_list_prepend (entries, menu_entry_new (_("&Sort..."), CK_Sort));
entries =
g_list_prepend (entries, menu_entry_create (_("Insert &literal..."), CK_InsertLiteral));
entries = g_list_prepend (entries, menu_entry_create (_("Insert &date/time"), CK_Date));
entries = g_list_prepend (entries, menu_separator_create ());
entries =
g_list_prepend (entries, menu_entry_create (_("&Format paragraph"), CK_ParagraphFormat));
entries = g_list_prepend (entries, menu_entry_create (_("&Sort..."), CK_Sort));
entries =
g_list_prepend (entries, menu_entry_create (_("&Paste output of..."), CK_ExternalCommand));
entries =
g_list_prepend (entries, menu_entry_create (_("&External formatter"), CK_PipeBlock (0)));
g_list_prepend (entries, menu_entry_new (_("&Paste output of..."), CK_ExternalCommand));
entries = g_list_prepend (entries, menu_entry_new (_("&External formatter"), CK_PipeBlock (0)));
return g_list_reverse (entries);
}
@ -231,14 +223,14 @@ create_window_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Move"), CK_WindowMove));
entries = g_list_prepend (entries, menu_entry_create (_("&Resize"), CK_WindowResize));
entries = g_list_prepend (entries, menu_entry_new (_("&Move"), CK_WindowMove));
entries = g_list_prepend (entries, menu_entry_new (_("&Resize"), CK_WindowResize));
entries =
g_list_prepend (entries, menu_entry_create (_("&Toggle fullscreen"), CK_WindowFullscreen));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Next"), CK_WindowNext));
entries = g_list_prepend (entries, menu_entry_create (_("&Previous"), CK_WindowPrev));
entries = g_list_prepend (entries, menu_entry_create (_("&List..."), CK_WindowList));
g_list_prepend (entries, menu_entry_new (_("&Toggle fullscreen"), CK_WindowFullscreen));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Next"), CK_WindowNext));
entries = g_list_prepend (entries, menu_entry_new (_("&Previous"), CK_WindowPrev));
entries = g_list_prepend (entries, menu_entry_new (_("&List..."), CK_WindowList));
return g_list_reverse (entries);
}
@ -250,16 +242,16 @@ create_options_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&General..."), CK_Options));
entries = g_list_prepend (entries, menu_entry_create (_("Save &mode..."), CK_OptionsSaveMode));
entries = g_list_prepend (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys));
entries = g_list_prepend (entries, menu_entry_new (_("&General..."), CK_Options));
entries = g_list_prepend (entries, menu_entry_new (_("Save &mode..."), CK_OptionsSaveMode));
entries = g_list_prepend (entries, menu_entry_new (_("Learn &keys..."), CK_LearnKeys));
entries =
g_list_prepend (entries, menu_entry_create (_("Syntax &highlighting..."), CK_SyntaxChoose));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("S&yntax file"), CK_EditSyntaxFile));
entries = g_list_prepend (entries, menu_entry_create (_("&Menu file"), CK_EditUserMenu));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup));
g_list_prepend (entries, menu_entry_new (_("Syntax &highlighting..."), CK_SyntaxChoose));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("S&yntax file"), CK_EditSyntaxFile));
entries = g_list_prepend (entries, menu_entry_new (_("&Menu file"), CK_EditUserMenu));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Save setup"), CK_SaveSetup));
return g_list_reverse (entries);
}
@ -271,7 +263,7 @@ edit_drop_menu_cmd (WDialog * h, int which)
{
WMenuBar *menubar;
menubar = find_menubar (h);
menubar = menubar_find (h);
menubar_activate (menubar, drop_menus, which);
}
@ -283,22 +275,20 @@ void
edit_init_menu (WMenuBar * menubar)
{
menubar_add_menu (menubar,
create_menu (_("&File"), create_file_menu (), "[Internal File Editor]"));
menu_new (_("&File"), create_file_menu (), "[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("&Edit"), create_edit_menu (), "[Internal File Editor]"));
menu_new (_("&Edit"), create_edit_menu (), "[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("&Search"), create_search_replace_menu (),
menu_new (_("&Search"), create_search_replace_menu (),
"[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("&Command"), create_command_menu (),
"[Internal File Editor]"));
menu_new (_("&Command"), create_command_menu (), "[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("For&mat"), create_format_menu (), "[Internal File Editor]"));
menu_new (_("For&mat"), create_format_menu (), "[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("&Window"), create_window_menu (), "[Internal File Editor]"));
menu_new (_("&Window"), create_window_menu (), "[Internal File Editor]"));
menubar_add_menu (menubar,
create_menu (_("&Options"), create_options_menu (),
"[Internal File Editor]"));
menu_new (_("&Options"), create_options_menu (), "[Internal File Editor]"));
}
/* --------------------------------------------------------------------------------------------- */

View File

@ -770,7 +770,7 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
case MSG_RESIZE:
dlg_default_callback (w, NULL, MSG_RESIZE, 0, NULL);
menubar_arrange (find_menubar (h));
menubar_arrange (menubar_find (h));
return MSG_HANDLED;
case MSG_ACTION:
@ -783,7 +783,7 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
/* We forward any commands coming from the menu, and which haven't been
handled by the dialog, to the focused WEdit window. */
if (result == MSG_NOT_HANDLED && sender == WIDGET (find_menubar (h)))
if (result == MSG_NOT_HANDLED && sender == WIDGET (menubar_find (h)))
result = send_message (g->current->data, NULL, MSG_ACTION, parm, NULL);
return result;
@ -869,7 +869,7 @@ edit_dialog_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
WDialog *h = DIALOG (w);
WMenuBar *b;
b = find_menubar (h);
b = menubar_find (h);
if (!widget_get_state (WIDGET (b), WST_FOCUSED))
{

View File

@ -195,32 +195,31 @@ create_panel_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("File listin&g"), CK_PanelListing));
entries = g_list_prepend (entries, menu_entry_create (_("&Quick view"), CK_PanelQuickView));
entries = g_list_prepend (entries, menu_entry_create (_("&Info"), CK_PanelInfo));
entries = g_list_prepend (entries, menu_entry_create (_("&Tree"), CK_PanelTree));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_new (_("File listin&g"), CK_PanelListing));
entries = g_list_prepend (entries, menu_entry_new (_("&Quick view"), CK_PanelQuickView));
entries = g_list_prepend (entries, menu_entry_new (_("&Info"), CK_PanelInfo));
entries = g_list_prepend (entries, menu_entry_new (_("&Tree"), CK_PanelTree));
entries = g_list_prepend (entries, menu_separator_new ());
entries =
g_list_prepend (entries,
menu_entry_create (_("&Listing format..."), CK_SetupListingFormat));
entries = g_list_prepend (entries, menu_entry_create (_("&Sort order..."), CK_Sort));
entries = g_list_prepend (entries, menu_entry_create (_("&Filter..."), CK_Filter));
g_list_prepend (entries, menu_entry_new (_("&Listing format..."), CK_SetupListingFormat));
entries = g_list_prepend (entries, menu_entry_new (_("&Sort order..."), CK_Sort));
entries = g_list_prepend (entries, menu_entry_new (_("&Filter..."), CK_Filter));
#ifdef HAVE_CHARSET
entries = g_list_prepend (entries, menu_entry_create (_("&Encoding..."), CK_SelectCodepage));
entries = g_list_prepend (entries, menu_entry_new (_("&Encoding..."), CK_SelectCodepage));
#endif
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_separator_new ());
#ifdef ENABLE_VFS_FTP
entries = g_list_prepend (entries, menu_entry_create (_("FT&P link..."), CK_ConnectFtp));
entries = g_list_prepend (entries, menu_entry_new (_("FT&P link..."), CK_ConnectFtp));
#endif
#ifdef ENABLE_VFS_FISH
entries = g_list_prepend (entries, menu_entry_create (_("S&hell link..."), CK_ConnectFish));
entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectFish));
#endif
#ifdef ENABLE_VFS_SFTP
entries = g_list_prepend (entries, menu_entry_create (_("SFTP li&nk..."), CK_ConnectSftp));
entries = g_list_prepend (entries, menu_entry_new (_("SFTP li&nk..."), CK_ConnectSftp));
#endif
entries = g_list_prepend (entries, menu_entry_create (_("Paneli&ze"), CK_Panelize));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Rescan"), CK_Reread));
entries = g_list_prepend (entries, menu_entry_new (_("Paneli&ze"), CK_Panelize));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Rescan"), CK_Reread));
return g_list_reverse (entries);
}
@ -232,34 +231,32 @@ create_file_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&View"), CK_View));
entries = g_list_prepend (entries, menu_entry_create (_("Vie&w file..."), CK_ViewFile));
entries = g_list_prepend (entries, menu_entry_create (_("&Filtered view"), CK_ViewFiltered));
entries = g_list_prepend (entries, menu_entry_create (_("&Edit"), CK_Edit));
entries = g_list_prepend (entries, menu_entry_create (_("&Copy"), CK_Copy));
entries = g_list_prepend (entries, menu_entry_create (_("C&hmod"), CK_ChangeMode));
entries = g_list_prepend (entries, menu_entry_create (_("&Link"), CK_Link));
entries = g_list_prepend (entries, menu_entry_create (_("&Symlink"), CK_LinkSymbolic));
entries = g_list_prepend (entries, menu_entry_new (_("&View"), CK_View));
entries = g_list_prepend (entries, menu_entry_new (_("Vie&w file..."), CK_ViewFile));
entries = g_list_prepend (entries, menu_entry_new (_("&Filtered view"), CK_ViewFiltered));
entries = g_list_prepend (entries, menu_entry_new (_("&Edit"), CK_Edit));
entries = g_list_prepend (entries, menu_entry_new (_("&Copy"), CK_Copy));
entries = g_list_prepend (entries, menu_entry_new (_("C&hmod"), CK_ChangeMode));
entries = g_list_prepend (entries, menu_entry_new (_("&Link"), CK_Link));
entries = g_list_prepend (entries, menu_entry_new (_("&Symlink"), CK_LinkSymbolic));
entries =
g_list_prepend (entries,
menu_entry_create (_("Relative symlin&k"), CK_LinkSymbolicRelative));
entries = g_list_prepend (entries, menu_entry_create (_("Edit s&ymlink"), CK_LinkSymbolicEdit));
entries = g_list_prepend (entries, menu_entry_create (_("Ch&own"), CK_ChangeOwn));
entries =
g_list_prepend (entries, menu_entry_create (_("&Advanced chown"), CK_ChangeOwnAdvanced));
g_list_prepend (entries, menu_entry_new (_("Relative symlin&k"), CK_LinkSymbolicRelative));
entries = g_list_prepend (entries, menu_entry_new (_("Edit s&ymlink"), CK_LinkSymbolicEdit));
entries = g_list_prepend (entries, menu_entry_new (_("Ch&own"), CK_ChangeOwn));
entries = g_list_prepend (entries, menu_entry_new (_("&Advanced chown"), CK_ChangeOwnAdvanced));
#ifdef ENABLE_EXT2FS_ATTR
entries = g_list_prepend (entries, menu_entry_create (_("Cha&ttr"), CK_ChangeAttributes));
entries = g_list_prepend (entries, menu_entry_new (_("Cha&ttr"), CK_ChangeAttributes));
#endif
entries = g_list_prepend (entries, menu_entry_create (_("&Rename/Move"), CK_Move));
entries = g_list_prepend (entries, menu_entry_create (_("&Mkdir"), CK_MakeDir));
entries = g_list_prepend (entries, menu_entry_create (_("&Delete"), CK_Delete));
entries = g_list_prepend (entries, menu_entry_create (_("&Quick cd"), CK_CdQuick));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("Select &group"), CK_Select));
entries = g_list_prepend (entries, menu_entry_create (_("U&nselect group"), CK_Unselect));
entries = g_list_prepend (entries, menu_entry_create (_("&Invert selection"), CK_SelectInvert));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("E&xit"), CK_Quit));
entries = g_list_prepend (entries, menu_entry_new (_("&Rename/Move"), CK_Move));
entries = g_list_prepend (entries, menu_entry_new (_("&Mkdir"), CK_MakeDir));
entries = g_list_prepend (entries, menu_entry_new (_("&Delete"), CK_Delete));
entries = g_list_prepend (entries, menu_entry_new (_("&Quick cd"), CK_CdQuick));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("Select &group"), CK_Select));
entries = g_list_prepend (entries, menu_entry_new (_("U&nselect group"), CK_Unselect));
entries = g_list_prepend (entries, menu_entry_new (_("&Invert selection"), CK_SelectInvert));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("E&xit"), CK_Quit));
return g_list_reverse (entries);
}
@ -275,52 +272,48 @@ create_command_menu (void)
*/
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&User menu"), CK_UserMenu));
entries = g_list_prepend (entries, menu_entry_create (_("&Directory tree"), CK_Tree));
entries = g_list_prepend (entries, menu_entry_create (_("&Find file"), CK_Find));
entries = g_list_prepend (entries, menu_entry_create (_("S&wap panels"), CK_Swap));
entries = g_list_prepend (entries, menu_entry_create (_("Switch &panels on/off"), CK_Shell));
entries =
g_list_prepend (entries, menu_entry_create (_("&Compare directories"), CK_CompareDirs));
entries = g_list_prepend (entries, menu_entry_new (_("&User menu"), CK_UserMenu));
entries = g_list_prepend (entries, menu_entry_new (_("&Directory tree"), CK_Tree));
entries = g_list_prepend (entries, menu_entry_new (_("&Find file"), CK_Find));
entries = g_list_prepend (entries, menu_entry_new (_("S&wap panels"), CK_Swap));
entries = g_list_prepend (entries, menu_entry_new (_("Switch &panels on/off"), CK_Shell));
entries = g_list_prepend (entries, menu_entry_new (_("&Compare directories"), CK_CompareDirs));
#ifdef USE_DIFF_VIEW
entries = g_list_prepend (entries, menu_entry_create (_("C&ompare files"), CK_CompareFiles));
entries = g_list_prepend (entries, menu_entry_new (_("C&ompare files"), CK_CompareFiles));
#endif
entries =
g_list_prepend (entries, menu_entry_create (_("E&xternal panelize"), CK_ExternalPanelize));
entries = g_list_prepend (entries, menu_entry_create (_("Show directory s&izes"), CK_DirSize));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("Command &history"), CK_History));
g_list_prepend (entries, menu_entry_new (_("E&xternal panelize"), CK_ExternalPanelize));
entries = g_list_prepend (entries, menu_entry_new (_("Show directory s&izes"), CK_DirSize));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("Command &history"), CK_History));
entries =
g_list_prepend (entries,
menu_entry_create (_("Viewed/edited files hi&story"),
CK_EditorViewerHistory));
entries = g_list_prepend (entries, menu_entry_create (_("Di&rectory hotlist"), CK_HotList));
menu_entry_new (_("Viewed/edited files hi&story"), CK_EditorViewerHistory));
entries = g_list_prepend (entries, menu_entry_new (_("Di&rectory hotlist"), CK_HotList));
#ifdef ENABLE_VFS
entries = g_list_prepend (entries, menu_entry_create (_("&Active VFS list"), CK_VfsList));
entries = g_list_prepend (entries, menu_entry_new (_("&Active VFS list"), CK_VfsList));
#endif
#ifdef ENABLE_BACKGROUND
entries = g_list_prepend (entries, menu_entry_create (_("&Background jobs"), CK_Jobs));
entries = g_list_prepend (entries, menu_entry_new (_("&Background jobs"), CK_Jobs));
#endif
entries = g_list_prepend (entries, menu_entry_create (_("Screen lis&t"), CK_ScreenList));
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_new (_("Screen lis&t"), CK_ScreenList));
entries = g_list_prepend (entries, menu_separator_new ());
#ifdef ENABLE_VFS_UNDELFS
entries =
g_list_prepend (entries,
menu_entry_create (_("&Undelete files (ext2fs only)"), CK_Undelete));
g_list_prepend (entries, menu_entry_new (_("&Undelete files (ext2fs only)"), CK_Undelete));
#endif
#ifdef LISTMODE_EDITOR
entries = g_list_prepend (entries, menu_entry_create (_("&Listing format edit"), CK_ListMode));
entries = g_list_prepend (entries, menu_entry_new (_("&Listing format edit"), CK_ListMode));
#endif
#if defined (ENABLE_VFS_UNDELFS) || defined (LISTMODE_EDITOR)
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_separator_new ());
#endif
entries =
g_list_prepend (entries,
menu_entry_create (_("Edit &extension file"), CK_EditExtensionsFile));
entries = g_list_prepend (entries, menu_entry_create (_("Edit &menu file"), CK_EditUserMenu));
g_list_prepend (entries, menu_entry_new (_("Edit &extension file"), CK_EditExtensionsFile));
entries = g_list_prepend (entries, menu_entry_new (_("Edit &menu file"), CK_EditUserMenu));
entries =
g_list_prepend (entries,
menu_entry_create (_("Edit hi&ghlighting group file"),
menu_entry_new (_("Edit hi&ghlighting group file"),
CK_EditFileHighlightFile));
return g_list_reverse (entries);
@ -333,21 +326,19 @@ create_options_menu (void)
{
GList *entries = NULL;
entries = g_list_prepend (entries, menu_entry_create (_("&Configuration..."), CK_Options));
entries = g_list_prepend (entries, menu_entry_create (_("&Layout..."), CK_OptionsLayout));
entries = g_list_prepend (entries, menu_entry_create (_("&Panel options..."), CK_OptionsPanel));
entries = g_list_prepend (entries, menu_entry_new (_("&Configuration..."), CK_Options));
entries = g_list_prepend (entries, menu_entry_new (_("&Layout..."), CK_OptionsLayout));
entries = g_list_prepend (entries, menu_entry_new (_("&Panel options..."), CK_OptionsPanel));
entries = g_list_prepend (entries, menu_entry_new (_("C&onfirmation..."), CK_OptionsConfirm));
entries = g_list_prepend (entries, menu_entry_new (_("&Appearance..."), CK_OptionsAppearance));
entries =
g_list_prepend (entries, menu_entry_create (_("C&onfirmation..."), CK_OptionsConfirm));
entries =
g_list_prepend (entries, menu_entry_create (_("&Appearance..."), CK_OptionsAppearance));
entries =
g_list_prepend (entries, menu_entry_create (_("&Display bits..."), CK_OptionsDisplayBits));
entries = g_list_prepend (entries, menu_entry_create (_("Learn &keys..."), CK_LearnKeys));
g_list_prepend (entries, menu_entry_new (_("&Display bits..."), CK_OptionsDisplayBits));
entries = g_list_prepend (entries, menu_entry_new (_("Learn &keys..."), CK_LearnKeys));
#ifdef ENABLE_VFS
entries = g_list_prepend (entries, menu_entry_create (_("&Virtual FS..."), CK_OptionsVfs));
entries = g_list_prepend (entries, menu_entry_new (_("&Virtual FS..."), CK_OptionsVfs));
#endif
entries = g_list_prepend (entries, menu_separator_create ());
entries = g_list_prepend (entries, menu_entry_create (_("&Save setup"), CK_SaveSetup));
entries = g_list_prepend (entries, menu_separator_new ());
entries = g_list_prepend (entries, menu_entry_new (_("&Save setup"), CK_SaveSetup));
return g_list_reverse (entries);
}
@ -357,14 +348,14 @@ create_options_menu (void)
static void
init_menu (void)
{
left_menu = create_menu ("", create_panel_menu (), "[Left and Right Menus]");
left_menu = menu_new ("", create_panel_menu (), "[Left and Right Menus]");
menubar_add_menu (the_menubar, left_menu);
menubar_add_menu (the_menubar, create_menu (_("&File"), create_file_menu (), "[File Menu]"));
menubar_add_menu (the_menubar, menu_new (_("&File"), create_file_menu (), "[File Menu]"));
menubar_add_menu (the_menubar,
create_menu (_("&Command"), create_command_menu (), "[Command Menu]"));
menu_new (_("&Command"), create_command_menu (), "[Command Menu]"));
menubar_add_menu (the_menubar,
create_menu (_("&Options"), create_options_menu (), "[Options Menu]"));
right_menu = create_menu ("", create_panel_menu (), "[Left and Right Menus]");
menu_new (_("&Options"), create_options_menu (), "[Options Menu]"));
right_menu = menu_new ("", create_panel_menu (), "[Left and Right Menus]");
menubar_add_menu (the_menubar, right_menu);
update_menu ();
}