// TableView -> X
connect(_jobs_table, SIGNAL(clicked(QModelIndex)), _job_tab, SLOT(job_selected(QModelIndex)));
connect(_jobs_table, SIGNAL(clicked(QModelIndex)), this, SLOT(job_selected(QModelIndex)));
- connect(_jobs_table, SIGNAL(clicked(QModelIndex)), _model_manager, SLOT(job_selected(QModelIndex)));
+ connect(_jobs_table, SIGNAL(activated(QModelIndex)), this, SLOT(job_activated(QModelIndex)));
+ connect(_jobs_table, SIGNAL(activated(QModelIndex)), _job_tab, SLOT(job_activated(QModelIndex)));
// Delete Job -> X
connect(this, SIGNAL(job_deleted(QString)), _job_tab, SLOT(reset(QString)));
}
updateButtonsStates();
}
+void
+BL::GenericGui::job_activated(const QModelIndex & index)
+{
+ DEBTRACE("BL::GenericGui::job_activated slot");
+ job_selected(index);
+}
+
void
BL::GenericGui::job_state_changed(const QString & name)
{
void stop_job();
void get_results_job();
void job_selected(const QModelIndex & index);
+ void job_activated(const QModelIndex & index);
void job_state_changed(const QString & name);
void updateButtonsStates();
insertTab(1, _files_tab, "Job Files");
}
+void
+BL::JobTab::job_activated(const QModelIndex & index)
+{
+ DEBTRACE("BL::JobTab::job_activated slot");
+ job_selected(index);
+}
+
void
BL::JobTab::job_selected(const QModelIndex & index)
{
public slots:
void job_selected(const QModelIndex & index);
+ void job_activated(const QModelIndex & index);
void itemChanged(QStandardItem * item);
void reset(QString job_name);
setShowGrid(false);
setCornerButtonEnabled(false);
setEditTriggers(QAbstractItemView::NoEditTriggers);
- setSelectionBehavior(QAbstractItemView::SelectRows);
setAlternatingRowColors(true);
setSortingEnabled(true);
+ setSelectionBehavior(QAbstractItemView::SelectRows);
+ setSelectionMode(QAbstractItemView::ExtendedSelection);
+
QHeaderView * header_view = verticalHeader();
header_view->setClickable(false);
}
{
DEBTRACE("Destroying BL::JobsTable");
}
+
+void
+BL::JobsTable::currentChanged(const QModelIndex & current, const QModelIndex & previous)
+{
+ DEBTRACE("BL::JobsTable currentChanged");
+ activated(current);
+}
protected:
QWidget* _parent;
+ protected slots:
+ void currentChanged(const QModelIndex & current, const QModelIndex & previous);
};
}
if (list.size() > 0)
_model->removeRow(list[0]->row());
}
-
-void
-BL::QModelManager::job_selected(const QModelIndex & index)
-{
- DEBTRACE("BL::QModelManager::job_selected slot");
- QStandardItem * item = _model->itemFromIndex(index);
- int row = item->row();
-
- // Algo un peu bourrin....
- for (int i = 0; i < _model->rowCount(); i++)
- for (int j = 0; j < _model->columnCount(); j++)
- {
- _model->item(i,j)->setBackground(QBrush(Qt::white));
- _model->item(i,j)->setForeground(QBrush(Qt::black));
- }
-
- for (int j = 0; j < _model->columnCount(); j++)
- {
- _model->item(row,j)->setBackground(QBrush(Qt::darkBlue));
- _model->item(row,j)->setForeground(QBrush(Qt::white));
- }
-}
public slots:
void new_job_added(const QString & name);
void job_state_changed(const QString & name);
- void job_selected(const QModelIndex & index);
private:
QStandardItemModel * _model;