Compare commits

...

6 Commits

Author SHA1 Message Date
Laurent Trinques 22e6188bb6 Merge pull request #333 from plc-user/master
corrected a few places where QETApp::documentDir() should also be used
2025-01-29 14:38:25 +01:00
Laurent Trinques 9d83d3180a Merge pull request #334 from zultron/zultron/2025-01-29_Fix_snap_qet_tb_generator
build-aux/snap/snapcraft.yaml:  python3.8 -> 3.10
2025-01-29 13:31:46 +01:00
John Morris 09c87cf811 build-aux/snap/snapcraft.yaml: python3.8 -> 3.10
Fix traceback when selecting "Project" menu "Launch the terminal block
creation plugin" item:

    Traceback (most recent call last):
      File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 33, in <module>
        sys.exit(load_entry_point('qet-tb-generator==1.3.1', 'console_scripts', 'qet_tb_generator')())
      File "/snap/qelectrotech/1973/bin/qet_tb_generator", line 25, in importlib_load_entry_point
        return next(matches).load()
      File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
        module = import_module(match.group('module'))
      File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/main.py", line 98, in <module>
        import src.PySimpleGUI as sg
      File "/snap/qelectrotech/1973/lib/python3.10/site-packages/src/PySimpleGUI.py", line 95, in <module>
        import tkinter as tk
    ModuleNotFoundError: No module named 'tkinter'
2025-01-29 00:22:17 -06:00
plc-user bdee8e3e36 set default search-path of non-standard locations of collections and titleblocks (common, company and user) also to QETApp::documentsDir() 2025-01-28 19:01:32 +01:00
plc-user 30a6221e45 remove unused function 2025-01-28 18:56:16 +01:00
plc-user 9f8287206b fix: "dxf2elmt" and "QET_ElementScaler" also read imported files from QETApp::documentDir() by default 2025-01-28 18:44:19 +01:00
4 changed files with 8 additions and 27 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ apps:
environment: &env
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
HOME: $SNAP_USER_COMMON
PYTHONPATH: $SNAP:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3.8:$SNAP/usr/lib/python3.8/lib-dynload
PYTHONPATH: $SNAP:$SNAP/lib/python3.10/site-packages:$SNAP/usr/lib/python3.10:$SNAP/usr/lib/python3.10/lib-dynload
qet-tb-generator:
command: bin/qet_tb_generator
+2 -20
View File
@@ -1282,24 +1282,6 @@ void QETElementEditor::on_m_open_from_file_action_triggered()
openElement(user_filename);
}
void QETElementEditor::on_m_open_scaled_element_action_triggered()
{
#ifdef TODO_LIST
# pragma message("@TODO Merge 'Element-Scaling' code into QET")
# pragma message("https://github.com/plc-user/QET_ElementScaler")
#endif
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
QString program = (QDir::homePath() + "/Application Data/qet/QET_ElementScaler.exe");
#elif defined(Q_OS_MAC)
QString program = (QDir::homePath() + "/.qet/QET_ElementScaler.app");
#else
QString program = (QDir::homePath() + "/.qet/QET_ElementScaler");
#endif
QStringList arguments;
QProcess *ES = new QProcess(qApp);
ES -> start(program,arguments);
}
bool QETElementEditor::on_m_save_as_file_action_triggered()
{
// Check element before writing
@@ -1472,7 +1454,7 @@ void QETElementEditor::on_m_import_dxf_triggered()
{
QString file_path{QFileDialog::getOpenFileName(this,
QObject::tr("Importer un fichier dxf"),
QDir::homePath(),
QETApp::documentDir(),
"DXF (*.dxf)")};
if (file_path.isEmpty()) {
return;
@@ -1498,7 +1480,7 @@ void QETElementEditor::on_m_import_scaled_element_triggered()
{
QString file_path{QFileDialog::getOpenFileName(this,
tr("Importer un élément à redimensionner"),
QDir::homePath(),
QETApp::documentDir(),
tr("Éléments QElectroTech (*.elmt)"))};
if (file_path.isEmpty()) {
return;
-1
View File
@@ -86,7 +86,6 @@ class QETElementEditor : public QMainWindow
void on_m_new_action_triggered();
void on_m_open_action_triggered();
void on_m_open_from_file_action_triggered();
void on_m_open_scaled_element_action_triggered();
bool on_m_save_as_file_action_triggered();
void on_m_reload_action_triggered();
void on_m_quit_action_triggered();
@@ -436,7 +436,7 @@ void GeneralConfigurationPage::on_m_common_elmt_path_cb_currentIndexChanged(int
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection commune"), QDir::homePath());
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection commune"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_common_elmt_path_cb->setItemData(1, path, Qt::DisplayRole);
}
@@ -450,7 +450,7 @@ void GeneralConfigurationPage::on_m_company_elmt_path_cb_currentIndexChanged(int
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection company"), QDir::homePath());
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection company"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_company_elmt_path_cb->setItemData(1, path, Qt::DisplayRole);
}
@@ -464,7 +464,7 @@ void GeneralConfigurationPage::on_m_custom_elmt_path_cb_currentIndexChanged(int
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection utilisateur"), QDir::homePath());
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection utilisateur"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_custom_elmt_path_cb->setItemData(1, path, Qt::DisplayRole);
}
@@ -478,7 +478,7 @@ void GeneralConfigurationPage::on_m_company_tbt_path_cb_currentIndexChanged(int
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des cartouches company"), QDir::homePath());
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des cartouches company"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_company_tbt_path_cb->setItemData(1, path, Qt::DisplayRole);
}
@@ -492,7 +492,7 @@ void GeneralConfigurationPage::on_m_custom_tbt_path_cb_currentIndexChanged(int i
{
if (index == 1)
{
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des cartouches utilisateur"), QDir::homePath());
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin des cartouches utilisateur"), QETApp::documentDir());
if (!path.isEmpty()) {
ui->m_custom_tbt_path_cb->setItemData(1, path, Qt::DisplayRole);
}