# Path: pytrainer/gui/dialogs.py
# def calendar_dialog(title="Calendar", date=None):
#     dialog = Gtk.Dialog(title=title, flags=Gtk.DialogFlags.MODAL)
#     dialog.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK,
#                        Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
#     calendar = Gtk.Calendar()
#     if date:
#         try:
#             year, month, day = date.split("-")
#             calendar.select_month(int(month)-1, int(year))
#             calendar.select_day(int(day))
#         except:
#             pass
#     dialog.vbox.pack_start(calendar, True, True, 0)
#     calendar.show()
#     result = dialog.run()
#     dialog.destroy()
#     if result == Gtk.ResponseType.OK:
#         date = calendar.get_date()
#         return "%0.4d-%0.2d-%0.2d" % (date[0], date[1] + 1, date[2])
#     elif result == Gtk.ResponseType.CANCEL:
#         return None


import warnings
from pytrainer.gui.dialogs import calendar_dialog
# -*- coding: utf-8 -*-

#Copyright (C) Fiz Vazquez vud1@sindominio.net

#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.

#This program 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 General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


class WindowCalendar(object):
    def __init__(self, data_path = None, parent = None, date = None):
        warnings.warn("Deprecated WindowCalendar class called", DeprecationWarning, stacklevel=2)
        self.parent = parent
        self.date = date

    def run(self):

# Path: pytrainer/gui/dialogs.py
# def calendar_dialog(title="Calendar", date=None):
#     dialog = Gtk.Dialog(title=title, flags=Gtk.DialogFlags.MODAL)
#     dialog.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK,
#                        Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
#     calendar = Gtk.Calendar()
#     if date:
#         try:
#             year, month, day = date.split("-")
#             calendar.select_month(int(month)-1, int(year))
#             calendar.select_day(int(day))
#         except:
#             pass
#     dialog.vbox.pack_start(calendar, True, True, 0)
#     calendar.show()
#     result = dialog.run()
#     dialog.destroy()
#     if result == Gtk.ResponseType.OK:
#         date = calendar.get_date()
#         return "%0.4d-%0.2d-%0.2d" % (date[0], date[1] + 1, date[2])
#     elif result == Gtk.ResponseType.CANCEL:
#         return None


# Path: pytrainer/gui/windowcalendar.py
import warnings
from pytrainer.gui.dialogs import calendar_dialog

# -*- coding: utf-8 -*-

#Copyright (C) Fiz Vazquez vud1@sindominio.net

#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.

#This program 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 General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


class WindowCalendar(object):
    def __init__(self, data_path = None, parent = None, date = None):
        warnings.warn("Deprecated WindowCalendar class called", DeprecationWarning, stacklevel=2)
        self.parent = parent
        self.date = date

    def run(self):

        date = calendar_dialog(date=self.date)