Wed Apr 15 10:48:41 1998 Alex Tkachenko <alex@bcs.zp.ua>

* src/hotlist.c: changes to hotlist boxes i18n.

	* src/panelize.c: changes to panelize boxes i18n.

	* src/wtools.c (query_dialog): Take care about possible '&' in
	button names while calculating window sizes and button positions.
This commit is contained in:
Miguel de Icaza 1998-04-15 20:09:13 +00:00
parent 41eeb94d42
commit 33bcad66ff
9 changed files with 326 additions and 130 deletions

View File

@ -1,4 +1,4 @@
VERSION=4.1.31
VERSION=4.1.32
SHELL = /bin/sh

View File

@ -1 +1 @@
#define VERSION "4.1.31"
#define VERSION "4.1.32"

214
po/mc.pot
View File

@ -1,6 +1,6 @@
msgid ""
msgstr ""
"Date: 1998-04-13 14:04:36-0500\n"
"Date: 1998-04-15 01:22:02-0500\n"
"From: Miguel de Icaza,computo,622-4680 <miguel@metropolis.nuclecu.unam.mx>\n"
"Content-Type: text/plain; charset=\n"
"Xgettext-Options: --default-domain=mc --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\n"
@ -63,7 +63,7 @@ msgid " Save As "
msgstr ""
#. Warning message with a query to continue or cancel the operation
#: edit/editcmd.c:407 edit/editcmd.c:714 edit/editcmd.c:726 edit/editcmd.c:827 edit/editcmd.c:910 gnome/gdesktop.c:1044 src/ext.c:291 src/help.c:320 src/main.c:683 src/subshell.c:696 src/subshell.c:722 src/utilunix.c:373 src/utilunix.c:377 src/utilunix.c:443
#: edit/editcmd.c:407 edit/editcmd.c:714 edit/editcmd.c:726 edit/editcmd.c:827 edit/editcmd.c:910 gnome/gdesktop.c:1207 src/ext.c:291 src/help.c:320 src/main.c:683 src/subshell.c:696 src/subshell.c:722 src/utilunix.c:373 src/utilunix.c:377 src/utilunix.c:443
msgid " Warning "
msgstr ""
@ -304,11 +304,11 @@ msgstr ""
msgid "Cancel quit"
msgstr ""
#: edit/editcmd.c:1961 gnome/gdesktop.c:858 src/cmd.c:240 src/file.c:2116 src/file.c:2469 src/file.c:2549 src/hotlist.c:887 src/main.c:838 src/screen.c:1976 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
#: edit/editcmd.c:1961 gnome/gdesktop.c:1023 src/cmd.c:240 src/file.c:2116 src/file.c:2469 src/file.c:2549 src/hotlist.c:887 src/main.c:838 src/screen.c:1976 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
msgid "&Yes"
msgstr ""
#: edit/editcmd.c:1961 gnome/gdesktop.c:858 src/cmd.c:240 src/file.c:2116 src/file.c:2466 src/file.c:2549 src/hotlist.c:887 src/main.c:838 src/screen.c:1976 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
#: edit/editcmd.c:1961 gnome/gdesktop.c:1023 src/cmd.c:240 src/file.c:2116 src/file.c:2466 src/file.c:2549 src/hotlist.c:887 src/main.c:838 src/screen.c:1976 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
msgid "&No"
msgstr ""
@ -753,7 +753,7 @@ msgstr ""
msgid "Error initialising editor.\n"
msgstr ""
#: edit/editwidget.c:910 gnome/glayout.c:263 src/help.c:812 src/main.c:1670 src/screen.c:2187 src/screen.c:2221 src/tree.c:1451 src/view.c:1978
#: edit/editwidget.c:910 gnome/glayout.c:272 src/help.c:812 src/main.c:1670 src/screen.c:2187 src/screen.c:2221 src/tree.c:1451 src/view.c:1978
msgid "Help"
msgstr ""
@ -765,19 +765,19 @@ msgstr ""
msgid "Replac"
msgstr ""
#: edit/editwidget.c:914 gnome/gdesktop.c:215 gnome/glayout.c:192 src/screen.c:2191 src/screen.c:2225 src/tree.c:1457
#: edit/editwidget.c:914 gnome/gdesktop.c:335 gnome/glayout.c:194 src/screen.c:2191 src/screen.c:2225 src/tree.c:1457
msgid "Copy"
msgstr ""
#: edit/editwidget.c:915 gnome/gdesktop.c:220
#: edit/editwidget.c:915 gnome/gdesktop.c:340
msgid "Move"
msgstr ""
#: edit/editwidget.c:916 gnome/gview.c:285 gnome/gview.c:309 src/view.c:1991
#: edit/editwidget.c:916 gnome/gview.c:286 gnome/gview.c:310 src/view.c:1991
msgid "Search"
msgstr ""
#: edit/editwidget.c:917 gnome/gdesktop.c:755 gnome/glayout.c:195 src/screen.c:2194 src/screen.c:2228
#: edit/editwidget.c:917 gnome/gdesktop.c:920 gnome/glayout.c:197 src/screen.c:2194 src/screen.c:2228
msgid "Delete"
msgstr ""
@ -785,7 +785,7 @@ msgstr ""
msgid "PullDn"
msgstr ""
#: edit/editwidget.c:920 gnome/gview.c:280 src/help.c:824 src/main.c:1673 src/view.c:1980 src/view.c:2000
#: edit/editwidget.c:920 gnome/gview.c:281 src/help.c:824 src/main.c:1673 src/view.c:1980 src/view.c:2000
msgid "Quit"
msgstr ""
@ -805,7 +805,7 @@ msgid ""
"\n"
msgstr ""
#: src/achown.c:72 src/boxes.c:138 src/boxes.c:273 src/boxes.c:370 src/boxes.c:457 src/boxes.c:636 src/boxes.c:757 src/boxes.c:799 src/chmod.c:115 src/chown.c:81 src/cmd.c:832 src/file.c:1953 src/find.c:158 src/hotlist.c:140 src/hotlist.c:696 src/hotlist.c:777 src/layout.c:365 src/learn.c:58 src/option.c:143 src/panelize.c:89 src/view.c:411 src/wtools.c:114 src/wtools.c:401 src/wtools.c:572 src/wtools.c:652
#: src/achown.c:72 src/boxes.c:138 src/boxes.c:273 src/boxes.c:370 src/boxes.c:457 src/boxes.c:636 src/boxes.c:757 src/boxes.c:799 src/chmod.c:115 src/chown.c:81 src/cmd.c:832 src/file.c:1953 src/find.c:158 src/hotlist.c:140 src/hotlist.c:696 src/hotlist.c:777 src/layout.c:365 src/learn.c:58 src/option.c:143 src/panelize.c:89 src/view.c:411 src/wtools.c:114 src/wtools.c:401 src/wtools.c:574 src/wtools.c:654
msgid "&Cancel"
msgstr ""
@ -841,7 +841,7 @@ msgstr ""
msgid "Flag"
msgstr ""
#: gnome/gview.c:310 src/achown.c:366
#: gnome/gview.c:311 src/achown.c:366
msgid "Mode"
msgstr ""
@ -927,7 +927,7 @@ msgstr ""
msgid "user &Mini status"
msgstr ""
#: gnome/gtools.c:129 src/boxes.c:137 src/boxes.c:272 src/boxes.c:372 src/boxes.c:459 src/boxes.c:638 src/boxes.c:758 src/boxes.c:801 src/boxes.c:910 src/file.c:1960 src/find.c:158 src/layout.c:364 src/option.c:142 src/wtools.c:295 src/wtools.c:574
#: gnome/gtools.c:129 src/boxes.c:137 src/boxes.c:272 src/boxes.c:372 src/boxes.c:459 src/boxes.c:638 src/boxes.c:758 src/boxes.c:801 src/boxes.c:910 src/file.c:1960 src/find.c:158 src/layout.c:364 src/option.c:142 src/wtools.c:295 src/wtools.c:576
msgid "&Ok"
msgstr ""
@ -1589,7 +1589,7 @@ msgstr ""
msgid "Deleting"
msgstr ""
#: gnome/glayout.c:259 gnome/gview.c:308 src/file.c:562
#: gnome/glayout.c:267 gnome/gview.c:309 src/file.c:562
msgid "File"
msgstr ""
@ -2525,7 +2525,7 @@ msgstr ""
msgid " The shell is already running a command "
msgstr ""
#: gnome/gdesktop.c:856 src/main.c:836 src/screen.c:1974
#: gnome/gdesktop.c:1021 src/main.c:836 src/screen.c:1974
msgid " The Midnight Commander "
msgstr ""
@ -3024,7 +3024,7 @@ msgstr ""
#. SCO_FLAVOR
#. SCO_FLAVOR
#: gnome/glayout.c:238 src/panelize.c:164 src/panelize.c:425
#: gnome/glayout.c:240 src/panelize.c:164 src/panelize.c:425
msgid "External panelize"
msgstr ""
@ -3124,11 +3124,11 @@ msgstr ""
msgid "Unknow tag on display format: "
msgstr ""
#: gnome/gdesktop.c:857 src/screen.c:1975
#: gnome/gdesktop.c:1022 src/screen.c:1975
msgid " Do you really want to execute? "
msgstr ""
#: gnome/glayout.c:197 gnome/gscreen.c:363 src/screen.c:2189 src/screen.c:2223
#: gnome/glayout.c:199 gnome/gscreen.c:363 src/screen.c:2189 src/screen.c:2223
msgid "View"
msgstr ""
@ -3140,7 +3140,7 @@ msgstr ""
msgid "RenMov"
msgstr ""
#: gnome/glayout.c:194 src/screen.c:2193 src/screen.c:2227 src/tree.c:1463
#: gnome/glayout.c:196 src/screen.c:2193 src/screen.c:2227 src/tree.c:1463
msgid "Mkdir"
msgstr ""
@ -3160,7 +3160,7 @@ msgstr ""
msgid " Quit anyway? "
msgstr ""
#: src/subshell.c:777
#: src/subshell.c:776
msgid "Warning: Couldn't change to %s.\n"
msgstr ""
@ -3224,7 +3224,7 @@ msgid ""
" %s "
msgstr ""
#: gnome/glayout.c:213 src/tree.c:1453
#: gnome/glayout.c:215 src/tree.c:1453
msgid "Rescan"
msgstr ""
@ -3334,15 +3334,15 @@ msgstr ""
msgid "File: %s"
msgstr ""
#: gnome/gview.c:109 src/view.c:709
#: gnome/gview.c:110 src/view.c:709
msgid "Offset 0x%08x"
msgstr ""
#: gnome/gview.c:111 src/view.c:711
#: gnome/gview.c:112 src/view.c:711
msgid "Col %d"
msgstr ""
#: gnome/gview.c:114 src/view.c:715
#: gnome/gview.c:115 src/view.c:715
msgid "%s bytes"
msgstr ""
@ -3376,7 +3376,7 @@ msgstr ""
msgid "Ascii"
msgstr ""
#: gnome/gview.c:302 src/view.c:1981
#: gnome/gview.c:303 src/view.c:1981
msgid "Hex"
msgstr ""
@ -3400,7 +3400,7 @@ msgstr ""
msgid "UnWrap"
msgstr ""
#: gnome/gview.c:294 src/view.c:1988
#: gnome/gview.c:295 src/view.c:1988
msgid "Wrap"
msgstr ""
@ -3619,11 +3619,11 @@ msgstr ""
msgid "NumLock on keypad"
msgstr ""
#: src/wtools.c:600
#: src/wtools.c:602
msgid "Password"
msgstr ""
#: src/wtools.c:654
#: src/wtools.c:656
msgid "Ok"
msgstr ""
@ -3639,243 +3639,254 @@ msgstr ""
msgid "The GNOME edition of the Midnight Commander file manager."
msgstr ""
#. Not yet implemented the Link bits, so better to not show what we dont have
#: gnome/gdesktop.c:226
#: gnome/gdesktop.c:346
msgid "Link"
msgstr ""
#: gnome/gdesktop.c:748 gnome/gscreen.c:359
#: gnome/gdesktop.c:913 gnome/gscreen.c:359
msgid "Properties"
msgstr ""
#: gnome/gdesktop.c:867
#: gnome/gdesktop.c:1032
msgid "Open with..."
msgstr ""
#: gnome/gdesktop.c:868 gnome/gscreen.c:315
#: gnome/gdesktop.c:1033 gnome/gscreen.c:315
msgid "Enter extra arguments:"
msgstr ""
#: gnome/gdesktop.c:1044
#: gnome/gdesktop.c:1207
msgid " Could not open %s directory"
msgstr ""
#: gnome/glayout.c:189
#: gnome/glayout.c:191
msgid "New panel"
msgstr ""
#: gnome/glayout.c:189
#: gnome/glayout.c:191
msgid "Opens a new panel"
msgstr ""
#: gnome/glayout.c:190
#: gnome/glayout.c:192
msgid "Open Terminal"
msgstr ""
#: gnome/glayout.c:190
#: gnome/glayout.c:192
msgid "Opens a terminal"
msgstr ""
#: gnome/glayout.c:192
#: gnome/glayout.c:194
msgid "Copy files"
msgstr ""
#: gnome/glayout.c:193
#: gnome/glayout.c:195
msgid "Rename/Move"
msgstr ""
#: gnome/glayout.c:193
#: gnome/glayout.c:195
msgid "Rename or move files"
msgstr ""
#: gnome/glayout.c:194
#: gnome/glayout.c:196
msgid "Creates a new folder"
msgstr ""
#: gnome/glayout.c:195
#: gnome/glayout.c:197
msgid "Delete files from disk"
msgstr ""
#: gnome/glayout.c:197
#: gnome/glayout.c:199
msgid "View file"
msgstr ""
#: gnome/glayout.c:198
#: gnome/glayout.c:200
msgid "View raw"
msgstr ""
#: gnome/glayout.c:198
#: gnome/glayout.c:200
msgid "View the file without further processing"
msgstr ""
#: gnome/glayout.c:200
#: gnome/glayout.c:202
msgid "Select group"
msgstr ""
#: gnome/glayout.c:200
#: gnome/glayout.c:202
msgid "Selects a group of files"
msgstr ""
#: gnome/glayout.c:201
#: gnome/glayout.c:203
msgid "Unselect group"
msgstr ""
#: gnome/glayout.c:201
#: gnome/glayout.c:203
msgid "Un-selects a group of marked files"
msgstr ""
#: gnome/glayout.c:202
#: gnome/glayout.c:204
msgid "Reverse selection"
msgstr ""
#: gnome/glayout.c:202
#: gnome/glayout.c:204
msgid "Reverses the list of tagged files"
msgstr ""
#: gnome/glayout.c:204
#: gnome/glayout.c:206
msgid "Exit"
msgstr ""
#: gnome/glayout.c:204
#: gnome/glayout.c:206
msgid "Exit program"
msgstr ""
#: gnome/glayout.c:210
#: gnome/glayout.c:212
msgid "Display mode..."
msgstr ""
#: gnome/glayout.c:210
#: gnome/glayout.c:212
msgid "Set the display mode for the panel"
msgstr ""
#: gnome/glayout.c:211
#: gnome/glayout.c:213
msgid "Sort order..."
msgstr ""
#: gnome/glayout.c:211
#: gnome/glayout.c:213
msgid "Changes the sort order of the files"
msgstr ""
#: gnome/glayout.c:212
#: gnome/glayout.c:214
msgid "Filter..."
msgstr ""
#: gnome/glayout.c:212
#: gnome/glayout.c:214
msgid "Set a filter for the files"
msgstr ""
#: gnome/glayout.c:213
#: gnome/glayout.c:215
msgid "Rescan the directory contents"
msgstr ""
#: gnome/glayout.c:216
#: gnome/glayout.c:218
msgid "Network link..."
msgstr ""
#: gnome/glayout.c:216
#: gnome/glayout.c:218
msgid "Connect to a remote machine"
msgstr ""
#: gnome/glayout.c:217
#: gnome/glayout.c:219
msgid "FTP link..."
msgstr ""
#: gnome/glayout.c:217
#: gnome/glayout.c:219
msgid "Connect to a remote machine with FTP"
msgstr ""
#: gnome/glayout.c:223
#: gnome/glayout.c:225
msgid "Confirmation"
msgstr ""
#: gnome/glayout.c:223
#: gnome/glayout.c:225
msgid "Confirmation settings"
msgstr ""
#: gnome/glayout.c:224 gnome/glayout.c:262
#: gnome/glayout.c:226 gnome/glayout.c:270
msgid "Options"
msgstr ""
#: gnome/glayout.c:224
#: gnome/glayout.c:226
msgid "Global option settings"
msgstr ""
#: gnome/glayout.c:227
#: gnome/glayout.c:229
msgid "Virtual FS"
msgstr ""
#: gnome/glayout.c:227
#: gnome/glayout.c:229
msgid "Virtual File System settings"
msgstr ""
#: gnome/glayout.c:230
#: gnome/glayout.c:232
msgid "Save setup"
msgstr ""
#: gnome/glayout.c:235
#: gnome/glayout.c:237
msgid "Find"
msgstr ""
#: gnome/glayout.c:235
#: gnome/glayout.c:237
msgid "Locate files on disk"
msgstr ""
#: gnome/glayout.c:236
#: gnome/glayout.c:238
msgid "Hotlist"
msgstr ""
#: gnome/glayout.c:236
#: gnome/glayout.c:238
msgid "List of favorite sites"
msgstr ""
#: gnome/glayout.c:237
#: gnome/glayout.c:239
msgid "Compare panels"
msgstr ""
#: gnome/glayout.c:237
#: gnome/glayout.c:239
msgid "Compare panel contents"
msgstr ""
#: gnome/glayout.c:240
#: gnome/glayout.c:242
msgid "Active VFS list"
msgstr ""
#: gnome/glayout.c:240
#: gnome/glayout.c:242
msgid "List of active virtual file systems"
msgstr ""
#: gnome/glayout.c:243
#: gnome/glayout.c:245
msgid "Undelete files (ext2fs only)"
msgstr ""
#: gnome/glayout.c:243
#: gnome/glayout.c:245
msgid "Recover deleted files"
msgstr ""
#: gnome/glayout.c:246
#: gnome/glayout.c:248
msgid "Background jobs"
msgstr ""
#: gnome/glayout.c:246
#: gnome/glayout.c:248
msgid "List of background operations"
msgstr ""
#: gnome/glayout.c:252
msgid "About"
#: gnome/glayout.c:254
msgid "Arrange icons"
msgstr ""
#: gnome/glayout.c:252
msgid "Information on this program"
#: gnome/glayout.c:254
msgid "Arranges the icons on the desktop"
msgstr ""
#: gnome/glayout.c:260
msgid "About"
msgstr ""
#: gnome/glayout.c:260
msgid "Information on this program"
msgstr ""
#: gnome/glayout.c:268
msgid "Panel"
msgstr ""
#: gnome/glayout.c:261
#: gnome/glayout.c:269
msgid "Commands"
msgstr ""
#: gnome/glayout.c:271
msgid "Desktop"
msgstr ""
#: gnome/gprop.c:54 gnome/gprop.c:71
msgid "Filename"
msgstr ""
@ -4073,52 +4084,51 @@ msgstr ""
msgid "Error"
msgstr ""
#: gnome/gview.c:278
#: gnome/gview.c:279
msgid "Goto line"
msgstr ""
#: gnome/gview.c:278
#: gnome/gview.c:279
msgid "Jump to a specified line number"
msgstr ""
#: gnome/gview.c:279
#: gnome/gview.c:280
msgid "Monitor file"
msgstr ""
#: gnome/gview.c:279
#: gnome/gview.c:280
msgid "Monitor file growing"
msgstr ""
#: gnome/gview.c:280
#: gnome/gview.c:281
msgid "Terminate the viewer"
msgstr ""
#: gnome/gview.c:285
#: gnome/gview.c:286
msgid "String search"
msgstr ""
#: gnome/gview.c:286
#: gnome/gview.c:287
msgid "Regexp search"
msgstr ""
#: gnome/gview.c:286
#: gnome/gview.c:287
msgid "Regular expression search"
msgstr ""
#: gnome/gview.c:288
#: gnome/gview.c:289
msgid "Search again..."
msgstr ""
#: gnome/gview.c:288
#: gnome/gview.c:289
msgid "Continue searching"
msgstr ""
#: gnome/gview.c:294
#: gnome/gview.c:295
msgid "Wrap the text"
msgstr ""
#. Can not use this one yet, as it destroys the viewer, need to fix that
#: gnome/gview.c:300
#: gnome/gview.c:301
msgid "Formatted"
msgstr ""

View File

@ -1,3 +1,12 @@
Wed Apr 15 10:48:41 1998 Alex Tkachenko <alex@bcs.zp.ua>
* src/hotlist.c: changes to hotlist boxes i18n.
* src/panelize.c: changes to panelize boxes i18n.
* src/wtools.c (query_dialog): Take care about possible '&' in
button names while calculating window sizes and button positions.
1998-04-15 Miguel de Icaza <miguel@nuclecu.unam.mx>
* screen.c (string_file_nlinks): The buffer was too small and we

View File

@ -82,10 +82,10 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
case DLG_DRAW:
attrset (COLOR_NORMAL);
dlg_erase (h);
draw_box (h, 1, 2, DISPLAY_Y-2, DISPLAY_X-4);
draw_box (h, 1, 2, h->lines - 2, h->cols - 4);
attrset (COLOR_HOT_NORMAL);
dlg_move (h, 1, (DISPLAY_X - strlen(display_title))/2);
dlg_move (h, 1, (h->cols - strlen(display_title))/2);
addstr (display_title);
attrset (COLOR_NORMAL);
break;

View File

@ -178,9 +178,11 @@ static void hotlist_refresh (Dlg_head *dlg)
{
dialog_repaint (dlg, COLOR_NORMAL, COLOR_HOT_NORMAL);
attrset (COLOR_NORMAL);
draw_box (dlg, UY, UX, UY+(LINES-14), COLS-2*UX-6);
draw_box (dlg, 2, 5,
dlg->lines - (hotlist_state.moving ? 6 : 10),
dlg->cols - (UX*2));
if (!hotlist_state.moving)
draw_box (dlg, UY+(LINES-12), UX, 3, COLS-2*UX-6);
draw_box (dlg, dlg->lines-8, 5, 3, dlg->cols - (UX*2));
}
#endif
@ -203,9 +205,9 @@ static INLINE void update_path_name ()
#ifndef HAVE_X
p = copy_strings (" ", current_group->label, " ", (char *)0);
if (!hotlist_state.moving)
label_set_text (pname_group, name_trunc (p, COLS-2*UX-8));
label_set_text (pname_group, name_trunc (p, dlg->cols - (UX*2+4)));
else
label_set_text (movelist_group, name_trunc (p, COLS-2*UX-8));
label_set_text (movelist_group, name_trunc (p, dlg->cols - (UX*2+4)));
free (p);
#endif
} else {
@ -215,7 +217,7 @@ static INLINE void update_path_name ()
text = "";
}
if (!hotlist_state.moving)
label_set_text (pname, name_trunc (text, COLS-2*UX-10));
label_set_text (pname, name_trunc (text, dlg->cols - (UX*2+4)));
dlg_redraw (dlg);
}
@ -517,16 +519,99 @@ static void add_name_to_list (char *path)
listbox_add_item (l_hotlist, 0, 0, path, 0);
}
/*
* Expands all button names (once) and recalculates button positions.
* returns number of columns in the dialog box, which is 10 chars longer
* then buttonbar.
*
* If common width of the window (i.e. in xterm) is less than returned
* width - sorry :) (anyway this did not handled in previous version too)
*/
static int
init_i18n_stuff(int list_type, int cols)
{
register int i;
static char* cancel_but = "&Cancel";
#ifdef ENABLE_NLS
static int hotlist_i18n_flag = 0;
if (!hotlist_i18n_flag)
{
i = sizeof (hotlist_but) / sizeof (hotlist_but [0]);
while (i--)
hotlist_but [i].text = _(hotlist_but [i].text);
cancel_but = _(cancel_but);
hotlist_i18n_flag = 1;
}
#endif /* ENABLE_NLS */
/* Dynamic resizing of buttonbars */
{
int len[2], count[2]; /* at most two lines of buttons */
int cur_x[2], row;
i = sizeof (hotlist_but) / sizeof (hotlist_but [0]);
len[0] = len[1] = count[0] = count[1] = 0;
/* Count len of buttonbars, assuming 2 extra space between buttons */
while (i--)
{
if (! (hotlist_but[i].type & list_type))
continue;
row = hotlist_but [i].y;
++count [row];
len [row] += strlen (hotlist_but [i].text) + 5;
if (hotlist_but [i].flags == DEFPUSH_BUTTON)
len [row] += 2;
}
len[0] -= 2;
len[1] -= 2;
cols = max(cols, max(len[0], len[1]));
/* arrange buttons */
cur_x[0] = cur_x[1] = 0;
i = sizeof (hotlist_but) / sizeof (hotlist_but [0]);
while (i--)
{
if (! (hotlist_but[i].type & list_type))
continue;
row = hotlist_but [i].y;
if (hotlist_but [i].x != 0)
{
/* not first int the row */
if (!strcmp (hotlist_but [i].text, cancel_but))
hotlist_but [i].x =
cols - strlen (hotlist_but [i].text) - 13;
else
hotlist_but [i].x = cur_x [row];
}
cur_x [row] += strlen (hotlist_but [i].text) + 2
+ (hotlist_but [i].flags == DEFPUSH_BUTTON ? 5 : 3);
}
}
return cols;
}
static void init_hotlist (int list_type)
{
int i;
int hotlist_cols = init_i18n_stuff (list_type, COLS - 6);
do_refresh ();
hotlist_state.expanded = GetPrivateProfileInt ("HotlistConfig",
"expanded_view_of_groups", 0, profile_name);
hotlist_dlg = create_dlg (0, 0, LINES-2, COLS-6, dialog_colors,
hotlist_dlg = create_dlg (0, 0, LINES-2, hotlist_cols, dialog_colors,
hotlist_callback,
list_type == LIST_VFSLIST ? "[vfshot]" : "[Hotlist]",
list_type == LIST_VFSLIST ? "vfshot" : "hotlist",
@ -534,7 +619,7 @@ static void init_hotlist (int list_type)
x_set_dialog_title (hotlist_dlg,
list_type == LIST_VFSLIST ? _("Active VFS directories") : _("Directory hotlist"));
#define XTRACT(i) BY+hotlist_but[i].y, BX+hotlist_but[i].x, hotlist_but[i].ret_cmd, hotlist_but[i].flags, _(hotlist_but[i].text), hotlist_button_callback, 0, hotlist_but[i].tkname
#define XTRACT(i) BY+hotlist_but[i].y, BX+hotlist_but[i].x, hotlist_but[i].ret_cmd, hotlist_but[i].flags, hotlist_but[i].text, hotlist_button_callback, 0, hotlist_but[i].tkname
for (i = 0; i < BUTTONS; i++){
if (hotlist_but[i].type & list_type)
@ -576,10 +661,11 @@ static void init_movelist (int list_type, struct hotlist *item)
{
int i;
char *hdr = copy_strings (_("Moving "), item->label, 0);
int movelist_cols = init_i18n_stuff (list_type, COLS - 6);
do_refresh ();
movelist_dlg = create_dlg (0, 0, LINES-6, COLS-6, dialog_colors,
movelist_dlg = create_dlg (0, 0, LINES-6, movelist_cols, dialog_colors,
hotlist_callback, "[Hotlist]",
"movelist",
DLG_CENTER|DLG_GRID);
@ -604,7 +690,9 @@ static void init_movelist (int list_type, struct hotlist *item)
add_widget (movelist_dlg, movelist_group);
#endif
/* get new listbox */
l_movelist = listbox_new (UY + 1, UX + 1, COLS-2*UX-8, LINES-14, listbox_cback, l_call, "listbox");
l_movelist = listbox_new (UY + 1, UX + 1,
movelist_dlg->cols - 2*UX - 2, movelist_dlg->lines - 8,
listbox_cback, l_call, "listbox");
fill_listbox ();
@ -689,6 +777,32 @@ add2hotlist (char *label, char *directory, enum HotListType type, int pos)
}
/*
* Support routine for add_new_entry_input()/add_new_group_input()
* Change positions of buttons (first three widgets).
*
* This is just a quick hack. Accurate procedure must take care of
* internationalized label lengths and total buttonbar length...assume
* 64 is longer anyway.
*/
static void add_widgets_i18n(QuickWidget* qw, int len)
{
int i, l[3], space, cur_x;
for (i = 0; i < 3; i++)
{
qw [i].text = _(qw [i].text);
l[i] = strlen (qw [i].text) + 3;
}
space = (len - 4 - l[0] - l[1] - l[2]) / 4;
for (cur_x = 2 + space, i = 3; i--; cur_x += l[i] + space)
{
qw [i].relative_x = cur_x;
qw [i].x_divisions = len;
}
}
static int add_new_entry_input (char *header, char *text1, char *text2, char *help, char **r1, char **r2)
{
QuickDialog Quick_input;
@ -710,10 +824,22 @@ static int add_new_entry_input (char *header, char *text1, char *text2, char *he
int lines1, lines2;
char *my_str1, *my_str2;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
#endif /* ENABLE_NLS */
len = max (strlen (header), msglen (text1, &lines1));
len = max (len, msglen (text2, &lines2)) + 4;
len = max (len, 64);
#ifdef ENABLE_NLS
if (!i18n_flag)
{
add_widgets_i18n(quick_widgets, len);
i18n_flag = 1;
}
#endif /* ENABLE_NLS */
Quick_input.xlen = len;
Quick_input.xpos = -1;
Quick_input.title = header;
@ -789,9 +915,21 @@ static int add_new_group_input (char *header, char *label, char **result)
int lines;
char *my_str;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
#endif /* ENABLE_NLS */
len = max (strlen (header), msglen (label, &lines)) + 4;
len = max (len, 64);
#ifdef ENABLE_NLS
if (!i18n_flag)
{
add_widgets_i18n(quick_widgets, len);
i18n_flag = 1;
}
#endif /* ENABLE_NLS */
Quick_input.xlen = len;
Quick_input.xpos = -1;
Quick_input.title = header;
@ -838,9 +976,11 @@ void add_new_group_cmd (void)
void add2hotlist_cmd (void)
{
char *prompt, *label;
char* cp = _("Label for \"%s\":");
int l = strlen(cp);
prompt = xmalloc (strlen (cpanel->cwd) + 20, "add2hotlist_cmd");
sprintf (prompt, _("Label for \"%s\":"), name_trunc (cpanel->cwd, COLS-2*UX-23));
prompt = xmalloc (strlen (cpanel->cwd) + l, "add2hotlist_cmd");
sprintf (prompt, cp, name_trunc (cpanel->cwd, COLS-2*UX-(l+8)));
label = input_dialog (_(" Add to hotlist "), prompt, cpanel->cwd);
free (prompt);
if (!label || !*label)

View File

@ -99,18 +99,20 @@ static struct panelize{
struct panelize *next;
} *panelize = NULL;
static char* panelize_title = N_(" External panelize ");
#ifndef HAVE_X
static void panelize_refresh (void)
{
attrset (COLOR_NORMAL);
dlg_erase (panelize_dlg);
draw_box (panelize_dlg, 1, 2, 20, 70);
draw_box (panelize_dlg, UY, UX, 12, 63);
draw_box (panelize_dlg, 1, 2, panelize_dlg->lines-2, panelize_dlg->cols-4);
draw_box (panelize_dlg, UY, UX, panelize_dlg->lines-10, panelize_dlg->cols-10);
attrset (COLOR_HOT_NORMAL);
dlg_move (panelize_dlg, 1, (72 - 19) / 2);
addstr (_(" External panelize "));
dlg_move (panelize_dlg, 1, (panelize_dlg->cols - strlen(panelize_title)) / 2);
addstr (panelize_title);
}
#endif
@ -151,14 +153,42 @@ static int l_call (void *data)
static void init_panelize (void)
{
int i;
int i, panelize_cols = COLS - 6;
struct panelize *current = panelize;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
static int maxlen = 0;
if (!i18n_flag)
{
i = sizeof(panelize_but) / sizeof(panelize_but[0]);
while (i--)
{
panelize_but [i].text = _(panelize_but [i].text);
maxlen += strlen (panelize_but [i].text) + 5;
}
maxlen += 10;
panelize_title = _(panelize_title);
i18n_flag = 1;
}
panelize_cols = max(panelize_cols, maxlen);
panelize_but [2].x = panelize_but [3].x
+ strlen (panelize_but [3].text) + 7;
panelize_but [1].x = panelize_but [2].x
+ strlen (panelize_but [2].text) + 5;
panelize_but [0].x = panelize_cols
- strlen (panelize_but[0].text) - 8 - BX;
#endif /* ENABLE_NLS */
last_listitem = 0;
do_refresh ();
panelize_dlg = create_dlg (0, 0, 22, 74, dialog_colors,
panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors,
panelize_callback, "[External panelize]", "panelize",
DLG_CENTER|DLG_GRID);
x_set_dialog_title (panelize_dlg, _("External panelize"));
@ -169,13 +199,13 @@ static void init_panelize (void)
add_widgetl (panelize_dlg, button_new (XTRACT (i)), (i == BUTTONS - 1) ?
XV_WLAY_CENTERROW : XV_WLAY_RIGHTOF);
pname = input_new (UY+14, UX, INPUT_COLOR, 63, "", "in");
pname = input_new (UY+14, UX, INPUT_COLOR, panelize_dlg->cols-10, "", "in");
add_widgetl (panelize_dlg, pname, XV_WLAY_RIGHTOF);
add_widgetl (panelize_dlg, label_new (UY+13, UX, _("Command"), "label-command"), XV_WLAY_NEXTROW);
/* get new listbox */
l_panelize = listbox_new (UY + 1, UX + 1, 61, 10, 0, l_call, "li");
l_panelize = listbox_new (UY + 1, UX + 1, panelize_dlg->cols-12, 10, 0, l_call, "li");
while (current){
listbox_add_item (l_panelize, 0, 0, current->label, current);
@ -226,7 +256,8 @@ void add2panelize_cmd (void)
char *label;
if (pname->buffer && (*pname->buffer)) {
label = input_dialog (_(" Add to external panelize "), "Unnamed find",
label = input_dialog (_(" Add to external panelize "),
_(" Enter command label: "),
"");
if (!label)
return;
@ -265,7 +296,7 @@ void external_panelize (void)
if (!vfs_current_is_local ()){
message (1, _(" Oops... "),
_(" I can't run external panalize while logged on a non local directory "));
_(" I can't run external panelize while logged on a non local directory "));
return;
}

View File

@ -227,12 +227,17 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
if (count > 0){
va_start (ap, count);
for (i = 0; i < count; i++)
win_len += strlen (va_arg (ap, char *)) + 6;
{
char* cp = va_arg (ap, char *);
win_len += strlen (cp) + 6;
if (strchr (cp, '&') != NULL)
win_len--;
}
va_end (ap);
}
/* count coordinates */
cols = 6 + max (win_len+1, max (strlen (header), msglen (text, &lines)));
cols = 6 + max (win_len, max (strlen (header), msglen (text, &lines)));
lines += 4 + (count > 0 ? 2 : 0);
xpos = COLS/2 - cols/2;
ypos = LINES/3 - (lines-3)/2;
@ -258,6 +263,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
for (i = 0; i < count; i++){
cur_name = va_arg (ap, char *);
xpos = strlen (cur_name)+6;
if (strchr(cur_name, '&') != NULL)
xpos--;
#ifndef HAVE_XVIEW
add_widget (query_dlg, button_new
(lines-3, cols, B_USER+i, NORMAL_BUTTON, cur_name,

View File

@ -49,7 +49,6 @@ static int extfserrno = 0;
static struct stat hstat; /* Stat struct corresponding */
static char *current_file_name, *current_link_name;
static char *extfs_current_dir;
static struct extfs_entry *extfs_find_entry (struct extfs_entry *dir, char *name, int make_dirs, int make_file);
enum {
EFS_ARG_EMPTY,