Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "config.h"
00038 #include "window1.hh"
00039 #include "bridge.hh"
00040 #include "main_window.hh"
00041
00042 void window1::on_button10_clicked(){
00043 entry1->set_text("");
00044 set_title("Search");
00045 m_refTreeModel->clear();
00046 treeview1->remove_all_columns();
00047
00048 }
00049 int window1::get_selected(){
00050 return selected;
00051 }
00052 void window1::on_button11_clicked(){
00053 m_refTreeModel->clear();
00054 char msg[1000];
00055 char bc_msg[1000];
00056
00057
00058 io_go_to(0);
00059 int res=0,serial=0,idx=0,pos=0;
00060 treeview1->remove_all_columns();
00061 treeview1->set_model(m_refTreeModel);
00062 treeview1->append_column("ID", m_Columns.m_col_id);
00063 treeview1->append_column("Serial", m_Columns.m_col_number);
00064
00065 if (message_rb->get_active()){
00066 treeview1->append_column("Message ", m_Columns.m_col_name);
00067 }
00068
00069
00070 while (res>=0){
00071 if (token_rb->get_active()){
00072 res=read_next_token(msg,bc_msg,&serial,&pos,entry1->get_text().c_str());
00073 if (res>0){
00074 Gtk::TreeModel::Row row = *(m_refTreeModel->append());
00075 row[m_Columns.m_col_id] = pos;
00076 row[m_Columns.m_col_bc] = bc_msg;
00077 row[m_Columns.m_col_number] = serial;
00078 idx++;
00079 }
00080 } else if (message_rb->get_active()){
00081 res=read_next_message(msg,bc_msg,&serial,&pos,entry1->get_text().c_str());
00082 if (res>0){
00083 Gtk::TreeModel::Row row = *(m_refTreeModel->append());
00084 row[m_Columns.m_col_id] = pos;
00085 row[m_Columns.m_col_name] = msg;
00086 row[m_Columns.m_col_bc] = bc_msg;
00087 row[m_Columns.m_col_number] = serial;
00088 idx++;
00089 selected=pos;
00090 }
00091 } else if (aut_rb->get_active()){
00092 res=read_next_authorization(msg,bc_msg,&serial,&pos,entry1->get_text().c_str());
00093 if (res>0){
00094 Gtk::TreeModel::Row row = *(m_refTreeModel->append());
00095 row[m_Columns.m_col_id] = pos;
00096 row[m_Columns.m_col_bc] = bc_msg;
00097 row[m_Columns.m_col_number] = serial;
00098 idx++;
00099 }
00100 } else if (drop_rb->get_active()){
00101 res=read_next_drop(msg,bc_msg,&serial,&pos,entry1->get_text().c_str());
00102 if (res>0){
00103 Gtk::TreeModel::Row row = *(m_refTreeModel->append());
00104 row[m_Columns.m_col_id] = pos;
00105 row[m_Columns.m_col_number] = serial;
00106 idx++;
00107 }
00108 } else if (all_rb->get_active()){
00109 res=read_next_bc(msg,bc_msg,&serial,&pos,entry1->get_text().c_str());
00110 if (res>0){
00111 Gtk::TreeModel::Row row = *(m_refTreeModel->append());
00112 row[m_Columns.m_col_id] = pos;
00113 row[m_Columns.m_col_name] = msg;
00114 row[m_Columns.m_col_bc] = bc_msg;
00115 row[m_Columns.m_col_number] = serial;
00116 idx++;
00117 }
00118 }
00119 }
00120 char txt[30];
00121 sprintf(txt,"Search (%d)",idx);
00122 set_title(txt);
00123 }
00124 void window1::on_button12_clicked(){
00125 hide();
00126 }
00127 #include "icon.h"
00128 window1::window1(main_window* mw):window1_glade(){
00129 this->mw=mw;
00130 all_rb->hide();
00131 drop_rb->hide();
00132 set_icon(Gdk::Pixbuf::create_from_xpm_data(icon));
00133 set_size_request(200, 600);
00134 treeview1->signal_cursor_changed().connect(sigc::mem_fun(*this, &window1::on_cursor_changed));
00135 m_refTreeModel = Gtk::TreeStore::create(m_Columns);
00136
00137 set_title("Search");
00138 set_keep_above(true);
00139 }
00140
00141 void window1::on_cursor_changed(){
00142 Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview1->get_selection();
00143 Gtk::TreeModel::iterator iter = refTreeSelection->get_selected();
00144 if(iter){
00145 Gtk::TreeModel::Row row = *iter;
00146 selected = row[m_Columns.m_col_id];
00147 mw->notify_selection(selected);
00148 }
00149 }