@@ -88,7 +88,8 @@ MainWindow::MainWindow(bool useAlternativeSources, QWidget *parent) : QMainWindo
88
88
&QWidget::setVisible);
89
89
90
90
// Connect the playlistWidget signals to some slots
91
- auto const fileInfoAdapter = [this ] {
91
+ auto const fileInfoAdapter = [this ]
92
+ {
92
93
auto items = ui.playlistTreeWidget ->getSelectedItems ();
93
94
ui.fileInfoWidget ->setInfo (items[0 ] ? items[0 ]->getInfo () : InfoData (),
94
95
items[1 ] ? items[1 ]->getInfo () : InfoData ());
@@ -101,11 +102,14 @@ MainWindow::MainWindow(bool useAlternativeSources, QWidget *parent) : QMainWindo
101
102
&PlaylistTreeWidget::selectedItemChanged,
102
103
ui.fileInfoWidget ,
103
104
fileInfoAdapter);
104
- connect (ui.fileInfoWidget , &FileInfoWidget::infoButtonClicked, [this ](int infoIndex, int row) {
105
- auto items = ui.playlistTreeWidget ->getSelectedItems ();
106
- if (items[infoIndex])
107
- items[infoIndex]->infoListButtonPressed (row);
108
- });
105
+ connect (ui.fileInfoWidget ,
106
+ &FileInfoWidget::infoButtonClicked,
107
+ [this ](int infoIndex, int row)
108
+ {
109
+ auto items = ui.playlistTreeWidget ->getSelectedItems ();
110
+ if (items[infoIndex])
111
+ items[infoIndex]->infoListButtonPressed (row);
112
+ });
109
113
connect (ui.playlistTreeWidget ,
110
114
&PlaylistTreeWidget::selectionRangeChanged,
111
115
ui.playbackController ,
@@ -174,7 +178,8 @@ MainWindow::MainWindow(bool useAlternativeSources, QWidget *parent) : QMainWindo
174
178
restoreGeometry (settings.value (" mainWindow/geometry" ).toByteArray ());
175
179
restoreState (settings.value (" mainWindow/windowState" ).toByteArray (), QT_VERSION);
176
180
separateViewWindow.restoreGeometry (settings.value (" separateViewWindow/geometry" ).toByteArray ());
177
- separateViewWindow.restoreState (settings.value (" separateViewWindow/windowState" ).toByteArray (), QT_VERSION);
181
+ separateViewWindow.restoreState (settings.value (" separateViewWindow/windowState" ).toByteArray (),
182
+ QT_VERSION);
178
183
}
179
184
180
185
connect (ui.openButton , &QPushButton::clicked, this , &MainWindow::showFileOpenDialog);
@@ -239,11 +244,12 @@ void MainWindow::loadFiles(const QStringList &files)
239
244
240
245
void MainWindow::createMenusAndActions ()
241
246
{
242
- auto addActionToMenu = [this ](QMenu * menu,
247
+ auto addActionToMenu = [this ](QMenu * menu,
243
248
QString name,
244
249
auto reciever,
245
250
auto functionPointer,
246
- const QKeySequence shortcut = {}) {
251
+ const QKeySequence shortcut = {})
252
+ {
247
253
(void )this ; // QObject::connect uses this
248
254
auto action = new QAction (name, menu);
249
255
action->setShortcut (shortcut);
@@ -357,12 +363,13 @@ void MainWindow::createMenusAndActions()
357
363
358
364
auto dockPanelsMenu = viewMenu->addMenu (" Dock Panels" );
359
365
auto addDockViewAction =
360
- [dockPanelsMenu](QDockWidget *dockWidget, QString text, const QKeySequence &shortcut = {}) {
361
- auto action = dockWidget->toggleViewAction ();
362
- action->setText (text);
363
- action->setShortcut (shortcut);
364
- dockPanelsMenu->addAction (action);
365
- };
366
+ [dockPanelsMenu](QDockWidget *dockWidget, QString text, const QKeySequence &shortcut = {})
367
+ {
368
+ auto action = dockWidget->toggleViewAction ();
369
+ action->setText (text);
370
+ action->setShortcut (shortcut);
371
+ dockPanelsMenu->addAction (action);
372
+ };
366
373
addDockViewAction (ui.playlistDockWidget , " Show P&laylist" , Qt::CTRL | Qt::Key_L);
367
374
addDockViewAction (ui.propertiesDock , " Show &Properties" , Qt::CTRL | Qt::Key_P);
368
375
addDockViewAction (ui.fileInfoDock , " Show &Info" , Qt::CTRL | Qt::Key_I);
@@ -413,7 +420,8 @@ void MainWindow::createMenusAndActions()
413
420
&PlaybackController::previousFrame,
414
421
Qt::Key_Left);
415
422
416
- auto addLambdaActionToMenu = [this ](QMenu *menu, const QString name, auto lambda) {
423
+ auto addLambdaActionToMenu = [](QMenu *menu, const QString name, auto lambda)
424
+ {
417
425
auto action = new QAction (name, menu);
418
426
QObject::connect (action, &QAction::triggered, lambda);
419
427
menu->addAction (action);
@@ -423,31 +431,43 @@ void MainWindow::createMenusAndActions()
423
431
addActionToMenu (helpMenu, " About YUView" , this , &MainWindow::showAbout);
424
432
addActionToMenu (helpMenu, " Help" , this , &MainWindow::showHelp);
425
433
helpMenu->addSeparator ();
426
- addLambdaActionToMenu (helpMenu, " Open Project Website..." , []() {
427
- QDesktopServices::openUrl (QUrl (" https://github.com/IENT/YUView" ));
428
- });
434
+ addLambdaActionToMenu (helpMenu,
435
+ " Open Project Website..." ,
436
+ []()
437
+ { QDesktopServices::openUrl (QUrl (" https://github.com/IENT/YUView" )); });
429
438
addLambdaActionToMenu (
430
439
helpMenu, " Check for new version" , [this ]() { this ->updater ->startCheckForNewVersion (); });
431
440
432
441
auto downloadsMenu = helpMenu->addMenu (" Downloads" );
433
- addLambdaActionToMenu (downloadsMenu, " libde265 HEVC decoder" , []() {
434
- QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/libde265/releases" ));
435
- });
436
- addLambdaActionToMenu (downloadsMenu, " HM reference HEVC decoder" , []() {
437
- QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/libHM/releases" ));
438
- });
439
- addLambdaActionToMenu (downloadsMenu, " VTM VVC decoder" , []() {
440
- QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/VTM/releases" ));
441
- });
442
- addLambdaActionToMenu (downloadsMenu, " dav1d AV1 decoder" , []() {
443
- QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/dav1d/releases" ));
444
- });
445
- addLambdaActionToMenu (downloadsMenu, " FFmpeg libraries" , []() {
446
- QDesktopServices::openUrl (QUrl (" https://ffmpeg.org/" ));
447
- });
448
- addLambdaActionToMenu (downloadsMenu, " VVDec libraries" , []() {
449
- QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/vvdec/releases" ));
450
- });
442
+ addLambdaActionToMenu (downloadsMenu,
443
+ " libde265 HEVC decoder" ,
444
+ []() {
445
+ QDesktopServices::openUrl (
446
+ QUrl (" https://github.com/ChristianFeldmann/libde265/releases" ));
447
+ });
448
+ addLambdaActionToMenu (
449
+ downloadsMenu,
450
+ " HM reference HEVC decoder" ,
451
+ []()
452
+ { QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/libHM/releases" )); });
453
+ addLambdaActionToMenu (
454
+ downloadsMenu,
455
+ " VTM VVC decoder" ,
456
+ []()
457
+ { QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/VTM/releases" )); });
458
+ addLambdaActionToMenu (
459
+ downloadsMenu,
460
+ " dav1d AV1 decoder" ,
461
+ []()
462
+ { QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/dav1d/releases" )); });
463
+ addLambdaActionToMenu (downloadsMenu,
464
+ " FFmpeg libraries" ,
465
+ []() { QDesktopServices::openUrl (QUrl (" https://ffmpeg.org/" )); });
466
+ addLambdaActionToMenu (
467
+ downloadsMenu,
468
+ " VVDec libraries" ,
469
+ []()
470
+ { QDesktopServices::openUrl (QUrl (" https://github.com/ChristianFeldmann/vvdec/releases" )); });
451
471
helpMenu->addSeparator ();
452
472
addLambdaActionToMenu (downloadsMenu, " Performance Tests" , [this ]() { this ->performanceTest (); });
453
473
addActionToMenu (helpMenu, " Reset Window Layout" , this , &MainWindow::resetWindowLayout);
0 commit comments