예제 #1
0
void InspectorPanel::newItemsInspected(const Selection& objects)
{
    // Ignore items in both
    // Create items in objects and not in current
    // Delete items in current and not in objects
    Selection toCreate, toDelete;
    std::set_difference(objects.begin(), objects.end(),
                        m_currentSel.begin(), m_currentSel.end(),
                        std::inserter(toCreate, toCreate.begin()));

    std::set_difference(m_currentSel.begin(), m_currentSel.end(),
                        objects.begin(), objects.end(),
                        std::inserter(toDelete, toDelete.begin()));
    for(const auto& object : toDelete)
    {
        auto widget_it = m_map.get<0>().find(object);
        if(widget_it != m_map.get<0>().end())
        {
            (*widget_it)->deleteLater();
            *m_map.get<0>().erase(widget_it);
        }
    }

    for(const auto& object : toCreate)
    {
        auto widget = InspectorWidgetList::makeInspectorWidget(object->objectName(),
                                                               object,
                                                               m_tabWidget);
        m_tabWidget->addTab(widget, widget->tabName());
        m_map.insert(widget);
    }

    m_currentSel = objects;
}
예제 #2
0
wstring QueryAssembler::getQueryTemplateFromDB(const wstring& frameName, const string& pathToDb)
{
	DataTuple<QueryColumnTypes> key;

	std::list<DataTuple<QueryResultTypes>> rows;

	string sframeName = "";

	string tabName(tableName);

	CONVERT_TO_UTF8_STRING(frameName,  sframeName);

	key.set<frame_name>(sframeName);

	getTemplate(tabName, key, rows);

	if(rows.size() == 0)
	{
		throw ENoInterpretation(frameName.c_str());
	}

	if(rows.size() > 1)
	{
		throw EMultipleInterpretations(frameName.c_str());
	}

	wstring wtemplate = L"";

	for (std::list<DataTuple<QueryResultTypes> >::iterator i = rows.begin(); i != rows.end(); ++i)
	{
		wtemplate =  CONVERT_TO_WSTRING(i->get<0>());
	}

	return wtemplate;
}
예제 #3
0
파일: tabbar.cpp 프로젝트: amosbird/CopyQ
void TabBar::dropEvent(QDropEvent *event)
{
    int tabIndex = dropItemsTabIndex(*event, *this);

    if ( tabIndex != -1 )
        emit dropItems( tabName(tabIndex), event->mimeData() );
    else
        QTabBar::dropEvent(event);
}
예제 #4
0
void LuminaryDialog::OnClickButtonAdd(wxCommandEvent& event)
{
  if(m_nbPanels < NB_MAXFLAMMES){
    m_luminaryPanels[m_nbPanels] = new LuminaryPanel(m_luminaryNotebook, -1, m_currentConfig->nbLuminaries);
    m_nbPanels++;
    wxString tabName(_("Luminary #")); tabName << m_nbPanels;
    m_luminaryNotebook->AddPage(m_luminaryPanels[m_nbPanels-1], tabName);
    m_luminaryNotebook->SetSelection(m_nbPanels);
  }
}
예제 #5
0
void OpenOtherDialog::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem*)
{
    if (current->data(0, Qt::UserRole).isValid()) {
        QString currentData(current->data(0, Qt::UserRole).toString());
        for (int i = 0; i < ui->methodTabWidget->count(); i++) {
            QString tabName(ui->methodTabWidget->widget(i)->objectName());
            if (currentData == tabName) {
                ui->methodTabWidget->setCurrentIndex(i);
                QWidget* w = ui->methodTabWidget->currentWidget();
                if (w == ui->networkTab)
                    m_current = ui->networkWidget;
                else if (w == ui->decklinkTab)
                    m_current = ui->decklinkWidget;
                else if (w == ui->v4lTab)
                    m_current = ui->v4lWidget;
                else if (w == ui->colorTab)
                    m_current = ui->colorWidget;
                else if (w == ui->noiseTab)
                    m_current = ui->noiseWidget;
                else if (w == ui->isingTab)
                    m_current = ui->isingWidget;
                else if (w == ui->lissajousTab)
                    m_current = ui->lissajousWidget;
                else if (w == ui->plasmaTab)
                    m_current = ui->plasmaWidget;
                else if (w == ui->colorbarsTab)
                    m_current = ui->colorbarsWidget;
                else if (w == ui->pulseTab)
                    m_current = ui->pulseWidget;
                else if (w == ui->jackTab)
                    m_current = ui->jackWidget;
                else if (w == ui->alsaTab)
                    m_current = ui->alsaWidget;
                else if (w == ui->x11grabTab)
                    m_current = ui->x11grabWidget;
                else if (w == ui->dshowVideoTab)
                    m_current = ui->dshowVideoWidget;
                else if (w == ui->toneTab)
                    m_current = ui->toneWidget;
                break;
            }
        }
    }
}
예제 #6
0
std::wstring ResponseAssembler::getResponseTemplateFromDB(const wstring& frameName, const wstring& _question, const string& _templateType)
{
	std::list<DataTuple<QueryResultTypes> > rows;

	string sframeName = "";
	CONVERT_TO_UTF8_STRING(frameName, sframeName);

	string squestion = "";
	CONVERT_TO_UTF8_STRING(_question, squestion);

	string templateType = _templateType;

	string tabName(tableName);

	DataTuple<QueryColumnTypes> key;

	key.set<frame_name>(sframeName);
	key.set<question>(squestion);
	key.set<type>(templateType);

	getTemplate(tabName, key, rows);

	std::wstring currentTemplate = L"";

	for (std::list<DataTuple<QueryResultTypes> >::iterator i = rows.begin(); i != rows.end(); ++i)
	{
		currentTemplate = CONVERT_TO_WSTRING(i->get<0>());
	}

	if(rows.size() > 1)
	{
		throw EMultipleInterpretations(frameName.c_str());
	}
	else if(rows.size() == 0)
	{
		ENoInterpretation(frameName.c_str());
	}

	return currentTemplate;

}
예제 #7
0
void LuminaryDialog::doLayout()
{
  m_sizer = new wxBoxSizer(wxVERTICAL);

  m_sizer->Add(m_activateGlobalSolverCheckBox, 0, 0, 0);
  m_luminaryNotebook->AddPage(m_globalSolverPanel, _("Global Solver"));
  if(!m_currentConfig->useGlobalField)
    m_globalSolverPanel->Disable();

  for(uint i = 0; i < m_currentConfig->nbLuminaries; i++)
    {
      wxString tabName(_("Luminary #")); tabName << i+1;
      m_luminaryNotebook->AddPage(m_luminaryPanels[i], tabName);
    }
  m_sizer->Add(m_luminaryNotebook, 1, wxEXPAND, 0);
  wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
  buttonSizer->Add(m_addLuminaryButton, 0, wxADJUST_MINSIZE, 0);
  buttonSizer->Add(m_deleteLuminaryButton, 0, wxADJUST_MINSIZE, 0);
  buttonSizer->Add(m_okButton, 0, wxADJUST_MINSIZE|wxLEFT, 20);
  buttonSizer->Add(m_cancelButton, 0, wxADJUST_MINSIZE, 0);
  m_sizer->Add(buttonSizer, 0, wxEXPAND, 0);
  SetAutoLayout(true);
  SetSizerAndFit(m_sizer);
}
예제 #8
0
QString ScriptableProxyHelper::tab()
{
    BROWSER_INVOKE(tabName(), QString());
}