Subversion Repositories Projects

Rev

Rev 159 | Blame | Last modification | View Log | RSS feed

/***************************************************************************
 *   Copyright (C) 2008 by Manuel Schrape                                  *
 *   manuel.schrape@gmx.de                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License.        *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "dlg_Preferences.h"

dlg_Preferences::dlg_Preferences(QWidget *parent) : QDialog(parent)
{
    setupUi(this);
    connect(pb_DIR_CVS,   SIGNAL(clicked()), this, SLOT(slot_DIR_CVS()));
    connect(pb_DIR_SET,   SIGNAL(clicked()), this, SLOT(slot_DIR_SET()));
}

void dlg_Preferences::set_Settings(cSettings *Set)
{
    Settings = Set;

    le_DIR_CVS->setText(Settings->DIR.Logging);
    le_DIR_SET->setText(Settings->DIR.Parameter);
}

cSettings *dlg_Preferences::get_Settings()
{
    return Settings;
}

// Configuration -> Verzeichnisse
/////////////////////////////////
void dlg_Preferences::slot_DIR_CVS()
{
    QString directory = QFileDialog::getExistingDirectory(this, "Verzeichniss fuer CSV-Logdateien", Settings->DIR.Logging, QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly);

    if ((!directory.isEmpty()) && (Settings->DIR.Logging != directory))
    {
        Settings->DIR.Logging = directory;
        le_DIR_CVS->setText(Settings->DIR.Logging);
//        Settings->write_Settings();
    }
}

void dlg_Preferences::slot_DIR_SET()
{
    QString directory = QFileDialog::getExistingDirectory(this, "Verzeichniss fuer Settings-Dateien", Settings->DIR.Parameter, QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly);

    if ((!directory.isEmpty()) && (Settings->DIR.Parameter != directory))
    {
        Settings->DIR.Parameter = directory;
        le_DIR_SET->setText(Settings->DIR.Parameter);
//        Settings->write_Settings();
    }

}
dlg_Preferences::~dlg_Preferences()
{
}