From d2f2e85785cbffc7068183e09bfb35e9a5f867df Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Tue, 6 Dec 2005 17:24:03 +0000 Subject: [PATCH] Agrego nombre de archivo. --- viewer/main.cpp | 3 ++- viewer/new_tree_dialog.cpp | 9 +++++++++ viewer/new_tree_dialog.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/viewer/main.cpp b/viewer/main.cpp index e6a7a86..8fcda79 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -149,7 +149,8 @@ void nuevo_arbol () int type = d.getKeyType (); int atype = d.getTreeType (); - tree = Glib::RefPtr(new ViewBTree (real_canvas->root(), "test.idx", d.getBlockSize (), atype, type)); + std::string name = d.getName (); + tree = Glib::RefPtr(new ViewBTree (real_canvas->root(), name+".idx", d.getBlockSize (), atype, type)); real_frame->SetTree (tree); tree->signal_selected ().connect ( sigc::mem_fun (*real_frame, &ViewProperties::ShowItem) ); if (type == BTree::KEY_FIXED) { diff --git a/viewer/new_tree_dialog.cpp b/viewer/new_tree_dialog.cpp index d3dbf5c..c2df0bf 100644 --- a/viewer/new_tree_dialog.cpp +++ b/viewer/new_tree_dialog.cpp @@ -12,6 +12,10 @@ NewTreeDialog::NewTreeDialog(): Gtk::Dialog ("Nuevo Arbol", true, true), table.attach (fixed_key, 0, 1, 1, 2); table.attach (variable_key, 1, 2, 1, 2); + label_name.set_label ("Nombre de Archivo : "); + table.attach (label_name, 0, 1, 2, 3, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); + table.attach (entry_name, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); + label_block.set_label ("Tamaño de Bloque : "); table.attach (label_block, 0, 1, 2, 3, Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK, 8, 8); table.attach (entry_block, 1, 2, 2, 3, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 8, 8); @@ -55,6 +59,11 @@ uint NewTreeDialog::getBlockSize() return atoi (entry_block.get_text ().c_str()); } +std::string NewTreeDialog::getName () +{ + return entry_name.get_text (); +} + int NewTreeDialog::getKeyType () { if (fixed_key.get_active ()) diff --git a/viewer/new_tree_dialog.h b/viewer/new_tree_dialog.h index 63a5e56..5ece06e 100644 --- a/viewer/new_tree_dialog.h +++ b/viewer/new_tree_dialog.h @@ -12,6 +12,7 @@ class NewTreeDialog : public Gtk::Dialog { uint getAdds (); uint getDels (); uint getBlockSize (); + std::string getName (); int getKeyType (); int getTreeType (); private: @@ -20,9 +21,11 @@ class NewTreeDialog : public Gtk::Dialog { Gtk::Label label_block; Gtk::Label label_dels; Gtk::Label label_tt; + Gtk::Label label_name; Gtk::Entry entry_count; Gtk::Entry entry_dels; Gtk::Entry entry_block; + Gtk::Entry entry_name; Gtk::RadioButton fixed_key; Gtk::RadioButton variable_key; Gtk::RadioButton tree_ident; -- 2.43.0