Changeset 176 for smplayer/trunk/src/smplayer.cpp
- Timestamp:
- May 3, 2016, 5:25:45 PM (10 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/smplayer.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 175
- Property svn:mergeinfo changed
-
smplayer/trunk/src/smplayer.cpp
r170 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo 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 … … 18 18 19 19 #include "smplayer.h" 20 #include "defaultgui.h"21 #include "minigui.h"22 20 #include "global.h" 23 21 #include "paths.h" … … 28 26 #include "cleanconfig.h" 29 27 #include "myapplication.h" 30 #include "images.h" 28 #include "baseguiplus.h" 29 30 #ifdef DEFAULTGUI 31 #include "defaultgui.h" 32 #endif 33 34 #ifdef MINIGUI 35 #include "minigui.h" 36 #endif 31 37 32 38 #ifdef MPCGUI … … 90 96 showInfo(); 91 97 92 #ifdef Q_OS_WIN98 #ifdef 93 99 createFontFile(); 94 100 #endif … … 121 127 qDebug("SMPlayer::gui: user_theme_dir: %s", user_theme_dir.toUtf8().constData()); 122 128 qDebug("SMPlayer::gui: theme_dir: %s", theme_dir.toUtf8().constData()); 123 #ifdef USE_RESOURCES124 QString user_theme_resource = user_theme_dir +"/"+ theme +".rcc";125 QString theme_resource = theme_dir +"/"+ theme +".rcc";126 qDebug("SMPlayer::gui: user_theme_resource: %s", user_theme_resource.toUtf8().constData());127 qDebug("SMPlayer::gui: theme_resource: %s", theme_resource.toUtf8().constData());128 if ((QFile::exists(user_theme_resource)) || (QFile::exists(theme_resource))) {129 #else130 129 if ((QDir(theme_dir).exists()) || (QDir(user_theme_dir).exists())) { 131 #endif132 130 if (pref->iconset.isEmpty()) pref->iconset = theme; 133 131 } else { 134 #ifdef USE_RESOURCES135 qDebug("SMPlayer::gui: skin resource file doesn't exist. Falling back to default gui.");136 #else137 132 qDebug("SMPlayer::gui: skin folder doesn't exist. Falling back to default gui."); 138 #endif139 133 gui_to_use = "DefaultGUI"; 140 134 pref->iconset = ""; … … 167 161 else 168 162 #endif 163 169 164 if (gui_name.toLower() == "minigui") 170 165 gui = new MiniGui(0); 171 166 else 167 172 168 #ifdef MPCGUI 173 169 if (gui_name.toLower() == "mpcgui") … … 175 171 else 176 172 #endif 173 174 177 175 gui = new DefaultGui(0); 176 177 178 179 180 181 182 178 183 179 184 gui->setForceCloseOnFinish(close_at_end); … … 227 232 228 233 229 QString action; // Action to be passed to running instance234 QString action; // Action to be passed to running instance 230 235 bool show_help = false; 231 236 … … 291 296 } 292 297 else 298 299 300 301 302 303 304 293 305 if (argument == "-pos") { 294 306 if (n+2 < args.count()) { … … 356 368 gui_to_use = "DefaultGUI"; 357 369 } 370 371 372 373 374 375 376 377 358 378 #ifdef SKINS 359 379 else … … 400 420 if (!subtitle_file.isEmpty()) { 401 421 a->sendMessage("load_sub " + subtitle_file); 422 423 424 425 402 426 } 403 427 … … 438 462 if (!files_to_play.isEmpty()) { 439 463 if (!subtitle_file.isEmpty()) gui()->setInitialSubtitle(subtitle_file); 464 440 465 gui()->openFiles(files_to_play); 441 466 } … … 469 494 #endif 470 495 471 #ifdef Q_OS_WIN496 #ifdef 472 497 void SMPlayer::createFontFile() { 473 498 qDebug("SMPlayer::createFontFile"); … … 487 512 488 513 QString input = Paths::appPath() + "/mplayer/fonts/fonts.conf"; 489 qDebug("SMPlayer::createFontFile: input: %s", input.toLatin1().constData()); 514 if (!QFile::exists(input)) { 515 qDebug("SMPlayer::createFontFile: %s doesn't exist", input.toUtf8().constData()); 516 input = Paths::appPath() + "/mplayer/mpv/fonts.conf"; 517 if (!QFile::exists(input)) { 518 qDebug("SMPlayer::createFontFile: %s doesn't exist", input.toUtf8().constData()); 519 qWarning("SMPlayer::createFontFile: failed to create fonts.conf"); 520 return; 521 } 522 } 523 qDebug("SMPlayer::createFontFile: input: %s", input.toUtf8().constData()); 490 524 QFile infile(input); 491 525 if (infile.open(QIODevice::ReadOnly | QIODevice::Text)) { 492 526 QString text = infile.readAll(); 527 493 528 text = text.replace("<dir>WINDOWSFONTDIR</dir>", "<dir>" + Paths::fontPath() + "</dir>"); 494 529 //qDebug("SMPlayer::createFontFile: %s", text.toUtf8().constData()); … … 518 553 case QSysInfo::WV_WINDOWS8: win_ver = "Windows 8/Server 2012"; break; 519 554 #endif 555 556 557 558 559 560 520 561 case QSysInfo::WV_NT_based: win_ver = "NT-based Windows"; break; 521 562 default: win_ver = QString("Unknown/Unsupported Windows OS"); break; … … 553 594 qDebug(" * file for subtitles' styles: '%s'", Paths::subtitleStyleFile().toUtf8().data()); 554 595 qDebug(" * current path: '%s'", QDir::currentPath().toUtf8().data()); 555 #ifdef Q_OS_WIN596 #ifdef 556 597 qDebug(" * font path: '%s'", Paths::fontPath().toUtf8().data()); 557 598 #endif … … 584 625 orig_line = msg; 585 626 #else 627 628 629 586 630 orig_line = QString::fromUtf8(msg); 631 587 632 #endif 588 633
Note:
See TracChangeset
for help on using the changeset viewer.
