diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-19 18:22:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-19 18:22:05 +0000 |
commit | 57e10fedbcb8c3e8c6590ff0935dbf017ce5587f (patch) | |
tree | 3000a7649ca4e40e43f9e7feed963236a0b0f56b /kipi-plugins/mpegencoder/optionsdialog.cpp | |
download | kipi-plugins-57e10fedbcb8c3e8c6590ff0935dbf017ce5587f.tar.gz kipi-plugins-57e10fedbcb8c3e8c6590ff0935dbf017ce5587f.zip |
Import abandoned KDE3 version of kipi plugins
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/kipi-plugins@1077221 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kipi-plugins/mpegencoder/optionsdialog.cpp')
-rw-r--r-- | kipi-plugins/mpegencoder/optionsdialog.cpp | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/kipi-plugins/mpegencoder/optionsdialog.cpp b/kipi-plugins/mpegencoder/optionsdialog.cpp new file mode 100644 index 0000000..615c321 --- /dev/null +++ b/kipi-plugins/mpegencoder/optionsdialog.cpp @@ -0,0 +1,134 @@ +////////////////////////////////////////////////////////////////////////////// +// +// OPTIONSDIALOG.CPP +// +// Copyright (C) 2003 Gilles CAULIER <caulier dot gilles at gmail dot com> +// +// 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., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA. +// +////////////////////////////////////////////////////////////////////////////// + +// Include files for Qt + +#include <qvbox.h> +#include <qlayout.h> +#include <qwidget.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <qgroupbox.h> +#include <qstring.h> + +// Include files for KDE + +#include <klocale.h> +#include <klineedit.h> +#include <kiconloader.h> +#include <kfiledialog.h> + +// Local includes. + +#include "optionsdialog.h" +#include "kimg2mpg.h" + +namespace KIPIMPEGEncoderPlugin +{ + +////////////////////////////////// CONSTRUCTOR ////////////////////////////////////////////// + +OptionsDialog::OptionsDialog(QWidget *parent) + : KDialogBase( parent, "MPEGEncoderOptionsDialog", true, + i18n("MPEG Encoder Plugin Settings"), Ok|Cancel, Ok, false) +{ + Icons = new KIconLoader( QString( "MenuDlg" ) ); + + QWidget* box = new QWidget( this ); + setMainWidget(box); + QVBoxLayout* vbox = new QVBoxLayout (box, 10); + QHBoxLayout* h1 = new QHBoxLayout( vbox ); + QVBoxLayout* v1 = new QVBoxLayout( h1 ); + h1->addSpacing( 5 ); + QGridLayout* g1 = new QGridLayout( v1, 3, 3 ); + + // ImageMagick binary programs folder + + QGroupBox* IMBinFolderGroup = new QGroupBox( 3, Qt::Horizontal, i18n( "ImageMagick Binary Programs Path" ), box); + g1->addWidget( IMBinFolderGroup, 1, 1, Qt::AlignLeft); + IMBinFolderEditFilename = new KLineEdit( IMBinFolderGroup ); + IMBinFolderEditFilename->setMinimumWidth( 300 ); + QPushButton* IMBinFolderButtonFilename = new QPushButton( IMBinFolderGroup ); + IMBinFolderButtonFilename->setPixmap( LoadIcon( QString( "fileopen" ), KIcon::Toolbar ) ); + connect( IMBinFolderButtonFilename, SIGNAL( clicked() ), this, SLOT( slotIMBinFolderFilenameDialog())); + + // MjpegTools binary programs folder + + QGroupBox* MJBinFolderGroup = new QGroupBox( 3, Qt::Horizontal, i18n( "MjpegTools Binary Programs Path" ), box); + g1->addWidget( MJBinFolderGroup, 2, 1, Qt::AlignLeft); + MJBinFolderEditFilename = new KLineEdit( MJBinFolderGroup ); + MJBinFolderEditFilename->setMinimumWidth( 300 ); + QPushButton* MJBinFolderButtonFilename = new QPushButton( MJBinFolderGroup ); + MJBinFolderButtonFilename->setPixmap( LoadIcon( QString( "fileopen" ), KIcon::Toolbar ) ); + connect( MJBinFolderButtonFilename, SIGNAL( clicked() ), this, SLOT( slotMJBinFolderFilenameDialog())); +} + + +//////////////////////////////////// DESTRUCTOR ///////////////////////////////////////////// + +OptionsDialog::~OptionsDialog() +{ +} + + +//////////////////////////////////// FONCTIONS ////////////////////////////////////////////// + +QPixmap OptionsDialog::LoadIcon( QString Name, int Group ) +{ + return Icons->loadIcon( Name, (KIcon::Group)Group ); +} + +////////////////////////////////// SLOTS //////////////////////////////////////////////////// + + +void OptionsDialog::slotIMBinFolderFilenameDialog( void ) +{ + QString temp; + + temp = KFileDialog::getExistingDirectory(IMBinFolderEditFilename->text(), + this, + i18n("Select path to ImageMagick binary programs...")); + + if( temp.isEmpty() ) + return; + + IMBinFolderEditFilename->setText( temp ); +} + + +void OptionsDialog::slotMJBinFolderFilenameDialog( void ) +{ + QString temp; + + temp = KFileDialog::getExistingDirectory(MJBinFolderEditFilename->text(), + this, + i18n("Select path to MjpegTools binary programs...")); + + if( temp.isEmpty() ) + return; + + MJBinFolderEditFilename->setText( temp ); +} + +} // NameSpace KIPIMPEGEncoderPlugin + +#include "optionsdialog.moc" |