Author: janderwald
Date: Fri Aug 24 03:52:59 2007
New Revision: 28502
URL:
http://svn.reactos.org/svn/reactos?rev=28502&view=rev
Log:
- make more util mui-aware
- english translation needs to be done
Added:
trunk/reactos/base/applications/cmdutils/more/lang/
trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc (with props)
trunk/reactos/base/applications/cmdutils/more/resource.h (with props)
trunk/reactos/base/applications/cmdutils/more/rsrc.rc (with props)
Modified:
trunk/reactos/base/applications/cmdutils/more/more.c
trunk/reactos/base/applications/cmdutils/more/more.rbuild
trunk/reactos/base/applications/cmdutils/more/more.rc
Added: trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc (added)
+++ trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc Fri Aug 24 03:52:59 2007
@@ -1,0 +1,35 @@
+LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_USAGE, "Zeigt Daten seitenweise auf dem Bildschirm an.\n\n\
+ MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [Laufwerk:][Pfad]Dateiname\n\
+ Befehl | MORE [/E [/C] [/P] [/S] [/Tn] [+n]] \n\
+ MORE /E [/C] [/P] [/S] [/Tn] [+n] [Dateien]\n\n\
+ [Laufwerk:][Pfad]Dateiname Ein Datei, deren Inhalt angezeigt\n\
+\t\t\t werden soll.\n\n\
+ Befehl\t\t Ein Befehl, dessen Ausgabe angezeigt\n\
+\t\t\t werden soll.\n\n\
+ /E\tAktiviert die erweiterten Möglichkeiten.\n\
+ /C\tLöscht den Bildschirm, bevor eine Seite angezeigt wird.\n\
+ /P\tFührt Seitenvorschubzeichen aus.\n\
+ /S\tFasst mehrere leere Zeilen zu einer Zeile zusammen.\n\
+ /Tn\tErsetzt Tabulatorenzeichen durch n Leerzeichen (Standard 8).\n\n\
+\tDie Optionen können in der Umgebungsvariablen MORE angegeben\n\
+\twerden.\n\n\
+ +n\tBeginnt mit der Anzeige der ersten Datei in Zeile n.\n\n\
+ Dateien Gibt eine Liste mit anzuzeigenden Dateien an.\n\
+\t Trennen sie die Dateinamen durch ein Leerzeichen.\n\n\
+ Wenn die erweiterten Möglichkeiten aktiviert sind, können die folgenden\n\
+ Befehle an der Eingabeforderung \"--Fortsetzung--\" eingegeben werden:\n\n\
+ P n\t Zeigt die nächsten n Zeilen an.\n\
+ S n\t Überspringt die nächsten n Zeilen.\n\
+ Q\tBeendet die Ausgabe.\n\
+ =\tZeigt die Zeilennummer an.\n\
+ ?\tZeigt die Hilfezeile an.\n\
+ <LEERTASTE> Zeigt die nächste Zeile an.\n\
+ <EINGABETASTE> Zeigt die nächste Zeile an.\n"
+
+ IDS_CONTINUE, " -- Fortsetzung (100%) -- "
+ IDS_FILE_ACCESS, "Auf die Datei %s kann nicht zugegriffen werden."
+}
Propchange: trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/applications/cmdutils/more/more.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/more.c (original)
+++ trunk/reactos/base/applications/cmdutils/more/more.c Fri Aug 24 03:52:59 2007
@@ -13,11 +13,12 @@
#include <windows.h>
#include <malloc.h>
#include <tchar.h>
-
-
-DWORD len;
-LPTSTR msg = _T("--- continue ---");
-
+#include <stdio.h>
+#include "resource.h"
+
+static TCHAR szCont[128];
+static DWORD szContLength;
+static HINSTANCE hApp;
/*handle for file and console*/
HANDLE hStdIn;
@@ -42,7 +43,7 @@
VOID ConOutPuts (LPTSTR szText)
{
DWORD dwWritten;
-
+
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten,
NULL);
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
}
@@ -70,7 +71,7 @@
{
DWORD dwWritten;
- WriteFile (hStdErr,msg , len, &dwWritten, NULL);
+ WriteFile (hStdErr, szCont , szContLength, &dwWritten, NULL);
ConInKey();
@@ -88,7 +89,7 @@
DWORD i, last;
HANDLE hFile = INVALID_HANDLE_VALUE;
TCHAR szFullPath[MAX_PATH];
-
+ TCHAR szMsg[1024];
/*reading/writing buffer*/
TCHAR *buff;
@@ -98,14 +99,28 @@
/*ReadFile() return value*/
BOOL bRet;
- len = _tcslen (msg);
+
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
hStdErr = GetStdHandle(STD_ERROR_HANDLE);
+ hApp = GetModuleHandle(NULL);
+
+ buff=malloc(4096);
+ if (!buff)
+ {
+ ConOutPuts(_T("Error: no memory"));
+ return 0;
+ }
if (argc > 1 && _tcsncmp (argv[1], _T("/?"), 2) == 0)
{
- ConOutPuts(_T("Help text still missing!!"));
+ if (LoadString(hApp, IDS_USAGE, buff, 4096 / sizeof(TCHAR)) < 4096 /
sizeof(TCHAR))
+ {
+ CharToOem(buff, buff);
+ ConOutPuts(buff);
+ }
+
+ free(buff);
return 0;
}
@@ -114,26 +129,46 @@
GetScreenSize(&maxx,&maxy);
- buff=malloc(4096);
+
FlushConsoleInputBuffer (hKeyboard);
if(argc > 1)
{
- GetFullPathName(argv[1], MAX_PATH, szFullPath, NULL);
- hFile = CreateFile (szFullPath, GENERIC_READ,
- 0,NULL,OPEN_ALWAYS,0,0);
-
- if (hFile == INVALID_HANDLE_VALUE)
+ GetFullPathNameA(argv[1], MAX_PATH, szFullPath, NULL);
+ hFile = CreateFile (szFullPath,
+ GENERIC_READ,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ 0,
+ 0);
+ if (hFile == INVALID_HANDLE_VALUE)
{
- ConOutPuts(_T("The file could not be opened"));
- return 0;
+ if (LoadString(hApp, IDS_FILE_ACCESS, szMsg, sizeof(szMsg) / sizeof(TCHAR))
< sizeof(szMsg) / sizeof(TCHAR))
+ {
+ _stprintf(buff, szMsg, szFullPath);
+ CharToOem(buff, buff);
+ ConOutPuts(buff);
+ }
+
+ free(buff);
+ return 0;
}
}
else
{
hFile = hStdIn;
}
+
+ if (!LoadString(hApp, IDS_CONTINUE, szCont, sizeof(szCont) / sizeof(TCHAR)))
+ {
+ /* fail back to english */
+ _tcscpy(szCont, _T("--- continue ---"));
+ }
+ szContLength = _tcslen(szCont);
+
+
do
{
Modified: trunk/reactos/base/applications/cmdutils/more/more.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/more.rbuild (original)
+++ trunk/reactos/base/applications/cmdutils/more/more.rbuild Fri Aug 24 03:52:59 2007
@@ -4,6 +4,7 @@
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<library>ntdll</library>
+ <library>user32</library>
<file>more.c</file>
<file>more.rc</file>
</module>
Modified: trunk/reactos/base/applications/cmdutils/more/more.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/more.rc (original)
+++ trunk/reactos/base/applications/cmdutils/more/more.rc Fri Aug 24 03:52:59 2007
@@ -4,3 +4,5 @@
#define REACTOS_STR_INTERNAL_NAME "more\0"
#define REACTOS_STR_ORIGINAL_FILENAME "more.exe\0"
#include <reactos/version.rc>
+
+#include "rsrc.rc"
Added: trunk/reactos/base/applications/cmdutils/more/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/resource.h (added)
+++ trunk/reactos/base/applications/cmdutils/more/resource.h Fri Aug 24 03:52:59 2007
@@ -1,0 +1,20 @@
+#ifndef RESOURCE_H__ /* resource.h */
+#define RESOURCE_H__
+
+#define IDS_USAGE 100
+#define IDS_CONTINUE 101
+#define IDS_FILE_ACCESS 102
+
+
+
+
+
+
+
+
+
+
+
+
+
+#endif /* EOF of resource.h */
Propchange: trunk/reactos/base/applications/cmdutils/more/resource.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/applications/cmdutils/more/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/rsrc.rc (added)
+++ trunk/reactos/base/applications/cmdutils/more/rsrc.rc Fri Aug 24 03:52:59 2007
@@ -1,0 +1,5 @@
+#include <windows.h>
+#include "resource.h"
+
+#include "lang/de-DE.rc"
+
Propchange: trunk/reactos/base/applications/cmdutils/more/rsrc.rc
------------------------------------------------------------------------------
svn:eol-style = native