Skip to content

Commit d471d7f

Browse files
committed
Minor modifications to the Editor Undo/Redo patch.
Removes the TV Editing/UNDO and REDO key bindings (which will go into Global context, instead, in a later commit). Adds indenting that Jim left out of his patch (on purpose, to make it easier to see what he was changing). Minor changes to the Edit menu. Modifies a few UI strings--including previously existing strings. Includes binary version change. Plugins will need rebuilding.
1 parent 0791662 commit d471d7f

File tree

5 files changed

+43
-47
lines changed

5 files changed

+43
-47
lines changed

mythtv/libs/libmythbase/mythversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Update this whenever the plug-in API changes.
1212
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
1313
/// libmythui class methods used by plug-ins.
14-
#define MYTH_BINARY_VERSION "0.25.20110127-3"
14+
#define MYTH_BINARY_VERSION "0.25.20110128-1"
1515

1616
/** \brief Increment this whenever the MythTV network protocol changes.
1717
*

mythtv/libs/libmythtv/deletemap.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define LOC QString("DelMap: ")
99
#define LOC_ERR QString("DelMap Err: ")
1010
#define EDIT_CHECK if(!m_editing) \
11-
{ VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot edit outside editmode."); return; }
11+
{ VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot edit outside edit mode."); return; }
1212

1313
DeleteMapUndoEntry::DeleteMapUndoEntry(frm_dir_map_t dm, QString msg) :
1414
deleteMap(dm), message(msg) { }
@@ -56,13 +56,13 @@ bool DeleteMap::Redo(void)
5656
QString DeleteMap::GetUndoMessage(void)
5757
{
5858
return (HasUndo() ? m_undoStack[m_undoStackPointer].message :
59-
QObject::tr("(No more undo operations)"));
59+
QObject::tr("(Nothing to undo)"));
6060
}
6161

6262
QString DeleteMap::GetRedoMessage(void)
6363
{
6464
return (HasRedo() ? m_undoStack[m_undoStackPointer + 1].message :
65-
QObject::tr("(No more redo operations)"));
65+
QObject::tr("(Nothing to redo)"));
6666
}
6767

6868
bool DeleteMap::HandleAction(QString &action, uint64_t frame,
@@ -76,21 +76,21 @@ bool DeleteMap::HandleAction(QString &action, uint64_t frame,
7676
else if (action == ACTION_DOWN)
7777
UpdateSeekAmount(-1, rate);
7878
else if (action == ACTION_CLEARMAP)
79-
Clear(QObject::tr("Clear Cut List"));
79+
Clear(QObject::tr("Clear Cuts"));
8080
else if (action == ACTION_INVERTMAP)
8181
ReverseAll(total);
8282
else if (action == "MOVEPREV")
8383
MoveRelative(frame, total, false);
8484
else if (action == "MOVENEXT")
8585
MoveRelative(frame, total, true);
8686
else if (action == "CUTTOBEGINNING")
87-
Add(frame, total, MARK_CUT_END, QObject::tr("Cut To Beginning"));
87+
Add(frame, total, MARK_CUT_END, QObject::tr("Cut to Beginning"));
8888
else if (action == "CUTTOEND")
89-
Add(frame, total, MARK_CUT_START, QObject::tr("Cut To End"));
89+
Add(frame, total, MARK_CUT_START, QObject::tr("Cut to End"));
9090
else if (action == "NEWCUT")
9191
NewCut(frame, total);
9292
else if (action == "DELETE")
93-
Delete(frame, total, QObject::tr("Delete Cut Area"));
93+
Delete(frame, total, QObject::tr("Delete"));
9494
else if (action == "UNDO")
9595
Undo();
9696
else if (action == "REDO")
@@ -226,7 +226,7 @@ void DeleteMap::ReverseAll(uint64_t total)
226226
Add(it.key(), it.value() == MARK_CUT_END ? MARK_CUT_START :
227227
MARK_CUT_END);
228228
CleanMap(total);
229-
Push(QObject::tr("Invert Cut List"));
229+
Push(QObject::tr("Reverse Cuts"));
230230
}
231231

232232
/**
@@ -249,7 +249,7 @@ void DeleteMap::Add(uint64_t frame, uint64_t total, MarkTypes type,
249249
{
250250
// Delete the temporary mark before putting a real mark at its
251251
// location
252-
Delete(frame, total, "");
252+
Delete(frame, total);
253253
}
254254
else // Don't add a mark on top of a mark
255255
return;
@@ -466,14 +466,14 @@ void DeleteMap::MoveRelative(uint64_t frame, uint64_t total, bool right)
466466
{
467467
// If on a mark, don't collapse a cut region to 0;
468468
// instead, delete the region
469-
Delete(frame, total, QObject::tr("Delete Cut Area"));
469+
Delete(frame, total, QObject::tr("Delete"));
470470
return;
471471
}
472472
else if (MARK_PLACEHOLDER == type)
473473
{
474474
// Delete the temporary mark before putting a real mark at its
475475
// location
476-
Delete(frame, total, "");
476+
Delete(frame, total);
477477
}
478478
}
479479

@@ -667,7 +667,7 @@ void DeleteMap::LoadCommBreakMap(uint64_t total, frm_dir_map_t &map)
667667
Add(it.key(), it.value() == MARK_COMM_START ?
668668
MARK_CUT_START : MARK_CUT_END);
669669
CleanMap(total);
670-
Push(QObject::tr("Load Commskip List"));
670+
Push(QObject::tr("Load Detected Commercials"));
671671
}
672672

673673
/// Loads the delete map from the database.
@@ -699,7 +699,7 @@ bool DeleteMap::LoadAutoSaveMap(uint64_t total, PlayerContext *ctx)
699699
ctx->UnlockPlayingInfo(__FILE__, __LINE__);
700700
CleanMap(total);
701701
if (result)
702-
Push(QObject::tr("Load Auto-Save Cut List"));
702+
Push(QObject::tr("Load Auto-saved Cuts"));
703703
else
704704
m_deleteMap = tmpDeleteMap;
705705

@@ -714,19 +714,19 @@ void DeleteMap::SaveMap(uint64_t total, PlayerContext *ctx, bool isAutoSave)
714714

715715
if (!isAutoSave)
716716
{
717-
// Remove temporary placeholder marks
718-
QMutableMapIterator<uint64_t, MarkTypes> it(m_deleteMap);
719-
while (it.hasNext())
720-
{
721-
it.next();
722-
if (MARK_PLACEHOLDER == it.value())
717+
// Remove temporary placeholder marks
718+
QMutableMapIterator<uint64_t, MarkTypes> it(m_deleteMap);
719+
while (it.hasNext())
723720
{
724-
it.remove();
725-
m_changed = true;
721+
it.next();
722+
if (MARK_PLACEHOLDER == it.value())
723+
{
724+
it.remove();
725+
m_changed = true;
726+
}
726727
}
727-
}
728728

729-
CleanMap(total);
729+
CleanMap(total);
730730
}
731731
ctx->LockPlayingInfo(__FILE__, __LINE__);
732732
ctx->playingInfo->SaveMarkupFlag(MARK_UPDATED_CUT);

mythtv/libs/libmythtv/deletemap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ class DeleteMap
4040

4141
void SetMap(const frm_dir_map_t &map);
4242
void LoadCommBreakMap(uint64_t total, frm_dir_map_t &map);
43-
void SaveMap(uint64_t total, PlayerContext *ctx, bool isAutoSave=false);
44-
void LoadMap(uint64_t total, PlayerContext *ctx, QString undoMessage="");
43+
void SaveMap(uint64_t total, PlayerContext *ctx, bool isAutoSave = false);
44+
void LoadMap(uint64_t total, PlayerContext *ctx, QString undoMessage = "");
4545
bool LoadAutoSaveMap(uint64_t total, PlayerContext *ctx);
4646
void CleanMap(uint64_t total);
4747

48-
void Clear(QString undoMessage="");
48+
void Clear(QString undoMessage = "");
4949
void ReverseAll(uint64_t total);
5050
void Add(uint64_t frame, uint64_t total, MarkTypes type,
5151
QString undoMessage);
5252
void NewCut(uint64_t frame, uint64_t total);
53-
void Delete(uint64_t frame, uint64_t total, QString undoMessage);
53+
void Delete(uint64_t frame, uint64_t total, QString undoMessage = "");
5454
void Reverse(uint64_t frame, uint64_t total);
5555
void MoveRelative(uint64_t frame, uint64_t total, bool right);
5656
void Move(uint64_t frame, uint64_t to, uint64_t total);

mythtv/libs/libmythtv/mythplayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,7 +3565,7 @@ bool MythPlayer::EnableEdit(void)
35653565
bool loadedAutoSave = deleteMap.LoadAutoSaveMap(totalFrames, player_ctx);
35663566
if (loadedAutoSave)
35673567
{
3568-
SetOSDMessage(QObject::tr("Using previously auto-saved cut list"),
3568+
SetOSDMessage(QObject::tr("Using previously auto-saved cuts"),
35693569
kOSDTimeout_Short);
35703570
}
35713571

@@ -3688,13 +3688,13 @@ bool MythPlayer::HandleProgramEditorActions(QStringList &actions,
36883688
else if (action == "DELETE")
36893689
{
36903690
deleteMap.Delete(frame, totalFrames,
3691-
QObject::tr("Delete cut area"));
3691+
QObject::tr("Delete"));
36923692
refresh = true;
36933693
}
36943694
else if (action == "REVERT")
36953695
{
36963696
deleteMap.LoadMap(totalFrames, player_ctx,
3697-
QObject::tr("Load Cut List"));
3697+
QObject::tr("Undo Changes"));
36983698
refresh = true;
36993699
}
37003700
else if (action == "REVERTEXIT")

mythtv/libs/libmythtv/tv_play.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ void TV::InitKeys(void)
712712
REG_KEY("TV Editing", ACTION_INVERTMAP, QT_TRANSLATE_NOOP("MythControls",
713713
"Invert Begin/End cut points"),"I");
714714
REG_KEY("TV Editing", ACTION_SAVEMAP, QT_TRANSLATE_NOOP("MythControls",
715-
"Save cut list"),"");
715+
"Save cuts"),"");
716716
REG_KEY("TV Editing", ACTION_LOADCOMMSKIP,QT_TRANSLATE_NOOP("MythControls",
717-
"Load cut list from commercial skips"), "Z,End");
717+
"Load cuts from detected commercials"), "Z,End");
718718
REG_KEY("TV Editing", ACTION_NEXTCUT, QT_TRANSLATE_NOOP("MythControls",
719719
"Jump to the next cut point"), "PgDown");
720720
REG_KEY("TV Editing", ACTION_PREVCUT, QT_TRANSLATE_NOOP("MythControls",
@@ -723,10 +723,6 @@ void TV::InitKeys(void)
723723
"Jump back 10x the normal amount"), ",,<");
724724
REG_KEY("TV Editing", ACTION_BIGJUMPFWD, QT_TRANSLATE_NOOP("MythControls",
725725
"Jump forward 10x the normal amount"), ">,.");
726-
// REG_KEY("TV Editing", "UNDO", QT_TRANSLATE_NOOP("MythControls",
727-
// "Undo"), "Ctrl+Z");
728-
// REG_KEY("TV Editing", "REDO", QT_TRANSLATE_NOOP("MythControls",
729-
// "Redo"), "Ctrl+Y");
730726

731727
/* Teletext keys */
732728
REG_KEY("Teletext Menu", ACTION_NEXTPAGE, QT_TRANSLATE_NOOP("MythControls",
@@ -8916,9 +8912,6 @@ void TV::ShowOSDCutpoint(PlayerContext *ctx, const QString &type)
89168912
QString("DIALOG_CUTPOINT_DELETE_%1")
89178913
.arg(frame));
89188914
}
8919-
if ("EDIT_CUT_POINTS" == type)
8920-
osd->DialogAddButton(QObject::tr("Cut List Options"),
8921-
"DIALOG_CUTPOINT_CUTLISTOPTIONS_0", true);
89228915
if (ctx->player->DeleteMapHasUndo())
89238916
osd->DialogAddButton(QObject::tr("Undo") + " - " +
89248917
ctx->player->DeleteMapGetUndoMessage(),
@@ -8927,33 +8920,36 @@ void TV::ShowOSDCutpoint(PlayerContext *ctx, const QString &type)
89278920
osd->DialogAddButton(QObject::tr("Redo") + " - " +
89288921
ctx->player->DeleteMapGetRedoMessage(),
89298922
QString("DIALOG_CUTPOINT_REDO_0"));
8923+
if ("EDIT_CUT_POINTS" == type)
8924+
osd->DialogAddButton(QObject::tr("Cut List Options"),
8925+
"DIALOG_CUTPOINT_CUTLISTOPTIONS_0", true);
89308926
}
89318927
else if ("CUT_LIST_OPTIONS" == type)
89328928
{
89338929
osd->DialogShow(OSD_DLG_CUTPOINT,
89348930
QObject::tr("Cut List Options"));
8935-
osd->DialogAddButton(QObject::tr("Clear Cut List"),
8931+
osd->DialogAddButton(QObject::tr("Clear Cuts"),
89368932
"DIALOG_CUTPOINT_CLEARMAP_0");
8937-
osd->DialogAddButton(QObject::tr("Invert Cut List"),
8933+
osd->DialogAddButton(QObject::tr("Reverse Cuts"),
89388934
"DIALOG_CUTPOINT_INVERTMAP_0");
89398935
osd->DialogAddButton(QObject::tr("Undo Changes"),
89408936
"DIALOG_CUTPOINT_REVERT_0");
89418937
osd->DialogAddButton(QObject::tr("Exit Without Saving"),
89428938
"DIALOG_CUTPOINT_REVERTEXIT_0");
8943-
osd->DialogAddButton(QObject::tr("Save Cut List"),
8939+
osd->DialogAddButton(QObject::tr("Save Cuts"),
89448940
"DIALOG_CUTPOINT_SAVEMAP_0");
8945-
osd->DialogAddButton(QObject::tr("Save Cut List and Exit"),
8941+
osd->DialogAddButton(QObject::tr("Save Cuts and Exit"),
89468942
"DIALOG_CUTPOINT_SAVEEXIT_0");
89478943
}
89488944
else if ("EXIT_EDIT_MODE" == type)
89498945
{
89508946
osd->DialogShow(OSD_DLG_CUTPOINT,
8951-
QObject::tr("Exit Cut List Editor"));
8952-
osd->DialogAddButton(QObject::tr("Save Cut List and Exit"),
8947+
QObject::tr("Exit Recording Editor"));
8948+
osd->DialogAddButton(QObject::tr("Save Cuts and Exit"),
89538949
"DIALOG_CUTPOINT_SAVEEXIT_0");
89548950
osd->DialogAddButton(QObject::tr("Exit Without Saving"),
89558951
"DIALOG_CUTPOINT_REVERTEXIT_0");
8956-
osd->DialogAddButton(QObject::tr("Save Cut List"),
8952+
osd->DialogAddButton(QObject::tr("Save Cuts"),
89578953
"DIALOG_CUTPOINT_SAVEMAP_0");
89588954
osd->DialogAddButton(QObject::tr("Undo Changes"),
89598955
"DIALOG_CUTPOINT_REVERT_0");

0 commit comments

Comments
 (0)