summaryrefslogtreecommitdiffstats
path: root/src/mplayerthumbsconfig/mplayerthumbscfg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mplayerthumbsconfig/mplayerthumbscfg.cpp')
-rw-r--r--src/mplayerthumbsconfig/mplayerthumbscfg.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/mplayerthumbsconfig/mplayerthumbscfg.cpp b/src/mplayerthumbsconfig/mplayerthumbscfg.cpp
new file mode 100644
index 0000000..f1fc24a
--- /dev/null
+++ b/src/mplayerthumbsconfig/mplayerthumbscfg.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Marco Gulino *
+ * *
+ * 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 );
+}