Ejemplo n.º 1
0
		TITANIUM_FUNCTION(TableView, deleteSection)
		{
			if (arguments.size() < 2) {
				return get_context().CreateUndefined();
			} else if (arguments.size() >= 2) {
				const auto _0 = arguments.at(0);
				TITANIUM_ASSERT(_0.IsNumber());
				const auto _1 = arguments.at(1);
				TITANIUM_ASSERT(_1.IsObject());
				const uint32_t section = static_cast<uint32_t>(_0);
				const auto animation = static_cast<JSObject>(_1);
				deleteSection(section, animation.GetPrivate<TableViewAnimationProperties>());
			} else if (arguments.size() >= 1) {
				const auto _0 = arguments.at(0);
				TITANIUM_ASSERT(_0.IsNumber());
				const uint32_t section = static_cast<uint32_t>(_0);
				const auto animation = get_context().CreateObject();
				deleteSection(section, animation.GetPrivate<TableViewAnimationProperties>());
			}
			return get_context().CreateUndefined();
		}
Ejemplo n.º 2
0
bool FQTermConfig::renameSection(const QString &szSection, const QString
                                 &szNewName) {
  if (hasSection(szNewName) || !hasSection(szSection)) {
    return false;
  }

  if (!addSection(szNewName)) {
    return false;
  }
  data[szNewName] = data[szSection];

  return deleteSection(szSection);
}
Ejemplo n.º 3
0
ServiceSection::ServiceSection(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ServiceSection)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::CustomizeWindowHint);
    this->setWindowTitle(tr("Услуги"));
    model = new QSqlTableModel(this);
    model->setTable("services");
    model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    this->selectData();


    proxy = new QSortFilterProxyModel(this);
    proxy->setSourceModel(model);

    menu = new QMenu();
    menu->addAction("Содержание...", this, SLOT(openSection()), Qt::Key_Enter);
    menu->addAction("Изменить...", this, SLOT(editSection()), Qt::CTRL + Qt::Key_U);
    menu->addAction("Добавить...", this, SLOT(addSection()), Qt::CTRL + Qt::Key_A);
    menu->addAction("Удалить...", this, SLOT(deleteSection()), Qt::CTRL + Qt::Key_D);
    connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(openSection()));

    settings = Settings::getInstance();
    this->restoreGeometry(settings->value("serviceSectionDialog/geometry").toByteArray());



    ui->tableView->setModel(proxy);
    ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);

    ui->tableView->setSortingEnabled(true);
    ui->tableView->sortByColumn(1, Qt::AscendingOrder);

    ui->tableView->resizeColumnsToContents();
    ui->tableView->horizontalHeader()->setStretchLastSection(true);
    ui->tableView->verticalHeader()->hide();
    ui->tableView->hideColumn(0);
    ui->tableView->hideColumn(2);
    ui->tableView->hideColumn(3);

    ui->tableView->selectRow(0);
    ui->tableView->setFocus();
}
Ejemplo n.º 4
0
void OWLENTRY OWLSectionFree( owl_section_handle section ) {
//**********************************************************

    owl_file_handle     file;

    file = section->file;
    deleteSection( file, section );
    if( section->buffer != NULL ) {
        OWLBufferFini( section->buffer );
    }
    if( section->linenum_buffer != NULL ) {
        OWLBufferFini( section->linenum_buffer );
    }
    if( section->first_reloc != NULL ) {
        freeRelocs( file, section->first_reloc );
    }
    _ClientFree( file, section );
    _Log(( file, "OWLSectionFree( %x )\n", section ));
}
Ejemplo n.º 5
0
void CodeDocument::replaceSection (const int start, const int end, const String& newText)
{
    insertText (start, newText);
    const int newTextLen = newText.length();
    deleteSection (start + newTextLen, end + newTextLen);
}
Ejemplo n.º 6
0
void CodeDocument::deleteSection (const Position& startPosition, const Position& endPosition)
{
    deleteSection (startPosition.getPosition(), endPosition.getPosition());
}
Ejemplo n.º 7
0
void CodeDocument::replaceSection (const int start, const int end, const String& newText)
{
    insertText (end, newText);
    deleteSection (start, end);
}
Ejemplo n.º 8
0
bool File::deleteSection(const Section &section) {
    if(!util::checkEntityInput(section, false)) {
        return false;
    }
    return deleteSection(section.id());
}
Ejemplo n.º 9
0
bool File::deleteSection(const Section &section) {
    util::checkEntityInput(section);
    return deleteSection(section.id());
}