360
384
connect( doubleSpeedAct, SIGNAL(triggered()),
361
385
core, SLOT(doubleSpeed()) );
363
decSpeedAct = new MyAction( Qt::Key_BracketLeft, this, "dec_speed" );
364
connect( decSpeedAct, SIGNAL(triggered()),
365
core, SLOT(decSpeed()) );
367
incSpeedAct = new MyAction( Qt::Key_BracketRight, this, "inc_speed" );
368
connect( incSpeedAct, SIGNAL(triggered()),
369
core, SLOT(incSpeed()) );
387
decSpeed10Act = new MyAction( Qt::Key_BracketLeft, this, "dec_speed" );
388
connect( decSpeed10Act, SIGNAL(triggered()),
389
core, SLOT(decSpeed10()) );
391
incSpeed10Act = new MyAction( Qt::Key_BracketRight, this, "inc_speed" );
392
connect( incSpeed10Act, SIGNAL(triggered()),
393
core, SLOT(incSpeed10()) );
395
decSpeed4Act = new MyAction( this, "dec_speed_4" );
396
connect( decSpeed4Act, SIGNAL(triggered()),
397
core, SLOT(decSpeed4()) );
399
incSpeed4Act = new MyAction( this, "inc_speed_4" );
400
connect( incSpeed4Act, SIGNAL(triggered()),
401
core, SLOT(incSpeed4()) );
403
decSpeed1Act = new MyAction( this, "dec_speed_1" );
404
connect( decSpeed1Act, SIGNAL(triggered()),
405
core, SLOT(decSpeed1()) );
407
incSpeed1Act = new MyAction( this, "inc_speed_1" );
408
connect( incSpeed1Act, SIGNAL(triggered()),
409
core, SLOT(incSpeed1()) );
380
420
connect( compactAct, SIGNAL(toggled(bool)),
381
421
this, SLOT(toggleCompactMode(bool)) );
383
equalizerAct = new MyAction( QKeySequence("Ctrl+E"), this, "equalizer" );
384
equalizerAct->setCheckable( true );
385
connect( equalizerAct, SIGNAL(toggled(bool)),
386
this, SLOT(showEqualizer(bool)) );
423
videoEqualizerAct = new MyAction( QKeySequence("Ctrl+E"), this, "video_equalizer" );
424
videoEqualizerAct->setCheckable( true );
425
connect( videoEqualizerAct, SIGNAL(toggled(bool)),
426
this, SLOT(showVideoEqualizer(bool)) );
388
428
screenshotAct = new MyAction( Qt::Key_S, this, "screenshot" );
389
429
connect( screenshotAct, SIGNAL(triggered()),
390
430
core, SLOT(screenshot()) );
392
onTopAct = new MyAction( this, "on_top" );
393
onTopAct->setCheckable( true );
394
connect( onTopAct, SIGNAL(toggled(bool)),
395
this, SLOT(toggleStayOnTop(bool)) );
432
videoPreviewAct = new MyAction( this, "video_preview" );
433
connect( videoPreviewAct, SIGNAL(triggered()),
434
this, SLOT(showVideoPreviewDialog()) );
397
436
flipAct = new MyAction( this, "flip" );
398
437
flipAct->setCheckable( true );
399
438
connect( flipAct, SIGNAL(toggled(bool)),
400
439
core, SLOT(toggleFlip(bool)) );
441
mirrorAct = new MyAction( this, "mirror" );
442
mirrorAct->setCheckable( true );
443
connect( mirrorAct, SIGNAL(toggled(bool)),
444
core, SLOT(toggleMirror(bool)) );
403
446
// Submenu filter
404
447
postProcessingAct = new MyAction( this, "postprocessing" );
471
519
connect( incAudioDelayAct, SIGNAL(triggered()),
472
520
core, SLOT(incAudioDelay()) );
522
audioDelayAct = new MyAction( this, "audio_delay" );
523
connect( audioDelayAct, SIGNAL(triggered()),
524
this, SLOT(showAudioDelayDialog()) );
474
526
loadAudioAct = new MyAction( this, "load_audio_file" );
475
527
connect( loadAudioAct, SIGNAL(triggered()),
476
528
this, SLOT(loadAudioFile()) );
514
566
connect( incSubDelayAct, SIGNAL(triggered()),
515
567
core, SLOT(incSubDelay()) );
569
subDelayAct = new MyAction( this, "sub_delay" );
570
connect( subDelayAct, SIGNAL(triggered()),
571
this, SLOT(showSubDelayDialog()) );
517
573
decSubPosAct = new MyAction( Qt::Key_R, this, "dec_sub_pos" );
518
574
connect( decSubPosAct, SIGNAL(triggered()),
519
575
core, SLOT(decSubPos()) );
549
605
useForcedSubsOnlyAct->setCheckable(true);
550
606
connect( useForcedSubsOnlyAct, SIGNAL(toggled(bool)), core, SLOT(toggleForcedSubsOnly(bool)) );
608
showFindSubtitlesDialogAct = new MyAction( this, "show_find_sub_dialog" );
609
connect( showFindSubtitlesDialogAct, SIGNAL(triggered()),
610
this, SLOT(showFindSubtitlesDialog()) );
612
openUploadSubtitlesPageAct = new MyAction( this, "upload_subtitles" ); //turbos
613
connect( openUploadSubtitlesPageAct, SIGNAL(triggered()), //turbos
614
this, SLOT(openUploadSubtitlesPage()) ); //turbos
553
618
showPlaylistAct = new MyAction( QKeySequence("Ctrl+L"), this, "show_playlist" );
554
619
showPlaylistAct->setCheckable( true );
587
652
connect( showFAQAct, SIGNAL(triggered()),
588
653
this, SLOT(helpFAQ()) );
590
showCLOptions = new MyAction( this, "cl_options" );
591
connect( showCLOptions, SIGNAL(triggered()),
655
showCLOptionsAct = new MyAction( this, "cl_options" );
656
connect( showCLOptionsAct, SIGNAL(triggered()),
592
657
this, SLOT(helpCLOptions()) );
659
showTipsAct = new MyAction( this, "tips" );
660
connect( showTipsAct, SIGNAL(triggered()),
661
this, SLOT(helpTips()) );
594
663
aboutQtAct = new MyAction( this, "about_qt" );
595
664
connect( aboutQtAct, SIGNAL(triggered()),
596
665
this, SLOT(helpAboutQt()) );
629
698
resetZoomAct = new MyAction(Qt::SHIFT | Qt::Key_E, this, "reset_zoom");
630
699
connect( resetZoomAct, SIGNAL(triggered()), core, SLOT(resetPanscan()) );
701
autoZoomAct = new MyAction(Qt::SHIFT | Qt::Key_W, this, "auto_zoom");
702
connect( autoZoomAct, SIGNAL(triggered()), core, SLOT(autoPanscan()) );
704
autoZoom169Act = new MyAction(Qt::SHIFT | Qt::Key_A, this, "zoom_169");
705
connect( autoZoom169Act, SIGNAL(triggered()), core, SLOT(autoPanscanFor169()) );
707
autoZoom235Act = new MyAction(Qt::SHIFT | Qt::Key_S, this, "zoom_235");
708
connect( autoZoom235Act, SIGNAL(triggered()), core, SLOT(autoPanscanFor235()) );
633
711
// Actions not in menus or buttons
670
748
incSaturationAct = new MyAction( Qt::Key_8, this, "inc_saturation");
671
749
connect( incSaturationAct, SIGNAL(triggered()), core, SLOT(incSaturation()) );
673
decGammaAct = new MyAction( Qt::ALT | Qt::Key_1, this, "dec_gamma");
751
decGammaAct = new MyAction( this, "dec_gamma");
674
752
connect( decGammaAct, SIGNAL(triggered()), core, SLOT(decGamma()) );
676
incGammaAct = new MyAction( Qt::ALT | Qt::Key_2, this, "inc_gamma");
754
incGammaAct = new MyAction( this, "inc_gamma");
677
755
connect( incGammaAct, SIGNAL(triggered()), core, SLOT(incGamma()) );
757
nextVideoAct = new MyAction( this, "next_video");
758
connect( nextVideoAct, SIGNAL(triggered()), core, SLOT(nextVideo()) );
679
760
nextAudioAct = new MyAction( Qt::Key_H, this, "next_audio");
680
761
connect( nextAudioAct, SIGNAL(triggered()), core, SLOT(nextAudio()) );
692
773
connect( doubleSizeAct, SIGNAL(triggered()), core, SLOT(toggleDoubleSize()) );
694
775
resetVideoEqualizerAct = new MyAction( this, "reset_video_equalizer");
695
connect( resetVideoEqualizerAct, SIGNAL(triggered()), equalizer, SLOT(reset()) );
776
connect( resetVideoEqualizerAct, SIGNAL(triggered()), video_equalizer, SLOT(reset()) );
778
resetAudioEqualizerAct = new MyAction( this, "reset_audio_equalizer");
779
connect( resetAudioEqualizerAct, SIGNAL(triggered()), audio_equalizer, SLOT(reset()) );
697
781
showContextMenuAct = new MyAction( this, "show_context_menu");
698
782
connect( showContextMenuAct, SIGNAL(triggered()),
699
783
this, SLOT(showPopupMenu()) );
786
nextAspectAct = new MyAction( Qt::Key_A, this, "next_aspect");
787
connect( nextAspectAct, SIGNAL(triggered()),
788
core, SLOT(nextAspectRatio()) );
772
862
aspect169Act = new MyActionGroupItem(this, aspectGroup, "aspect_16:9", MediaSettings::Aspect169 );
773
863
aspect1610Act = new MyActionGroupItem(this, aspectGroup, "aspect_16:10", MediaSettings::Aspect1610 );
774
864
aspect235Act = new MyActionGroupItem(this, aspectGroup, "aspect_2.35:1", MediaSettings::Aspect235 );
866
aspect11Act = new MyActionGroupItem(this, aspectGroup, "aspect_1:1", MediaSettings::Aspect11 );
868
QAction * sep = new QAction(aspectGroup);
869
sep->setSeparator(true);
871
aspectNoneAct = new MyActionGroupItem(this, aspectGroup, "aspect_none", MediaSettings::AspectNone);
775
874
#if !NEW_ASPECT_CODE
776
875
QAction * aspect_separator = new QAction(aspectGroup);
777
876
aspect_separator->setSeparator(true);
793
892
connect( rotateGroup, SIGNAL(activated(int)),
794
893
core, SLOT(changeRotate(int)) );
896
onTopActionGroup = new MyActionGroup(this);
897
onTopAlwaysAct = new MyActionGroupItem( this,onTopActionGroup,"on_top_always",Preferences::AlwaysOnTop);
898
onTopNeverAct = new MyActionGroupItem( this,onTopActionGroup,"on_top_never",Preferences::NeverOnTop);
899
onTopWhilePlayingAct = new MyActionGroupItem( this,onTopActionGroup,"on_top_playing",Preferences::WhilePlayingOnTop);
900
connect( onTopActionGroup , SIGNAL(activated(int)),
901
this, SLOT(changeStayOnTop(int)) );
903
toggleStayOnTopAct = new MyAction( this, "toggle_stay_on_top");
904
connect( toggleStayOnTopAct, SIGNAL(triggered()), this, SLOT(toggleStayOnTop()) );
908
screenGroup = new MyActionGroup(this);
909
screenDefaultAct = new MyActionGroupItem(this, screenGroup, "screen_default", -1);
911
DeviceList display_devices = DeviceInfo::displayDevices();
912
if (!display_devices.isEmpty()) {
913
for (int n = 0; n < display_devices.count(); n++) {
914
int id = display_devices[n].ID().toInt();
915
QString desc = display_devices[n].desc();
916
MyAction * screen_item = new MyActionGroupItem(this, screenGroup, QString("screen_%1").arg(n).toAscii().constData(), id);
917
screen_item->change( "&"+QString::number(n) + " - " + desc);
922
for (int n = 1; n <= 4; n++) {
923
MyAction * screen_item = new MyActionGroupItem(this, screenGroup, QString("screen_%1").arg(n).toAscii().constData(), n);
924
screen_item->change( "&"+QString::number(n) );
927
connect( screenGroup, SIGNAL(activated(int)),
928
core, SLOT(changeAdapter(int)) );
932
videoTrackGroup = new MyActionGroup(this);
933
connect( videoTrackGroup, SIGNAL(activated(int)),
934
core, SLOT(changeVideo(int)) );
797
937
audioTrackGroup = new MyActionGroup(this);
798
938
connect( audioTrackGroup, SIGNAL(activated(int)),
817
957
chapterGroup = new MyActionGroup(this);
818
958
connect( chapterGroup, SIGNAL(activated(int)),
819
959
core, SLOT(changeChapter(int)) );
962
dvdnavUpAct = new MyAction(Qt::SHIFT | Qt::Key_Up, this, "dvdnav_up");
963
connect( dvdnavUpAct, SIGNAL(triggered()), core, SLOT(dvdnavUp()) );
965
dvdnavDownAct = new MyAction(Qt::SHIFT | Qt::Key_Down, this, "dvdnav_down");
966
connect( dvdnavDownAct, SIGNAL(triggered()), core, SLOT(dvdnavDown()) );
968
dvdnavLeftAct = new MyAction(Qt::SHIFT | Qt::Key_Left, this, "dvdnav_left");
969
connect( dvdnavLeftAct, SIGNAL(triggered()), core, SLOT(dvdnavLeft()) );
971
dvdnavRightAct = new MyAction(Qt::SHIFT | Qt::Key_Right, this, "dvdnav_right");
972
connect( dvdnavRightAct, SIGNAL(triggered()), core, SLOT(dvdnavRight()) );
974
dvdnavMenuAct = new MyAction(Qt::SHIFT | Qt::Key_Return, this, "dvdnav_menu");
975
connect( dvdnavMenuAct, SIGNAL(triggered()), core, SLOT(dvdnavMenu()) );
977
dvdnavSelectAct = new MyAction(Qt::Key_Return, this, "dvdnav_select");
978
connect( dvdnavSelectAct, SIGNAL(triggered()), core, SLOT(dvdnavSelect()) );
980
dvdnavPrevAct = new MyAction(Qt::SHIFT | Qt::Key_Escape, this, "dvdnav_prev");
981
connect( dvdnavPrevAct, SIGNAL(triggered()), core, SLOT(dvdnavPrev()) );
983
dvdnavMouseAct = new MyAction( this, "dvdnav_mouse");
984
connect( dvdnavMouseAct, SIGNAL(triggered()), core, SLOT(dvdnavMouse()) );
822
989
#if AUTODISABLE_ACTIONS
841
1008
normalSpeedAct->setEnabled(b);
842
1009
halveSpeedAct->setEnabled(b);
843
1010
doubleSpeedAct->setEnabled(b);
844
decSpeedAct->setEnabled(b);
845
incSpeedAct->setEnabled(b);
1011
decSpeed10Act->setEnabled(b);
1012
incSpeed10Act->setEnabled(b);
1013
decSpeed4Act->setEnabled(b);
1014
incSpeed4Act->setEnabled(b);
1015
decSpeed1Act->setEnabled(b);
1016
incSpeed1Act->setEnabled(b);
848
equalizerAct->setEnabled(b);
1019
videoEqualizerAct->setEnabled(b);
849
1020
screenshotAct->setEnabled(b);
850
1021
flipAct->setEnabled(b);
1022
mirrorAct->setEnabled(b);
851
1023
postProcessingAct->setEnabled(b);
852
1024
phaseAct->setEnabled(b);
853
1025
deblockAct->setEnabled(b);
911
1087
incZoomAct->setEnabled(b);
912
1088
decZoomAct->setEnabled(b);
913
1089
resetZoomAct->setEnabled(b);
1090
autoZoomAct->setEnabled(b);
1091
autoZoom169Act->setEnabled(b);
1092
autoZoom235Act->setEnabled(b);
1095
dvdnavUpAct->setEnabled(b);
1096
dvdnavDownAct->setEnabled(b);
1097
dvdnavLeftAct->setEnabled(b);
1098
dvdnavRightAct->setEnabled(b);
1099
dvdnavMenuAct->setEnabled(b);
1100
dvdnavSelectAct->setEnabled(b);
1101
dvdnavPrevAct->setEnabled(b);
1102
dvdnavMouseAct->setEnabled(b);
916
1106
denoiseGroup->setActionsEnabled(b);
935
1128
// Disable the compact action if not using video window
936
1129
compactAct->setEnabled( panel->isVisible() );
1131
// Enable or disable the audio equalizer
1132
audioEqualizerAct->setEnabled(pref->use_audio_equalizer);
938
1134
// Disable audio actions if there's not audio track
939
1135
if ((core->mdat.audios.numItems()==0) && (core->mset.external_audio.isEmpty())) {
1136
audioEqualizerAct->setEnabled(false);
940
1137
muteAct->setEnabled(false);
941
1138
decVolumeAct->setEnabled(false);
942
1139
incVolumeAct->setEnabled(false);
943
1140
decAudioDelayAct->setEnabled(false);
944
1141
incAudioDelayAct->setEnabled(false);
1142
audioDelayAct->setEnabled(false);
945
1143
extrastereoAct->setEnabled(false);
946
1144
karaokeAct->setEnabled(false);
947
1145
volnormAct->setEnabled(false);
973
1172
incZoomAct->setEnabled(false);
974
1173
decZoomAct->setEnabled(false);
975
1174
resetZoomAct->setEnabled(false);
1175
autoZoomAct->setEnabled(false);
1176
autoZoom169Act->setEnabled(false);
1177
autoZoom235Act->setEnabled(false);
977
1179
denoiseGroup->setActionsEnabled(false);
978
1180
sizeGroup->setActionsEnabled(false);
979
1181
deinterlaceGroup->setActionsEnabled(false);
980
1182
aspectGroup->setActionsEnabled(false);
981
1183
rotateGroup->setActionsEnabled(false);
1185
screenGroup->setActionsEnabled(false);
1190
screenGroup->setActionsEnabled(pref->vo.startsWith(OVERLAY_VO));
1194
if (!core->mdat.filename.startsWith("dvdnav:")) {
1195
dvdnavUpAct->setEnabled(false);
1196
dvdnavDownAct->setEnabled(false);
1197
dvdnavLeftAct->setEnabled(false);
1198
dvdnavRightAct->setEnabled(false);
1199
dvdnavMenuAct->setEnabled(false);
1200
dvdnavSelectAct->setEnabled(false);
1201
dvdnavPrevAct->setEnabled(false);
1202
dvdnavMouseAct->setEnabled(false);
985
1207
void BaseGui::disableActionsOnStop() {
1037
1259
normalSpeedAct->change( tr("&Normal speed") );
1038
1260
halveSpeedAct->change( tr("&Halve speed") );
1039
1261
doubleSpeedAct->change( tr("&Double speed") );
1040
decSpeedAct->change( tr("Speed &-10%") );
1041
incSpeedAct->change( tr("Speed &+10%") );
1262
decSpeed10Act->change( tr("Speed &-10%") );
1263
incSpeed10Act->change( tr("Speed &+10%") );
1264
decSpeed4Act->change( tr("Speed -&4%") );
1265
incSpeed4Act->change( tr("&Speed +4%") );
1266
decSpeed1Act->change( tr("Speed -&1%") );
1267
incSpeed1Act->change( tr("S&peed +1%") );
1044
1270
fullscreenAct->change( Images::icon("fullscreen"), tr("&Fullscreen") );
1045
1271
compactAct->change( Images::icon("compact"), tr("&Compact mode") );
1046
equalizerAct->change( Images::icon("equalizer"), tr("&Equalizer") );
1272
videoEqualizerAct->change( Images::icon("equalizer"), tr("&Equalizer") );
1047
1273
screenshotAct->change( Images::icon("screenshot"), tr("&Screenshot") );
1048
onTopAct->change( Images::icon("ontop"), tr("S&tay on top") );
1274
videoPreviewAct->change( Images::icon("video_preview"), tr("Pre&view...") );
1049
1275
flipAct->change( Images::icon("flip"), tr("Flip i&mage") );
1276
mirrorAct->change( Images::icon("mirror"), tr("Mirr&or image") );
1051
1278
decZoomAct->change( tr("Zoom &-") );
1052
1279
incZoomAct->change( tr("Zoom &+") );
1053
1280
resetZoomAct->change( tr("&Reset") );
1281
autoZoomAct->change( tr("&Auto zoom") );
1282
autoZoom169Act->change( tr("Zoom for &16:9") );
1283
autoZoom235Act->change( tr("Zoom for &2.35:1") );
1054
1284
moveLeftAct->change( tr("Move &left") );
1055
1285
moveRightAct->change( tr("Move &right") );
1056
1286
moveUpAct->change( tr("Move &up") );
1152
1389
incSaturationAct->change( tr("Inc saturation") );
1153
1390
decGammaAct->change( tr("Dec gamma") );
1154
1391
incGammaAct->change( tr("Inc gamma") );
1392
nextVideoAct->change( tr("Next video") );
1155
1393
nextAudioAct->change( tr("Next audio") );
1156
1394
nextSubtitleAct->change( tr("Next subtitle") );
1157
1395
nextChapterAct->change( tr("Next chapter") );
1158
1396
prevChapterAct->change( tr("Previous chapter") );
1159
1397
doubleSizeAct->change( tr("&Toggle double size") );
1160
1398
resetVideoEqualizerAct->change( tr("Reset video equalizer") );
1399
resetAudioEqualizerAct->change( tr("Reset audio equalizer") );
1161
1400
showContextMenuAct->change( tr("Show context menu") );
1402
nextAspectAct->change( Images::icon("next_aspect"), tr("Next aspect ratio") );
1163
1405
// Action groups
1164
1406
osdNoneAct->change( tr("&Disabled") );
1216
1461
rotate_menu->menuAction()->setText( tr("&Rotate") );
1217
1462
rotate_menu->menuAction()->setIcon( Images::icon("rotate") );
1464
ontop_menu->menuAction()->setText( tr("S&tay on top") );
1465
ontop_menu->menuAction()->setIcon( Images::icon("ontop") );
1468
screen_menu->menuAction()->setText( tr("Scree&n") );
1469
screen_menu->menuAction()->setIcon( Images::icon("screen") );
1220
1473
denoise_menu->menuAction()->setText( tr("De&noise") );
1221
1474
denoise_menu->menuAction()->setIcon( Images::icon("denoise") );
1224
aspectDetectAct->change( tr("&Autodetect") );
1477
aspectDetectAct->change( tr("&Auto") );
1225
1478
aspect43Act->change( "&4:3" );
1226
1479
aspect54Act->change( "&5:4" );
1227
1480
aspect149Act->change( "&14:9" );
1228
1481
aspect169Act->change( "16:&9" );
1229
1482
aspect1610Act->change( "1&6:10" );
1230
1483
aspect235Act->change( "&2.35:1" );
1485
aspect11Act->change( "1&:1" );
1486
aspectNoneAct->change( tr("&Disabled") );
1231
1489
#if !NEW_ASPECT_CODE
1232
1490
aspect43LetterAct->change( tr("4:3 &Letterbox") );
1233
1491
aspect169LetterAct->change( tr("16:9 L&etterbox") );
1252
1510
rotateCounterclockwiseAct->change( tr("Rotate by 90 degrees counterclock&wise") );
1253
1511
rotateCounterclockwiseFlipAct->change( tr("Rotate by 90 degrees counterclockwise and &flip") );
1513
onTopAlwaysAct->change( tr("&Always") );
1514
onTopNeverAct->change( tr("&Never") );
1515
onTopWhilePlayingAct->change( tr("While &playing") );
1516
toggleStayOnTopAct->change( tr("Toggle stay on top") );
1519
screenDefaultAct->change( tr("&Default") );
1256
audiotrack_menu->menuAction()->setText( tr("&Track") );
1523
audiotrack_menu->menuAction()->setText( tr("&Track", "audio") );
1257
1524
audiotrack_menu->menuAction()->setIcon( Images::icon("audio_track") );
1259
1526
audiofilter_menu->menuAction()->setText( tr("&Filters") );
1288
1555
angles_menu->menuAction()->setText( tr("&Angle") );
1289
1556
angles_menu->menuAction()->setIcon( Images::icon("angle") );
1559
dvdnavUpAct->change(Images::icon("dvdnav_up"), tr("DVD menu, move up"));
1560
dvdnavDownAct->change(Images::icon("dvdnav_down"), tr("DVD menu, move down"));
1561
dvdnavLeftAct->change(Images::icon("dvdnav_left"), tr("DVD menu, move left"));
1562
dvdnavRightAct->change(Images::icon("dvdnav_right"), tr("DVD menu, move right"));
1563
dvdnavMenuAct->change(Images::icon("dvdnav_menu"), tr("DVD &menu"));
1564
dvdnavSelectAct->change(Images::icon("dvdnav_select"), tr("DVD menu, select option"));
1565
dvdnavPrevAct->change(Images::icon("dvdnav_prev"), tr("DVD &previous menu"));
1566
dvdnavMouseAct->change(Images::icon("dvdnav_mouse"), tr("DVD menu, mouse click"));
1291
1569
// Menu Options
1292
1570
osd_menu->menuAction()->setText( tr("&OSD") );
1293
1571
osd_menu->menuAction()->setIcon( Images::icon("osd") );
1351
1629
this, SLOT(initializeMenus()) );
1352
1630
connect( core, SIGNAL(widgetsNeedUpdate()),
1353
1631
this, SLOT(updateWidgets()) );
1354
connect( core, SIGNAL(equalizerNeedsUpdate()),
1355
this, SLOT(updateEqualizer()) );
1632
connect( core, SIGNAL(videoEqualizerNeedsUpdate()),
1633
this, SLOT(updateVideoEqualizer()) );
1635
connect( core, SIGNAL(audioEqualizerNeedsUpdate()),
1636
this, SLOT(updateAudioEqualizer()) );
1357
1638
connect( core, SIGNAL(showFrame(int)),
1358
1639
this, SIGNAL(frameChanged(int)) );
1375
1658
connect( core, SIGNAL(mediaLoaded()),
1376
1659
this, SLOT(enableActionsOnPlaying()) );
1660
#if NOTIFY_AUDIO_CHANGES
1661
connect( core, SIGNAL(audioTracksChanged()),
1662
this, SLOT(enableActionsOnPlaying()) );
1377
1664
connect( core, SIGNAL(mediaFinished()),
1378
1665
this, SLOT(disableActionsOnStop()) );
1379
1666
connect( core, SIGNAL(mediaStoppedByUser()),
1380
1667
this, SLOT(disableActionsOnStop()) );
1382
connect( core, SIGNAL(mediaLoaded()),
1383
this, SLOT(newMediaLoaded()) );
1669
connect( core, SIGNAL(mediaStartPlay()),
1670
this, SLOT(newMediaLoaded()), Qt::QueuedConnection );
1384
1671
connect( core, SIGNAL(mediaInfoChanged()),
1385
1672
this, SLOT(updateMediaInfo()) );
1674
connect( core, SIGNAL(mediaStartPlay()),
1675
this, SLOT(checkPendingActionsToRun()), Qt::QueuedConnection );
1676
#if REPORT_OLD_MPLAYER
1677
connect( core, SIGNAL(mediaStartPlay()),
1678
this, SLOT(checkMplayerVersion()), Qt::QueuedConnection );
1387
1680
connect( core, SIGNAL(failedToParseMplayerVersion(QString)),
1388
1681
this, SLOT(askForMplayerVersion(QString)) );
1396
1689
// Hide mplayer window
1397
1690
connect( core, SIGNAL(noVideo()),
1398
1691
this, SLOT(hidePanel()) );
1693
// Log mplayer output
1694
connect( core, SIGNAL(aboutToStartPlaying()),
1695
this, SLOT(clearMplayerLog()) );
1696
connect( core, SIGNAL(logLineAvailable(QString)),
1697
this, SLOT(recordMplayerLog(QString)) );
1699
connect( core, SIGNAL(mediaLoaded()),
1700
this, SLOT(autosaveMplayerLog()) );
1401
1703
void BaseGui::createMplayerWindow() {
1438
1740
void BaseGui::createVideoEqualizer() {
1440
equalizer = new VideoEqualizer(this);
1742
video_equalizer = new VideoEqualizer(this);
1442
connect( equalizer->contrast, SIGNAL(valueChanged(int)),
1744
connect( video_equalizer->contrast, SIGNAL(valueChanged(int)),
1443
1745
core, SLOT(setContrast(int)) );
1444
connect( equalizer->brightness, SIGNAL(valueChanged(int)),
1746
connect( video_equalizer->brightness, SIGNAL(valueChanged(int)),
1445
1747
core, SLOT(setBrightness(int)) );
1446
connect( equalizer->hue, SIGNAL(valueChanged(int)),
1748
connect( video_equalizer->hue, SIGNAL(valueChanged(int)),
1447
1749
core, SLOT(setHue(int)) );
1448
connect( equalizer->saturation, SIGNAL(valueChanged(int)),
1750
connect( video_equalizer->saturation, SIGNAL(valueChanged(int)),
1449
1751
core, SLOT(setSaturation(int)) );
1450
connect( equalizer->gamma, SIGNAL(valueChanged(int)),
1752
connect( video_equalizer->gamma, SIGNAL(valueChanged(int)),
1451
1753
core, SLOT(setGamma(int)) );
1452
connect( equalizer, SIGNAL(visibilityChanged()),
1754
connect( video_equalizer, SIGNAL(visibilityChanged()),
1755
this, SLOT(updateWidgets()) );
1758
void BaseGui::createAudioEqualizer() {
1760
audio_equalizer = new AudioEqualizer(this);
1762
connect( audio_equalizer->eq[0], SIGNAL(valueChanged(int)),
1763
core, SLOT(setAudioEq0(int)) );
1764
connect( audio_equalizer->eq[1], SIGNAL(valueChanged(int)),
1765
core, SLOT(setAudioEq1(int)) );
1766
connect( audio_equalizer->eq[2], SIGNAL(valueChanged(int)),
1767
core, SLOT(setAudioEq2(int)) );
1768
connect( audio_equalizer->eq[3], SIGNAL(valueChanged(int)),
1769
core, SLOT(setAudioEq3(int)) );
1770
connect( audio_equalizer->eq[4], SIGNAL(valueChanged(int)),
1771
core, SLOT(setAudioEq4(int)) );
1772
connect( audio_equalizer->eq[5], SIGNAL(valueChanged(int)),
1773
core, SLOT(setAudioEq5(int)) );
1774
connect( audio_equalizer->eq[6], SIGNAL(valueChanged(int)),
1775
core, SLOT(setAudioEq6(int)) );
1776
connect( audio_equalizer->eq[7], SIGNAL(valueChanged(int)),
1777
core, SLOT(setAudioEq7(int)) );
1778
connect( audio_equalizer->eq[8], SIGNAL(valueChanged(int)),
1779
core, SLOT(setAudioEq8(int)) );
1780
connect( audio_equalizer->eq[9], SIGNAL(valueChanged(int)),
1781
core, SLOT(setAudioEq9(int)) );
1783
connect( audio_equalizer, SIGNAL(applyClicked(AudioEqualizerList)),
1784
core, SLOT(setAudioAudioEqualizerRestart(AudioEqualizerList)) );
1786
connect( audio_equalizer, SIGNAL(visibilityChanged()),
1453
1787
this, SLOT(updateWidgets()) );
1477
1811
void BaseGui::createPanel() {
1478
1812
panel = new QWidget( this );
1479
1813
panel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
1480
panel->setMinimumSize( QSize(0,0) );
1814
panel->setMinimumSize( QSize(1,1) );
1481
1815
panel->setFocusPolicy( Qt::StrongFocus );
1484
1818
panel->setAutoFillBackground(TRUE);
1485
Helper::setBackgroundColor( panel, QColor(0,0,0) );
1819
ColorUtils::setBackgroundColor( panel, QColor(0,0,0) );
1488
1822
void BaseGui::createPreferencesDialog() {
1550
1884
// Speed submenu
1551
1885
speed_menu = new QMenu(this);
1552
1886
speed_menu->addAction(normalSpeedAct);
1887
speed_menu->addSeparator();
1553
1888
speed_menu->addAction(halveSpeedAct);
1554
1889
speed_menu->addAction(doubleSpeedAct);
1555
speed_menu->addAction(decSpeedAct);
1556
speed_menu->addAction(incSpeedAct);
1890
speed_menu->addSeparator();
1891
speed_menu->addAction(decSpeed10Act);
1892
speed_menu->addAction(incSpeed10Act);
1893
speed_menu->addSeparator();
1894
speed_menu->addAction(decSpeed4Act);
1895
speed_menu->addAction(incSpeed4Act);
1896
speed_menu->addSeparator();
1897
speed_menu->addAction(decSpeed1Act);
1898
speed_menu->addAction(incSpeed1Act);
1558
1900
playMenu->addMenu(speed_menu);
1560
1902
playMenu->addAction(repeatAct);
1561
1903
playMenu->addSeparator();
1562
1904
playMenu->addAction(gotoAct);
1905
playMenu->addSeparator();
1906
playMenu->addAction(playPrevAct);
1907
playMenu->addAction(playNextAct);
1910
videotrack_menu = new QMenu(this);
1912
videoMenu->addMenu(videotrack_menu);
1565
1914
videoMenu->addAction(fullscreenAct);
1566
1915
videoMenu->addAction(compactAct);
1919
screen_menu = new QMenu(this);
1920
screen_menu->addActions( screenGroup->actions() );
1921
videoMenu->addMenu(screen_menu);
1568
1924
// Size submenu
1569
1925
videosize_menu = new QMenu(this);
1570
1926
videosize_menu->addActions( sizeGroup->actions() );
1627
1988
videoMenu->addMenu(rotate_menu);
1629
1990
videoMenu->addAction(flipAct);
1991
videoMenu->addAction(mirrorAct);
1630
1992
videoMenu->addSeparator();
1631
videoMenu->addAction(equalizerAct);
1993
videoMenu->addAction(videoEqualizerAct);
1632
1994
videoMenu->addAction(screenshotAct);
1633
videoMenu->addAction(onTopAct);
1997
ontop_menu = new QMenu(this);
1998
ontop_menu->addActions(onTopActionGroup->actions());
2000
videoMenu->addMenu(ontop_menu);
2002
videoMenu->addSeparator();
2003
videoMenu->addAction(videoPreviewAct);
1801
2186
//updateWidgets();
1804
void BaseGui::showEqualizer() {
1805
showEqualizer( !equalizer->isVisible() );
1808
void BaseGui::showEqualizer(bool b) {
1812
// Exit fullscreen, otherwise dialog is not visible
1813
exitFullscreenIfNeeded();
2189
void BaseGui::showVideoEqualizer() {
2190
showVideoEqualizer( !video_equalizer->isVisible() );
2193
void BaseGui::showVideoEqualizer(bool b) {
2195
video_equalizer->hide();
2197
// Exit fullscreen, otherwise dialog is not visible
2198
exitFullscreenIfNeeded();
2199
video_equalizer->show();
2204
void BaseGui::showAudioEqualizer() {
2205
showAudioEqualizer( !audio_equalizer->isVisible() );
2208
void BaseGui::showAudioEqualizer(bool b) {
2210
audio_equalizer->hide();
2212
// Exit fullscreen, otherwise dialog is not visible
2213
exitFullscreenIfNeeded();
2214
audio_equalizer->show();
1816
2216
updateWidgets();
2034
2445
void BaseGui::newMediaLoaded() {
2035
2446
qDebug("BaseGui::newMediaLoaded");
2037
recents->add( core->mdat.filename );
2448
pref->history_recents->addItem( core->mdat.filename );
2038
2449
updateRecents();
2040
2451
// If a VCD, Audio CD or DVD, add items to playlist
2041
if ( (core->mdat.type == TYPE_VCD) || (core->mdat.type == TYPE_DVD) ||
2042
(core->mdat.type == TYPE_AUDIO_CD) )
2452
bool is_disc = ( (core->mdat.type == TYPE_VCD) || (core->mdat.type == TYPE_DVD) || (core->mdat.type == TYPE_AUDIO_CD) );
2454
// Don't add the list of titles if using dvdnav
2455
if ((core->mdat.type == TYPE_DVD) && (core->mdat.filename.startsWith("dvdnav:"))) is_disc = false;
2457
if (pref->auto_add_to_playlist && is_disc)
2044
2459
int first_title = 1;
2045
2460
if (core->mdat.type == TYPE_VCD) first_title = pref->vcd_initial_title;
2047
QString type = "dvd";
2462
QString type = "dvd"; // FIXME: support dvdnav
2048
2463
if (core->mdat.type == TYPE_VCD) type="vcd";
2050
2465
if (core->mdat.type == TYPE_AUDIO_CD) type="cdda";
2071
2487
playlist->clear();
2072
2488
playlist->addCurrentFile();
2491
if ((core->mdat.type == TYPE_FILE) && (pref->auto_add_to_playlist) && (pref->add_to_playlist_consecutive_files)) {
2492
// Look for consecutive files
2493
QStringList files_to_add = Helper::searchForConsecutiveFiles(core->mdat.filename);
2494
if (!files_to_add.empty()) playlist->addFiles(files_to_add);
2498
void BaseGui::clearMplayerLog() {
2499
mplayer_log.clear();
2500
if (mplayer_log_window->isVisible()) mplayer_log_window->clear();
2503
void BaseGui::recordMplayerLog(QString line) {
2504
if (pref->log_mplayer) {
2505
if ( (line.indexOf("A:")==-1) && (line.indexOf("V:")==-1) ) {
2507
mplayer_log.append(line);
2508
if (mplayer_log_window->isVisible()) mplayer_log_window->appendText(line);
2513
void BaseGui::recordSmplayerLog(QString line) {
2514
if (pref->log_smplayer) {
2516
smplayer_log.append(line);
2517
if (smplayer_log_window->isVisible()) smplayer_log_window->appendText(line);
2522
Save the mplayer log to a file, so it can be used by external
2525
void BaseGui::autosaveMplayerLog() {
2526
qDebug("BaseGui::autosaveMplayerLog");
2528
if (pref->autosave_mplayer_log) {
2529
if (!pref->mplayer_log_saveto.isEmpty()) {
2530
QFile file( pref->mplayer_log_saveto );
2531
if ( file.open( QIODevice::WriteOnly ) ) {
2532
QTextStream strm( &file );
2533
strm << mplayer_log;
2076
2540
void BaseGui::showMplayerLog() {
2143
2622
titles_menu->addActions( titleGroup->actions() );
2624
#if GENERIC_CHAPTER_SUPPORT
2625
chapterGroup->clear(true);
2626
if (core->mdat.chapters > 0) {
2627
for (n=0; n < core->mdat.chapters; n++) {
2628
QAction *a = new QAction(chapterGroup);
2629
a->setCheckable(true);
2630
a->setText( QString::number(n+1) );
2631
a->setData( n + Core::firstChapter() );
2634
QAction * a = chapterGroup->addAction( tr("<empty>") );
2635
a->setEnabled(false);
2637
chapters_menu->addActions( chapterGroup->actions() );
2145
2639
// DVD Chapters
2146
2640
chapterGroup->clear(true);
2147
2641
if ( (core->mdat.type == TYPE_DVD) && (core->mset.current_title_id > 0) ) {
2387
2895
incSubStepAct->setEnabled(e);
2390
void BaseGui::updateEqualizer() {
2898
void BaseGui::updateVideoEqualizer() {
2392
equalizer->contrast->setValue( core->mset.contrast );
2393
equalizer->brightness->setValue( core->mset.brightness );
2394
equalizer->hue->setValue( core->mset.hue );
2395
equalizer->saturation->setValue( core->mset.saturation );
2396
equalizer->gamma->setValue( core->mset.gamma );
2900
video_equalizer->contrast->setValue( core->mset.contrast );
2901
video_equalizer->brightness->setValue( core->mset.brightness );
2902
video_equalizer->hue->setValue( core->mset.hue );
2903
video_equalizer->saturation->setValue( core->mset.saturation );
2904
video_equalizer->gamma->setValue( core->mset.gamma );
2907
void BaseGui::updateAudioEqualizer() {
2909
for (int n = 0; n < 10; n++) {
2910
audio_equalizer->eq[n]->setValue( core->mset.audio_equalizer[n].toInt() );
3309
void BaseGui::showAudioDelayDialog() {
3311
int delay = QInputDialog::getInteger(this, tr("SMPlayer - Audio delay"),
3312
tr("Audio delay (in milliseconds):"), core->mset.audio_delay,
3313
-3600000, 3600000, 1, &ok);
3315
core->setAudioDelay(delay);
3319
void BaseGui::showSubDelayDialog() {
3321
int delay = QInputDialog::getInteger(this, tr("SMPlayer - Subtitle delay"),
3322
tr("Subtitle delay (in milliseconds):"), core->mset.sub_delay,
3323
-3600000, 3600000, 1, &ok);
3325
core->setSubDelay(delay);
2776
3329
void BaseGui::exitFullscreen() {
2777
3330
if (pref->fullscreen) {
2778
3331
toggleFullscreen(false);
3542
void BaseGui::checkPendingActionsToRun() {
3543
qDebug("BaseGui::checkPendingActionsToRun");
3546
if (!pending_actions_to_run.isEmpty()) {
3547
actions = pending_actions_to_run;
3548
pending_actions_to_run.clear();
3549
if (!pref->actions_to_run.isEmpty()) {
3550
actions = pref->actions_to_run +" "+ actions;
3553
actions = pref->actions_to_run;
3556
if (!actions.isEmpty()) {
3557
qDebug("BaseGui::checkPendingActionsToRun: actions: '%s'", actions.toUtf8().constData());
3558
runActions(actions);
3562
#if REPORT_OLD_MPLAYER
3563
void BaseGui::checkMplayerVersion() {
3564
qDebug("BaseGui::checkMplayerVersion");
3566
// Qt 4.3.5 is crazy, I can't popup a messagebox here, it calls
3567
// this function once and again when the messagebox is shown
3569
if ( (pref->mplayer_detected_version > 0) && (!MplayerVersion::isMplayerAtLeast(25158)) ) {
3570
QTimer::singleShot(1000, this, SLOT(displayWarningAboutOldMplayer()));
3574
void BaseGui::displayWarningAboutOldMplayer() {
3575
qDebug("BaseGui::displayWarningAboutOldMplayer");
3577
if (!pref->reported_mplayer_is_old) {
3578
QMessageBox::warning(this, tr("Warning - Using old MPlayer"),
3579
tr("The version of MPlayer (%1) installed on your system "
3580
"is obsolete. SMPlayer can't work well with it: some "
3581
"options won't work, subtitle selection may fail...")
3582
.arg(MplayerVersion::toString(pref->mplayer_detected_version)) +
3584
tr("Please, update your MPlayer.") +
3586
tr("(This warning won't be displayed anymore)") );
3588
pref->reported_mplayer_is_old = true;
3591
//statusBar()->showMessage( tr("Using an old MPlayer, please update it"), 10000 );
2982
3595
void BaseGui::dragEnterEvent( QDragEnterEvent *e ) {
2983
3596
qDebug("BaseGui::dragEnterEvent");
3200
3810
QSize video_size(w,h);
3202
//panel->resize(w, h);
3203
resize(w + diff_size.width(), h + diff_size.height());
3205
if ( panel->size() != video_size ) {
3208
qDebug("BaseGui::resizeWindow: temp window size: %d, %d", this->width(), this->height());
3209
qDebug("BaseGui::resizeWindow: temp panel->size: %d, %d",
3210
panel->size().width(),
3211
panel->size().height() );
3213
int diff_width = this->width() - panel->width();
3214
int diff_height = this->height() - panel->height();
3216
int new_width = w + diff_width;
3217
int new_height = h + diff_height;
3219
if ((new_width < w) || (new_height < h)) {
3220
qWarning("BaseGui::resizeWindow: invalid new size: %d, %d. Not resizing", new_width, new_height);
3222
qDebug("BaseGui::resizeWindow: diff: %d, %d", diff_width, diff_height);
3223
resize(new_width, new_height);
3225
diff_size = QSize(diff_width, diff_height );
3812
if (video_size == panel->size()) {
3813
qDebug("BaseGui::resizeWindow: the panel size is already the required size. Doing nothing.");
3817
int diff_width = this->width() - panel->width();
3818
int diff_height = this->height() - panel->height();
3820
int new_width = w + diff_width;
3821
int new_height = h + diff_height;
3824
int minimum_width = minimumSizeHint().width();
3825
if (pref->gui_minimum_width != 0) minimum_width = pref->gui_minimum_width;
3826
if (new_width < minimum_width) {
3827
qDebug("BaseGui::resizeWindow: width is too small, setting width to %d", minimum_width);
3828
new_width = minimum_width;
3832
resize(new_width, new_height);
3229
3834
qDebug("BaseGui::resizeWindow: done: window size: %d, %d", this->width(), this->height());
3230
3835
qDebug("BaseGui::resizeWindow: done: panel->size: %d, %d",
3235
3840
mplayerwindow->size().height() );
3238
void BaseGui::calculateDiff() {
3239
qDebug("BaseGui::calculateDiff: diff_size: %d, %d", diff_size.width(), diff_size.height());
3241
// if (diff_size == QSize(0,0)) {
3242
int diff_width = width() - panel->width();
3243
int diff_height = height() - panel->height();
3245
if ((diff_width < 0) || (diff_height < 0)) {
3246
qWarning("BaseGui::calculateDiff: invalid diff: %d, %d", diff_width, diff_height);
3248
diff_size = QSize(diff_width, diff_height);
3249
qDebug("BaseGui::calculateDiff: diff_size set to: %d, %d", diff_size.width(), diff_size.height());
3256
void BaseGui::resizeWindow(int w, int h) {
3257
qDebug("BaseGui::resizeWindow: %d, %d", w, h);
3259
// If fullscreen, don't resize!
3260
if (pref->fullscreen) return;
3262
if ( (pref->resize_method==Preferences::Never) && (panel->isVisible()) ) {
3266
if (!panel->isVisible()) {
3268
/* #if QT_VERSION >= 0x040301 */
3269
// Work-around for Qt 4.3.1
3287
// Enable compact mode
3288
//compactAct->setEnabled(true);
3291
if (pref->size_factor != 100) {
3292
double zoom = (double) pref->size_factor/100;
3297
int width = size().width() - panel->size().width();
3298
int height = size().height() - panel->size().height();
3303
resize(width,height);
3305
qDebug("width: %d, height: %d", width, height);
3306
qDebug("mplayerwindow->size: %d, %d",
3307
mplayerwindow->size().width(),
3308
mplayerwindow->size().height() );
3310
mplayerwindow->setFocus(); // Needed?
3314
3843
void BaseGui::hidePanel() {
3315
3844
qDebug("BaseGui::hidePanel");
3846
#if ALLOW_TO_HIDE_VIDEO_WINDOW_ON_AUDIO_FILES
3847
if (!pref->hide_video_window_on_audio_files) {
3848
mplayerwindow->showLogo(true);
3317
3853
if (panel->isVisible()) {
3318
3854
// Exit from fullscreen mode
3319
3855
if (pref->fullscreen) { toggleFullscreen(false); update(); }
3408
pref->stay_on_top = b;
3963
ignore_show_hide_events = false;
3966
void BaseGui::changeStayOnTop(int stay_on_top) {
3967
switch (stay_on_top) {
3968
case Preferences::AlwaysOnTop : setStayOnTop(true); break;
3969
case Preferences::NeverOnTop : setStayOnTop(false); break;
3970
case Preferences::WhilePlayingOnTop : setStayOnTop((core->state() == Core::Playing)); break;
3973
pref->stay_on_top = (Preferences::OnTop) stay_on_top;
3410
3974
updateWidgets();
3977
void BaseGui::checkStayOnTop(Core::State state) {
3978
qDebug("BaseGui::checkStayOnTop");
3979
if ((!pref->fullscreen) && (pref->stay_on_top == Preferences::WhilePlayingOnTop)) {
3980
setStayOnTop((state == Core::Playing));
3984
void BaseGui::toggleStayOnTop() {
3985
if (pref->stay_on_top == Preferences::AlwaysOnTop)
3986
changeStayOnTop(Preferences::NeverOnTop);
3988
if (pref->stay_on_top == Preferences::NeverOnTop)
3989
changeStayOnTop(Preferences::AlwaysOnTop);
3414
3992
// Called when a new window (equalizer, preferences..) is opened.
3415
3993
void BaseGui::exitFullscreenIfNeeded() {
3423
4001
void BaseGui::checkMousePos(QPoint p) {
3424
4002
//qDebug("BaseGui::checkMousePos: %d, %d", p.x(), p.y());
3426
if (!pref->fullscreen) return;
4004
bool compact = (pref->floating_display_in_compact_mode && pref->compact_mode);
4006
if (!pref->fullscreen && !compact) return;
3428
4008
#define MARGIN 70
3429
if (p.y() > mplayerwindow->height() - MARGIN) {
4010
int margin = MARGIN + pref->floating_control_margin;
4012
if (p.y() > mplayerwindow->height() - margin) {
3430
4013
//qDebug("BaseGui::checkMousePos: %d, %d", p.x(), p.y());
3431
4014
if (!near_bottom) {
3432
4015
emit cursorNearBottom(p);
3547
4134
void BaseGui::showExitCodeFromMplayer(int exit_code) {
3548
4135
qDebug("BaseGui::showExitCodeFromMplayer: %d", exit_code);
4137
if (!pref->report_mplayer_crashes) {
4138
qDebug("BaseGui::showExitCodeFromMplayer: not displaying error dialog");
3550
4142
if (exit_code != 255 ) {
3551
4143
ErrorDialog d(this);
3552
4144
d.setText(tr("MPlayer has finished unexpectedly.") + " " +
3553
4145
tr("Exit code: %1").arg(exit_code));
3554
d.setLog( core->mplayer_log );
4146
d.setLog( mplayer_log );
3559
4151
void BaseGui::showErrorFromMplayer(QProcess::ProcessError e) {
4152
qDebug("BaseGui::showErrorFromMplayer");
4154
if (!pref->report_mplayer_crashes) {
4155
qDebug("showErrorFromMplayer: not displaying error dialog");
3560
4159
if ((e == QProcess::FailedToStart) || (e == QProcess::Crashed)) {
3561
4160
ErrorDialog d(this);
3562
4161
if (e == QProcess::FailedToStart) {
3566
4165
d.setText(tr("MPlayer has crashed.") + " " +
3567
4166
tr("See the log for more info."));
3569
d.setLog( core->mplayer_log );
4168
d.setLog( mplayer_log );
4174
void BaseGui::showFindSubtitlesDialog() {
4175
qDebug("BaseGui::showFindSubtitlesDialog");
4177
if (!find_subs_dialog) {
4178
find_subs_dialog = new FindSubtitlesWindow(this, Qt::Window | Qt::WindowMinMaxButtonsHint);
4179
find_subs_dialog->setSettings(Global::settings);
4180
find_subs_dialog->setWindowIcon(windowIcon());
4182
connect(find_subs_dialog, SIGNAL(subtitleDownloaded(const QString &)),
4183
core, SLOT(loadSub(const QString &)));
4187
find_subs_dialog->show();
4188
find_subs_dialog->setMovie(core->mdat.filename);
4191
void BaseGui::openUploadSubtitlesPage() {
4192
//QDesktopServices::openUrl( QUrl("http://ds6.ovh.org/hashsubtitles/upload.php") );
4193
//QDesktopServices::openUrl( QUrl("http://www.opensubtitles.com/upload") );
4194
QDesktopServices::openUrl( QUrl("http://www.opensubtitles.org/uploadjava") );
4197
void BaseGui::showVideoPreviewDialog() {
4198
qDebug("BaseGui::showVideoPreviewDialog");
4200
if (video_preview == 0) {
4201
video_preview = new VideoPreview( pref->mplayer_bin, this );
4202
video_preview->setSettings(Global::settings);
4205
if (!core->mdat.filename.isEmpty()) {
4206
video_preview->setVideoFile(core->mdat.filename);
4209
if (core->mdat.type==TYPE_DVD) {
4210
QString file = core->mdat.filename;
4211
DiscData disc_data = DiscName::split(file);
4212
QString dvd_folder = disc_data.device;
4213
if (dvd_folder.isEmpty()) dvd_folder = pref->dvd_device;
4214
int dvd_title = disc_data.title;
4215
file = disc_data.protocol + "://" + QString::number(dvd_title);
4217
video_preview->setVideoFile(file);
4218
video_preview->setDVDDevice(dvd_folder);
4220
video_preview->setDVDDevice("");
4224
video_preview->setMplayerPath(pref->mplayer_bin);
4226
if ( (video_preview->showConfigDialog(this)) && (video_preview->createThumbnails()) ) {
4227
video_preview->show();
4228
video_preview->adjustWindowSize();
3574
4232
// Language change stuff
3575
4233
void BaseGui::changeEvent(QEvent *e) {
3576
4234
if (e->type() == QEvent::LanguageChange) {
3577
4235
retranslateStrings();
3579
QWidget::changeEvent(e);
4237
QMainWindow::changeEvent(e);