/*
 * Copyright (C) 2017  Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
#include <QApplication>
#include <QMainWindow>
#include <QToolBar>
#include <QDebug>
#include "../core/folder.h"
#include "../foldermodel.h"
#include "../folderview.h"
#include "../cachedfoldermodel.h"
#include "../proxyfoldermodel.h"
#include "../pathedit.h"
#include "../filedialog.h"
#include "libfmqt.h"


int main(int argc, char** argv) {
    QApplication app(argc, argv);

    Fm::LibFmQt contex;

    /*
    QFileDialog dlg0;
    dlg0.setFileMode(QFileDialog::ExistingFiles);

    dlg0.setNameFilters(QStringList() << "Txt (*.txt)");
    QObject::connect(&dlg0, &QFileDialog::currentChanged, [](const QString& path) {
        qDebug() << "currentChanged:" << path;
    });
    QObject::connect(&dlg0, &QFileDialog::fileSelected, [](const QString& path) {
        qDebug() << "fileSelected:" << path;
    });
    QObject::connect(&dlg0, &QFileDialog::filesSelected, [](const QStringList& paths) {
        qDebug() << "filesSelected:" << paths;
    });

    dlg0.exec();
    */

    Fm::FileDialog dlg;
    // dlg.setFileMode(QFileDialog::ExistingFile);
    dlg.setFileMode(QFileDialog::ExistingFiles);
    // dlg.setFileMode(QFileDialog::Directory);
    dlg.setNameFilters(QStringList() << QStringLiteral("All (*)") << QStringLiteral("Text (*.txt)") << QStringLiteral("Images (*.gif *.jpeg *.jpg)"));

    dlg.exec();
    qDebug() << "selected files:" << dlg.selectedFiles();

    return 0;
}
