Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Palapeli
Commits
b04597b1
Commit
b04597b1
authored
Oct 06, 2021
by
Antoni Bella Pérez
🚵🏻
Browse files
l10n fixes
* Add @title:window helpers * Capitalize menu items, titles and page names into settings dialog
parent
6d9f335c
Pipeline
#85822
passed with stage
in 47 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/config/configdialog.cpp
View file @
b04597b1
...
...
@@ -49,7 +49,7 @@ Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
,
m_triggerPage
(
new
Palapeli
::
TriggerConfigWidget
)
,
m_shownForFirstTime
(
false
)
{
//setup page "General
s
ettings"
//setup page "General
S
ettings"
QWidget
*
generalPage
=
new
QWidget
;
m_generalUi
.
setupUi
(
generalPage
);
...
...
@@ -59,10 +59,10 @@ Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
Palapeli
::
TextureHelper
::
instance
());
setupSolutionAreaComboBox
();
addPage
(
generalPage
,
i18n
(
"General
s
ettings"
))
->
addPage
(
generalPage
,
i18n
(
"General
S
ettings"
))
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)));
//setup page "Mouse
i
nteraction"
addPage
(
m_triggerPage
,
i18n
(
"Mouse
i
nteraction"
))
->
//setup page "Mouse
I
nteraction"
addPage
(
m_triggerPage
,
i18n
(
"Mouse
I
nteraction"
))
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"input-mouse"
)));
connect
(
m_triggerPage
,
&
TriggerConfigWidget
::
associationsChanged
,
this
,
&
ConfigDialog
::
updateButtons
);
...
...
src/config/triggerconfigwidget.cpp
View file @
b04597b1
...
...
@@ -17,8 +17,8 @@ Palapeli::TriggerConfigWidget::TriggerConfigWidget(QWidget* parent)
,
m_mouseView
(
new
Palapeli
::
TriggerListView
(
m_interactors
,
Palapeli
::
MouseInteractor
,
this
))
,
m_wheelView
(
new
Palapeli
::
TriggerListView
(
m_interactors
,
Palapeli
::
WheelInteractor
,
this
))
{
addTab
(
m_mouseView
,
i18n
(
"Mouse
b
uttons"
));
addTab
(
m_wheelView
,
i18n
(
"Mouse
w
heel"
));
addTab
(
m_mouseView
,
i18n
(
"Mouse
B
uttons"
));
addTab
(
m_wheelView
,
i18n
(
"Mouse
W
heel"
));
connect
(
m_mouseView
,
&
Palapeli
::
TriggerListView
::
associationsChanged
,
this
,
&
TriggerConfigWidget
::
associationsChanged
);
connect
(
m_wheelView
,
&
Palapeli
::
TriggerListView
::
associationsChanged
,
this
,
&
TriggerConfigWidget
::
associationsChanged
);
}
...
...
src/creator/puzzlecreator.cpp
View file @
b04597b1
...
...
@@ -35,7 +35,7 @@ Palapeli::PuzzleCreatorDialog::PuzzleCreatorDialog()
,
m_slicerConfigMasterWidget
(
new
QStackedWidget
)
{
//setup dialog
setWindowTitle
(
i18nc
(
"@title:window"
,
"Create
n
ew
p
uzzle"
));
setWindowTitle
(
i18nc
(
"@title:window"
,
"Create
N
ew
P
uzzle"
));
buttonBox
()
->
button
(
QDialogButtonBox
::
Help
)
->
setVisible
(
false
);
//setup image selector
m_imageSelector
->
setMode
(
KFile
::
File
|
KFile
::
LocalOnly
|
KFile
::
ExistingOnly
);
...
...
src/engine/gameplay.cpp
View file @
b04597b1
...
...
@@ -311,7 +311,7 @@ void Palapeli::GamePlay::actionImport()
{
const
QString
filter
=
i18nc
(
"Filter for a file dialog"
,
"Palapeli puzzles (*.puzzle)"
);
const
QStringList
paths
=
QFileDialog
::
getOpenFileNames
(
m_mainWindow
,
i18n
(
"Import Palapeli
p
uzzles"
),
i18n
c
(
"@title:window"
,
"Import Palapeli
P
uzzles"
),
QString
(),
filter
);
Palapeli
::
Collection
*
coll
=
Palapeli
::
Collection
::
instance
();
...
...
@@ -337,7 +337,7 @@ void Palapeli::GamePlay::actionExport()
const
QString
startLoc
=
QString
::
fromLatin1
(
"%1.puzzle"
).
arg
(
cmp
->
metadata
.
name
);
const
QString
filter
=
i18nc
(
"Filter for a file dialog"
,
"Palapeli puzzles (*.puzzle)"
);
const
QString
location
=
QFileDialog
::
getSaveFileName
(
m_mainWindow
,
i18n
(
"Save Palapeli
p
uzzles"
),
i18n
c
(
"@title:window"
,
"Save Palapeli
P
uzzles"
),
startLoc
,
filter
);
if
(
location
.
isEmpty
())
...
...
src/engine/puzzlepreview.cpp
View file @
b04597b1
...
...
@@ -26,7 +26,7 @@ Palapeli::PuzzlePreview::PuzzlePreview(QWidget* parent)
setScene
(
new
QGraphicsScene
(
this
));
setParent
(
parent
);
setWindowTitle
(
i18nc
(
"
Window title
"
,
"Preview of completed puzzle"
));
setWindowTitle
(
i18nc
(
"
@title:window
"
,
"Preview of completed puzzle"
));
setWindowFlags
(
Qt
::
Tool
|
Qt
::
WindowTitleHint
);
setAttribute
(
Qt
::
WA_NoMousePropagation
);
// Accept all mouse events.
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
...
...
@@ -61,7 +61,7 @@ void Palapeli::PuzzlePreview::loadImageFrom(const Palapeli::PuzzleMetadata& md)
{
// Metadata is assumed to have been loaded by the caller.
setImage
(
md
.
image
);
setWindowTitle
(
i18n
(
"%1 - Preview"
,
md
.
name
));
setWindowTitle
(
i18n
c
(
"@title:window"
,
"%1 - Preview"
,
md
.
name
));
// Set hover-zoom so that 3x3 pieces would be visible on a square grid.
m_hoverZoom
=
sqrt
(
md
.
pieceCount
)
/
3.0
;
if
(
m_hoverZoom
<
1
)
...
...
src/file-io/collection-view.cpp
View file @
b04597b1
...
...
@@ -55,11 +55,11 @@ Palapeli::CollectionView::CollectionView(QWidget* parent)
searchLine
->
setClearButtonEnabled
(
true
);
connect
(
searchLine
,
&
QLineEdit
::
textChanged
,
this
,
&
Palapeli
::
CollectionView
::
slotTextChanged
);
//setup sort button
QPushButton
*
sortButton
=
new
QPushButton
(
i18nc
(
"@action:button that pops up sorting strategy selection menu"
,
"Sort
l
ist..."
),
this
);
QPushButton
*
sortButton
=
new
QPushButton
(
i18nc
(
"@action:button that pops up sorting strategy selection menu"
,
"Sort
L
ist..."
),
this
);
QMenu
*
sortMenu
=
new
QMenu
(
sortButton
);
sortButton
->
setMenu
(
sortMenu
);
m_sortByTitle
=
sortMenu
->
addAction
(
i18nc
(
"@action:inmenu selects sorting strategy for collection list"
,
"By
t
itle"
));
m_sortByPieceCount
=
sortMenu
->
addAction
(
i18nc
(
"@action:inmenu selects sorting strategy for collection list"
,
"By
p
iece
c
ount"
));
m_sortByTitle
=
sortMenu
->
addAction
(
i18nc
(
"@action:inmenu selects sorting strategy for collection list"
,
"By
T
itle"
));
m_sortByPieceCount
=
sortMenu
->
addAction
(
i18nc
(
"@action:inmenu selects sorting strategy for collection list"
,
"By
P
iece
C
ount"
));
m_sortByTitle
->
setCheckable
(
true
);
m_sortByPieceCount
->
setCheckable
(
true
);
m_sortByTitle
->
setChecked
(
true
);
...
...
src/window/mainwindow.cpp
View file @
b04597b1
...
...
@@ -50,24 +50,24 @@ void Palapeli::MainWindow::setupActions()
QAction
*
statusBarAct
=
KStandardAction
::
showStatusbar
(
m_game
->
puzzleTable
(),
&
PuzzleTableWidget
::
showStatusBar
,
actionCollection
());
statusBarAct
->
setChecked
(
Settings
::
showStatusBar
());
statusBarAct
->
setText
(
i18n
(
"Show
s
tatusbar of
p
uzzle
t
able"
));
statusBarAct
->
setText
(
i18n
(
"Show
S
tatusbar of
P
uzzle
T
able"
));
// Back to collection.
QAction
*
goCollAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"go-previous"
)),
i18n
(
"Back to &
c
ollection"
),
this
);
QAction
*
goCollAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"go-previous"
)),
i18n
(
"Back to &
C
ollection"
),
this
);
goCollAct
->
setToolTip
(
i18n
(
"Go back to the collection to choose another puzzle"
));
goCollAct
->
setEnabled
(
false
);
//because the collection is initially shown
actionCollection
()
->
addAction
(
QStringLiteral
(
"view_collection"
),
goCollAct
);
connect
(
goCollAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
actionGoCollection
);
// Create new puzzle (FIXME: action should have a custom icon).
QAction
*
createAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tools-wizard"
)),
i18n
(
"Create &
n
ew
p
uzzle..."
),
this
);
QAction
*
createAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tools-wizard"
)),
i18n
(
"Create &
N
ew
P
uzzle..."
),
this
);
createAct
->
setToolTip
(
i18n
(
"Create a new puzzle using an image file from your disk"
));
actionCollection
()
->
setDefaultShortcuts
(
createAct
,
KStandardShortcut
::
openNew
());
actionCollection
()
->
addAction
(
QStringLiteral
(
"game_new"
),
createAct
);
connect
(
createAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
actionCreate
);
// Delete a puzzle.
QAction
*
deleteAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)),
i18n
(
"&Delete
p
uzzle"
),
this
);
QAction
*
deleteAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)),
i18n
(
"&Delete
P
uzzle"
),
this
);
deleteAct
->
setEnabled
(
false
);
//will be enabled when something is selected
deleteAct
->
setToolTip
(
i18n
(
"Delete the selected puzzle from your collection"
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"game_delete"
),
deleteAct
);
...
...
@@ -75,13 +75,13 @@ void Palapeli::MainWindow::setupActions()
connect
(
deleteAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
actionDelete
);
// Import from file...
QAction
*
importAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-import"
)),
i18n
(
"&Import from
f
ile..."
),
this
);
QAction
*
importAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-import"
)),
i18n
(
"&Import from
F
ile..."
),
this
);
importAct
->
setToolTip
(
i18n
(
"Import a new puzzle from a file into your collection"
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"game_import"
),
importAct
);
connect
(
importAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
actionImport
);
// Export to file...
QAction
*
exportAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-export"
)),
i18n
(
"&Export to
f
ile..."
),
this
);
QAction
*
exportAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-export"
)),
i18n
(
"&Export to
F
ile..."
),
this
);
exportAct
->
setEnabled
(
false
);
//will be enabled when something is selected
exportAct
->
setToolTip
(
i18n
(
"Export the selected puzzle from your collection into a file"
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"game_export"
),
exportAct
);
...
...
@@ -89,7 +89,7 @@ void Palapeli::MainWindow::setupActions()
connect
(
exportAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
actionExport
);
//Reshuffle and restart puzzle
QAction
*
restartPuzzleAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-refresh"
)),
i18n
(
"&Restart
p
uzzle..."
),
this
);
QAction
*
restartPuzzleAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-refresh"
)),
i18n
(
"&Restart
P
uzzle..."
),
this
);
restartPuzzleAct
->
setToolTip
(
i18n
(
"Delete the saved progress and reshuffle the pieces"
));
restartPuzzleAct
->
setEnabled
(
false
);
//no puzzle in progress initially
actionCollection
()
->
addAction
(
QStringLiteral
(
"game_restart"
),
restartPuzzleAct
);
...
...
@@ -97,7 +97,7 @@ void Palapeli::MainWindow::setupActions()
// Quit.
KStandardGameAction
::
quit
(
this
,
&
QWidget
::
close
,
actionCollection
());
// Create piece-holder.
QAction
*
createHolderAct
=
new
QAction
(
i18n
(
"&Create
p
iece
h
older..."
),
this
);
QAction
*
createHolderAct
=
new
QAction
(
i18n
(
"&Create
P
iece
H
older..."
),
this
);
createHolderAct
->
setToolTip
(
i18n
(
"Create a temporary holder for sorting pieces"
));
actionCollection
()
->
setDefaultShortcut
(
createHolderAct
,
QKeySequence
(
Qt
::
Key_C
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"move_create_holder"
),
createHolderAct
);
...
...
@@ -105,21 +105,21 @@ void Palapeli::MainWindow::setupActions()
qOverload
<>
(
&
GamePlay
::
createHolder
));
// Delete piece-holder.
QAction
*
deleteHolderAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)),
i18n
(
"&Delete
p
iece
h
older"
),
this
);
QAction
*
deleteHolderAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)),
i18n
(
"&Delete
P
iece
H
older"
),
this
);
deleteHolderAct
->
setToolTip
(
i18n
(
"Delete a selected temporary holder when it is empty"
));
actionCollection
()
->
setDefaultShortcut
(
deleteHolderAct
,
QKeySequence
(
Qt
::
Key_D
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"move_delete_holder"
),
deleteHolderAct
);
connect
(
deleteHolderAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
deleteHolder
);
// Select all pieces in a piece-holder.
QAction
*
selectAllAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-select-all"
)),
i18n
(
"&Select
a
ll in
h
older"
),
this
);
QAction
*
selectAllAct
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-select-all"
)),
i18n
(
"&Select
A
ll in
H
older"
),
this
);
selectAllAct
->
setToolTip
(
i18n
(
"Select all pieces in a selected piece holder"
));
actionCollection
()
->
setDefaultShortcut
(
selectAllAct
,
QKeySequence
(
Qt
::
Key_A
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"move_select_all"
),
selectAllAct
);
connect
(
selectAllAct
,
&
QAction
::
triggered
,
m_game
,
&
GamePlay
::
selectAll
);
// Rearrange a selected piece-holder or selected pieces in any view.
QAction
*
rearrangeAct
=
new
QAction
(
i18n
(
"&Rearrange
p
ieces"
),
this
);
QAction
*
rearrangeAct
=
new
QAction
(
i18n
(
"&Rearrange
P
ieces"
),
this
);
rearrangeAct
->
setToolTip
(
i18n
(
"Rearrange all pieces in a selected piece holder or selected pieces in any window"
));
actionCollection
()
->
setDefaultShortcut
(
rearrangeAct
,
QKeySequence
(
Qt
::
Key_R
));
actionCollection
()
->
addAction
(
QStringLiteral
(
"move_rearrange"
),
rearrangeAct
);
...
...
@@ -144,7 +144,7 @@ void Palapeli::MainWindow::setupActions()
KStandardAction
::
zoomOut
(
m_game
,
&
GamePlay
::
actionZoomOut
,
actionCollection
());
// Settings: enable messages that the user marked "Do not show again".
QAction
*
enableMessagesAct
=
new
QAction
(
i18n
(
"Enable
a
ll
m
essages"
),
this
);
QAction
*
enableMessagesAct
=
new
QAction
(
i18n
(
"Enable
A
ll
M
essages"
),
this
);
actionCollection
()
->
addAction
(
QStringLiteral
(
"enable_messages"
),
enableMessagesAct
);
connect
(
enableMessagesAct
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
enableMessages
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment