src/wscout_gui_filter_dialog.hxx

00001 /*
00002  * WScout - Lightweight PCAP visualizer.
00003  * Copyright (C) 2007  Universite Pierre et Marie Curie - Paris 6
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00018  * MA  02110-1301  USA
00019  *
00020  * Author: Thomas Claveirole <thomas.claveirole@lip6.fr>
00021  */
00022 
00023 #ifndef WSCOUT_GUI_FILTER_DIALOG_HXX_
00024 # define WSCOUT_GUI_FILTER_DIALOG_HXX_
00025 
00026 # include "wscout_gui_filter_dialog.hh"
00027 
00028 namespace wscout
00029 {
00030 
00031   namespace gui
00032   {
00033 
00034     inline
00035     QString
00036     FilterDialog::inputFileName() const
00037     {
00038       return in_file_name_;
00039     }
00040 
00041     inline
00042     void
00043     FilterDialog::setInputFileName(const QString& n)
00044     {
00045       in_file_name_ = n;
00046     }
00047 
00048     inline
00049     QString
00050     FilterDialog::outputFileName() const
00051     {
00052       return out_file_name_.text();
00053     }
00054 
00055     inline
00056     void
00057     FilterDialog::setOutputFileName(const QString& n)
00058     {
00059       out_file_name_.setText(n);
00060     }
00061 
00062     inline
00063     void
00064     FilterDialog::setDefaultFilter(const QString& f)
00065     {
00066       default_filter_ = f;
00067     }
00068 
00069     inline
00070     void
00071     FilterDialog::setDefaultCommand(const QString& c)
00072     {
00073       default_command_ = c;
00074     }
00075 
00076     inline
00077     std::string
00078     FilterDialog::commandLine() const
00079     {
00080       return
00081         command_.text()
00082         .arg(in_file_name_)
00083         .arg(out_file_name_.text())
00084         .arg(filter_.text()).toStdString();
00085     }
00086 
00087     inline
00088     QString
00089     FilterDialog::prettyCommandLine() const
00090     {
00091       return tr("<p><b>Command line</b></p>"
00092                 "<p><code>") + commandLine().c_str() + tr("</code></p>");
00093     }
00094 
00095     inline
00096     QString
00097     FilterDialog::prettyProcessOutput()
00098     {
00099       return
00100         tr("<p><b>Process output</b></p>"
00101            "<p><code>") + process_.readAll() + tr("</code></p>");
00102     }
00103 
00104   } // End of namespace gui.
00105 
00106 } // End of namespace wscout.
00107 
00108 #endif // ! WSCOUT_GUI_FILTER_DIALOG_HXX_

Generated on Wed Jan 30 19:02:27 2008 for WScout by  doxygen 1.5.4