From 5fb7ed71ee8aa56a7b1b7bac7fb5610e42725827 Mon Sep 17 00:00:00 2001 From: ribes Date: Thu, 27 Oct 2011 16:38:33 +0000 Subject: [PATCH] Fix view selection when creating or restarting a job. --- src/engine/BL_JobsManager.cxx | 1 + src/genericgui/BL_GenericGui.hxx | 2 +- src/genericgui/BL_JobsManager_QT.cxx | 4 ++++ src/genericgui/BL_QModelManager.cxx | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/BL_JobsManager.cxx b/src/engine/BL_JobsManager.cxx index 92bfc68..c13730d 100644 --- a/src/engine/BL_JobsManager.cxx +++ b/src/engine/BL_JobsManager.cxx @@ -447,6 +447,7 @@ BL::JobsManager::launcher_event_new_job(const std::string & data) std::istringstream job_number_stream(data); if (job_number_stream >> job_number) { + DEBTRACE("Receive NEWJOB:" << job_number); BL::JobsManager::thread_info_new_job * ti = new thread_info_new_job(); ti->object_ptr = this; ti->job_number = job_number; diff --git a/src/genericgui/BL_GenericGui.hxx b/src/genericgui/BL_GenericGui.hxx index 79d93d3..0f3d824 100644 --- a/src/genericgui/BL_GenericGui.hxx +++ b/src/genericgui/BL_GenericGui.hxx @@ -80,6 +80,7 @@ namespace BL public: BL::JobTab * _job_tab; + BL::JobsTable * _jobs_table; protected: BL::MainWindows_Wrap * _wrapper; @@ -92,7 +93,6 @@ namespace BL QDockWidget * _dw_resource_catalog; BL::Buttons * _buttons; - BL::JobsTable * _jobs_table; BL::Summary * _summary; QAction * _create_job_action; diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index 5ceb460..8951cc6 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -305,6 +305,10 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard) // End addJobToLauncher(wizard.job_name); emit new_job_added(QString::fromStdString(wizard.job_name)); + QStandardItemModel * model = _model_manager->getModel(); + QList item_list = model->findItems(QString::fromStdString(wizard.job_name)); + QStandardItem * job_state_item = model->item(item_list.at(0)->row(), 2); + _main_gui->_jobs_table->selectRow(item_list.at(0)->row()); if (wizard.start_job) start_job(wizard.job_name); } diff --git a/src/genericgui/BL_QModelManager.cxx b/src/genericgui/BL_QModelManager.cxx index 43b481c..aeb34cb 100644 --- a/src/genericgui/BL_QModelManager.cxx +++ b/src/genericgui/BL_QModelManager.cxx @@ -53,6 +53,7 @@ BL::QModelManager::getModel() void BL::QModelManager::new_job_added(const QString & name) { + DEBTRACE("Adding new job in the model manager"); BL::Job * job = _jobs_manager->getJob(name.toStdString()); QStandardItem * new_job_name = new QStandardItem(name); -- 2.39.2