~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to arts/tools/midiportdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
        /*
 
2
 
 
3
        Copyright (C) 1998 Stefan Westerfeld
 
4
                       stefan@space.twc.de
 
5
 
 
6
    This program is free software; you can redistribute it and/or modify
 
7
    it under the terms of the GNU General Public License as published by
 
8
    the Free Software Foundation; either version 2 of the License, or
 
9
    (at your option) any later version.
 
10
 
 
11
    This program is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
    GNU General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU General Public License
 
17
    along with this program; if not, write to the Free Software
 
18
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
 
 
20
    */
 
21
 
 
22
#include "midiportdlg.h"
 
23
#include <klocale.h>
 
24
 
 
25
#include <qlayout.h>
 
26
#include <qlabel.h>
 
27
#include <kseparator.h>
 
28
#include <kbuttonbox.h>
 
29
#include <qlineedit.h>
 
30
 
 
31
MidiPortDlg::MidiPortDlg(QWidget *parent, const char *oldname, const char *title) :QDialog(parent,title,TRUE)
 
32
{
 
33
        QVBoxLayout *mainlayout = new QVBoxLayout(this);
 
34
 
 
35
// caption label: title
 
36
 
 
37
        mainlayout->addSpacing(5);
 
38
        QLabel *captionlabel = new QLabel(this);
 
39
        QFont labelfont(captionlabel->font());
 
40
        labelfont.setPointSize(labelfont.pointSize()*3/2);
 
41
        captionlabel->setFont(labelfont);
 
42
        captionlabel->setText(i18n("OSS Midi Port"));
 
43
        captionlabel->setAlignment(AlignCenter);
 
44
        //min_size(captionlabel);
 
45
        mainlayout->addWidget(captionlabel);
 
46
 
 
47
// hruler
 
48
 
 
49
        mainlayout->addSpacing(5);
 
50
        KSeparator *ruler2 = new KSeparator( KSeparator::HLine, this);
 
51
        mainlayout->addWidget(ruler2);
 
52
        mainlayout->addSpacing(5);
 
53
 
 
54
// editwidget
 
55
 
 
56
        edit = new QLineEdit(this);
 
57
        edit->setText(oldname);
 
58
        //min_size(edit);
 
59
 
 
60
        mainlayout->addWidget(edit);
 
61
 
 
62
// hruler
 
63
 
 
64
        mainlayout->addSpacing(5);
 
65
        KSeparator *ruler = new KSeparator( KSeparator::HLine, this);
 
66
        mainlayout->addWidget(ruler);
 
67
        mainlayout->addSpacing(5);
 
68
 
 
69
// buttons
 
70
 
 
71
        QHBoxLayout *buttonlayout = new QHBoxLayout;
 
72
        mainlayout->addSpacing(5);
 
73
        mainlayout->addLayout(buttonlayout);
 
74
        mainlayout->addSpacing(5);
 
75
 
 
76
        buttonlayout->addSpacing(5);
 
77
        KButtonBox *bbox = new KButtonBox(this);
 
78
 
 
79
        bbox->addButton(i18n("Help"));
 
80
        bbox->addStretch(1);
 
81
 
 
82
        QButton *okbutton = bbox->addButton(i18n("OK"));
 
83
        connect( okbutton, SIGNAL( clicked() ), SLOT(accept() ) );
 
84
 
 
85
        bbox->layout();
 
86
 
 
87
        buttonlayout->addWidget(bbox);
 
88
        buttonlayout->addSpacing(5);
 
89
 
 
90
        mainlayout->freeze();
 
91
};
 
92
 
 
93
const char *MidiPortDlg::device()
 
94
{
 
95
        return edit->text().ascii();
 
96
}
 
97
#include "midiportdlg.moc"