| 1 | /* |
| 2 | * midisnoop - MIDI monitor and prober |
| 3 | * Copyright (C) 2012 Devin Anderson |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License as published by the Free |
| 7 | * Software Foundation; either version 2 of the License, or (at your option) |
| 8 | * any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | * more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along with |
| 16 | * this program; if not, write to the Free Software Foundation, Inc., 675 Mass |
| 17 | * Ave, Cambridge, MA 02139, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "messageview.h" |
| 21 | #include "util.h" |
| 22 | |
| 23 | MessageView::MessageView(QObject *parent): |
| 24 | DesignerView(":/midisnoop/messageview.ui", parent) |
| 25 | { |
| 26 | QWidget *rootWidget = getRootWidget(); |
| 27 | |
| 28 | closeButton = getChild<QPushButton>(rootWidget, "closeButton"); |
| 29 | connect(closeButton, SIGNAL(clicked()), SIGNAL(closeRequest())); |
| 30 | |
| 31 | message = getChild<QPlainTextEdit>(rootWidget, "message"); |
| 32 | |
| 33 | sendButton = getChild<QPushButton>(rootWidget, "sendButton"); |
| 34 | connect(sendButton, SIGNAL(clicked()), SLOT(handleSendButtonClick())); |
| 35 | } |
| 36 | |
| 37 | MessageView::~MessageView() |
| 38 | { |
| 39 | // Empty |
| 40 | } |
| 41 | |
| 42 | void |
| 43 | MessageView::handleSendButtonClick() |
| 44 | { |
| 45 | emit sendRequest(message->toPlainText()); |
| 46 | } |