diff options
author | Timothy Pearson <[email protected]> | 2011-11-06 15:56:34 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-11-06 15:56:34 -0600 |
commit | b529f046c9a64ac5fcfa60747af940cf972b3ebc (patch) | |
tree | 83c28cf7fa8fed1960ebd3924b579e7ed8c95cc6 /tdeprint/tdeprintfax/filterdlg.cpp | |
parent | 6508fe4c40c60fd7a43bd3d9e19b762e10ea3f53 (diff) | |
download | tdebase-b529f046c9a64ac5fcfa60747af940cf972b3ebc.tar.gz tdebase-b529f046c9a64ac5fcfa60747af940cf972b3ebc.zip |
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'tdeprint/tdeprintfax/filterdlg.cpp')
-rw-r--r-- | tdeprint/tdeprintfax/filterdlg.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tdeprint/tdeprintfax/filterdlg.cpp b/tdeprint/tdeprintfax/filterdlg.cpp new file mode 100644 index 000000000..0324863bc --- /dev/null +++ b/tdeprint/tdeprintfax/filterdlg.cpp @@ -0,0 +1,72 @@ +/* + * tdeprintfax - a small fax utility + * Copyright (C) 2001 Michael Goffioul + * + * 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, Boston, MA 02110-1301, USA. + * + */ + +#include "filterdlg.h" +#include "filterdlg.moc" + +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqlayout.h> + +#include <klocale.h> + +FilterDlg::FilterDlg(TQWidget *parent, const char *name) +: KDialogBase(parent, name, true, i18n("Filter Parameters"), Ok|Cancel, Ok) +{ + TQWidget *w = new TQWidget(this); + + m_mime = new TQLineEdit(w); + m_cmd = new TQLineEdit(w); + TQLabel *m_mimelabel = new TQLabel(i18n("MIME type:"), w); + TQLabel *m_cmdlabel = new TQLabel(i18n("Command:"), w); + + TQGridLayout *l0 = new TQGridLayout(w, 2, 2, 10, 5); + l0->setColStretch(1, 1); + l0->addWidget(m_mimelabel, 0, 0); + l0->addWidget(m_cmdlabel, 1, 0); + l0->addWidget(m_mime, 0, 1); + l0->addWidget(m_cmd, 1, 1); + + setMainWidget(w); + m_mime->setFocus(); + resize(300, 100); + connect(m_mime, TQT_SIGNAL(textChanged ( const TQString & )),this, TQT_SLOT(slotTextFilterChanged())); + connect(m_cmd, TQT_SIGNAL(textChanged ( const TQString & )),this, TQT_SLOT(slotTextFilterChanged())); + slotTextFilterChanged(); +} + +void FilterDlg::slotTextFilterChanged( ) +{ + enableButtonOK(!m_mime->text().isEmpty() && !m_cmd->text().isEmpty()); +} + +bool FilterDlg::doIt(TQWidget *parent, TQString *mime, TQString *cmd) +{ + FilterDlg dlg(parent); + if (mime) dlg.m_mime->setText(*mime); + if (cmd) dlg.m_cmd->setText(*cmd); + if (dlg.exec()) + { + if (mime) *mime = dlg.m_mime->text(); + if (cmd) *cmd = dlg.m_cmd->text(); + return true; + } + return false; +} |