summaryrefslogtreecommitdiffstats
path: root/src/mplayerthumbsconfig
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 10:41:32 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-24 10:41:32 -0500
commitc53429a6968563f72f8b334486d6dd1f0de75ecb (patch)
tree6c6b3c6d09f776dc7a54635584bfa79a3af71ed9 /src/mplayerthumbsconfig
downloadmplayerthumbs-c53429a6968563f72f8b334486d6dd1f0de75ecb.tar.gz
mplayerthumbs-c53429a6968563f72f8b334486d6dd1f0de75ecb.zip
Initial import of mplayerthumbs 0.5b sources
Diffstat (limited to 'src/mplayerthumbsconfig')
-rw-r--r--src/mplayerthumbsconfig/Makefile.am11
-rw-r--r--src/mplayerthumbsconfig/main.cpp69
-rw-r--r--src/mplayerthumbsconfig/mplayerthumbscfg.cpp65
-rw-r--r--src/mplayerthumbsconfig/mplayerthumbscfg.h38
4 files changed, 183 insertions, 0 deletions
diff --git a/src/mplayerthumbsconfig/Makefile.am b/src/mplayerthumbsconfig/Makefile.am
new file mode 100644
index 0000000..6534793
--- /dev/null
+++ b/src/mplayerthumbsconfig/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_builddir)/src $(all_includes)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/videopreview.pot
+bin_PROGRAMS = mplayerthumbsconfig
+mplayerthumbsconfig_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+mplayerthumbsconfig_SOURCES = main.cpp mplayerthumbscfg.cpp
+noinst_HEADERS = mplayerthumbscfg.h
+mplayerthumbsconfig_LDADD = $(top_builddir)/src/videopreview.la $(LIB_KDEUI)
diff --git a/src/mplayerthumbsconfig/main.cpp b/src/mplayerthumbsconfig/main.cpp
new file mode 100644
index 0000000..2d1bc6f
--- /dev/null
+++ b/src/mplayerthumbsconfig/main.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Marco Gulino *
+ * marco@kmobiletools.org *
+ * *
+ * 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 <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+#include "mplayerthumbscfg.h"
+#include "mplayerthumbs.h"
+
+static const char description[] =
+ I18N_NOOP("MPlayerThumbs Configuration Utility");
+
+static const char version[] = "0.1";
+
+static KCmdLineOptions options[] =
+{
+// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("MPlayerThumbsConfig", I18N_NOOP("MPlayerThumbsConfig"), version, description,
+ KAboutData::License_GPL, "(C) 2006 Marco Gulino", 0, 0, "marco@kmobiletools.org");
+ about.addAuthor( "Marco Gulino", 0, "marco@kmobiletools.org" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+ MPlayerThumbsConfig *mainWin = 0;
+
+// if (app.isRestored())
+// {
+// RESTORE(MPlayerThumbsConfig);
+// }
+// else
+// {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ /// @todo do something with the command line args here
+
+ mainWin = new MPlayerThumbsConfig(0, "configDialog", new MPlayerThumbsCfg(), KDialogBase::Swallow );
+ app.setMainWidget( mainWin );
+ mainWin->show();
+
+ args->clear();
+// }
+
+ // mainWin has WDestructiveClose flag by default, so it will delete itself.
+ return app.exec();
+}
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 *
+ * marco@kmobiletools.org *
+ * *
+ * 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 );
+}
diff --git a/src/mplayerthumbsconfig/mplayerthumbscfg.h b/src/mplayerthumbsconfig/mplayerthumbscfg.h
new file mode 100644
index 0000000..6757a4c
--- /dev/null
+++ b/src/mplayerthumbsconfig/mplayerthumbscfg.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Marco Gulino *
+ * marco@kmobiletools.org *
+ * *
+ * 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. *
+ ***************************************************************************/
+#ifndef _MPLAYERTHUMBSCONFIG_
+#define _MPLAYERTHUMBSCONFIG_
+#include <kconfigdialog.h>
+#include "mplayerthumbs.h"
+
+class KLineEdit;
+class MPlayerThumbsConfig : public KConfigDialog
+{
+ Q_OBJECT
+ public:
+ MPlayerThumbsConfig(QWidget *parent, const char *name, MPlayerThumbsCfg *config, DialogType dialogType=IconList, int dialogButtons=Default|Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool modal=false);
+ ~MPlayerThumbsConfig();
+ private:
+ KLineEdit *kcfg_mplayerbin;
+public slots:
+ void autoFindPath();
+};
+
+#endif