#!/usr/bin/env python
#-*- coding: utf8 -*-
'''
  Open just the nxs raw data dialog.
'''

import os
import sys

# if script was run from commandline
try:
  if os.path.abspath(__file__).endswith('scripts/quicknxs'):
    sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
except NameError:
  pass

# first thing to do is starting the logging system
from quicknxs.gui_logging import setup_system, check_runstate

def _run(argv=[]):
  from PyQt4.QtGui import QApplication, QPixmap
  from PyQt4.QtCore import Qt
  app=QApplication(argv)
  from quicknxs import icons_rc, version  #@UnusedImport

  from quicknxs.nxs_gui import NXSDialog
  window=NXSDialog(None, argv[0])
  window.show()
  return app.exec_()

if __name__=='__main__':
  setup_system()
  sys.exit(_run(sys.argv[1:]))
