#include "kxtodvd.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <KDE/KLocale>

static const char description[] =
    I18N_NOOP("Konvert video files to DVD discs.");

static const char version[] = "0.0.1alpha";

int main(int argc, char **argv)
{
    KAboutData about("kxtodvd", 0, ki18n("KxToDvd"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2010 Drake Justice"), KLocalizedString(), 0, "djustice.kde@gmail.com");
    about.addAuthor( ki18n("Drake Justice"), KLocalizedString(), "djustice.kde@gmail.com" );
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
//    options.add("+[URL]", ki18n( "Document to open" ));
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    KxToDvd *widget = new KxToDvd;

    if (app.isSessionRestored())
    {
        RESTORE(KxToDvd);
    }
    else
    {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0)
        {
            widget->show();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++)
            {
                widget->show();
            }
        }
        args->clear();
    }

    return app.exec();
}
