File indexing completed on 2024-04-21 05:45:46

0001 /***************************************************************************
0002  *   Copyright (C) 2008 by Pino Toscano <pino@kde.org>                     *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  ***************************************************************************/
0009 
0010 #include "slavewidget.h"
0011 #include "altparser.h"
0012 
0013 #include <klocalizedstring.h>
0014 
0015 SlaveWidget::SlaveWidget(Slave *slave, QWidget *parent)
0016     : QWidget(parent), m_slave(slave)
0017 {
0018     setupUi(this);
0019     layout()->setContentsMargins(0, 0, 0, 0);
0020 
0021     m_slavePath->setWindowTitle(i18n("Choose Slave"));
0022     m_slavePath->setFilter(i18n("*|All Files"));
0023     m_slavePath->setMode(KFile::File | KFile::LocalOnly);
0024 
0025     m_slaveText->setText(i18n("Slave link for %1:", m_slave->slname));
0026 
0027     connect(m_slavePath, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
0028 }
0029 
0030 SlaveWidget::~SlaveWidget()
0031 {
0032 }
0033 
0034 QString SlaveWidget::slavePath() const
0035 {
0036     return m_slavePath->url().toLocalFile();
0037 }
0038 
0039 void SlaveWidget::slotTextChanged(const QString &)
0040 {
0041     emit slaveChanged(slavePath());
0042 }
0043 
0044 #include <slavewidget.moc>