* Fixed style violations introduced with the previous patch, and a few more

that were already present.
* Removed one more case of excessive translating that I missed before.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40875 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2011-03-08 17:47:58 +00:00
parent 15301dc49b
commit 7b2d26701f
4 changed files with 25 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@ -19,6 +19,7 @@
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "ProgressWindow"
static const uint32 kMsgShow = 'show';

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@ -15,14 +15,17 @@
#include <Catalog.h>
#include <TextView.h>
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "Sudoku"
const char* kSignature = "application/x-vnd.Haiku-Sudoku";
Sudoku::Sudoku()
: BApplication(kSignature)
:
BApplication(kSignature)
{
}
@ -76,7 +79,7 @@ Sudoku::DisplayAbout()
font.SetSize(18);
font.SetFace(B_BOLD_FACE);
view->SetFontAndColor(0, strlen(B_TRANSLATE("Sudoku")), &font);
alert->SetShortcut(0, B_ESCAPE);
alert->Go();
}

View File

@ -1,24 +1,26 @@
/*
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
* Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#include "SudokuGenerator.h"
#include "ProgressWindow.h"
#include "SudokuField.h"
#include "SudokuSolver.h"
#include <Catalog.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Catalog.h>
#include "ProgressWindow.h"
#include "SudokuField.h"
#include "SudokuSolver.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "SudokuGenerator"
SudokuGenerator::SudokuGenerator()
{
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007-2010, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
@ -33,6 +33,7 @@
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "SudokuWindow"
const uint32 kMsgOpenFilePanel = 'opfp';
const uint32 kMsgGenerateSudoku = 'gnsu';
const uint32 kMsgAbortSudokuGenerator = 'asgn';
@ -115,10 +116,7 @@ GenerateSudoku::_Generate()
bigtime_t start = system_time();
generator.Generate(&fField, 40 - fLevel * 5, fProgress, &fQuit);
printf(B_TRANSLATE_WITH_CONTEXT("generated in %g msecs\n",
"When Sudoku is launched from a Terminal window, this message "
"is shown there."),
(system_time() - start) / 1000.0);
printf("generated in %g msecs\n", (system_time() - start) / 1000.0);
BMessage done(kMsgSudokuGenerated);
if (!fQuit) {
@ -144,8 +142,9 @@ GenerateSudoku::_GenerateThread(void* _self)
SudokuWindow::SudokuWindow()
: BWindow(BRect(100, 100, 500, 520), B_TRANSLATE("Sudoku"),
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE),
:
BWindow(BRect(100, 100, 500, 520), B_TRANSLATE("Sudoku"),
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE),
fGenerator(NULL),
fStoredState(NULL),
fExportFormat(kExportAsText)
@ -271,16 +270,14 @@ SudokuWindow::SudokuWindow()
new BMessage(B_UNDO), 'Z'));
fUndoItem->SetEnabled(false);
menu->AddItem(fRedoItem = new BMenuItem(B_TRANSLATE("Redo"),
new BMessage(B_REDO), 'Z',
B_SHIFT_KEY));
new BMessage(B_REDO), 'Z', B_SHIFT_KEY));
fRedoItem->SetEnabled(false);
menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(B_TRANSLATE("Snapshot current"),
new BMessage(kMsgStoreState)));
menu->AddItem(fRestoreStateItem = new BMenuItem(
B_TRANSLATE("Restore snapshot"),
new BMessage(kMsgRestoreState)));
B_TRANSLATE("Restore snapshot"), new BMessage(kMsgRestoreState)));
fRestoreStateItem->SetEnabled(fStoredState != NULL);
menu->AddSeparatorItem();