From 7b2d26701f40213586957359f2671c179a2a692e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 8 Mar 2011 17:47:58 +0000 Subject: [PATCH] * 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 --- src/apps/sudoku/ProgressWindow.cpp | 3 ++- src/apps/sudoku/Sudoku.cpp | 9 ++++++--- src/apps/sudoku/SudokuGenerator.cpp | 16 +++++++++------- src/apps/sudoku/SudokuWindow.cpp | 19 ++++++++----------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/apps/sudoku/ProgressWindow.cpp b/src/apps/sudoku/ProgressWindow.cpp index c84c663635..60ec486459 100644 --- a/src/apps/sudoku/ProgressWindow.cpp +++ b/src/apps/sudoku/ProgressWindow.cpp @@ -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'; diff --git a/src/apps/sudoku/Sudoku.cpp b/src/apps/sudoku/Sudoku.cpp index b53227d21c..9514468295 100644 --- a/src/apps/sudoku/Sudoku.cpp +++ b/src/apps/sudoku/Sudoku.cpp @@ -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 #include + #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(); } diff --git a/src/apps/sudoku/SudokuGenerator.cpp b/src/apps/sudoku/SudokuGenerator.cpp index 12d5bc9635..13f1a3a374 100644 --- a/src/apps/sudoku/SudokuGenerator.cpp +++ b/src/apps/sudoku/SudokuGenerator.cpp @@ -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 - #include #include #include +#include + +#include "ProgressWindow.h" +#include "SudokuField.h" +#include "SudokuSolver.h" + + #undef B_TRANSLATE_CONTEXT #define B_TRANSLATE_CONTEXT "SudokuGenerator" + SudokuGenerator::SudokuGenerator() { } diff --git a/src/apps/sudoku/SudokuWindow.cpp b/src/apps/sudoku/SudokuWindow.cpp index f5bd86bd35..f3d98ef5f8 100644 --- a/src/apps/sudoku/SudokuWindow.cpp +++ b/src/apps/sudoku/SudokuWindow.cpp @@ -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();