AMDataViewWithActionButtons::AMDataViewWithActionButtons(AMDatabase* database, QWidget *parent) : QWidget(parent) { QVBoxLayout* vl = new QVBoxLayout; dataView_ = new AMDataView(database); QFrame* actionsBarFrame = new QFrame; ui_ = new Ui::AMDataViewActionsBar; ui_->setupUi(actionsBarFrame); vl->setContentsMargins(0,0,0,0); vl->setSpacing(0); vl->addWidget(dataView_); vl->addWidget(actionsBarFrame); setLayout(vl); connect(ui_->sizeSlider, SIGNAL(valueChanged(int)), dataView_, SLOT(setItemSize(int))); connect(ui_->expandAllButton, SIGNAL(clicked()), dataView_, SLOT(expandAll())); connect(ui_->collapseAllButton, SIGNAL(clicked()), dataView_, SLOT(collapseAll())); connect(ui_->openSameEditorButton, SIGNAL(clicked()), this, SLOT(onCompareScansAction())); connect(ui_->openSeparateEditorButton, SIGNAL(clicked()), this, SLOT(onEditScansAction())); connect(ui_->exportButton, SIGNAL(clicked()), this, SLOT(onExportScansAction())); connect(ui_->scanConfigurationButton, SIGNAL(clicked()), this, SLOT(onLaunchScanConfigurationsFromDb())); connect(dataView_, SIGNAL(viewDoubleClicked()), this, SLOT(onDoubleClick())); connect(dataView_, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); connect(dataView_, SIGNAL(editScansFromDb()), this, SLOT(onEditScansAction())); connect(dataView_, SIGNAL(compareScansFromDb()), this, SLOT(onCompareScansAction())); connect(dataView_, SIGNAL(exportScansFromDb()), this, SLOT(onExportScansAction())); connect(dataView_, SIGNAL(launchScanConfigurationsFromDb()), this, SLOT(onLaunchScanConfigurationsFromDb())); connect(dataView_, SIGNAL(fixCDF()), this, SLOT(onFixCDF())); }
bool AMDatamanAppControllerForActions2::startupCreateUserInterface() { AMErrorMon::information(this, AMDATAMANAPPCONTROLLER_STARTUP_MESSAGES, "Acquaman Startup: Populating User Interface"); qApp->processEvents(); settingsMasterView_ = 0; issueSubmissionView_ = 0; bottomBar_ = new AMBottomBar(); // These buttons are never used. Hiding them. bottomBar_->fullScreenButton->hide(); bottomBar_->adjustScanFinishButton->hide(); bottomBar_->restartScanButton->hide(); mw_->addBottomWidget(bottomBar_); connect(bottomBar_, SIGNAL(addButtonClicked()), this, SLOT(onAddButtonClicked())); connect(bottomBar_, SIGNAL(pauseScanIssued()), this, SIGNAL(pauseScanIssued())); connect(bottomBar_, SIGNAL(resumeScanIssued()), this, SIGNAL(resumeScanIssued())); connect(bottomBar_, SIGNAL(stopScanIssued()), this, SIGNAL(stopScanIssued())); // Create panes in the main window: //////////////////////////////////// // A heading for the scan editors scanEditorsParentItem_ = mw_->windowPaneModel()->headingItem("Open Scans"); // Make a dataview widget and add it under two links/headings: "Runs" and "Experiments". See AMMainWindowModel for more information. //////////////////////////////////// dataView_ = new AMDataViewWithActionButtons(); dataView_->setWindowTitle("Data"); QStandardItem* dataViewItem = new QStandardItem(); dataViewItem->setData(qVariantFromValue((QWidget*)dataView_), AM::WidgetRole); dataViewItem->setFlags(Qt::ItemIsEnabled); // enabled, but should not be selectable QFont font = QFont("Lucida Grande", 10, QFont::Bold); font.setCapitalization(QFont::AllUppercase); dataViewItem->setFont(font); dataViewItem->setData(QBrush(QColor::fromRgb(100, 109, 125)), Qt::ForegroundRole); dataViewItem->setData(true, AMWindowPaneModel::DockStateRole); mw_->windowPaneModel()->appendRow(dataViewItem); runsParentItem_ = new QStandardItem(QIcon(":/22x22/view_calendar_upcoming_days.png"), "Runs"); mw_->windowPaneModel()->initAliasItem(runsParentItem_, dataViewItem, "Runs", -1); dataViewItem->appendRow(runsParentItem_); experimentsParentItem_ = new QStandardItem(QIcon(":/applications-science.png"), "Experiments"); mw_->windowPaneModel()->initAliasItem(experimentsParentItem_, dataViewItem, "Experiments", -1); dataViewItem->appendRow(experimentsParentItem_); // Hook into the sidebar and add Run and Experiment links below these headings. runExperimentInsert_ = new AMRunExperimentInsert(AMDatabase::database("user"), runsParentItem_, experimentsParentItem_, this); connect(runExperimentInsert_, SIGNAL(newExperimentAdded(QModelIndex)), this, SLOT(onNewExperimentAdded(QModelIndex))); // connect the activated signal from the dataview to our own slot connect(dataView_, SIGNAL(selectionActivated(QList<QUrl>)), this, SLOT(onDataViewItemsActivated(QList<QUrl>))); connect(dataView_, SIGNAL(selectionActivatedSeparateWindows(QList<QUrl>)), this, SLOT(onDataViewItemsActivatedSeparateWindows(QList<QUrl>))); connect(dataView_, SIGNAL(selectionExported(QList<QUrl>)), this, SLOT(onDataViewItemsExported(QList<QUrl>))); connect(dataView_, SIGNAL(launchScanConfigurationsFromDb(QList<QUrl>)), this, SLOT(onLaunchScanConfigurationsFromDb(QList<QUrl>))); connect(dataView_, SIGNAL(fixCDF(QUrl)), this, SLOT(fixCDF(QUrl))); // When 'alias' links are clicked in the main window sidebar, we might need to notify some widgets of the details connect(mw_, SIGNAL(aliasItemActivated(QWidget*,QString,QVariant)), this, SLOT(onMainWindowAliasItemActivated(QWidget*,QString,QVariant))); ///////////////////////// // Make connections: ////////////////////////////// connect(mw_, SIGNAL(currentPaneChanged(QWidget*)), this, SLOT(onCurrentPaneChanged(QWidget*))); // show main window mw_->show(); return true; }