rec_param_dlg.cc
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           WMPSNIFFER          --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V7.0B  11/05/10
00005  *
00006  *
00007  *  File: rec_param_dlg.cc
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2012, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
00034  *
00035  *----------------------------------------------------------------------*/
00036 
00037 #include "config.h"
00038 #include "rec_param_dlg.hh"
00039 #include "unistd.h"
00040 #include <gtkmm/messagedialog.h>
00041 #include <gtkmm/filechooserdialog.h>
00042 #include <gtkmm/stock.h>
00043 void rec_param_dlg::on_sim_rb_clicked(){
00044         ok_btn->set_sensitive(true);
00045         if (marte_rb->get_active()){
00046                 int id=getuid();
00047                 if (id!=0){
00048                         ok_btn->set_sensitive(false);
00049                         Gtk::MessageDialog dialog(*this, "wmpSniffer v0.1b");
00050                                 dialog.set_secondary_text("Root Privileges are needed to use MaRTE Monitor");
00051                         dialog.run();
00052                 }
00053         }
00054 }
00055 
00056 void rec_param_dlg::on_button24_clicked(){
00057         Gtk::FileChooserDialog dialog("Please choose a folder",
00058                         Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
00059         dialog.set_transient_for(*this);
00060 
00061         //Add response buttons the the dialog:
00062         dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
00063         dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
00064 
00065         int result = dialog.run();
00066         switch (result) {
00067                 case (Gtk::RESPONSE_OK): {
00068                         break;
00069                 }
00070                 case (Gtk::RESPONSE_CANCEL): {
00071 
00072                         return;
00073                         break;
00074                 }
00075                 default: {
00076                         //std::cout << "Unexpected button clicked." << std::endl;
00077                         break;
00078                 }
00079         }
00080 }
00081 
00082 void rec_param_dlg::on_shmem_btn_clicked(){
00083         Gtk::FileChooserDialog dialog("Please choose an executable",
00084                                 Gtk::FILE_CHOOSER_ACTION_OPEN);
00085                 dialog.set_transient_for(*this);
00086 
00087                 //Add response buttons the the dialog:
00088                 dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
00089                 dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
00090 
00091                 int result = dialog.run();
00092                 switch (result) {
00093                         case (Gtk::RESPONSE_OK): {
00094                                 break;
00095                         }
00096                         case (Gtk::RESPONSE_CANCEL): {
00097                                 return;
00098                                 break;
00099                         }
00100                         default: {
00101                                 //std::cout << "Unexpected button clicked." << std::endl;
00102                                 break;
00103                         }
00104                 }
00105                 shmem_file->set_text(dialog.get_filename());
00106 }
00107 
00108 #include <vte-0.0/vte/vte.h>
00109 #include "icon.h"
00110 
00111 rec_param_dlg::rec_param_dlg() : rec_param_dlg_glade(){
00112         set_icon(Gdk::Pixbuf::create_from_xpm_data(icon));
00113         frame13->hide();
00114          set_size_request(400,200);
00115 }
00116 void rec_param_dlg::on_filename_clicked(){
00117         Gtk::FileChooserDialog dialog("Please choose a Filename",
00118                         Gtk::FILE_CHOOSER_ACTION_SAVE);
00119         dialog.set_transient_for(*this);
00120         dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
00121         dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
00122         dialog.run();
00123         filename_txt->set_text(dialog.get_filename());
00124 }


ros_rt_wmp_sniffer
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:57