]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Fix view selection when creating or restarting a job. V6_4_0a1
authorribes <ribes>
Thu, 27 Oct 2011 16:38:33 +0000 (16:38 +0000)
committerribes <ribes>
Thu, 27 Oct 2011 16:38:33 +0000 (16:38 +0000)
src/engine/BL_JobsManager.cxx
src/genericgui/BL_GenericGui.hxx
src/genericgui/BL_JobsManager_QT.cxx
src/genericgui/BL_QModelManager.cxx

index 92bfc68182a751a740174c37f3d357aa689475ec..c13730d4226c7a121f42c1c114a3d03cc63a906f 100644 (file)
@@ -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;
index 79d93d36dd4566bec8b900b9717effd64d2eb490..0f3d8245a0aabc1244014ee0493d9bb221602b6d 100644 (file)
@@ -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;
index 5ceb46028444a75c726a64c3781fea8b551fe774..8951cc61878fe198e0b8ac8a67a8a82539cdb0cc 100644 (file)
@@ -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<QStandardItem *> 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);
 }
index 43b481c29f8f1f7ea4ddb3a0c09073abaf7f1875..aeb34cb60ff0eceaa8adad94772065b89a6733b8 100644 (file)
@@ -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);