Changeset 140 for smplayer/vendor/current/src/basegui.cpp
- Timestamp:
- May 23, 2013, 5:06:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/basegui.cpp
r137 r140 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 2Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 38 38 #include <QDesktopServices> 39 39 #include <QInputDialog> 40 #include <QClipboard> 40 41 41 42 #include <cmath> … … 56 57 #include "filepropertiesdialog.h" 57 58 #include "eqslider.h" 58 #include "videoequalizer .h"59 #include "videoequalizer2.h" 59 60 #include "audioequalizer.h" 60 61 #include "inputdvddirectory.h" … … 98 99 99 100 #include "extensions.h" 101 #include "version.h" 100 102 101 103 #ifdef Q_OS_WIN … … 103 105 #include <QSysInfo> 104 106 #endif 107 108 #include "updatechecker.h" 105 109 106 110 using namespace Global; … … 193 197 194 198 initializeGui(); 199 200 #ifdef UPDATE_CHECKER 201 update_checker = new UpdateChecker(this, Global::settings); 202 connect(update_checker, SIGNAL(newVersionFound(QString)), 203 this, SLOT(reportNewVersionAvailable(QString))); 204 #endif 205 206 #ifdef TEST_UPDATE 207 QTimer::singleShot(2000, this, SLOT(testUpdate())); 208 #endif 195 209 } 196 210 … … 733 747 734 748 // Menu Help 749 showFirstStepsAct = new MyAction( this, "first_steps" ); 750 connect( showFirstStepsAct, SIGNAL(triggered()), 751 this, SLOT(helpFirstSteps()) ); 752 735 753 showFAQAct = new MyAction( this, "faq" ); 736 754 connect( showFAQAct, SIGNAL(triggered()), … … 756 774 connect( aboutThisAct, SIGNAL(triggered()), 757 775 this, SLOT(helpAbout()) ); 776 777 facebookAct = new MyAction (this, "facebook"); 778 twitterAct = new MyAction (this, "twitter"); 779 gmailAct = new MyAction (this, "gmail"); 780 hotmailAct = new MyAction (this, "hotmail"); 781 yahooAct = new MyAction (this, "yahoo"); 782 783 connect( facebookAct, SIGNAL(triggered()), 784 this, SLOT(shareSMPlayer()) ); 785 connect( twitterAct, SIGNAL(triggered()), 786 this, SLOT(shareSMPlayer()) ); 787 connect( gmailAct, SIGNAL(triggered()), 788 this, SLOT(shareSMPlayer()) ); 789 connect( hotmailAct, SIGNAL(triggered()), 790 this, SLOT(shareSMPlayer()) ); 791 connect( yahooAct, SIGNAL(triggered()), 792 this, SLOT(shareSMPlayer()) ); 793 758 794 759 795 // Playlist … … 867 903 868 904 doubleSizeAct = new MyAction( Qt::CTRL | Qt::Key_D, this, "toggle_double_size"); 869 connect( doubleSizeAct, SIGNAL(triggered()), core, SLOT(toggleDoubleSize()) );905 connect( doubleSizeAct, SIGNAL(triggered()), this, SLOT(toggleDoubleSize()) ); 870 906 871 907 resetVideoEqualizerAct = new MyAction( this, "reset_video_equalizer"); 872 connect( resetVideoEqualizerAct, SIGNAL(triggered()), video_equalizer , SLOT(reset()) );908 connect( resetVideoEqualizerAct, SIGNAL(triggered()), video_equalizer2, SLOT(reset()) ); 873 909 874 910 resetAudioEqualizerAct = new MyAction( this, "reset_audio_equalizer"); … … 931 967 size100->setShortcut( Qt::CTRL | Qt::Key_1 ); 932 968 size200->setShortcut( Qt::CTRL | Qt::Key_2 ); 933 connect( sizeGroup, SIGNAL(activated(int)), core, SLOT(changeSize(int)) );969 connect( sizeGroup, SIGNAL(activated(int)), this, SLOT(changeSizeFactor(int)) ); 934 970 // Make all not checkable 935 971 QList <QAction *> size_list = sizeGroup->actions(); … … 965 1001 leftChannelAct = new MyActionGroupItem(this, stereoGroup, "left_channel", MediaSettings::Left); 966 1002 rightChannelAct = new MyActionGroupItem(this, stereoGroup, "right_channel", MediaSettings::Right); 1003 monoAct = new MyActionGroupItem(this, stereoGroup, "mono", MediaSettings::Mono); 1004 reverseAct = new MyActionGroupItem(this, stereoGroup, "reverse_channels", MediaSettings::Reverse); 967 1005 connect( stereoGroup, SIGNAL(activated(int)), 968 1006 core, SLOT(setStereoMode(int)) ); … … 1065 1103 connect( ccGroup, SIGNAL(activated(int)), 1066 1104 core, SLOT(changeClosedCaptionChannel(int)) ); 1105 1106 subFPSGroup = new MyActionGroup(this); 1107 subFPSNoneAct = new MyActionGroupItem(this, subFPSGroup, "sub_fps_none", MediaSettings::SFPS_None); 1108 /* subFPS23Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_23", MediaSettings::SFPS_23); */ 1109 subFPS23976Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_23976", MediaSettings::SFPS_23976); 1110 subFPS24Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_24", MediaSettings::SFPS_24); 1111 subFPS25Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_25", MediaSettings::SFPS_25); 1112 subFPS29970Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_29970", MediaSettings::SFPS_29970); 1113 subFPS30Act = new MyActionGroupItem(this, subFPSGroup, "sub_fps_30", MediaSettings::SFPS_30); 1114 connect( subFPSGroup, SIGNAL(activated(int)), 1115 core, SLOT(changeExternalSubFPS(int)) ); 1067 1116 1068 1117 // Titles … … 1540 1589 ccChannel4Act->change( "&4" ); 1541 1590 1591 subFPSNoneAct->change( tr("&Default", "subfps menu") ); 1592 /* subFPS23Act->change( "2&3" ); */ 1593 subFPS23976Act->change( "23.9&76" ); 1594 subFPS24Act->change( "2&4" ); 1595 subFPS25Act->change( "2&5" ); 1596 subFPS29970Act->change( "29.&970" ); 1597 subFPS30Act->change( "3&0" ); 1598 1542 1599 // Menu Options 1543 1600 showPlaylistAct->change( Images::icon("playlist"), tr("&Playlist") ); 1544 1601 showPropertiesAct->change( Images::icon("info"), tr("View &info and properties...") ); 1545 1602 showPreferencesAct->change( Images::icon("prefs"), tr("P&references") ); 1546 showTubeBrowserAct->change( Images::icon("tubebrowser"), tr("&YouTube browser") );1603 showTubeBrowserAct->change( Images::icon("tubebrowser"), tr("&YouTube%1 browser").arg(QChar(0x2122)) ); 1547 1604 1548 1605 // Submenu Logs … … 1555 1612 1556 1613 // Menu Help 1614 showFirstStepsAct->change( Images::icon("guide"), tr("First Steps &Guide") ); 1557 1615 showFAQAct->change( Images::icon("faq"), tr("&FAQ") ); 1558 1616 showCLOptionsAct->change( Images::icon("cl_help"), tr("&Command line options") ); … … 1561 1619 aboutQtAct->change( QPixmap(":/icons-png/qt.png"), tr("About &Qt") ); 1562 1620 aboutThisAct->change( Images::icon("logo_small"), tr("About &SMPlayer") ); 1621 1622 facebookAct->change("&Facebook"); 1623 twitterAct->change("&Twitter"); 1624 gmailAct->change("&Gmail"); 1625 hotmailAct->change("&Hotmail"); 1626 yahooAct->change("&Yahoo!"); 1627 1563 1628 1564 1629 // Playlist … … 1769 1834 leftChannelAct->change( tr("&Left channel") ); 1770 1835 rightChannelAct->change( tr("&Right channel") ); 1836 monoAct->change( tr("&Mono") ); 1837 reverseAct->change( tr("Re&verse") ); 1771 1838 1772 1839 // Menu Subtitle … … 1776 1843 closed_captions_menu->menuAction()->setText( tr("&Closed captions") ); 1777 1844 closed_captions_menu->menuAction()->setIcon( Images::icon("closed_caption") ); 1845 1846 subfps_menu->menuAction()->setText( tr("F&rames per second") ); 1847 subfps_menu->menuAction()->setIcon( Images::icon("subfps") ); 1778 1848 1779 1849 // Menu Browse … … 1808 1878 osd_menu->menuAction()->setIcon( Images::icon("osd") ); 1809 1879 1880 share_menu->menuAction()->setText( tr("S&hare SMPlayer with your friends") ); 1881 share_menu->menuAction()->setIcon( Images::icon("share") ); 1882 1810 1883 #if defined(LOG_MPLAYER) || defined(LOG_SMPLAYER) 1811 1884 logs_menu->menuAction()->setText( tr("&View logs") ); … … 1897 1970 1898 1971 connect( core, SIGNAL(mediaStartPlay()), 1899 this, SLOT(enterFullscreenOnPlay()) );1972 this, SLOT(enterFullscreenOnPlay()), Qt::QueuedConnection ); 1900 1973 connect( core, SIGNAL(mediaStoppedByUser()), 1901 1974 this, SLOT(exitFullscreenOnStop()) ); … … 2000 2073 connect( mplayerwindow, SIGNAL(mouseMoved(QPoint)), 2001 2074 this, SLOT(checkMousePos(QPoint)) ); 2002 connect( mplayerwindow, SIGNAL(mouseMovedDiff(QPoint)), 2003 this, SLOT(moveWindow(QPoint))); 2075 2076 if (pref->move_when_dragging) { 2077 connect( mplayerwindow, SIGNAL(mouseMovedDiff(QPoint)), 2078 this, SLOT(moveWindow(QPoint))); 2079 } 2004 2080 } 2005 2081 2006 2082 void BaseGui::createVideoEqualizer() { 2007 2083 // Equalizer 2008 video_equalizer = new VideoEqualizer(this); 2009 2010 connect( video_equalizer->contrast, SIGNAL(valueChanged(int)), 2084 video_equalizer2 = new VideoEqualizer2(this); 2085 connect( video_equalizer2, SIGNAL(contrastChanged(int)), 2011 2086 core, SLOT(setContrast(int)) ); 2012 connect( video_equalizer ->brightness, SIGNAL(valueChanged(int)),2087 connect( video_equalizer2, SIGNAL(brightnessChanged(int)), 2013 2088 core, SLOT(setBrightness(int)) ); 2014 connect( video_equalizer ->hue, SIGNAL(valueChanged(int)),2089 connect( video_equalizer2, SIGNAL(hueChanged(int)), 2015 2090 core, SLOT(setHue(int)) ); 2016 connect( video_equalizer ->saturation, SIGNAL(valueChanged(int)),2091 connect( video_equalizer2, SIGNAL(saturationChanged(int)), 2017 2092 core, SLOT(setSaturation(int)) ); 2018 connect( video_equalizer ->gamma, SIGNAL(valueChanged(int)),2093 connect( video_equalizer2, SIGNAL(gammaChanged(int)), 2019 2094 core, SLOT(setGamma(int)) ); 2020 connect( video_equalizer, SIGNAL(visibilityChanged()), 2095 2096 connect( video_equalizer2, SIGNAL(visibilityChanged()), 2021 2097 this, SLOT(updateWidgets()) ); 2098 connect( video_equalizer2, SIGNAL(requestToChangeDefaultValues()), 2099 this, SLOT(setDefaultValuesFromVideoEqualizer()) ); 2100 connect( video_equalizer2, SIGNAL(bySoftwareChanged(bool)), 2101 this, SLOT(changeVideoEqualizerBySoftware(bool)) ); 2022 2102 } 2023 2103 … … 2368 2448 2369 2449 subtitlesMenu->addMenu(subtitlestrack_menu); 2450 subtitlesMenu->addSeparator(); 2370 2451 2371 2452 subtitlesMenu->addAction(loadSubsAct); 2372 2453 subtitlesMenu->addAction(unloadSubsAct); 2454 2455 subfps_menu = new QMenu(this); 2456 subfps_menu->menuAction()->setObjectName("subfps_menu"); 2457 subfps_menu->addAction( subFPSNoneAct ); 2458 /* subfps_menu->addAction( subFPS23Act ); */ 2459 subfps_menu->addAction( subFPS23976Act ); 2460 subfps_menu->addAction( subFPS24Act ); 2461 subfps_menu->addAction( subFPS25Act ); 2462 subfps_menu->addAction( subFPS29970Act ); 2463 subfps_menu->addAction( subFPS30Act ); 2464 subtitlesMenu->addMenu(subfps_menu); 2373 2465 subtitlesMenu->addSeparator(); 2374 2466 … … 2445 2537 optionsMenu->addAction(showPropertiesAct); 2446 2538 optionsMenu->addAction(showPlaylistAct); 2539 #if 0 2447 2540 // Check if the smplayer youtube browser is installed 2448 2541 { … … 2458 2551 } 2459 2552 } 2553 #else 2554 optionsMenu->addAction(showTubeBrowserAct); 2555 #endif 2460 2556 2461 2557 // OSD submenu … … 2487 2583 2488 2584 // HELP MENU 2585 // Share submenu 2586 share_menu = new QMenu(this); 2587 share_menu->addAction(facebookAct); 2588 share_menu->addAction(twitterAct); 2589 share_menu->addAction(gmailAct); 2590 share_menu->addAction(hotmailAct); 2591 share_menu->addAction(yahooAct); 2592 2593 helpMenu->addMenu(share_menu); 2594 helpMenu->addSeparator(); 2595 helpMenu->addAction(showFirstStepsAct); 2489 2596 helpMenu->addAction(showFAQAct); 2490 2597 helpMenu->addAction(showCLOptionsAct); … … 2558 2665 2559 2666 void BaseGui::showVideoEqualizer() { 2560 showVideoEqualizer( !video_equalizer ->isVisible() );2667 showVideoEqualizer( !video_equalizer2->isVisible() ); 2561 2668 } 2562 2669 2563 2670 void BaseGui::showVideoEqualizer(bool b) { 2564 2671 if (!b) { 2565 video_equalizer ->hide();2672 video_equalizer2->hide(); 2566 2673 } else { 2567 2674 // Exit fullscreen, otherwise dialog is not visible 2568 2675 exitFullscreenIfNeeded(); 2569 video_equalizer ->show();2676 video_equalizer2->show(); 2570 2677 } 2571 2678 updateWidgets(); … … 2647 2754 changeStyleSheet(pref->iconset); 2648 2755 #endif 2756 } 2757 2758 if (pref->move_when_dragging) { 2759 connect( mplayerwindow, SIGNAL(mouseMovedDiff(QPoint)), this, SLOT(moveWindow(QPoint))); 2760 } else { 2761 disconnect( mplayerwindow, SIGNAL(mouseMovedDiff(QPoint)), this, SLOT(moveWindow(QPoint))); 2649 2762 } 2650 2763 … … 2973 3086 // Audio 2974 3087 audioTrackGroup->clear(true); 3088 // If using an external audio file, show the file in the menu, but disabled. 3089 if (!core->mset.external_audio.isEmpty()) { 3090 QAction * a = audioTrackGroup->addAction( QFileInfo(core->mset.external_audio).fileName() ); 3091 a->setEnabled(false); 3092 a->setCheckable(true); 3093 a->setChecked(true); 3094 } 3095 else 2975 3096 if (core->mdat.audios.numItems()==0) { 2976 3097 QAction * a = audioTrackGroup->addAction( tr("<empty>") ); … … 3121 3242 3122 3243 void BaseGui::clearRecentsList() { 3123 // Delete items in menu 3124 pref->history_recents->clear(); 3125 updateRecents(); 3244 int ret = QMessageBox::question(this, tr("Confirm deletion - SMPlayer"), 3245 tr("Delete the list of recent files?"), 3246 QMessageBox::Cancel, QMessageBox::Ok); 3247 3248 if (ret == QMessageBox::Ok) { 3249 // Delete items in menu 3250 pref->history_recents->clear(); 3251 updateRecents(); 3252 } 3126 3253 } 3127 3254 … … 3135 3262 unloadSubsAct->setEnabled( !core->mset.external_subtitles.isEmpty() ); 3136 3263 3264 subFPSGroup->setEnabled( !core->mset.external_subtitles.isEmpty() ); 3265 3137 3266 // Closed caption menu 3138 3267 ccGroup->setChecked( core->mset.closed_caption_channel ); 3139 3268 3269 // Subfps menu 3270 subFPSGroup->setChecked( core->mset.external_subtitles_fps ); 3271 3140 3272 // Audio menu 3141 3273 audioTrackGroup->setChecked( core->mset.current_audio_id ); … … 3252 3384 3253 3385 // Video equalizer 3254 videoEqualizerAct->setChecked( video_equalizer->isVisible() ); 3386 videoEqualizerAct->setChecked( video_equalizer2->isVisible() ); 3387 video_equalizer2->setBySoftware( pref->use_soft_video_eq ); 3255 3388 3256 3389 // Audio equalizer … … 3306 3439 void BaseGui::updateVideoEqualizer() { 3307 3440 // Equalizer 3308 video_equalizer ->contrast->setValue( core->mset.contrast );3309 video_equalizer ->brightness->setValue( core->mset.brightness );3310 video_equalizer ->hue->setValue( core->mset.hue );3311 video_equalizer ->saturation->setValue( core->mset.saturation );3312 video_equalizer ->gamma->setValue( core->mset.gamma );3441 video_equalizer2->setContrast( core->mset.contrast ); 3442 video_equalizer2->setBrightness( core->mset.brightness ); 3443 video_equalizer2->setHue( core->mset.hue ); 3444 video_equalizer2->setSaturation( core->mset.saturation ); 3445 video_equalizer2->setGamma( core->mset.gamma ); 3313 3446 } 3314 3447 … … 3317 3450 for (int n = 0; n < 10; n++) { 3318 3451 audio_equalizer->eq[n]->setValue( core->mset.audio_equalizer[n].toInt() ); 3452 } 3453 } 3454 3455 void BaseGui::setDefaultValuesFromVideoEqualizer() { 3456 qDebug("BaseGui::setDefaultValuesFromVideoEqualizer"); 3457 3458 pref->initial_contrast = video_equalizer2->contrast(); 3459 pref->initial_brightness = video_equalizer2->brightness(); 3460 pref->initial_hue = video_equalizer2->hue(); 3461 pref->initial_saturation = video_equalizer2->saturation(); 3462 pref->initial_gamma = video_equalizer2->gamma(); 3463 3464 QMessageBox::information(this, tr("Information"), 3465 tr("The current values have been stored to be " 3466 "used as default.") ); 3467 } 3468 3469 void BaseGui::changeVideoEqualizerBySoftware(bool b) { 3470 qDebug("BaseGui::changeVideoEqualizerBySoftware: %d", b); 3471 3472 if (b != pref->use_soft_video_eq) { 3473 pref->use_soft_video_eq = b; 3474 core->restart(); 3319 3475 } 3320 3476 } … … 3442 3598 3443 3599 InputURL d(this); 3600 3601 // Get url from clipboard 3602 QString clipboard_text = QApplication::clipboard()->text(); 3603 if ((!clipboard_text.isEmpty()) && (clipboard_text.contains("://")) /*&& (QUrl(clipboard_text).isValid())*/) { 3604 d.setURL(clipboard_text); 3605 } 3444 3606 3445 3607 for (int n=0; n < pref->history_urls->count(); n++) { … … 3680 3842 } 3681 3843 3844 void BaseGui::helpFirstSteps() { 3845 QDesktopServices::openUrl(QString("http://smplayer.sourceforge.net/first-steps.php?version=%1").arg(smplayerVersion())); 3846 } 3847 3682 3848 void BaseGui::helpFAQ() { 3683 Q Url url = QUrl::fromLocalFile(Paths::doc("faq.html", pref->language));3684 qDebug("BaseGui::helpFAQ: file to open %s", url.toString().toUtf8().data());3685 QDesktopServices::openUrl( url);3849 QString url = "http://smplayer.sourceforge.net/faq.php"; 3850 /* if (!pref->language.isEmpty()) url += QString("?tr_lang=%1").arg(pref->language); */ 3851 QDesktopServices::openUrl( QUrl(url) ); 3686 3852 } 3687 3853 … … 3696 3862 3697 3863 void BaseGui::helpCheckUpdates() { 3698 QString url = "http://smplayer.sourceforge.net/ latest.php";3699 if (!pref->language.isEmpty()) url += QString("?tr_lang=%1").arg(pref->language);3864 QString url = "http://smplayer.sourceforge.net/changes.php"; 3865 /* if (!pref->language.isEmpty()) url += QString("?tr_lang=%1").arg(pref->language); */ 3700 3866 QDesktopServices::openUrl( QUrl(url) ); 3701 3867 } … … 3712 3878 void BaseGui::helpAboutQt() { 3713 3879 QMessageBox::aboutQt(this, tr("About Qt") ); 3880 } 3881 3882 void BaseGui::shareSMPlayer() { 3883 QString text = QString("SMPlayer - Free Media Player with built-in codecs that can play and download Youtube videos").replace(" ","+"); 3884 QString url = "http://smplayer.sourceforge.net"; 3885 3886 if (sender() == twitterAct) { 3887 QDesktopServices::openUrl(QUrl("http://twitter.com/intent/tweet?text=" + text + "&url=" + url + "/&via=smplayer_dev")); 3888 } 3889 else 3890 if (sender() == gmailAct) { 3891 QDesktopServices::openUrl(QUrl("https://mail.google.com/mail/?view=cm&fs=1&to&su=" + text + "&body=" + url + "&ui=2&tf=1&shva=1")); 3892 } 3893 else 3894 if (sender() == yahooAct) { 3895 QDesktopServices::openUrl(QUrl("http://compose.mail.yahoo.com/?To=&Subject=" + text + "&body=" + url)); 3896 } 3897 else 3898 if (sender() == hotmailAct) { 3899 QDesktopServices::openUrl(QUrl("http://www.hotmail.msn.com/secure/start?action=compose&to=&subject=" + text + "&body=" + url)); 3900 } 3901 else 3902 if (sender() == facebookAct) { 3903 QDesktopServices::openUrl(QUrl("http://www.facebook.com/sharer.php?u=" + url + "&t=" + text)); 3904 } 3714 3905 } 3715 3906 … … 4019 4210 //else 4020 4211 //statusBar()->showMessage( tr("Using an old MPlayer, please update it"), 10000 ); 4212 } 4213 #endif 4214 4215 #ifdef UPDATE_CHECKER 4216 void BaseGui::reportNewVersionAvailable(QString new_version) { 4217 QMessageBox::StandardButton button = QMessageBox::information(this, tr("New version available"), 4218 tr("A new version of SMPlayer is available.") + "<br><br>" + 4219 tr("Installed version: %1").arg(stableVersion()) + "<br>" + 4220 tr("Available version: %1").arg(new_version) + "<br><br>" + 4221 tr("Would you like to know more about this new version?"), 4222 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); 4223 4224 if (button == QMessageBox::Yes) { 4225 QDesktopServices::openUrl(QUrl("http://smplayer.sourceforge.net/changes.php")); 4226 } 4227 4228 update_checker->saveVersion(new_version); 4229 } 4230 #endif 4231 4232 #ifdef TEST_UPDATE 4233 void BaseGui::testUpdate() { 4234 qDebug("BaseGui::testUpdate"); 4235 QSettings * set = Global::settings; 4236 set->beginGroup("smplayer"); 4237 QString version = set->value("stable_version", "").toString(); 4238 bool check_for_new_version = set->value("check_for_new_version", true).toBool(); 4239 set->setValue("stable_version", stableVersion()); 4240 set->setValue("check_for_new_version", check_for_new_version); 4241 set->endGroup(); 4242 4243 if ( (check_for_new_version) && (version != stableVersion()) ) { 4244 // Running a new version 4245 qDebug("BaseGui::testUpdate: running a new version: %s", stableVersion().toUtf8().constData()); 4246 QString os = "other"; 4247 #ifdef Q_OS_WIN 4248 os = "win"; 4249 #endif 4250 #ifdef Q_OS_LINUX 4251 os = "linux"; 4252 #endif 4253 QDesktopServices::openUrl(QString("http://smplayer.sourceforge.net/thank-you.php?version=%1&so=%2").arg(smplayerVersion()).arg(os)); 4254 } 4021 4255 } 4022 4256 #endif … … 4223 4457 } 4224 4458 4459 void BaseGui::changeSizeFactor(int factor) { 4460 // If fullscreen, don't resize! 4461 if (pref->fullscreen) return; 4462 4463 if (!pref->use_mplayer_window) { 4464 pref->size_factor = factor; 4465 resizeMainWindow(core->mset.win_width, core->mset.win_height); 4466 } 4467 } 4468 4469 void BaseGui::toggleDoubleSize() { 4470 if (pref->size_factor != 100) changeSizeFactor(100); else changeSizeFactor(200); 4471 } 4472 4225 4473 void BaseGui::resizeWindow(int w, int h) { 4226 4474 qDebug("BaseGui::resizeWindow: %d, %d", w, h); … … 4240 4488 } 4241 4489 4490 resizeMainWindow(w, h); 4491 } 4492 4493 void BaseGui::resizeMainWindow(int w, int h) { 4242 4494 if (pref->size_factor != 100) { 4243 4495 w = w * pref->size_factor / 100; … … 4684 4936 qDebug("BaseGui::showTubeBrowser: '%s'", exec.toUtf8().constData()); 4685 4937 if (!QProcess::startDetached(exec, QStringList())) { 4686 QMessageBox::warning(this, tr("An error happened - SMPlayer"), tr("The YouTube Browser couldn't be launched")); 4938 QMessageBox::warning(this, "SMPlayer", 4939 tr("The YouTube Browser couldn't be launched.") +"<br>"+ 4940 tr("Be sure %1 is installed.").arg("SMTube")); 4687 4941 } 4688 4942 }
Note:
See TracChangeset
for help on using the changeset viewer.