File indexing completed on 2024-10-06 04:26:04

0001 /*
0002     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "k3bapplication.h"
0008 
0009 #include <KAboutData>
0010 #include <KLocalizedString>
0011 #include <QCommandLineParser>
0012 #include <QIcon>
0013 #if defined(__clang__) && defined(LLVM_MAJOR) && (LLVM_MAJOR > 5)
0014 #include <sanitizer/common_interface_defs.h>
0015 #endif
0016 
0017 int main( int argc, char* argv[] )
0018 {
0019     K3b::Application app( argc, argv );
0020 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0021     QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
0022 #endif
0023     
0024     KAboutData aboutData( "k3b",
0025                           i18n("K3b"),
0026                           LIBK3B_VERSION, i18n("<p>K3b is a full-featured CD/DVD/Blu-ray burning and ripping application.<br/>"
0027                                                "It supports a variety of project types as well as copying of optical media, "
0028                                                "burning of different types of images, and ripping Audio CDs, Video CDs, and "
0029                                                "Video DVDs.<br/>"
0030                                                "Its convenient user interface is targeted at all audiences, trying "
0031                                                "to be as simple as possible for novice users while also providing all features "
0032                                                "an advanced user might need."),
0033                           KAboutLicense::GPL,
0034                           i18n("Copyright © 1998–2018 K3b authors"),
0035                           QString(),
0036                           i18n("https://www.k3b.org" ) );
0037 
0038     aboutData.setOrganizationDomain("kde");
0039     aboutData.setDesktopFileName(QStringLiteral("org.kde.k3b.desktop"));
0040     aboutData.addAuthor(i18n("Leslie Zhai"), i18n("Maintainer"), "zhaixiang@loongson.cn");
0041     aboutData.addAuthor(i18n("Michał Małek"),i18n("Maintainer and current lead Developer"), "michalm@jabster.pl");
0042     aboutData.addAuthor(i18n("Sebastian Trüg"),i18n("Main developer"), "trueg@k3b.org");
0043     aboutData.addAuthor(i18n("Christian Kvasny"),i18n("Video CD Project and Video CD ripping"), "chris@k3b.org");
0044     aboutData.addAuthor(i18n("Montel Laurent"), i18n("Initial port to KDE Platform 4"), "montel@kde.org");
0045     aboutData.addAuthor( i18n("Ralf Habacker"), i18n( "Windows port" ), "ralf.habacker@freenet.de" );
0046 
0047     aboutData.addCredit(i18n("Klaus-Dieter Krannich"), i18n("Advanced Cdrdao integration"), "kd@k3b.org" );
0048     aboutData.addCredit(i18n("Thomas Froescher"),
0049                         i18n("Video DVD ripping and video encoding in pre-1.0 versions."),
0050                         "tfroescher@k3b.org");
0051     aboutData.addCredit(i18n("Alexis Younes aka Ayo"),
0052                         i18n("For his bombastic artwork."),
0053                         "73lab@free.fr" );
0054     aboutData.addCredit(i18n("Christoph Thielecke"),
0055                         i18n("For extensive testing and the first German translation."),
0056                         "crissi99@gmx.de");
0057     aboutData.addCredit(i18n("Andy Polyakov"),
0058                         i18n("For the great dvd+rw-tools and the nice cooperation."),
0059                         "appro@fy.chalmers.se" );
0060     aboutData.addCredit(i18n("Roberto De Leo"),
0061                         i18n("For the very cool eMovix package and his accommodating work."),
0062                         "peggish@users.sf.net" );
0063     aboutData.addCredit(i18n("John Steele Scott"),
0064                         i18n("For the flac decoding plugin."),
0065                         "toojays@toojays.net" );
0066     aboutData.addCredit(i18n("György Szombathelyi"),
0067                         i18n("For the very useful isofslib."),
0068                         "gyurco@users.sourceforge.net" );
0069     aboutData.addCredit(i18n("Erik de Castro Lopo"),
0070                         i18n("For libsamplerate which is used for generic resampling in the audio decoder framework."),
0071                         "erikd@mega-nerd.com" );
0072     aboutData.addCredit(i18n("Jakob Petsovits"),
0073                         i18n("For the very cool conditional audio ripping pattern."),
0074                         "jpetso@gmx.at" );
0075     aboutData.addCredit(i18n("Heiner Eichmann"),
0076                         i18n("For his work on the BSD port and some great patches."),
0077                         "h.eichmann@gmx.de" );
0078     aboutData.addCredit(i18n("Adriaan de Groot"),
0079                         i18n("For his work on the FreeBSD port."),
0080                         "" );
0081     aboutData.addCredit(i18n("Thiago Macieira"),
0082                         i18n("For his help with the many invalid k3b entries on bugs.kde.org."),
0083                         "thiago@kde.org" );
0084     aboutData.addCredit(i18n("Marcel Dierkes"),
0085                         i18n("For the great K3b icon eyecandy."),
0086                         "marcel.dierkes@gmx.de" );
0087     aboutData.addCredit(i18n("Christoph Burger-Scheidlin"),
0088                         i18n("For his neverending help cleaning out the K3b bug database."),
0089                         "andersin@freenet.de" );
0090     aboutData.addCredit( i18n("Robert Wadley"),
0091                          i18n( "Rob created a great theme and came up with the idea for transparent themes." ),
0092                          "rob@robntina.fastmail.us" );
0093     aboutData.addCredit( i18n("Dmitry Novikov"),
0094                          i18n( "For the amazing K3b 1.0 theme." ),
0095                          "quant@trktvs.ru" );
0096     aboutData.addCredit( i18n("Jeremy C. Andrus"),
0097                          i18n( "First Windows port of libk3bdevice." ),
0098                          "jeremy@jeremya.com" );
0099 
0100     KAboutData::setApplicationData( aboutData );
0101 
0102     QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("k3b"), app.windowIcon()));
0103 
0104     QCommandLineParser* parser = new QCommandLineParser;
0105     parser->addPositionalArgument( "urls", i18n("file(s) to open"), "[urls...]" );
0106     parser->addOption( QCommandLineOption( "data", i18n("Create a new data CD project and add all given files") ) );
0107     parser->addOption( QCommandLineOption( "audiocd", i18n("Create a new audio CD project and add all given files") ) );
0108     parser->addOption( QCommandLineOption( "videocd", i18n("Create a new video CD project and add all given files") ) );
0109     parser->addOption( QCommandLineOption( "mixedcd", i18n("Create a new mixed mode CD project and add all given files") ) );
0110     parser->addOption( QCommandLineOption( "emovix", i18n("Create a new eMovix CD project and add all given files") ) );
0111     parser->addOption( QCommandLineOption( "videodvd", i18n("Create a new Video DVD project and add all given files") ) );
0112     parser->addOption( QCommandLineOption( "burn", i18n("Open the project burn dialog for the current project") ) );
0113     parser->addOption( QCommandLineOption( "copy", i18n("Open the copy dialog, optionally specify the source device"), "device" ) );
0114     parser->addOption( QCommandLineOption( "image", i18n("Write an image to a CD or DVD"), "url" ) );
0115     parser->addOption( QCommandLineOption( "format", i18n("Format a rewritable medium"), "device" ) );
0116     parser->addOption( QCommandLineOption( "cddarip", i18n("Extract Audio tracks digitally (+encoding)"), "device" ) );
0117     parser->addOption( QCommandLineOption( "videodvdrip", i18n("Rip Video DVD Titles (+transcoding)"), "device" ) );
0118     parser->addOption( QCommandLineOption( "videocdrip", i18n("Rip Video CD Tracks"), "device" ) );
0119     parser->addOption( QCommandLineOption( "lang", i18n("Set the GUI language"), "language" ) );
0120     parser->addOption( QCommandLineOption( "nosplash", i18n("Disable the splash screen") ) );
0121     parser->addOption( QCommandLineOption( "device", i18n("Set the device to be used for new projects. (This option has no effect: "
0122                                                          "its main purpose is to enable handling of empty media from the KDE Media Manager.)" ), "device" ) );
0123     aboutData.setupCommandLine( parser );
0124 
0125     parser->process( app );
0126 
0127     aboutData.processCommandLine( parser );
0128 
0129     if( parser->isSet("lang") ) {
0130         QLocale::setDefault( QLocale( parser->value("lang") ) );
0131     }
0132 
0133     app.init( parser );
0134 
0135 #if defined(__clang__) && defined(LLVM_MAJOR) && (LLVM_MAJOR > 5)
0136     if (argc > 2)
0137         __sanitizer_print_memory_profile(atoi(argv[1]), atoi(argv[2]));
0138 #endif
0139 
0140     return app.exec();
0141 }