* 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:
parent
15301dc49b
commit
7b2d26701f
@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -19,6 +19,7 @@
|
|||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "ProgressWindow"
|
#define B_TRANSLATE_CONTEXT "ProgressWindow"
|
||||||
|
|
||||||
|
|
||||||
static const uint32 kMsgShow = 'show';
|
static const uint32 kMsgShow = 'show';
|
||||||
|
|
||||||
|
|
||||||
|
@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -15,14 +15,17 @@
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "Sudoku"
|
#define B_TRANSLATE_CONTEXT "Sudoku"
|
||||||
|
|
||||||
|
|
||||||
const char* kSignature = "application/x-vnd.Haiku-Sudoku";
|
const char* kSignature = "application/x-vnd.Haiku-Sudoku";
|
||||||
|
|
||||||
|
|
||||||
Sudoku::Sudoku()
|
Sudoku::Sudoku()
|
||||||
: BApplication(kSignature)
|
:
|
||||||
|
BApplication(kSignature)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "SudokuGenerator.h"
|
#include "SudokuGenerator.h"
|
||||||
|
|
||||||
#include "ProgressWindow.h"
|
|
||||||
#include "SudokuField.h"
|
|
||||||
#include "SudokuSolver.h"
|
|
||||||
|
|
||||||
#include <Catalog.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
|
#include "ProgressWindow.h"
|
||||||
|
#include "SudokuField.h"
|
||||||
|
#include "SudokuSolver.h"
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "SudokuGenerator"
|
#define B_TRANSLATE_CONTEXT "SudokuGenerator"
|
||||||
|
|
||||||
|
|
||||||
SudokuGenerator::SudokuGenerator()
|
SudokuGenerator::SudokuGenerator()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -33,6 +33,7 @@
|
|||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "SudokuWindow"
|
#define B_TRANSLATE_CONTEXT "SudokuWindow"
|
||||||
|
|
||||||
|
|
||||||
const uint32 kMsgOpenFilePanel = 'opfp';
|
const uint32 kMsgOpenFilePanel = 'opfp';
|
||||||
const uint32 kMsgGenerateSudoku = 'gnsu';
|
const uint32 kMsgGenerateSudoku = 'gnsu';
|
||||||
const uint32 kMsgAbortSudokuGenerator = 'asgn';
|
const uint32 kMsgAbortSudokuGenerator = 'asgn';
|
||||||
@ -115,10 +116,7 @@ GenerateSudoku::_Generate()
|
|||||||
|
|
||||||
bigtime_t start = system_time();
|
bigtime_t start = system_time();
|
||||||
generator.Generate(&fField, 40 - fLevel * 5, fProgress, &fQuit);
|
generator.Generate(&fField, 40 - fLevel * 5, fProgress, &fQuit);
|
||||||
printf(B_TRANSLATE_WITH_CONTEXT("generated in %g msecs\n",
|
printf("generated in %g msecs\n", (system_time() - start) / 1000.0);
|
||||||
"When Sudoku is launched from a Terminal window, this message "
|
|
||||||
"is shown there."),
|
|
||||||
(system_time() - start) / 1000.0);
|
|
||||||
|
|
||||||
BMessage done(kMsgSudokuGenerated);
|
BMessage done(kMsgSudokuGenerated);
|
||||||
if (!fQuit) {
|
if (!fQuit) {
|
||||||
@ -144,8 +142,9 @@ GenerateSudoku::_GenerateThread(void* _self)
|
|||||||
|
|
||||||
|
|
||||||
SudokuWindow::SudokuWindow()
|
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),
|
fGenerator(NULL),
|
||||||
fStoredState(NULL),
|
fStoredState(NULL),
|
||||||
fExportFormat(kExportAsText)
|
fExportFormat(kExportAsText)
|
||||||
@ -271,16 +270,14 @@ SudokuWindow::SudokuWindow()
|
|||||||
new BMessage(B_UNDO), 'Z'));
|
new BMessage(B_UNDO), 'Z'));
|
||||||
fUndoItem->SetEnabled(false);
|
fUndoItem->SetEnabled(false);
|
||||||
menu->AddItem(fRedoItem = new BMenuItem(B_TRANSLATE("Redo"),
|
menu->AddItem(fRedoItem = new BMenuItem(B_TRANSLATE("Redo"),
|
||||||
new BMessage(B_REDO), 'Z',
|
new BMessage(B_REDO), 'Z', B_SHIFT_KEY));
|
||||||
B_SHIFT_KEY));
|
|
||||||
fRedoItem->SetEnabled(false);
|
fRedoItem->SetEnabled(false);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Snapshot current"),
|
menu->AddItem(new BMenuItem(B_TRANSLATE("Snapshot current"),
|
||||||
new BMessage(kMsgStoreState)));
|
new BMessage(kMsgStoreState)));
|
||||||
menu->AddItem(fRestoreStateItem = new BMenuItem(
|
menu->AddItem(fRestoreStateItem = new BMenuItem(
|
||||||
B_TRANSLATE("Restore snapshot"),
|
B_TRANSLATE("Restore snapshot"), new BMessage(kMsgRestoreState)));
|
||||||
new BMessage(kMsgRestoreState)));
|
|
||||||
fRestoreStateItem->SetEnabled(fStoredState != NULL);
|
fRestoreStateItem->SetEnabled(fStoredState != NULL);
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user