1
1

Wed Apr 8 11:15:29 1998 Alex Tkachenko <alex@bcs.zp.ua>

* src/find.c: changes to find_parameters/find_file i18n.

	* src/widget.c: new function introduced, button_scan_hotkey();
	button_new() and button_set_text() fixed to use mentioned function.

	* src/key.[ch], src/dlg.c: changes to make recognition of ESC char as
	ALT(c) possible for 8-bit chars. (By replacing 'A'/'Z' comparisons with
	call to isalpha() in the way proposed by Norbert).

	* src/boxes.c: changes to display box i18n

	* src/learn.c: changes to learn key dialog i18n
Этот коммит содержится в:
Miguel de Icaza 1998-04-08 18:50:24 +00:00
родитель 3d6c500f23
Коммит 76496220cc
13 изменённых файлов: 676 добавлений и 460 удалений

Просмотреть файл

@ -240,11 +240,11 @@ x_init_dlg (Dlg_head *h)
p = p->next; p = p->next;
} while (p != first); } while (p != first);
gtk_ted_prepare (ted); gtk_ted_prepare (ted);
gtk_grab_add (GTK_WIDGET (ted));
if (!ted->need_gui) if (!ted->need_gui){
gtk_grab_add (GTK_WIDGET (ted));
gtk_window_set_policy (GTK_WINDOW (h->wdata), 0, 0, 0); gtk_window_set_policy (GTK_WINDOW (h->wdata), 0, 0, 0);
}
gtk_widget_show (GTK_WIDGET (h->wdata)); gtk_widget_show (GTK_WIDGET (h->wdata));
} }
gtk_signal_connect (GTK_OBJECT (h->wdata), "delete_event", gtk_signal_connect (GTK_OBJECT (h->wdata), "delete_event",

Просмотреть файл

@ -260,13 +260,16 @@ x_create_input (Dlg_head *h, widget_data parent, WInput *in)
void void
x_update_input (WInput *in) x_update_input (WInput *in)
{ {
GnomeEntry *gnome_entry = GNOME_ENTRY (in->widget.wdata); GnomeEntry *gnome_entry;
GtkEntry *entry = GTK_ENTRY (gnome_entry_gtk_entry (gnome_entry)); GtkEntry *entry;
/* If the widget has not been initialized yet (done by WIDGET_INIT) */ /* If the widget has not been initialized yet (done by WIDGET_INIT) */
if (!entry) if (!in->widget.wdata)
return; return;
gnome_entry = GNOME_ENTRY (in->widget.wdata);
entry = GTK_ENTRY (gnome_entry_gtk_entry (gnome_entry));
gtk_entry_set_text (entry, in->buffer); gtk_entry_set_text (entry, in->buffer);
gtk_entry_set_position (entry, in->point); gtk_entry_set_position (entry, in->point);
gtk_widget_draw (GTK_WIDGET (gnome_entry), NULL); gtk_widget_draw (GTK_WIDGET (gnome_entry), NULL);

Просмотреть файл

@ -1,11 +1,11 @@
[display-Widget-cancel-button] [display-Widget-cancel-button]
geometry=4,10,1,1 geometry=4,10,1,1
flags=ew flags=
[display-Widget-ok-button] [display-Widget-ok-button]
geometry=2,10,1,1 geometry=2,10,1,1
flags=ew flags=
[display-Frame-Frame-0] [display-Frame-Frame-0]
geometry=0,0,6,5 geometry=0,0,6,5
@ -581,7 +581,7 @@ flags=w
[sort-Widget-cancel-button] [sort-Widget-cancel-button]
geometry=4,2,1,1 geometry=4,2,1,1
flags= flags=ew
[sort-Widget-radio-1] [sort-Widget-radio-1]
geometry=1,1,1,6 geometry=1,1,1,6

238
po/mc.pot
Просмотреть файл

@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Date: 1998-04-07 00:09:20-0500\n" "Date: 1998-04-08 12:56:40-0500\n"
"From: Miguel de Icaza,computo,622-4680 <miguel@metropolis.nuclecu.unam.mx>\n" "From: Miguel de Icaza,computo,622-4680 <miguel@metropolis.nuclecu.unam.mx>\n"
"Content-Type: text/plain; charset=\n" "Content-Type: text/plain; charset=\n"
"Xgettext-Options: --default-domain=mc --directory=.. --add-comments --keyword=_ --keyword=N_ --files-from=./POTFILES.in\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 "" msgstr ""
#. Warning message with a query to continue or cancel the operation #. 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:994 src/ext.c:291 src/help.c:320 src/main.c:674 src/subshell.c:696 src/subshell.c:722 src/utilunix.c:372 src/utilunix.c:376 src/utilunix.c:442 #: edit/editcmd.c:407 edit/editcmd.c:714 edit/editcmd.c:726 edit/editcmd.c:827 edit/editcmd.c:910 gnome/gdesktop.c:997 src/ext.c:291 src/help.c:320 src/main.c:680 src/subshell.c:696 src/subshell.c:722 src/utilunix.c:373 src/utilunix.c:377 src/utilunix.c:443
msgid " Warning " msgid " Warning "
msgstr "" msgstr ""
@ -304,11 +304,11 @@ msgstr ""
msgid "Cancel quit" msgid "Cancel quit"
msgstr "" msgstr ""
#: edit/editcmd.c:1961 gnome/gdesktop.c:819 src/cmd.c:240 src/file.c:2115 src/file.c:2468 src/file.c:2548 src/hotlist.c:887 src/main.c:832 src/screen.c:1967 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411 #: edit/editcmd.c:1961 gnome/gdesktop.c:822 src/cmd.c:240 src/file.c:2115 src/file.c:2468 src/file.c:2548 src/hotlist.c:887 src/main.c:838 src/screen.c:1975 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
msgid "&Yes" msgid "&Yes"
msgstr "" msgstr ""
#: edit/editcmd.c:1961 gnome/gdesktop.c:819 src/cmd.c:240 src/file.c:2115 src/file.c:2465 src/file.c:2548 src/hotlist.c:887 src/main.c:832 src/screen.c:1967 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411 #: edit/editcmd.c:1961 gnome/gdesktop.c:822 src/cmd.c:240 src/file.c:2115 src/file.c:2465 src/file.c:2548 src/hotlist.c:887 src/main.c:838 src/screen.c:1975 src/subshell.c:697 src/subshell.c:723 src/tree.c:1195 src/view.c:411
msgid "&No" msgid "&No"
msgstr "" msgstr ""
@ -573,11 +573,11 @@ msgstr ""
msgid "&Save mode..." msgid "&Save mode..."
msgstr "" msgstr ""
#: edit/editmenu.c:243 edit/editmenu.c:252 src/main.c:1293 #: edit/editmenu.c:243 edit/editmenu.c:252 src/main.c:1299
msgid "&Layout..." msgid "&Layout..."
msgstr "" msgstr ""
#: edit/editmenu.c:262 edit/editmenu.c:271 edit/editmenu.c:388 src/chmod.c:174 src/chown.c:131 src/main.c:1324 #: edit/editmenu.c:262 edit/editmenu.c:271 edit/editmenu.c:388 src/chmod.c:174 src/chown.c:131 src/main.c:1330
msgid " File " msgid " File "
msgstr "" msgstr ""
@ -589,11 +589,11 @@ msgstr ""
msgid " Sear/Repl " msgid " Sear/Repl "
msgstr "" msgstr ""
#: edit/editmenu.c:265 edit/editmenu.c:274 edit/editmenu.c:438 src/main.c:1325 #: edit/editmenu.c:265 edit/editmenu.c:274 edit/editmenu.c:438 src/main.c:1331
msgid " Command " msgid " Command "
msgstr "" msgstr ""
#: edit/editmenu.c:266 edit/editmenu.c:275 src/main.c:1326 #: edit/editmenu.c:266 edit/editmenu.c:275 src/main.c:1332
msgid " Options " msgid " Options "
msgstr "" msgstr ""
@ -753,7 +753,7 @@ msgstr ""
msgid "Error initialising editor.\n" msgid "Error initialising editor.\n"
msgstr "" msgstr ""
#: edit/editwidget.c:910 gnome/glayout.c:264 src/help.c:812 src/main.c:1655 src/screen.c:2175 src/screen.c:2209 src/tree.c:1451 src/view.c:1978 #: edit/editwidget.c:910 gnome/glayout.c:264 src/help.c:812 src/main.c:1661 src/screen.c:2183 src/screen.c:2217 src/tree.c:1451 src/view.c:1978
msgid "Help" msgid "Help"
msgstr "" msgstr ""
@ -765,11 +765,11 @@ msgstr ""
msgid "Replac" msgid "Replac"
msgstr "" msgstr ""
#: edit/editwidget.c:914 gnome/gdesktop.c:184 gnome/glayout.c:193 src/screen.c:2179 src/screen.c:2213 src/tree.c:1457 #: edit/editwidget.c:914 gnome/gdesktop.c:185 gnome/glayout.c:193 src/screen.c:2187 src/screen.c:2221 src/tree.c:1457
msgid "Copy" msgid "Copy"
msgstr "" msgstr ""
#: edit/editwidget.c:915 gnome/gdesktop.c:189 #: edit/editwidget.c:915 gnome/gdesktop.c:190
msgid "Move" msgid "Move"
msgstr "" msgstr ""
@ -777,15 +777,15 @@ msgstr ""
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: edit/editwidget.c:917 gnome/gdesktop.c:716 gnome/glayout.c:196 src/screen.c:2182 src/screen.c:2216 #: edit/editwidget.c:917 gnome/gdesktop.c:719 gnome/glayout.c:196 src/screen.c:2190 src/screen.c:2224
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
#: edit/editwidget.c:919 src/main.c:1657 #: edit/editwidget.c:919 src/main.c:1663
msgid "PullDn" msgid "PullDn"
msgstr "" msgstr ""
#: edit/editwidget.c:920 gnome/gview.c:255 src/help.c:824 src/main.c:1658 src/view.c:1980 src/view.c:2000 #: edit/editwidget.c:920 gnome/gview.c:255 src/help.c:824 src/main.c:1664 src/view.c:1980 src/view.c:2000
msgid "Quit" msgid "Quit"
msgstr "" msgstr ""
@ -1978,7 +1978,7 @@ msgstr ""
msgid "Find File" msgid "Find File"
msgstr "" msgstr ""
#: src/find.c:158 src/main.c:1189 src/main.c:1210 #: src/find.c:158 src/main.c:1195 src/main.c:1216
msgid "&Tree" msgid "&Tree"
msgstr "" msgstr ""
@ -2425,7 +2425,7 @@ msgstr ""
msgid "Layout" msgid "Layout"
msgstr "" msgstr ""
#: src/layout.c:474 src/option.c:240 #: src/layout.c:474 src/option.c:241
msgid "Other options" msgid "Other options"
msgstr "" msgstr ""
@ -2501,7 +2501,7 @@ msgstr ""
msgid "key, or click with the mouse to define it. Move around with Tab." msgid "key, or click with the mouse to define it. Move around with Tab."
msgstr "" msgstr ""
#: src/main.c:675 #: src/main.c:681
msgid "" msgid ""
" The Commander can't change to the directory that \n" " The Commander can't change to the directory that \n"
" the subshell claims you are in. Perhaps you have \n" " the subshell claims you are in. Perhaps you have \n"
@ -2509,131 +2509,131 @@ msgid ""
" extra access permissions with the \"su\" command? " " extra access permissions with the \"su\" command? "
msgstr "" msgstr ""
#: src/main.c:753 #: src/main.c:759
msgid "Press any key to continue..." msgid "Press any key to continue..."
msgstr "" msgstr ""
#: src/main.c:803 #: src/main.c:809
msgid " The shell is already running a command " msgid " The shell is already running a command "
msgstr "" msgstr ""
#: gnome/gdesktop.c:817 src/main.c:830 src/screen.c:1965 #: gnome/gdesktop.c:820 src/main.c:836 src/screen.c:1973
msgid " The Midnight Commander " msgid " The Midnight Commander "
msgstr "" msgstr ""
#: src/main.c:831 #: src/main.c:837
msgid " Do you really want to quit the Midnight Commander? " msgid " Do you really want to quit the Midnight Commander? "
msgstr "" msgstr ""
#: src/main.c:1186 src/main.c:1207 #: src/main.c:1192 src/main.c:1213
msgid "&Listing mode..." msgid "&Listing mode..."
msgstr "" msgstr ""
#: src/main.c:1187 src/main.c:1208 #: src/main.c:1193 src/main.c:1214
msgid "&Quick view C-x q" msgid "&Quick view C-x q"
msgstr "" msgstr ""
#: src/main.c:1188 src/main.c:1209 #: src/main.c:1194 src/main.c:1215
msgid "&Info C-x i" msgid "&Info C-x i"
msgstr "" msgstr ""
#: src/main.c:1191 src/main.c:1212 #: src/main.c:1197 src/main.c:1218
msgid "&Sort order..." msgid "&Sort order..."
msgstr "" msgstr ""
#: src/main.c:1193 src/main.c:1214 #: src/main.c:1199 src/main.c:1220
msgid "&Filter..." msgid "&Filter..."
msgstr "" msgstr ""
#: src/main.c:1196 src/main.c:1217 #: src/main.c:1202 src/main.c:1223
msgid "&Network link..." msgid "&Network link..."
msgstr "" msgstr ""
#: src/main.c:1197 src/main.c:1218 #: src/main.c:1203 src/main.c:1224
msgid "FT&P link..." msgid "FT&P link..."
msgstr "" msgstr ""
#: src/main.c:1201 src/main.c:1222 #: src/main.c:1207 src/main.c:1228
msgid "&Drive... M-d" msgid "&Drive... M-d"
msgstr "" msgstr ""
#: src/main.c:1203 src/main.c:1224 #: src/main.c:1209 src/main.c:1230
msgid "&Rescan C-r" msgid "&Rescan C-r"
msgstr "" msgstr ""
#: src/main.c:1228 #: src/main.c:1234
msgid "&User menu F2" msgid "&User menu F2"
msgstr "" msgstr ""
#: src/main.c:1229 #: src/main.c:1235
msgid "&View F3" msgid "&View F3"
msgstr "" msgstr ""
#: src/main.c:1230 #: src/main.c:1236
msgid "&Filtered view M-!" msgid "&Filtered view M-!"
msgstr "" msgstr ""
#: src/main.c:1231 #: src/main.c:1237
msgid "&Edit F4" msgid "&Edit F4"
msgstr "" msgstr ""
#: src/main.c:1232 #: src/main.c:1238
msgid "&Copy F5" msgid "&Copy F5"
msgstr "" msgstr ""
#: src/main.c:1233 #: src/main.c:1239
msgid "c&Hmod C-x c" msgid "c&Hmod C-x c"
msgstr "" msgstr ""
#: src/main.c:1235 #: src/main.c:1241
msgid "&Link C-x l" msgid "&Link C-x l"
msgstr "" msgstr ""
#: src/main.c:1236 #: src/main.c:1242
msgid "&SymLink C-x s" msgid "&SymLink C-x s"
msgstr "" msgstr ""
#: src/main.c:1237 #: src/main.c:1243
msgid "edit s&Ymlink C-x C-s" msgid "edit s&Ymlink C-x C-s"
msgstr "" msgstr ""
#: src/main.c:1238 #: src/main.c:1244
msgid "ch&Own C-x o" msgid "ch&Own C-x o"
msgstr "" msgstr ""
#: src/main.c:1239 #: src/main.c:1245
msgid "&Advanced chown " msgid "&Advanced chown "
msgstr "" msgstr ""
#: src/main.c:1241 #: src/main.c:1247
msgid "&Rename/Move F6" msgid "&Rename/Move F6"
msgstr "" msgstr ""
#: src/main.c:1242 #: src/main.c:1248
msgid "&Mkdir F7" msgid "&Mkdir F7"
msgstr "" msgstr ""
#: src/main.c:1243 #: src/main.c:1249
msgid "&Delete F8" msgid "&Delete F8"
msgstr "" msgstr ""
#: src/main.c:1244 #: src/main.c:1250
msgid "&Quick cd M-c" msgid "&Quick cd M-c"
msgstr "" msgstr ""
#: src/main.c:1246 #: src/main.c:1252
msgid "select &Group M-+" msgid "select &Group M-+"
msgstr "" msgstr ""
#: src/main.c:1247 #: src/main.c:1253
msgid "u&Nselect group M-\\" msgid "u&Nselect group M-\\"
msgstr "" msgstr ""
#: src/main.c:1248 #: src/main.c:1254
msgid "reverse selec&Tion M-*" msgid "reverse selec&Tion M-*"
msgstr "" msgstr ""
#: src/main.c:1250 #: src/main.c:1256
msgid "e&Xit F10" msgid "e&Xit F10"
msgstr "" msgstr ""
@ -2641,111 +2641,111 @@ msgstr ""
#. * as a panel still has some problems, I have not yet finished #. * as a panel still has some problems, I have not yet finished
#. * the WTree widget port, sorry. #. * the WTree widget port, sorry.
#. #.
#: src/main.c:1259 #: src/main.c:1265
msgid "&Directory tree" msgid "&Directory tree"
msgstr "" msgstr ""
#: src/main.c:1260 #: src/main.c:1266
msgid "&Find file M-?" msgid "&Find file M-?"
msgstr "" msgstr ""
#: src/main.c:1262 #: src/main.c:1268
msgid "s&Wap panels C-u" msgid "s&Wap panels C-u"
msgstr "" msgstr ""
#: src/main.c:1263 #: src/main.c:1269
msgid "switch &Panels on/off C-o" msgid "switch &Panels on/off C-o"
msgstr "" msgstr ""
#: src/main.c:1265 #: src/main.c:1271
msgid "&Compare directories C-x d" msgid "&Compare directories C-x d"
msgstr "" msgstr ""
#: src/main.c:1266 #: src/main.c:1272
msgid "e&Xternal panelize C-x !" msgid "e&Xternal panelize C-x !"
msgstr "" msgstr ""
#: src/main.c:1268 #: src/main.c:1274
msgid "show directory s&Izes" msgid "show directory s&Izes"
msgstr "" msgstr ""
#: src/main.c:1271 #: src/main.c:1277
msgid "command &History" msgid "command &History"
msgstr "" msgstr ""
#: src/main.c:1272 #: src/main.c:1278
msgid "di&Rectory hotlist C-\\" msgid "di&Rectory hotlist C-\\"
msgstr "" msgstr ""
#: src/main.c:1274 #: src/main.c:1280
msgid "&Active VFS list C-x a" msgid "&Active VFS list C-x a"
msgstr "" msgstr ""
#: src/main.c:1277 #: src/main.c:1283
msgid "&Background jobs C-x j" msgid "&Background jobs C-x j"
msgstr "" msgstr ""
#: src/main.c:1281 #: src/main.c:1287
msgid "&Undelete files (ext2fs only)" msgid "&Undelete files (ext2fs only)"
msgstr "" msgstr ""
#: src/main.c:1284 #: src/main.c:1290
msgid "&Listing format edit" msgid "&Listing format edit"
msgstr "" msgstr ""
#: src/main.c:1286 #: src/main.c:1292
msgid "&Extension file edit" msgid "&Extension file edit"
msgstr "" msgstr ""
#: src/main.c:1287 #: src/main.c:1293
msgid "&Menu file edit" msgid "&Menu file edit"
msgstr "" msgstr ""
#: src/main.c:1292 #: src/main.c:1298
msgid "&Configuration..." msgid "&Configuration..."
msgstr "" msgstr ""
#: src/main.c:1294 #: src/main.c:1300
msgid "c&Onfirmation..." msgid "c&Onfirmation..."
msgstr "" msgstr ""
#: src/main.c:1295 #: src/main.c:1301
msgid "&Display bits..." msgid "&Display bits..."
msgstr "" msgstr ""
#: src/main.c:1297 #: src/main.c:1303
msgid "learn &Keys..." msgid "learn &Keys..."
msgstr "" msgstr ""
#: src/main.c:1300 #: src/main.c:1306
msgid "&Virtual FS..." msgid "&Virtual FS..."
msgstr "" msgstr ""
#: src/main.c:1303 #: src/main.c:1309
msgid "&Save setup" msgid "&Save setup"
msgstr "" msgstr ""
#: src/main.c:1319 src/main.c:1321 #: src/main.c:1325 src/main.c:1327
msgid " Left " msgid " Left "
msgstr "" msgstr ""
#: src/main.c:1321 #: src/main.c:1327
msgid " Above " msgid " Above "
msgstr "" msgstr ""
#: src/main.c:1329 src/main.c:1331 #: src/main.c:1335 src/main.c:1337
msgid " Right " msgid " Right "
msgstr "" msgstr ""
#: src/main.c:1331 #: src/main.c:1337
msgid " Below " msgid " Below "
msgstr "" msgstr ""
#: src/main.c:1392 #: src/main.c:1398
msgid " Information " msgid " Information "
msgstr "" msgstr ""
#: src/main.c:1393 #: src/main.c:1399
msgid "" msgid ""
" Using the fast reload option may not reflect the exact \n" " Using the fast reload option may not reflect the exact \n"
" directory contents. In this cases you'll need to do a \n" " directory contents. In this cases you'll need to do a \n"
@ -2753,45 +2753,45 @@ msgid ""
" the details. " " the details. "
msgstr "" msgstr ""
#: src/main.c:1656 src/screen.c:2176 src/screen.c:2210 #: src/main.c:1662 src/screen.c:2184 src/screen.c:2218
msgid "Menu" msgid "Menu"
msgstr "" msgstr ""
#: src/main.c:1870 #: src/main.c:1876
msgid "Thank you for using GNU Midnight Commander" msgid "Thank you for using GNU Midnight Commander"
msgstr "" msgstr ""
#: src/main.c:2216 #: src/main.c:2222
msgid "with mouse support on xterm%s.\n" msgid "with mouse support on xterm%s.\n"
msgstr "" msgstr ""
#: src/main.c:2217 #: src/main.c:2223
msgid " and the Linux console" msgid " and the Linux console"
msgstr "" msgstr ""
#: src/main.c:2308 #: src/main.c:2314
msgid "The TERM environment variable is unset!\n" msgid "The TERM environment variable is unset!\n"
msgstr "" msgstr ""
#: src/main.c:2601 #: src/main.c:2607
msgid "Library directory for the Midnight Commander: %s\n" msgid "Library directory for the Midnight Commander: %s\n"
msgstr "" msgstr ""
#: src/main.c:2606 #: src/main.c:2612
msgid "Option -m is obsolete. Please look at Display Bits... in the Option's menu\n" msgid "Option -m is obsolete. Please look at Display Bits... in the Option's menu\n"
msgstr "" msgstr ""
#: src/main.c:2816 #: src/main.c:2822
msgid "" msgid ""
"Couldn't open tty line. You have to run mc without the -P flag.\n" "Couldn't open tty line. You have to run mc without the -P flag.\n"
"On some systems you may want to run # `which mc`\n" "On some systems you may want to run # `which mc`\n"
msgstr "" msgstr ""
#: src/main.c:2904 #: src/main.c:2910
msgid " Notice " msgid " Notice "
msgstr "" msgstr ""
#: src/main.c:2905 #: src/main.c:2911
msgid "" msgid ""
" The Midnight Commander configuration files \n" " The Midnight Commander configuration files \n"
" are now stored in the ~/.mc directory, the \n" " are now stored in the ~/.mc directory, the \n"
@ -2902,11 +2902,11 @@ msgstr ""
msgid "Configure options" msgid "Configure options"
msgstr "" msgstr ""
#: src/option.c:242 #: src/option.c:243
msgid "Pause after run..." msgid "Pause after run..."
msgstr "" msgstr ""
#: src/option.c:244 #: src/option.c:245
msgid "Panel options" msgid "Panel options"
msgstr "" msgstr ""
@ -3012,7 +3012,7 @@ msgstr ""
msgid " %s bytes in %d file%s" msgid " %s bytes in %d file%s"
msgstr "" msgstr ""
#: gnome/gscreen.c:1136 src/screen.c:661 #: gnome/gscreen.c:1143 src/screen.c:661
msgid "<readlink failed>" msgid "<readlink failed>"
msgstr "" msgstr ""
@ -3020,23 +3020,23 @@ msgstr ""
msgid "Unknow tag on display format: " msgid "Unknow tag on display format: "
msgstr "" msgstr ""
#: gnome/gdesktop.c:818 src/screen.c:1966 #: gnome/gdesktop.c:821 src/screen.c:1974
msgid " Do you really want to execute? " msgid " Do you really want to execute? "
msgstr "" msgstr ""
#: gnome/glayout.c:198 gnome/gscreen.c:349 src/screen.c:2177 src/screen.c:2211 #: gnome/glayout.c:198 gnome/gscreen.c:349 src/screen.c:2185 src/screen.c:2219
msgid "View" msgid "View"
msgstr "" msgstr ""
#: src/screen.c:2178 src/screen.c:2212 src/view.c:1987 #: src/screen.c:2186 src/screen.c:2220 src/view.c:1987
msgid "Edit" msgid "Edit"
msgstr "" msgstr ""
#: src/screen.c:2180 src/screen.c:2214 src/tree.c:1459 #: src/screen.c:2188 src/screen.c:2222 src/tree.c:1459
msgid "RenMov" msgid "RenMov"
msgstr "" msgstr ""
#: gnome/glayout.c:195 src/screen.c:2181 src/screen.c:2215 src/tree.c:1463 #: gnome/glayout.c:195 src/screen.c:2189 src/screen.c:2223 src/tree.c:1463
msgid "Mkdir" msgid "Mkdir"
msgstr "" msgstr ""
@ -3170,11 +3170,11 @@ msgstr ""
msgid "name_trunc: too big" msgid "name_trunc: too big"
msgstr "" msgstr ""
#: src/utilunix.c:372 #: src/utilunix.c:373
msgid " Pipe failed " msgid " Pipe failed "
msgstr "" msgstr ""
#: src/utilunix.c:376 #: src/utilunix.c:377
msgid " Dup failed " msgid " Dup failed "
msgstr "" msgstr ""
@ -3536,18 +3536,18 @@ msgid "The GNOME edition of the Midnight Commander file manager."
msgstr "" msgstr ""
#. Not yet implemented the Link bits, so better to not show what we dont have #. Not yet implemented the Link bits, so better to not show what we dont have
#: gnome/gdesktop.c:195 #: gnome/gdesktop.c:196
msgid "Link" msgid "Link"
msgstr "" msgstr ""
#. We connect_object_after to the items so that we can destroy #. We connect_object_after to the items so that we can destroy
#. * the menu at the proper time. #. * the menu at the proper time.
#. #.
#: gnome/gdesktop.c:709 gnome/gscreen.c:345 #: gnome/gdesktop.c:712 gnome/gscreen.c:345
msgid "Properties" msgid "Properties"
msgstr "" msgstr ""
#: gnome/gdesktop.c:994 #: gnome/gdesktop.c:997
msgid " Could not open %s directory" msgid " Could not open %s directory"
msgstr "" msgstr ""
@ -3884,83 +3884,83 @@ msgstr ""
msgid "Delete..." msgid "Delete..."
msgstr "" msgstr ""
#: gnome/gscreen.c:944 #: gnome/gscreen.c:951
msgid "All files" msgid "All files"
msgstr "" msgstr ""
#: gnome/gscreen.c:946 #: gnome/gscreen.c:953
msgid "Archives and compressed files" msgid "Archives and compressed files"
msgstr "" msgstr ""
#: gnome/gscreen.c:948 #: gnome/gscreen.c:955
msgid "RPM/DEB files" msgid "RPM/DEB files"
msgstr "" msgstr ""
#: gnome/gscreen.c:950 #: gnome/gscreen.c:957
msgid "Text/Document files" msgid "Text/Document files"
msgstr "" msgstr ""
#: gnome/gscreen.c:952 #: gnome/gscreen.c:959
msgid "HTML and SGML files" msgid "HTML and SGML files"
msgstr "" msgstr ""
#: gnome/gscreen.c:954 #: gnome/gscreen.c:961
msgid "Postscript and PDF files" msgid "Postscript and PDF files"
msgstr "" msgstr ""
#: gnome/gscreen.c:956 #: gnome/gscreen.c:963
msgid "Spreadsheet files" msgid "Spreadsheet files"
msgstr "" msgstr ""
#: gnome/gscreen.c:958 #: gnome/gscreen.c:965
msgid "Image files" msgid "Image files"
msgstr "" msgstr ""
#: gnome/gscreen.c:961 #: gnome/gscreen.c:968
msgid "Video/animation files" msgid "Video/animation files"
msgstr "" msgstr ""
#: gnome/gscreen.c:963 #: gnome/gscreen.c:970
msgid "Audio files" msgid "Audio files"
msgstr "" msgstr ""
#: gnome/gscreen.c:965 #: gnome/gscreen.c:972
msgid "C program files" msgid "C program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:967 #: gnome/gscreen.c:974
msgid "C++ program files" msgid "C++ program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:969 #: gnome/gscreen.c:976
msgid "Objective-C program files" msgid "Objective-C program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:971 #: gnome/gscreen.c:978
msgid "Scheme program files" msgid "Scheme program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:973 #: gnome/gscreen.c:980
msgid "Assembler program files" msgid "Assembler program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:975 #: gnome/gscreen.c:982
msgid "Misc. program files" msgid "Misc. program files"
msgstr "" msgstr ""
#: gnome/gscreen.c:977 #: gnome/gscreen.c:984
msgid "Font files" msgid "Font files"
msgstr "" msgstr ""
#: gnome/gscreen.c:1102 #: gnome/gscreen.c:1109
msgid "Search: " msgid "Search: "
msgstr "" msgstr ""
#: gnome/gscreen.c:1112 #: gnome/gscreen.c:1119
msgid " %s bytes in %d file%s" msgid " %s bytes in %d file%s"
msgstr "" msgstr ""
#: gnome/gscreen.c:1182 #: gnome/gscreen.c:1189
msgid "Filter" msgid "Filter"
msgstr "" msgstr ""

544
po/ru.po

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,3 +1,18 @@
Wed Apr 8 11:15:29 1998 Alex Tkachenko <alex@bcs.zp.ua>
* src/find.c: changes to find_parameters/find_file i18n.
* src/widget.c: new function introduced, button_scan_hotkey();
button_new() and button_set_text() fixed to use mentioned function.
* src/key.[ch], src/dlg.c: changes to make recognition of ESC char as
ALT(c) possible for 8-bit chars. (By replacing 'A'/'Z' comparisons with
call to isalpha() in the way proposed by Norbert).
* src/boxes.c: changes to display box i18n
* src/learn.c: changes to learn key dialog i18n
1998-04-07 Miguel de Icaza <miguel@nuclecu.unam.mx> 1998-04-07 Miguel de Icaza <miguel@nuclecu.unam.mx>
* main.c (update_one_panel_widget): New routine: Updates a panel * main.c (update_one_panel_widget): New routine: Updates a panel

Просмотреть файл

@ -473,6 +473,43 @@ void display_bits_box ()
{ {
int current_mode; int current_mode;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
if (!i18n_flag)
{
register int i;
int l1, maxlen = 0;
for (i = 0; i < 3; i++)
{
display_widgets [i].text = _(display_widgets[i].text);
display_bits_str [i] = _(display_bits_str [i]);
l1 = strlen (display_bits_str [i]);
if (l1 > maxlen)
maxlen = l1;
}
l1 = strlen (display_widgets [2].text);
if (l1 > maxlen)
maxlen = l1;
display_bits.xlen = (maxlen + 5) * 6 / 4;
/* See above confirm_box */
l1 = strlen (display_widgets [0].text) + 3;
i = strlen (display_widgets [1].text) + 5;
if (i > l1)
l1 = i;
i = (l1 + 3) * 6 / 2;
if (i > display_bits.xlen)
display_bits.xlen = i;
display_bits.title = _(display_bits.title);
i18n_flag = display_bits.i18n = 1;
}
#endif /* ENABLE_NLS */
if (full_eight_bits) if (full_eight_bits)
current_mode = 0; current_mode = 0;
else if (eight_bit_clean) else if (eight_bit_clean)

Просмотреть файл

@ -595,8 +595,8 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
/* If it's an alt key, send the message */ /* If it's an alt key, send the message */
c = d_key & ~ALT(0); c = d_key & ~ALT(0);
if (d_key & ALT(0) && c >= 'A' && c <= 'z') if (d_key & ALT(0) && c < 255 && isalpha(c))
d_key = c; d_key = tolower(c);
#ifdef _OS_NT #ifdef _OS_NT
/* .ado: fix problem with file_permission under Win95 */ /* .ado: fix problem with file_permission under Win95 */

Просмотреть файл

@ -65,11 +65,11 @@ extern int verbose; /* Should be in a more sensible header file */
/* Size of the find parameters window */ /* Size of the find parameters window */
#define FIND_Y 12 #define FIND_Y 12
#define FIND_X 50 static int FIND_X = 50;
/* Size of the find window */ /* Size of the find window */
#define FIND2_Y LINES-4 #define FIND2_Y LINES-4
#define FIND2_X COLS-16 static int FIND2_X = 64;
#ifdef HAVE_X #ifdef HAVE_X
# define FIND2_X_USE 35 # define FIND2_X_USE 35
@ -116,6 +116,21 @@ typedef struct dir_stack {
dir_stack *dir_stack_base = 0; dir_stack *dir_stack_base = 0;
static struct {
char* text;
int len; /* length including space and brackets */
int x;
} fbuts [] = {
{ N_("&Suspend"), 11, 29 },
{ N_("&Continue"), 12, 29 },
{ N_("&Chdir"), 11, 3 },
{ N_("&Again"), 9, 17 },
{ N_("&Quit"), 8, 43 },
{ N_("Pane&lize"), 12, 3 },
{ N_("&View - F3"), 13, 20 },
{ N_("&Edit - F4"), 13, 38 }
};
/* /*
* find_parameters: gets information from the user * find_parameters: gets information from the user
* *
@ -139,6 +154,48 @@ find_parameters (char **start_dir, char **pattern, char **content)
static char *in_start_dir = NULL; static char *in_start_dir = NULL;
static char *in_start_name = NULL; static char *in_start_name = NULL;
static char* labs[] = {N_("Start at:"), N_("Filename:"), N_("Content: ")};
static char* buts[] = {N_("&Ok"), N_("&Tree"), N_("&Cancel")};
static int ilen = 30, istart = 14;
static int b0 = 3, b1 = 16, b2 = 36;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
if (!i18n_flag)
{
register int i = sizeof(labs)/sizeof(labs[0]);
int l1, maxlen = 0;
while (i--)
{
l1 = strlen (labs [i] = _(labs [i]));
if (l1 > maxlen)
maxlen = l1;
}
i = maxlen + ilen + 7;
if (i > FIND_X)
FIND_X = i;
for (i = sizeof(buts)/sizeof(buts[0]), l1 = 0; i--; )
{
l1 += strlen (buts [i] = _(buts [i]));
}
l1 += 21;
if (l1 > FIND_X)
FIND_X = l1;
ilen = FIND_X - 7 - maxlen; /* for the case of very long buttons :) */
istart = FIND_X - 3 - ilen;
b1 = b0 + strlen(buts[0]) + 7;
b2 = FIND_X - (strlen(buts[2]) + 6);
i18n_flag = 1;
}
#endif /* ENABLE_NLS */
find_par_start: find_par_start:
if (!in_start_dir) if (!in_start_dir)
in_start_dir = strdup ("."); in_start_dir = strdup (".");
@ -152,28 +209,25 @@ find_par_start:
DLG_CENTER | DLG_GRID); DLG_CENTER | DLG_GRID);
x_set_dialog_title (find_dlg, _("Find File")); x_set_dialog_title (find_dlg, _("Find File"));
add_widgetl (find_dlg, button_new (9, 36, B_CANCEL, NORMAL_BUTTON, add_widgetl (find_dlg, button_new (9, b2, B_CANCEL, NORMAL_BUTTON,
_("&Cancel"), 0 ,0, "cancel"), XV_WLAY_RIGHTOF); buts[2], 0 ,0, "cancel"), XV_WLAY_RIGHTOF);
add_widgetl (find_dlg, button_new (9, 16, B_TREE, NORMAL_BUTTON, add_widgetl (find_dlg, button_new (9, b1, B_TREE, NORMAL_BUTTON,
_("&Tree"), 0, 0, "tree"), XV_WLAY_RIGHTOF); buts[1], 0, 0, "tree"), XV_WLAY_RIGHTOF);
add_widgetl (find_dlg, button_new (9, 4, B_ENTER, DEFPUSH_BUTTON, add_widgetl (find_dlg, button_new (9, b0, B_ENTER, DEFPUSH_BUTTON,
_("&Ok"), 0, 0, "ok"), XV_WLAY_CENTERROW); buts[0], 0, 0, "ok"), XV_WLAY_CENTERROW);
in_with = input_new (7, 14, INPUT_COLOR, 30, in_contents, "content"); in_with = input_new (7, istart, INPUT_COLOR, ilen, in_contents, "content");
add_widgetl (find_dlg, in_with, XV_WLAY_BELOWOF); add_widgetl (find_dlg, in_with, XV_WLAY_BELOWOF);
in_name = input_new (5, 14, INPUT_COLOR, 30, in_start_name, "name"); in_name = input_new (5, istart, INPUT_COLOR, ilen, in_start_name, "name");
add_widgetl (find_dlg, in_name, XV_WLAY_BELOWOF); add_widgetl (find_dlg, in_name, XV_WLAY_BELOWOF);
in_start = input_new (3, 14, INPUT_COLOR, 30, in_start_dir, "start"); in_start = input_new (3, istart, INPUT_COLOR, ilen, in_start_dir, "start");
add_widgetl (find_dlg, in_start, XV_WLAY_NEXTCOLUMN); add_widgetl (find_dlg, in_start, XV_WLAY_NEXTCOLUMN);
add_widgetl (find_dlg, label_new (7, 3, _("Content: "), "label-cont"), add_widgetl (find_dlg, label_new (7, 3, labs[2], "label-cont"), XV_WLAY_BELOWOF);
XV_WLAY_BELOWOF); add_widgetl (find_dlg, label_new (5, 3, labs[1], "label-file"), XV_WLAY_BELOWOF);
add_widgetl (find_dlg, label_new (5, 3, _("Filename:"), "label-file"), add_widgetl (find_dlg, label_new (3, 3, labs[0], "label-start"), XV_WLAY_NEXTCOLUMN);
XV_WLAY_BELOWOF);
add_widgetl (find_dlg, label_new (3, 3, _("Start at:"), "label-start"),
XV_WLAY_NEXTCOLUMN);
run_dlg (find_dlg); run_dlg (find_dlg);
if (find_dlg->ret_value == B_CANCEL) if (find_dlg->ret_value == B_CANCEL)
@ -601,13 +655,12 @@ find_callback (struct Dlg_head *h, int id, int Msg)
static int static int
start_stop (int button, void *extra) start_stop (int button, void *extra)
{ {
char *button_labels [2] = { "Stop", "Start" };
running = is_start; running = is_start;
set_idle_proc (find_dlg, running); set_idle_proc (find_dlg, running);
is_start = !is_start; is_start = !is_start;
label_set_text (status_label, is_start ? _("Stopped") : _("Searching")); label_set_text (status_label, is_start ? _("Stopped") : _("Searching"));
button_set_text (stop_button, _(button_labels [is_start])); button_set_text (stop_button, fbuts [is_start].text);
return 0; return 0;
} }
@ -651,27 +704,77 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname, char
int return_value = 0; int return_value = 0;
char *dir; char *dir;
char *dir_tmp, *file_tmp; char *dir_tmp, *file_tmp;
#ifdef ENABLE_NLS
static int i18n_flag = 0;
if (!i18n_flag)
{
register int i = sizeof (fbuts) / sizeof (fbuts[0]);
while (i--)
fbuts [i].len = strlen (fbuts [i].text = _(fbuts [i].text)) + 3;
fbuts [2].len += 2; /* DEFPUSH_BUTTON */
i18n_flag = 1;
}
#endif /* ENABLE_NLS */
/*
* Dynamically place buttons centered within current window size
*/
{
int l0 = max (fbuts[0].len, fbuts[1].len);
int l1 = fbuts[2].len + fbuts[3].len + l0 + fbuts[4].len;
int l2 = fbuts[5].len + fbuts[6].len + fbuts[7].len;
int r1, r2;
FIND2_X = COLS - 16;
/* Check, if both button rows fit within FIND2_X */
if (l1 + 9 > FIND2_X) FIND2_X = l1 + 9;
if (l2 + 8 > FIND2_X) FIND2_X = l2 + 8;
/* compute amount of space between buttons for each row */
r1 = (FIND2_X - 4 - l1) % 5;
l1 = (FIND2_X - 4 - l1) / 5;
r2 = (FIND2_X - 4 - l2) % 4;
l2 = (FIND2_X - 4 - l2) / 4;
/* ...and finally, place buttons */
fbuts [2].x = 2 + r1/2 + l1;
fbuts [3].x = fbuts [2].x + fbuts [2].len + l1;
fbuts [0].x = fbuts [3].x + fbuts [3].len + l1;
fbuts [4].x = fbuts [0].x + l0 + l1;
fbuts [5].x = 2 + r2/2 + l2;
fbuts [6].x = fbuts [5].x + fbuts [5].len + l2;
fbuts [7].x = fbuts [6].x + fbuts [6].len + l2;
}
find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors, find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
find_callback, "[Find File]", "mfind", DLG_CENTER | DLG_GRID); find_callback, "[Find File]", "mfind", DLG_CENTER | DLG_GRID);
x_set_dialog_title (find_dlg, _("Find file")); x_set_dialog_title (find_dlg, _("Find file"));
add_widgetl (find_dlg, add_widgetl (find_dlg,
button_new (FIND2_Y-3, 32, B_VIEW, NORMAL_BUTTON, _("&Edit - F4"), find_do_edit_file, find_dlg, "button-edit"), 0); button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON,
add_widgetl (find_dlg, fbuts[7].text, find_do_edit_file, find_dlg, "button-edit"), 0);
button_new (FIND2_Y-3, 17, B_VIEW, NORMAL_BUTTON, _("&View - F3"), find_do_view_file, find_dlg, "button-view"), 0); add_widgetl (find_dlg,
add_widgetl (find_dlg, button_new (FIND2_Y-3, fbuts[6].x, B_VIEW, NORMAL_BUTTON,
button_new (FIND2_Y-3, 3, B_PANELIZE, NORMAL_BUTTON, _("Pane&lize"), 0, 0, "button-panelize"), fbuts[6].text, find_do_view_file, find_dlg, "button-view"), 0);
XV_WLAY_CENTERROW); add_widgetl (find_dlg,
add_widgetl (find_dlg, button_new (FIND2_Y-4, 37, B_CANCEL, NORMAL_BUTTON, _("&Quit"), 0, 0, "button-quit"), button_new (FIND2_Y-3, fbuts[5].x, B_PANELIZE, NORMAL_BUTTON,
XV_WLAY_RIGHTOF); fbuts[5].text, 0, 0, "button-panelize"), XV_WLAY_CENTERROW);
stop_button = button_new (FIND2_Y-4, 27, B_STOP, NORMAL_BUTTON, _("&Stop"), start_stop, find_dlg, "start-stop");
add_widgetl (find_dlg, stop_button, XV_WLAY_RIGHTOF); add_widgetl (find_dlg,
add_widgetl (find_dlg, button_new (FIND2_Y-4, 16, B_AGAIN, NORMAL_BUTTON, _("&Again"), 0, 0, "button-again"), button_new (FIND2_Y-4, fbuts[4].x, B_CANCEL, NORMAL_BUTTON,
XV_WLAY_RIGHTOF); fbuts[4].text, 0, 0, "button-quit"), XV_WLAY_RIGHTOF);
add_widgetl (find_dlg, button_new (FIND2_Y-4, 3, B_ENTER, DEFPUSH_BUTTON, _("&Chdir"), 0, 0, "button-chdir"), stop_button = button_new (FIND2_Y-4, fbuts[0].x, B_STOP, NORMAL_BUTTON,
XV_WLAY_CENTERROW); fbuts[0].text, start_stop, find_dlg, "start-stop");
add_widgetl (find_dlg, stop_button, XV_WLAY_RIGHTOF);
add_widgetl (find_dlg,
button_new (FIND2_Y-4, fbuts[3].x, B_AGAIN, NORMAL_BUTTON,
fbuts[3].text, 0, 0, "button-again"), XV_WLAY_RIGHTOF);
add_widgetl (find_dlg,
button_new (FIND2_Y-4, fbuts[2].x, B_ENTER, DEFPUSH_BUTTON,
fbuts[2].text, 0, 0, "button-chdir"), XV_WLAY_CENTERROW);
status_label = label_new (FIND2_Y-6, 4, _("Searching"), "label-search"); status_label = label_new (FIND2_Y-6, 4, _("Searching"), "label-search");
add_widgetl (find_dlg, status_label, XV_WLAY_BELOWOF); add_widgetl (find_dlg, status_label, XV_WLAY_BELOWOF);

Просмотреть файл

@ -562,7 +562,7 @@ int get_key_code (int no_delay)
else { else {
if (parent != NULL && parent->action == MCKEY_ESCAPE) { if (parent != NULL && parent->action == MCKEY_ESCAPE) {
/* This is just to save a lot of define_sequences */ /* This is just to save a lot of define_sequences */
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') if (isalpha(c)
|| (c == '\n') || (c == '\t') || (c == XCTRL('h')) || (c == '\n') || (c == '\t') || (c == XCTRL('h'))
|| (c == KEY_BACKSPACE) || (c == '!') || (c == '\r') || (c == KEY_BACKSPACE) || (c == '!') || (c == '\r')
|| c == 127 || c == '+' || c == '-' || c == '\\' || c == 127 || c == '+' || c == '-' || c == '\\'

Просмотреть файл

@ -52,7 +52,7 @@ int is_abort_char (int c);
int is_quit_char (int c); int is_quit_char (int c);
#define XCTRL(x) ((x) & 31) #define XCTRL(x) ((x) & 31)
#define ALT(x) (0x200 | (x)) #define ALT(x) (0x200 | (unsigned int)(x))
/* To define sequences and return codes */ /* To define sequences and return codes */
#define MCKEY_NOACTION 0 #define MCKEY_NOACTION 0

Просмотреть файл

@ -43,7 +43,6 @@
#define UX 4 #define UX 4
#define UY 3 #define UY 3
#define BX 25
#define BY UY + 17 #define BY UY + 17
#define ROWS 13 #define ROWS 13
@ -53,10 +52,11 @@
struct { struct {
int ret_cmd, flags, y, x; int ret_cmd, flags, y, x;
unsigned int hotkey;
char *text; char *text;
} learn_but[BUTTONS] = { } learn_but[BUTTONS] = {
{ B_CANCEL, NORMAL_BUTTON, 0, 14, N_("&Cancel") }, { B_CANCEL, NORMAL_BUTTON, 0, 39, 'C', N_("&Cancel") },
{ B_ENTER, DEFPUSH_BUTTON, 0, 0, N_("&Save") } { B_ENTER, DEFPUSH_BUTTON, 0, 25, 'S', N_("&Save") }
}; };
static Dlg_head *learn_dlg; static Dlg_head *learn_dlg;
@ -70,6 +70,7 @@ static learnkey *learnkeys = NULL;
static int learn_total; static int learn_total;
static int learnok; static int learnok;
static int learnchanged; static int learnchanged;
static char* learn_title = N_(" Learn keys ");
#ifndef HAVE_X #ifndef HAVE_X
static void learn_refresh (void) static void learn_refresh (void)
@ -77,11 +78,11 @@ static void learn_refresh (void)
attrset (COLOR_NORMAL); attrset (COLOR_NORMAL);
dlg_erase (learn_dlg); dlg_erase (learn_dlg);
draw_box (learn_dlg, 1, 2, 21, 73); draw_box (learn_dlg, 1, 2, learn_dlg->lines - 2, learn_dlg->cols - 4);
attrset (COLOR_HOT_NORMAL); attrset (COLOR_HOT_NORMAL);
dlg_move (learn_dlg, 1, (72 - 12) / 2); dlg_move (learn_dlg, 1, (learn_dlg->cols - strlen (learn_title)) / 2);
addstr (" Learn keys "); addstr (learn_title);
} }
#endif #endif
@ -171,13 +172,13 @@ static int learn_check_key (int c)
if (learnok >= learn_total) { if (learnok >= learn_total) {
learn_dlg->ret_value = B_CANCEL; learn_dlg->ret_value = B_CANCEL;
if (learnchanged) { if (learnchanged) {
if (query_dialog (_(" Learn keys "), if (query_dialog (learn_title,
_("It seems that all your keys already\n" _("It seems that all your keys already\n"
"work fine. That's great."), "work fine. That's great."),
1, 2, _("&Save"), _("&Discard")) == 0) 1, 2, _("&Save"), _("&Discard")) == 0)
learn_dlg->ret_value = B_ENTER; learn_dlg->ret_value = B_ENTER;
} else { } else {
message (1, _(" Learn keys "), message (1, learn_title,
_("Great! You have a complete terminal database!\n" _("Great! You have a complete terminal database!\n"
"All your keys work well.")); "All your keys work well."));
} }
@ -200,14 +201,18 @@ static int learn_check_key (int c)
case 'k': case 'k':
dlg_one_up (learn_dlg); dlg_one_up (learn_dlg);
return 1; return 1;
case 's':
case 'S':
case 'c':
case 'C':
/* Prevent from disappearing if a non-defined sequence is pressed
and contains s or c. Use ALT('s') or ALT('c'). */
return 1;
} }
/* Prevent from disappearing if a non-defined sequence is pressed
and contains s or c. Use ALT('s') or ALT('c'). */
if (c < 255 && isalpha(c))
{
c = toupper(c);
for (i = 0; i < BUTTONS; i++)
if (c == learn_but [i].hotkey)
return 1;
}
return 0; return 0;
} }
@ -228,15 +233,39 @@ static void init_learn (void)
int x, y, i, j; int x, y, i, j;
key_code_name_t *key; key_code_name_t *key;
char buffer [22]; char buffer [22];
static int i18n_flag = 0;
do_refresh (); do_refresh ();
#ifdef ENABLE_NLS
if (!i18n_flag)
{
char* cp;
learn_but [0].text = _(learn_but [0].text);
learn_but [0].x = 78 / 2 + 4;
learn_but [1].text = _(learn_but [1].text);
learn_but [1].x = 78 / 2 - (strlen (learn_but [1].text) + 9);
for (i = 0; i < BUTTONS; i++)
{
cp = strchr(learn_but [i].text, '&');
if (cp != NULL && *++cp != '\0')
learn_but [i].hotkey = toupper(*cp);
}
learn_title = _(learn_title);
i18n_flag = 1;
}
#endif /* ENABLE_NLS */
learn_dlg = create_dlg (0, 0, 23, 78, dialog_colors, learn_dlg = create_dlg (0, 0, 23, 78, dialog_colors,
learn_callback, "[Learn keys]", "Learn keys", learn_callback, "[Learn keys]", "Learn keys",
DLG_CENTER); DLG_CENTER);
x_set_dialog_title (learn_dlg, _("Learn keys")); x_set_dialog_title (learn_dlg, _("Learn keys"));
#define XTRACT(i) BY+learn_but[i].y, BX+learn_but[i].x, learn_but[i].ret_cmd, learn_but[i].flags, _(learn_but[i].text), 0, 0, NULL #define XTRACT(i) BY+learn_but[i].y, learn_but[i].x, learn_but[i].ret_cmd, learn_but[i].flags, _(learn_but[i].text), 0, 0, NULL
for (i = 0; i < BUTTONS; i++) for (i = 0; i < BUTTONS; i++)
add_widget (learn_dlg, button_new (XTRACT (i))); add_widget (learn_dlg, button_new (XTRACT (i)));

Просмотреть файл

@ -215,12 +215,29 @@ button_len (const char *text, unsigned int flags)
#endif #endif
} }
/*
* Assuming that button text is malloc'ed, we may safely change it
* (as opposed to statically allocated); from other hand, excluding &
* and shifting data past it to the left results to one unused byte.
* This does not harm though :)
*/
void
button_scan_hotkey(WButton* b)
{
char* cp = strchr(b->text,'&');
if (cp != NULL && cp[1] != '\0')
{
strcpy(cp, cp+1);
b->hotkey = tolower(*cp);
b->hotpos = cp - b->text;
}
}
WButton * WButton *
button_new (int y, int x, int action, int flags, char *text, button_new (int y, int x, int action, int flags, char *text,
int (*callback)(int, void *), void *callback_data, char *tkname) int (*callback)(int, void *), void *callback_data, char *tkname)
{ {
WButton *b = xmalloc (sizeof (WButton), "new_button"); WButton *b = xmalloc (sizeof (WButton), "new_button");
char *s, *t;
init_widget (&b->widget, y, x, 1, button_len (text, flags), init_widget (&b->widget, y, x, 1, button_len (text, flags),
(callback_fn) button_callback, (callback_fn) button_callback,
@ -235,21 +252,8 @@ button_new (int y, int x, int action, int flags, char *text,
widget_want_hotkey (b->widget, 1); widget_want_hotkey (b->widget, 1);
b->hotkey = 0; b->hotkey = 0;
b->hotpos = -1; b->hotpos = -1;
/* Scan for the hotkey */ button_scan_hotkey(b);
for (s = text, t = b->text; *s; s++, t++){
if (*s != '&'){
*t = *s;
continue;
}
s++;
*t = *s;
if (*s){
b->hotkey = tolower (*s);
b->hotpos = t - b->text;
}
}
*t = 0;
return b; return b;
} }
@ -259,8 +263,9 @@ button_set_text (WButton *b, char *text)
free (b->text); free (b->text);
b->text = strdup (text); b->text = strdup (text);
b->widget.cols = button_len (text, b->flags); b->widget.cols = button_len (text, b->flags);
button_scan_hotkey(b);
#ifdef HAVE_X #ifdef HAVE_X
x_button_set (b, text); x_button_set (b, b->text);
#else #else
dlg_redraw (b->widget.parent); dlg_redraw (b->widget.parent);
#endif #endif