#include "gui.hh"

#include "landed.hh"
#include "listfont.h"

#include <QFontDatabase>

int
main(int argc, char* argv[])
{
  
  Landed app(argc, argv);

}


Landed::
Landed(int argc, char* argv[]):
  QApplication(argc, argv)
{


  //int fontid=
  QByteArray b64(listfont_b64, strlen(listfont_b64));
  QFontDatabase::addApplicationFontFromData(QByteArray::fromBase64(b64));
  
  if (argc>1)
    gui_.loadFile(argv[1]);
  gui_.show();
  exec();
}

bool Landed::
event(QEvent* event)
{
  if (event->type()==QEvent::FileOpen)
    {
      gui_.loadFile(static_cast<QFileOpenEvent*>(event)->file());
      return true;
    }
  else
    return QApplication::event(event);
}
