- Removed "visible" flag from popup dialogs

- Laid out widget code for request adding. That`s not a trivial dialog like the previous...

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@900 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-18 00:27:33 +00:00
parent e27ba77fed
commit d8694b2f5b
8 changed files with 34 additions and 11 deletions

View File

@ -4,7 +4,6 @@
<glade-interface>
<widget class="GtkDialog" id="AddProcessDialog">
<property name="visible">True</property>
<property name="title" translatable="yes">Add Process</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_MOUSE</property>

View File

@ -5,7 +5,6 @@
<widget class="GtkDialog" id="AddRequestDialog">
<property name="height_request">0</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Add Request</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_MOUSE</property>

View File

@ -4,7 +4,6 @@
<glade-interface>
<widget class="GtkDialog" id="AddResourceDialog">
<property name="visible">True</property>
<property name="title" translatable="yes">Add Resource</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_MOUSE</property>

View File

@ -4,7 +4,6 @@
<glade-interface>
<widget class="GtkDialog" id="AddThreadDialog">
<property name="visible">True</property>
<property name="title" translatable="yes">Add Thread</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_MOUSE</property>

View File

@ -5,7 +5,6 @@
<widget class="GtkDialog" id="ConfigureCPUPolicyDialog">
<property name="height_request">0</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Configure the CPU Policy</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_MOUSE</property>

View File

@ -5,7 +5,6 @@
<widget class="GtkDialog" id="ConfigureDialog">
<property name="height_request">0</property>
<property name="visible">True</property>
<property name="title" translatable="yes">SGPEMv2 Preferences</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>

View File

@ -41,7 +41,8 @@ using Gnome::Glade::Xml;
SchedulablesTreeWidget::SchedulablesTreeWidget() :
_add_process_dialog_glade(Xml::create(GLADEDIR "/add-process-dialog.glade")),
_add_thread_dialog_glade(Xml::create(GLADEDIR "/add-thread-dialog.glade"))
_add_thread_dialog_glade(Xml::create(GLADEDIR "/add-thread-dialog.glade")),
_add_request_dialog_glade(Xml::create(GLADEDIR "/add-request-dialog.glade"))
{
_columns.add(_main_column);
@ -66,6 +67,9 @@ SchedulablesTreeWidget::SchedulablesTreeWidget() :
_action_group->add( Gtk::Action::create("AddThread", "Add Thread"),
sigc::mem_fun(*this, &SchedulablesTreeWidget::_on_add_thread) );
_action_group->add( Gtk::Action::create("AddRequest", "Add Request"),
sigc::mem_fun(*this, &SchedulablesTreeWidget::_on_add_request) );
_UIManager = Gtk::UIManager::create();
_UIManager->insert_action_group(_action_group);
@ -74,6 +78,7 @@ SchedulablesTreeWidget::SchedulablesTreeWidget() :
" <popup name='PopupMenu'>"
" <menuitem action='AddProcess'/>"
" <menuitem action='AddThread'/>"
" <menuitem action='AddRequest'/>"
" </popup>"
"</ui>";
@ -83,9 +88,7 @@ SchedulablesTreeWidget::SchedulablesTreeWidget() :
/** DIALOGS **/
_add_process_dialog_glade->get_widget("AddProcessDialog", _add_process_dialog);
_add_thread_dialog_glade->get_widget("AddThreadDialog", _add_thread_dialog);
//FIXME why do I need to call this? Is it reasonable?
_add_process_dialog->hide();
_add_thread_dialog->hide();
_add_request_dialog_glade->get_widget("AddRequestDialog", _add_request_dialog);
set_headers_visible(false);
@ -235,3 +238,26 @@ SchedulablesTreeWidget::_on_add_thread()
_add_thread_dialog->hide();
}
void
SchedulablesTreeWidget::_on_add_request()
{
TreeModel::iterator sel = get_selection()->get_selected();
if(!sel)
return;
const void* p_handle = (*sel)[_handles_column];
HandleType type = (*sel)[_types_column];
Thread* t = reinterpret_cast<Thread*>(const_cast<void*>(p_handle));
if(t == NULL || type != htype_thread)
return;
if(_add_request_dialog->run() == RESPONSE_OK)
{
//FIXME writre code for me :-)
}
_add_request_dialog->hide();
}

View File

@ -61,6 +61,7 @@ namespace sgpem
void _on_add_process();
void _on_add_thread();
void _on_add_request();
Glib::RefPtr<Gtk::TreeStore> _model;
Gtk::TreeModelColumnRecord _columns;
@ -72,8 +73,10 @@ namespace sgpem
Gtk::Menu* _menu;
Glib::RefPtr<Gnome::Glade::Xml> _add_process_dialog_glade;
Glib::RefPtr<Gnome::Glade::Xml> _add_thread_dialog_glade;
Glib::RefPtr<Gnome::Glade::Xml> _add_request_dialog_glade;
Gtk::Dialog* _add_process_dialog;
Gtk::Dialog* _add_thread_dialog;
Gtk::Dialog* _add_request_dialog;
};
} //~ namespace sgpem