Improve importing libraries

Please use this forum to ask for a new feature or to change an existing feature.
Merci d'utiliser ce forum pour demander de nouvelles fonctionnalités ou la modification de fonctionnalités existantes.

Improve importing libraries

Postby kikeenrique » Wed 10 Oct 2018 23:49

Hi,
I would like to propose an improvement for the import as library feature, so it can be easier.
When I need to update my library projects, it always needs an extra step to locate the library bouml project file path.

My proposal is to save the path to the file the first time the import as library Is executed. When executing an update, just import the changes from that previously saved path. If the file has dissapeared , ask for the path (current behaviour).

Regards and thanks for all the work.
kikeenrique
 
Posts: 11
Joined: Tue 24 Jul 2018 09:52

Re: Improve importing libraries

Postby Bruno Pagès » Thu 11 Oct 2018 07:55

Hello,

You are right, to help I will save the path of the imported/last update and propose it when it still exists, but I prefer the user confirm in any cases

Kind regards
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 664
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Improve importing libraries

Postby kikeenrique » Tue 16 Oct 2018 10:50

Thanks for your reply Bruno.

Also interesting would be that the file dialog chooser would filter the files and just show the “.prj”. Currently the other files are grayed, but, would it be possible to hide them completely?

Kind regards
kikeenrique
 
Posts: 11
Joined: Tue 24 Jul 2018 09:52

Re: Improve importing libraries

Postby Bruno Pagès » Tue 16 Oct 2018 15:21

Hello,

Sorry but there is no option in QFileDialog::getOpenFileNames to hide the filtered entries, and I don't know which file navigator is used, it can be the QT one or a system one depending on he OS

Kind regards
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 664
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Improve importing libraries

Postby kikeenrique » Wed 17 Oct 2018 13:58

Ok, I’ve realized that in fact is an OS problem.
On Linux/Debian I can only see *.prj files.
On Mac I can see all files, but all files except *.prj are gray.

Similar problems where already reported on qt https://bugreports.qt.io/browse/QTBUG-38303
kikeenrique
 
Posts: 11
Joined: Tue 24 Jul 2018 09:52

Re: Improve importing libraries

Postby Bruno Pagès » Wed 17 Oct 2018 14:20

under Windows you can see only the prj files, the used file explorer is the Windows one
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 664
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Improve importing libraries

Postby Bruno Pagès » Tue 23 Oct 2018 18:00

Hello,

BoUML 7.8 is available, adding the memorization of the path of the imported/updated project as library to propose it at the next update

Kind regards

P.S. The 7.8 is also available for the new Ubuntu 18.10
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 664
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Improve importing libraries

Postby Enno » Thu 16 Jul 2020 13:44

Salut Bruno,

A very useful feature would be relative paths to imported projects and automatic update of these upon loading a project. Especially if there are several libraries imported and collaboration work making it necessary to update many libraries by hand.
Enno
 
Posts: 5
Joined: Thu 16 Jul 2020 08:26

Re: Improve importing libraries

Postby Bruno Pagès » Thu 16 Jul 2020 15:53

Hallo,

Enno wrote:relative paths to imported projects

If you move (save-as) your project the relative path will not be anymore valid, this is why I preferred an absolute path more robust

Enno wrote:automatic update of these upon loading a project

But may be you do not want to be updated with the last version of the imported projects.

This is also very dangerous, may be some imported projects are under modification and non consistent and their update must not be done. That means also all the importing project cannot be used while the imported projects are not in the right state, this is too restrictive.

This is for these reasons an importing project contains the imported projects rather than to save their path.

Enno wrote:Especially if there are several libraries imported and collaboration work making it necessary to update many libraries by hand.

Yes, that's the flip side, but doing it explicitly makes things safer, you know what you're doing
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 664
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: Improve importing libraries

Postby Enno » Fri 17 Jul 2020 10:26

Bonjour Bruno,

Merci beaucoup pour la résponse rapide.

Bruno Pagès wrote:If you move (save-as) your project the relative path will not be anymore valid, this is why I preferred an absolute path more robust


Totally agree. But I believe there are several usecases where (interfaces) libraries reside in common folders tracked by a version control system and in these cases relative paths are fine.
E.g.:
- Root
-- libraries
--- lib1
--- lib2
-- interface
--- if1
--- if2
-- applications
--- app1
--- app2
In these cases absolut paths are really controproductive as the paths changes everytime a person updates the libraries on a different computer or workspace.
I believe it would be perfectly fine to allow relative paths inside the
Code: Select all
imported_project_dir "<DIR>"
tag inside the uml files. And to not change the last used path if it is the same as the one selected by the QFileDialog. This way one could change the path once after import by hand and then there would be no need to change it anymore for this usecase.

Old version from Github: https://github.com/gregsmirnov/bouml/bl ... ackage.cpp
Code: Select all
  QDir oldDir = QDir::currentPath();
  QDir::setCurrent(QStringLiteral(BrowserView::get_project().get_dir()))) // Something like this I guess, set current working directory so that the QFileDialog will find the path relative to the current project directory
  if (manual) {
    fn = QFileDialog::getOpenFileName(last_used_directory(), "*.prj");
    if (fn.isEmpty())
      return 0;
  }
  QFileInfo fi(fn);
  if(last_used_directory() != fi.absolutePath())  // Only update if it did change Same here, didn't test
  {
    set_last_used_directory(fn);
  }
  QDir::setCurrent(oldDir);


Bruno Pagès wrote:
Enno wrote:automatic update of these upon loading a project

But may be you do not want to be updated with the last version of the imported projects.

This is also very dangerous, may be some imported projects are under modification and non consistent and their update must not be done. That means also all the importing project cannot be used while the imported projects are not in the right state, this is too restrictive.

This is for these reasons an importing project contains the imported projects rather than to save their path.


Maybe a new menuentry in the browser's root to update all libraries would be a better way.
Enno
 
Posts: 5
Joined: Thu 16 Jul 2020 08:26


Return to Change requests / Demandes d'évolution

Who is online

Users browsing this forum: No registered users and 1 guest

cron