Changeset 186 for smplayer/vendor/current/src/basegui.cpp
- Timestamp:
- Jan 24, 2017, 12:24:46 PM (9 years ago)
- File:
-
- 1 edited
-
smplayer/vendor/current/src/basegui.cpp (modified) (35 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/basegui.cpp
r179 r186 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 6Ricardo Villalba <[email protected]>2 Copyright (C) 2006-201 Ricardo Villalba <[email protected]> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 42 42 #include <QDesktopWidget> 43 43 44 #include < cmath>44 #include <h> 45 45 46 46 #include "mplayerwindow.h" … … 261 261 #endif 262 262 263 #if defined(SHARE_ACTIONS) && !defined(SHARE_WIDGET)263 #if 264 264 QTimer::singleShot(1000, this, SLOT(checkReminder())); 265 265 #endif … … 907 907 this, SLOT(helpShowConfig()) ); 908 908 909 #ifdef SHARE_ACTIONS910 909 donateAct = new MyAction( this, "donate" ); 911 910 connect( donateAct, SIGNAL(triggered()), 912 911 this, SLOT(helpDonate()) ); 913 #endif914 912 915 913 aboutThisAct = new MyAction( this, "about_smplayer" ); … … 1068 1066 core, SLOT(nextWheelFunction()) ); 1069 1067 1070 showFilenameAct = new MyAction(Qt::SHIFT | Qt::Key_I, this, "show_ filename");1068 showFilenameAct = new MyAction(Qt::SHIFT | Qt::Key_I, this, "show_"); 1071 1069 connect( showFilenameAct, SIGNAL(triggered()), core, SLOT(showFilenameOnOSD()) ); 1072 1070 … … 1482 1480 1483 1481 // Screenshot option 1482 1484 1483 bool screenshots_enabled = ( (pref->use_screenshot) && 1485 1484 (!pref->screenshot_directory.isEmpty()) && … … 1488 1487 screenshotAct->setEnabled( screenshots_enabled ); 1489 1488 screenshotsAct->setEnabled( screenshots_enabled ); 1489 1490 1490 1491 1491 #ifdef CAPTURE_STREAM … … 1568 1568 // Disable video filters if using vdpau 1569 1569 if ((pref->vdpau.disable_video_filters) && (pref->vo.startsWith("vdpau"))) { 1570 1570 1571 screenshotAct->setEnabled(false); 1571 1572 screenshotsAct->setEnabled(false); 1573 1572 1574 flipAct->setEnabled(false); 1573 1575 mirrorAct->setEnabled(false); … … 1844 1846 #ifdef SHARE_ACTIONS 1845 1847 donateAct->change( Images::icon("donate"), tr("&Donate / Share with your friends") ); 1848 1849 1846 1850 #endif 1847 1851 aboutThisAct->change( Images::icon("logo"), tr("About &SMPlayer") ); … … 1899 1903 nextWheelFunctionAct->change( Images::icon("next_wheel_function"), tr("Next wheel function") ); 1900 1904 1901 showFilenameAct->change( tr("Show filenameon OSD") );1905 showFilenameAct->change( tr("Show on OSD") ); 1902 1906 showTimeAct->change( tr("Show playback time on OSD") ); 1907 1903 1908 toggleDeinterlaceAct->change( tr("Toggle deinterlacing") ); 1904 1909 … … 2320 2325 sharewidget = new ShareWidget(Global::settings, mplayerwindow); 2321 2326 mplayerwindow->setCornerWidget(sharewidget); 2322 #ifdef SHARE_ACTIONS2327 #ifdef SHARE_ACTIONS 2323 2328 connect(sharewidget, SIGNAL(supportClicked()), this, SLOT(helpDonate())); 2324 #endif2329 #endif 2325 2330 #endif 2326 2331 … … 2434 2439 core, SLOT(open(const QString &, int))); 2435 2440 2441 2442 2443 2436 2444 connect(playlist, SIGNAL(requestToAddCurrentFile()), this, SLOT(addToPlaylistCurrentFile())); 2437 2445 2438 if (playlist->automaticallyPlayNext()) { 2439 connect( core, SIGNAL(mediaFinished()), playlist, SLOT(playNext()), Qt::QueuedConnection ); 2440 } 2446 connect( core, SIGNAL(mediaFinished()), playlist, SLOT(playNextAuto()), Qt::QueuedConnection ); 2447 2441 2448 connect( core, SIGNAL(mplayerFailed(QProcess::ProcessError)), playlist, SLOT(playerFailed(QProcess::ProcessError)) ); 2442 2449 connect( core, SIGNAL(mplayerFinishedWithError(int)), playlist, SLOT(playerFinishedWithError(int)) ); … … 2696 2703 osd_menu->menuAction()->setObjectName("osd_menu"); 2697 2704 osd_menu->addActions(osdGroup->actions()); 2705 2706 2698 2707 osd_menu->addSeparator(); 2699 2708 osd_menu->addAction(decOSDScaleAct); … … 2985 2994 helpMenu->addSeparator(); 2986 2995 } 2987 #ifdef SHARE_ACTIONS2988 2996 helpMenu->addAction(donateAct); 2989 2997 helpMenu->addSeparator(); 2990 #endif2991 2998 helpMenu->addAction(aboutThisAct); 2992 2999 … … 3107 3114 pl->setSavePlaylistOnExit(playlist->savePlaylistOnExit()); 3108 3115 pl->setPlayFilesFromStart(playlist->playFilesFromStart()); 3116 3117 3109 3118 pl->setIgnorePlayerErrors(playlist->ignorePlayerErrors()); 3119 3120 3110 3121 3111 3122 pref_dialog->show(); … … 3117 3128 3118 3129 bool need_update_language = false; 3130 3119 3131 3120 3132 PlayerID::Player old_player_type = PlayerID::player(pref->mplayer_bin); … … 3124 3136 // Setup proxy 3125 3137 setupNetworkProxy(); 3126 3127 // Change application font3128 if (!pref->default_font.isEmpty()) {3129 QFont f;3130 f.fromString( pref->default_font );3131 if (QApplication::font() != f) {3132 qDebug("BaseGui::applyNewPreferences: setting new font: %s", pref->default_font.toLatin1().constData());3133 QApplication::setFont(f);3134 }3135 }3136 3138 3137 3139 PrefGeneral *_general = pref_dialog->mod_general(); … … 3150 3152 // Stylesheet 3151 3153 #if ALLOW_CHANGE_STYLESHEET 3152 if (!_interface->guiChanged()) applyStyles();3154 if (!_interface->guiChanged()) ; 3153 3155 #endif 3154 3156 } 3157 3158 3155 3159 3156 3160 #ifndef MOUSE_GESTURES … … 3199 3203 playlist->setSavePlaylistOnExit(pl->savePlaylistOnExit()); 3200 3204 playlist->setPlayFilesFromStart(pl->playFilesFromStart()); 3205 3206 3201 3207 playlist->setIgnorePlayerErrors(pl->ignorePlayerErrors()); 3208 3209 3202 3210 3203 3211 #ifdef PLAYLIST_DOWNLOAD … … 3214 3222 #if STYLE_SWITCHING 3215 3223 if (_interface->styleChanged()) { 3216 applyStyles(); 3217 } 3218 #endif 3219 3220 // Restart the video if needed 3224 need_apply_styles = true; 3225 } 3226 #endif 3227 3228 if (need_apply_styles) applyStyles(); 3229 3230 // Restart the video if needed 3221 3231 if (pref_dialog->requiresRestart()) 3222 3232 core->restart(); … … 4092 4102 qDebug("BaseGui::openFavorite"); 4093 4103 4104 4105 4106 4107 4108 4094 4109 openFiles(QStringList() << file); 4095 4110 } … … 4157 4172 4158 4173 void BaseGui::openFile() { 4159 qDebug("BaseGui:: fileOpen");4174 qDebug("BaseGui::"); 4160 4175 4161 4176 exitFullscreenIfNeeded(); … … 4176 4191 4177 4192 void BaseGui::openFile(QString file) { 4178 qDebug( "BaseGui::openFile: '%s'", file.toUtf8().data());4193 qDebug(; 4179 4194 4180 4195 if ( !file.isEmpty() ) { 4181 4196 4197 4198 4199 4200 4201 4202 4203 4204 4182 4205 //playlist->clear(); 4183 4206 //playlistdock->hide(); … … 4465 4488 #endif 4466 4489 } 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4467 4531 } 4468 4532 #endif … … 4652 4716 updateWidgets(); 4653 4717 4718 4654 4719 if ((pref->add_blackborders_on_fullscreen) && 4655 4720 (!core->mset.add_letterbox)) … … 4658 4723 /* core->restart(); */ 4659 4724 } 4725 4660 4726 4661 4727 setFocus(); // Fixes bug #2493415 … … 4890 4956 #endif 4891 4957 4892 #if defined(SHARE_ACTIONS) && !defined(SHARE_WIDGET)4958 #if 4893 4959 void BaseGui::checkReminder() { 4894 4960 qDebug("BaseGui::checkReminder"); … … 4912 4978 #endif 4913 4979 4980 4914 4981 ShareDialog d(this); 4915 4982 //d.showRemindCheck(false); … … 4923 4990 set->endGroup(); 4924 4991 } 4992 4993 4994 4995 4996 4997 4925 4998 4926 4999 if (action > 0) { … … 5222 5295 if (!core->mdat.filename.isEmpty()) { 5223 5296 playlist->addItem(core->mdat.filename, "", 0); 5297 5224 5298 playlist->getMediaInfo(core->mdat); 5225 5299 } … … 5260 5334 5261 5335 void BaseGui::gotCurrentTime(double sec) { 5262 //qDebug( "DefaultGui::displayTime: %f", sec);5336 //qDebug(; 5263 5337 5264 5338 static int last_second = 0; 5265 5339 5266 if ( floor(sec)==last_second) return; // Update only once per second5267 last_second = (int) floor(sec);5340 if (last_second) return; // Update only once per second 5341 last_second = loor(sec); 5268 5342 5269 5343 QString time = Helper::formatTime( (int) sec ) + " / " + 5270 5344 Helper::formatTime( (int) core->mdat.duration ); 5271 5272 //qDebug( " duration: %f, current_sec: %f", core->mdat.duration, core->mset.current_sec);5273 5345 5274 5346 emit timeChanged(sec); … … 5401 5473 5402 5474 if (panel->isVisible()) { 5475 5476 5403 5477 // Exit from fullscreen mode 5404 5478 if (pref->fullscreen) { toggleFullscreen(false); update(); } … … 5628 5702 } 5629 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5630 5713 //qDebug() << "BaseGui::changeStyleSheet: styleSheet:" << stylesheet; 5631 5714 qApp->setStyleSheet(stylesheet); … … 5635 5718 void BaseGui::applyStyles() { 5636 5719 qDebug("BaseGui::applyStyles"); 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5637 5731 5638 5732 #if ALLOW_CHANGE_STYLESHEET … … 5652 5746 } 5653 5747 #endif 5748 5654 5749 } 5655 5750
Note:
See TracChangeset
for help on using the changeset viewer.
