~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to src/core/setup_dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ragwitz
  • Date: 2005-12-22 16:22:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051222162250-key3p7x0212jy6dn
Tags: 0.1.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * setup_dialog.cpp - dialog for setting up LMMS
3
3
 *
4
 
 * Linux MultiMedia Studio
5
 
 * Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
 
4
 * Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
5
 * 
 
6
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
6
7
 *
7
8
 * This program is free software; you can redistribute it and/or
8
9
 * modify it under the terms of the GNU General Public
49
50
#include "tab_bar.h"
50
51
#include "tab_button.h"
51
52
#include "tab_widget.h"
52
 
#include "templates.h"
 
53
#include "gui_templates.h"
53
54
#include "mixer.h"
54
55
#include "config_mgr.h"
55
56
#include "embed.h"
67
68
 
68
69
// platform-specific midi-interface-classes
69
70
#include "midi_alsa_raw.h"
 
71
#include "midi_alsa_seq.h"
70
72
#include "midi_oss.h"
71
73
#include "midi_dummy.h"
72
74
 
89
91
 
90
92
 
91
93
 
 
94
 
92
95
setupDialog::setupDialog( configTabs _tab_to_open ) :
93
96
        QDialog(),
94
97
        m_bufferSize( mixer::inst()->framesPerAudioBuffer() ),
95
98
        m_disableToolTips( configManager::inst()->value( "tooltips",
96
99
                                                        "disabled" ).toInt() ),
97
100
        m_classicalKnobUsability( configManager::inst()->value( "knobs",
98
 
                                                "classicalusability" ).toInt() )
 
101
                                        "classicalusability" ).toInt() ),
 
102
        m_gimpLikeWindows( configManager::inst()->value( "app",
 
103
                                                "gimplikewindows" ).toInt() )
99
104
{
100
105
        setWindowIcon( embed::getIconPixmap( "setup_general" ) );
101
106
        setWindowTitle( tr( "Setup LMMS" ) );
102
107
 
103
108
        QVBoxLayout * vlayout = new QVBoxLayout( this );
 
109
        vlayout->setSpacing( 0 );
 
110
        vlayout->setMargin( 0 );
104
111
        QWidget * settings = new QWidget( this );
105
112
        QHBoxLayout * hlayout = new QHBoxLayout( settings );
 
113
        hlayout->setSpacing( 0 );
 
114
        hlayout->setMargin( 0 );
106
115
 
107
116
        m_tabBar = new tabBar( settings, QBoxLayout::TopToBottom );
108
117
        m_tabBar->setExclusive( TRUE );
114
123
        QWidget * general = new QWidget( ws );
115
124
        general->setFixedSize( 360, 200 );
116
125
        QVBoxLayout * gen_layout = new QVBoxLayout( general );
 
126
        gen_layout->setSpacing( 0 );
 
127
        gen_layout->setMargin( 0 );
117
128
        labelWidget( general, tr( "General settings" ) );
118
129
 
119
130
        tabWidget * bufsize_tw = new tabWidget( tr( "BUFFER SIZE" ), general );
156
167
 
157
168
 
158
169
        tabWidget * misc_tw = new tabWidget( tr( "MISC" ), general );
159
 
        misc_tw->setFixedHeight( 60 );
 
170
        misc_tw->setFixedHeight( 76 );
160
171
 
161
172
        ledCheckBox * disable_tooltips = new ledCheckBox(
162
173
                                        tr( "Disable tooltips (no spurious "
167
178
        connect( disable_tooltips, SIGNAL( toggled( bool ) ),
168
179
                        this, SLOT( toggleToolTips( bool ) ) );
169
180
 
 
181
 
170
182
        ledCheckBox * classical_knob_usability = new ledCheckBox(
171
183
                                        tr( "Classical knob usability (move "
172
184
                                                "cursor around knob to change "
178
190
                        this, SLOT( toggleKnobUsability( bool ) ) );
179
191
 
180
192
 
 
193
        ledCheckBox * gimp_like_windows = new ledCheckBox(
 
194
                                        tr( "GIMP-like windows (no MDI)" ),
 
195
                                                                misc_tw );
 
196
        gimp_like_windows->move( 10, 54 );
 
197
        gimp_like_windows->setChecked( m_gimpLikeWindows );
 
198
        connect( gimp_like_windows, SIGNAL( toggled( bool ) ),
 
199
                        this, SLOT( toggleGIMPLikeWindows( bool ) ) );
 
200
 
 
201
 
181
202
        gen_layout->addWidget( bufsize_tw );
182
203
        gen_layout->addSpacing( 10 );
183
204
        gen_layout->addWidget( misc_tw );
189
210
        QWidget * audio = new QWidget( ws );
190
211
        audio->setFixedSize( 360, 200 );
191
212
        QVBoxLayout * audio_layout = new QVBoxLayout( audio );
 
213
        audio_layout->setSpacing( 0 );
 
214
        audio_layout->setMargin( 0 );
192
215
        labelWidget( audio, tr( "Audio settings" ) );
193
216
 
194
217
        tabWidget * audioiface_tw = new tabWidget( tr( "AUDIO INTERFACE" ),
214
237
#endif
215
238
 
216
239
        QHBoxLayout * asw_layout = new QHBoxLayout( asw );
 
240
        asw_layout->setSpacing( 0 );
 
241
        asw_layout->setMargin( 0 );
217
242
        //asw_layout->setAutoAdd( TRUE );
218
243
 
219
244
#ifdef JACK_SUPPORT
273
298
 
274
299
        QWidget * midi = new QWidget( ws );
275
300
        QVBoxLayout * midi_layout = new QVBoxLayout( midi );
 
301
        midi_layout->setSpacing( 0 );
 
302
        midi_layout->setMargin( 0 );
276
303
        labelWidget( midi, tr( "MIDI settings" ) );
277
304
 
278
305
        tabWidget * midiiface_tw = new tabWidget( tr( "MIDI INTERFACE" ),
298
325
#endif
299
326
 
300
327
        QHBoxLayout * msw_layout = new QHBoxLayout( msw );
 
328
        msw_layout->setSpacing( 0 );
 
329
        msw_layout->setMargin( 0 );
301
330
        //msw_layout->setAutoAdd( TRUE );
302
331
 
303
332
#ifdef ALSA_SUPPORT
 
333
        m_midiIfaceSetupWidgets[midiALSASeq::name()] =
 
334
                                        new midiALSASeq::setupWidget( msw );
304
335
        m_midiIfaceSetupWidgets[midiALSARaw::name()] =
305
336
                                        new midiALSARaw::setupWidget( msw );
306
337
#endif
328
359
 
329
360
#ifdef QT4
330
361
        m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText(
331
 
                                        mixer::inst()->midiDevName() ) );
 
362
                                        mixer::inst()->midiClientName() ) );
332
363
#else
333
 
        m_midiInterfaces->setCurrentText( mixer::inst()->midiDevName() );
 
364
        m_midiInterfaces->setCurrentText( mixer::inst()->midiClientName() );
334
365
#endif
335
 
        m_midiIfaceSetupWidgets[mixer::inst()->midiDevName()]->show();
 
366
        m_midiIfaceSetupWidgets[mixer::inst()->midiClientName()]->show();
336
367
 
337
368
        connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ),
338
369
                this, SLOT( midiInterfaceChanged( const QString & ) ) );
344
375
        midi_layout->addStretch();
345
376
 
346
377
 
347
 
#ifndef QT
 
378
#ifndef QT4
348
379
#define setIcon setPixmap
349
380
#endif
350
381
 
367
398
 
368
399
        QWidget * buttons = new QWidget( this );
369
400
        QHBoxLayout * btn_layout = new QHBoxLayout( buttons );
 
401
        btn_layout->setSpacing( 0 );
 
402
        btn_layout->setMargin( 0 );
370
403
        QPushButton * ok_btn = new QPushButton( embed::getIconPixmap( "apply" ),
371
404
                                                tr( "OK" ), buttons );
372
405
        connect( ok_btn, SIGNAL( clicked() ), this, SLOT( accept() ) );
417
450
                                        QString::number( m_disableToolTips ) );
418
451
        configManager::inst()->setValue( "knobs", "classicalusability",
419
452
                                QString::number( m_classicalKnobUsability ) );
 
453
        configManager::inst()->setValue( "app", "gimplikewindows",
 
454
                                QString::number( m_gimpLikeWindows ) );
420
455
        // tell all audio-settings-widget to save their settings
421
456
        for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin();
422
457
                                it != m_audioIfaceSetupWidgets.end(); ++it )
588
623
 
589
624
 
590
625
 
 
626
void setupDialog::toggleGIMPLikeWindows( bool _enabled )
 
627
{
 
628
        m_gimpLikeWindows =  _enabled;
 
629
}
 
630
 
 
631
 
 
632
 
591
633
#include "setup_dialog.moc"
592
634