Changeset 168 for smplayer/vendor/current/src/basegui.cpp
- Timestamp:
- Oct 9, 2014, 11:54:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/basegui.cpp
r163 r168 117 117 #endif 118 118 119 #ifdef AUTO_SHUTDOWN_PC 120 #include "shutdowndialog.h" 121 #include "shutdown.h" 122 #endif 123 119 124 using namespace Global; 120 125 … … 123 128 { 124 129 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 130 #ifdef AVOID_SCREENSAVER 125 131 /* Disable screensaver by event */ 126 132 just_stopped = false; 133 #endif 127 134 #endif 128 135 ignore_show_hide_events = false; … … 1676 1683 showConfigAct->change( Images::icon("show_config"), tr("&Open configuration folder") ); 1677 1684 #ifdef REMINDER_ACTIONS 1678 donateAct->change( Images::icon("donate"), tr("&Donate ") );1679 #endif 1680 aboutThisAct->change( Images::icon("logo _small"), tr("About &SMPlayer") );1685 donateAct->change( Images::icon("donate"), tr("&Donate / Share with your friends") ); 1686 #endif 1687 aboutThisAct->change( Images::icon("logo"), tr("About &SMPlayer") ); 1681 1688 1682 1689 #ifdef SHARE_MENU … … 3034 3041 3035 3042 void BaseGui::newMediaLoaded() { 3036 qDebug("BaseGui::newMediaLoaded"); 3037 3038 pref->history_recents->addItem( core->mdat.filename ); 3043 qDebug("BaseGui::newMediaLoaded"); 3044 3045 QString stream_title = core->mdat.stream_title; 3046 qDebug("BaseGui::newMediaLoaded: mdat.stream_title: %s", stream_title.toUtf8().constData()); 3047 3048 if (!stream_title.isEmpty()) { 3049 pref->history_recents->addItem( core->mdat.filename, stream_title ); 3050 //pref->history_recents->list(); 3051 } else { 3052 pref->history_recents->addItem( core->mdat.filename ); 3053 } 3039 3054 updateRecents(); 3040 3055 … … 3323 3338 } 3324 3339 3325 QAction * a = recentfiles_menu->addAction( QString("%1. " + filename ).arg( i.insert( i.size()-1, '&' ), 3, ' ' )); 3340 QString show_name = filename; 3341 QString title = pref->history_recents->title(n); 3342 if (!title.isEmpty()) show_name = title; 3343 3344 QAction * a = recentfiles_menu->addAction( QString("%1. " + show_name ).arg( i.insert( i.size()-1, '&' ), 3, ' ' )); 3326 3345 a->setStatusTip(fullname); 3327 3346 a->setData(n); … … 4567 4586 files = Helper::resolveSymlinks(files); // Check for Windows shortcuts 4568 4587 #endif 4588 files.sort(); 4569 4589 4570 4590 if (files.count() == 1) { … … 4687 4707 4688 4708 if (arg_close_on_finish != 0) { 4689 if ((arg_close_on_finish == 1) || (pref->close_on_finish)) exitAct->trigger(); 4709 if ((arg_close_on_finish == 1) || (pref->close_on_finish)) { 4710 #ifdef AUTO_SHUTDOWN_PC 4711 if (pref->auto_shutdown_pc) { 4712 ShutdownDialog d(this); 4713 if (d.exec() == QDialog::Accepted) { 4714 qDebug("BaseGui::playlistHasFinished: the PC will shut down"); 4715 Shutdown::shutdown(); 4716 } else { 4717 qDebug("BaseGui::playlistHasFinished: shutdown aborted"); 4718 } 4719 } 4720 #endif 4721 exitAct->trigger(); 4722 } 4690 4723 } 4691 4724 } … … 4701 4734 4702 4735 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 4736 #ifdef AVOID_SCREENSAVER 4703 4737 /* Disable screensaver by event */ 4704 4738 just_stopped = false; … … 4709 4743 QTimer::singleShot( time, this, SLOT(clear_just_stopped()) ); 4710 4744 } 4745 #endif 4711 4746 #endif 4712 4747 } … … 4967 5002 QString styleSheet = QLatin1String(file.readAll()); 4968 5003 5004 #ifdef USE_RESOURCES 5005 Images::setTheme(pref->iconset); 5006 QString path = ":/" + pref->iconset; 5007 #else 4969 5008 QDir current = QDir::current(); 4970 5009 QString td = Images::themesDirectory(); 4971 QString relativePath = current.relativeFilePath(td); 5010 QString path = current.relativeFilePath(td); 5011 #endif 4972 5012 styleSheet.replace(QRegExp("url\\s*\\(\\s*([^\\);]+)\\s*\\)", Qt::CaseSensitive, QRegExp::RegExp2), 4973 QString("url(%1\\1)").arg(relativePath + "/")); 4974 qDebug("styeSheet: %s", styleSheet.toUtf8().constData()); 4975 5013 QString("url(%1\\1)").arg(path + "/")); 5014 //qDebug("BaseGui::loadQss: styeSheet: %s", styleSheet.toUtf8().constData()); 4976 5015 qApp->setStyleSheet(styleSheet); 4977 5016 } … … 5250 5289 5251 5290 #if defined(Q_OS_WIN) || defined(Q_OS_OS2) 5291 #ifdef AVOID_SCREENSAVER 5252 5292 void BaseGui::clear_just_stopped() { 5253 5293 qDebug("BaseGui::clear_just_stopped"); … … 5255 5295 } 5256 5296 #endif 5297 #endif 5257 5298 5258 5299 #include "moc_basegui.cpp"
Note:
See TracChangeset
for help on using the changeset viewer.