Gnumed.timelinelib.wxgui.dialogs.importevents.view

Package Gnumed :: Package timelinelib :: Package wxgui :: Package dialogs :: Package importevents :: Module view |
[frames] | no frames]

# Source Code for Module Gnumed.timelinelib.wxgui.dialogs.importevents.view

     1  # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018  Rickard Lindberg, Roger Lindberg
     2  #
     3  # This file is part of Timeline.
     4  #
     5  # Timeline is free software: you can redistribute it and/or modify
     6  # it under the terms of the GNU General Public License as published by
     7  # the Free Software Foundation, either version 3 of the License, or
     8  # (at your option) any later version.
     9  #
    10  # Timeline is distributed in the hope that it will be useful,
    11  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  # GNU General Public License for more details.
    14  #
    15  # You should have received a copy of the GNU General Public License
    16  # along with Timeline.  If not, see <http://www.gnu.org/licenses/>.
    17
    18
    19  from timelinelib.wxgui.dialogs.importevents.controller import ImportEventsDialogController
    20  from timelinelib.wxgui.framework import Dialog
    21  from timelinelib.wxgui.utils import WildcardHelper
    22
    23
    24 -class ImportEventsDialog(Dialog):
    25
    26      """
    27      <BoxSizerVertical>
    28          <Header label="$(header_label)"
    29              border="ALL"
    30          />
    31          <FileChooser
    32              name="file_chooser"
    33              dialog_wildcard="$(dialog_wildcard)"
    34              event_EVT_FILE_PATH_CHANGED="on_file_path_changed"
    35              border="LEFT|RIGHT"
    36          />
    37          <FeedbackText
    38              name="feedback_text"
    39              width="300"
    40              height="70"
    41              border="ALL"
    42              proportion="1"
    43          />
    44          <DialogButtonsOkCancelSizer
    45              border="LEFT|BOTTOM|RIGHT"
    46              event_EVT_BUTTON__ID_OK="on_ok_clicked"
    47          />
    48      </BoxSizerVertical>
    49      """
    50
    51 -    def __init__(self, db, parent=None):
    52          Dialog.__init__(self, ImportEventsDialogController, parent, {
    53              "header_label": _("Select timeline to import from:"),
    54              "dialog_wildcard": WildcardHelper(_("Timeline files"), ["timeline", "ics"]).wildcard_string(),
    55          }, title=_("Import events"))
    56          self.controller.on_init(db)
    57
    58 -    def GetFilePath(self):
    59          return self.file_chooser.GetFilePath()
    60
    61 -    def SetSuccess(self, text):
    62          self.feedback_text.SetSuccess(text)
    63          self.GetSizer().Layout()
    64
    65 -    def SetError(self, text):
    66          self.feedback_text.SetError(text)
    67          self.GetSizer().Layout()
    68