summaryrefslogtreecommitdiffstats
path: root/src/mplayerthumbsconfig/mplayerthumbscfg.cpp
blob: f1fc24a76839f5b325ada6732c599feb4897dad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/***************************************************************************
 *   Copyright (C) 2006 by Marco Gulino   *
 *   [email protected]   *
 *                                                                         *
 *   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, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   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 "mplayerthumbscfg.h"
#include <qvbox.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <qlabel.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <qtimer.h>
#include <keditlistbox.h>

MPlayerThumbsConfig::MPlayerThumbsConfig(QWidget *parent, const char *name, MPlayerThumbsCfg *config, DialogType dialogType, int dialogButtons, ButtonCode defaultButton, bool modal)
    : KConfigDialog(parent, name, config, dialogType, dialogButtons, defaultButton, modal)
{
    QVBox *vbox=new QVBox(0);
    vbox->setSpacing( 5);
    new QLabel(i18n("Enter here the path for mplayer executable file."), vbox);
    kcfg_mplayerbin=new KLineEdit( vbox, "kcfg_mplayerbin");
    new QLabel(i18n("Custom arguments for mplayer."), vbox);
    new KLineEdit( vbox, "kcfg_customargs");
    new KEditListBox( i18n("Blacklisted File Extensions"),
            vbox, "kcfg_noextensions", true, KEditListBox::Add | KEditListBox::Remove);
    addPage( vbox, i18n("General"), "mplayer" );
    kdDebug() << "config->mplayerbin().isNull()::" << config->mplayerbin().length() << endl;
    if(!config->mplayerbin().length() )
        QTimer::singleShot( 100, this, SLOT(autoFindPath()));
}

MPlayerThumbsConfig::~MPlayerThumbsConfig()
{
}

#include "mplayerthumbscfg.moc"


/*!
    \fn MPlayerThumbsConfig::autoFindPath()
 */
void MPlayerThumbsConfig::autoFindPath()
{
    QString playerPath=KStandardDirs::findExe("mplayer-bin");
    if(playerPath.isNull() ) playerPath=KStandardDirs::findExe("mplayer");
    kdDebug() << "Trying to set player path to " << playerPath << endl;
    kcfg_mplayerbin->setText( playerPath );
}