~slist/qmotion/2.3

« back to all changes in this revision

Viewing changes to recordersetupdlg_impl.cpp

  • Committer: Stephane List
  • Date: 2010-12-12 14:54:49 UTC
  • Revision ID: slist@lilotux.net-20101212145449-t3p63qypyb1jsgyn
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2008, 2009, 2010 by Stephane List                       *
 
3
 *   slist@lilotux.net                                                     *
 
4
 *                                                                         *
 
5
 *   This program 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 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program 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 this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 
19
 ***************************************************************************/
 
20
 
 
21
#include "recordersetupdlg_impl.h"
 
22
#include "recordersetupdlg.h"
 
23
#include "ui_recordersetupdlg.h"
 
24
 
 
25
#include <QSettings>
 
26
#include <QFileDialog>
 
27
 
 
28
//------------------------------------------------------------------------
 
29
/// Constructeur
 
30
//------------------------------------------------------------------------
 
31
RecorderSetupDlg::Impl::Impl(RecorderSetupDlg& Intf)
 
32
        : Intf_(Intf)
 
33
{
 
34
    QSettings settings;
 
35
 
 
36
    ui_.setupUi(&Intf);
 
37
 
 
38
    settings.beginGroup("recorder");
 
39
    ui_.dir->setText(settings.value("dir", "").toString());
 
40
    settings.endGroup();
 
41
}
 
42
 
 
43
//------------------------------------------------------------------------
 
44
/// Evt : bouton Valider
 
45
//------------------------------------------------------------------------
 
46
void RecorderSetupDlg::Impl::on_buttonBox_accepted()
 
47
{
 
48
    QSettings settings;
 
49
 
 
50
    settings.beginGroup("recorder");
 
51
    settings.setValue("dir", ui_.dir->text());
 
52
    settings.endGroup();
 
53
    settings.sync();
 
54
}
 
55
 
 
56
void RecorderSetupDlg::Impl::on_buttonDir_clicked()
 
57
{
 
58
 
 
59
    QString dir = QFileDialog::getExistingDirectory(&Intf_, tr("Choose Directory"),
 
60
                                                    "/home",
 
61
                                                    QFileDialog::ShowDirsOnly
 
62
                                                    | QFileDialog::DontResolveSymlinks
 
63
                                                    | QFileDialog::DontUseNativeDialog);
 
64
 
 
65
    if (!dir.isEmpty())
 
66
        ui_.dir->setText(dir);
 
67
}
 
68