Gnumed.timelinelib.wxgui.components.feedbackbutton

Package Gnumed :: Package timelinelib :: Package wxgui :: Package components :: Module feedbackbutton |
[frames] | no frames]

# Source Code for Module Gnumed.timelinelib.wxgui.components.feedbackbutton

     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  import os.path
    20
    21  import wx
    22
    23  from timelinelib.config.paths import ICONS_DIR
    24  from timelinelib.wxgui.dialogs.feedback.view import show_feedback_dialog
    25
    26
    27 -class FeedbackButton(wx.BitmapButton):
    28
    29 -    def __init__(self, parent, info, subject):
    30          self.parent = parent
    31          self.info = info
    32          self.subject = subject
    33          self._init_gui()
    34
    35 -    def _init_gui(self):
    36          feedback_bitmap = wx.Bitmap(os.path.join(ICONS_DIR, "feedback.png"))
    37          wx.BitmapButton.__init__(self, self.parent, wx.ID_ANY, feedback_bitmap)
    38          self.SetToolTip(wx.ToolTip(_("Give feedback")))
    39          self.Bind(wx.EVT_BUTTON, self.on_click, self)
    40
    41 -    def on_click(self, event):
    42          show_feedback_dialog(self.info, self.subject, "", self.parent)
    43