Disabled Accessibility on SheetTableView

This commit is contained in:
Adrian Popescu
2023-02-01 17:32:26 -05:00
committed by Chris Hennes
parent c71e551556
commit 3f3a548b22
4 changed files with 179 additions and 33 deletions

View File

@@ -37,11 +37,11 @@
#include "DlgSettingsImp.h"
#include "SpreadsheetView.h"
#include "SheetTableViewAccessibleInterface.h"
#include "ViewProviderSpreadsheet.h"
#include "Workbench.h"
// use a different name to CreateCommand()
// use a different name to CreateCommand()
void CreateSpreadsheetCommands(void);
void loadSpreadsheetResource()
@@ -52,52 +52,51 @@ void loadSpreadsheetResource()
}
namespace SpreadsheetGui {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("SpreadsheetGui")
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("SpreadsheetGui")
{
add_varargs_method("open",&Module::open
);
initialize("This module is the SpreadsheetGui module."); // register with Python
}
);
initialize("This module is the SpreadsheetGui module."); // register with Python
}
~Module() override {}
~Module() override {}
private:
Py::Object open(const Py::Tuple& args)
{
char* Name;
private:
Py::Object open(const Py::Tuple& args)
{
char* Name;
const char* DocName=nullptr;
if (!PyArg_ParseTuple(args.ptr(), "et|s","utf-8",&Name,&DocName))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
try {
Base::FileInfo file(EncodedName);
try {
Base::FileInfo file(EncodedName);
App::Document *pcDoc = App::GetApplication().newDocument(DocName ? DocName : QT_TR_NOOP("Unnamed"));
Spreadsheet::Sheet *pcSheet = static_cast<Spreadsheet::Sheet *>(pcDoc->addObject("Spreadsheet::Sheet", file.fileNamePure().c_str()));
pcSheet->importFromFile(EncodedName, '\t', '"', '\\');
pcSheet->execute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
pcSheet->importFromFile(EncodedName, '\t', '"', '\\');
pcSheet->execute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
return Py::None();
}
};
PyObject* initModule()
{
return Base::Interpreter().addModule(new Module);
}
};
PyObject* initModule()
{
return Base::Interpreter().addModule(new Module);
}
} // namespace SpreadsheetGui
/* Python entry */
PyMOD_INIT_FUNC(SpreadsheetGui)
{
@@ -109,6 +108,8 @@ PyMOD_INIT_FUNC(SpreadsheetGui)
// instantiating the commands
CreateSpreadsheetCommands();
QAccessible::installFactory(SpreadsheetGui::SheetTableViewAccessibleInterface::ifactory);
SpreadsheetGui::ViewProviderSheet::init();
SpreadsheetGui::ViewProviderSheetPython::init();
SpreadsheetGui::Workbench::init();