#!/usr/bin/env python
"""
.. module:: SettingsWindow
   :platform: Unix, Windows, Mac
   :synopsis: Settings Window of the Ivolution GUI designed to be supported by all platforms.

.. moduleauthor:: Julien Lengrand-Lambert <jlengrand@gmail.com>

"""

import wx
import wx.lib.newevent

import sys
import os
import logging
import webbrowser

from .. import get_data # used to load images and files

from SettingsTemplate import SettingsTemplate


class SettingsWindow(SettingsTemplate):
    """
    Settings Window of the Ivolution application
    """
    def __init__(self, parent):
        """
        Overrides init frame SettingsTemplate
        """
        SettingsTemplate.__init__(self, parent)
        # TODO : Set icon
        #self.SetIcon(wx.Icon('ivolution/data/media/icons/spanner_48.ico', wx.BITMAP_TYPE_ICO))  # Sets icon


        # Defining settings value
        self.output_folder = parent.out_fo
        self.file_name = "Ivolution"





        self.outputLocationLabel.SetLabel(self.output_folder) # setting default value from main window

    # Virtual event handlers, overide them in your derived class
    def on_output( self, event ):
        pass
        # default_dir = "~/Pictures"
        # self.inputdialog = wx.DirDialog(self, "Please choose your input directory", style=1, defaultPath=default_dir)

        # if self.inputdialog.ShowModal() == wx.ID_OK:
        #     self.inputtextbox.SetLabel(self.inputdialog.GetPath())
        # self.inputdialog.Destroy()

    def on_cancel( self, event ):
        self.Close(True)  # Close the frame.

    def on_save( self, event ):
        event.Skip()
@@ -133,50 +133,8 @@
  GUI
- designed to be supported by all platforms
 .%0A%0A.
@@ -240,63 +240,8 @@
 nt%0A%0A
-import sys%0Aimport os%0Aimport logging%0Aimport webbrowser%0A%0A
 from
@@ -622,16 +622,36 @@
 et icon%0A
+        # Sets icon%0A
         
@@ -716,16 +716,37 @@
 48.ico',
+%0A        #           
  wx.BITM
@@ -758,30 +758,16 @@
 PE_ICO))
-  # Sets icon%0A
 %0A%0A      
@@ -850,20 +850,21 @@
    self.
-file
+video
 _name = 
@@ -875,21 +875,16 @@
 lution%22%0A
-%0A%0A%0A%0A%0A
         
@@ -884,24 +884,167 @@
        self.
+type = %22%22%0A        self.mode = %22%22%0A        self.speed = %22%22%0A        self.sort = %22%22%0A%0A        # setting default value from main window%0A        self.
 outputLocati
@@ -1083,49 +1083,8 @@
 der)
- # setting default value from main window
 %0A%0A  
@@ -1164,17 +1164,16 @@
 _output(
- 
 self, ev
@@ -1167,33 +1167,32 @@
 tput(self, event
- 
 ):%0A        pass%0A
@@ -1190,97 +1190,86 @@
     
-pass%0A        # default_dir = %22~/Pictures%22%0A        # self.inputdialog = wx.DirDialog(self,
+self.outputdialog = wx.DirDialog(self,%0A                                       
  %22Pl
@@ -1285,18 +1285,19 @@
 se your 
-in
+out
 put dire
@@ -1307,40 +1307,127 @@
 ry%22,
- style=1, defaultPath=default_di
+%0A                                        style=1,%0A                                        defaultPath=self.output_folde
 r)%0A%0A
@@ -1433,18 +1433,16 @@
 %0A       
- #
  if self
@@ -1438,26 +1438,27 @@
     if self.
-in
+out
 putdialog.Sh
@@ -1483,26 +1483,24 @@
 _OK:%0A       
- #
      self.in
@@ -1501,37 +1501,32 @@
 elf.
-inputtextbox.SetLabel(
+output_folder = 
 self.
-in
+out
 putd
@@ -1540,17 +1540,16 @@
 etPath()
-)
 %0A       
@@ -1553,17 +1553,82 @@
     
-#
+   
  self.
-in
+outputLocationLabel.SetLabel(self.output_folder)%0A        self.out
 putd
@@ -1662,17 +1662,16 @@
 _cancel(
- 
 self, ev
@@ -1665,33 +1665,32 @@
 ncel(self, event
- 
 ):%0A        self.
@@ -1738,17 +1738,16 @@
 on_save(
- 
 self, ev
@@ -1749,17 +1749,16 @@
 f, event
- 
 ):%0A     
@@ -1772,8 +1772,9 @@
 t.Skip()
+%0A

Implement on_output for settings.