-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[style manager] imporve import and export experience, save symbols' tags & favorite flag #3789
Conversation
Small note regarding import of symbols and favorites: for the "Import symbol(s)" dialog, accessed through the style manager, the favorite flag attached to symbols within a .xml file is ignored in favor of the "Add to favorite" check box, which makes more sense. However, in the coming week, I'm planning to change the way QGIS creates its default style db (i.e. the symbology-ng.db copied by default in the ~/.qgis3 user directry), and it'll use the favorite flag declared within a given default-shipped-symbols.xml file. But more on that later 😄 |
Very nice! I'd suggest "don't import tags" or just "ignore existing tags" would be easier strings. The grid improvement makes a huge difference! |
@@ -273,6 +273,9 @@ class CORE_EXPORT QgsStyle : public QObject | |||
//! Changes ramp's name | |||
bool renameColorRamp( const QString& oldName, const QString& newName ); | |||
|
|||
//! Creates a temporary memory database | |||
bool createMemoryDB(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we want to make public? I'd lean toward making it private and making TestStyle a friend class of QgsStyle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, ignore that. It does look useful. I'd just expand on the docs to explain why you'd want to call this and what effect it has (something like "if you don't want to associate the style with an on-disk database, ...etc". I'd also make a note in the load() docs.
"Don't import embedded tags"? |
Maybe"do not import embedded tags" is better... I'm not sure if don't is too informal |
89e4927
to
31afb6a
Compare
@nyalldawson , comments addressed in updated set of commits. |
Once again, nice work! |
Could you also add a [feature] tag to the appropriate commits, in order to ease retrieval of new features for 3.0 changelog and create issues in the doc repo? |
and favorite flag
for the import/export symbol preview list
c412159
to
2260780
Compare
@DelazJ, there's a bottleneck in Qt QListView that don't allow for such a multiline label scenario. However, to try and mediate the situation, I've committed the following changes:
I've also added a [FEATURE] tag to the relevant commit, thanks for pointing that out. |
@nyalldawson , when you have a minute, this PR is ready to merge. |
@nyalldawson , thanks. |
This PR (greatly, IMHO) improves the usefulness of saved symbols' import and export function by implementing a //TODO within QgsStyle: the import and export of symbols' tags and favorite flag. If someone spends a fair share of time classifying his/her symbols with an elaborate set of tags, not being able to export tags amounts to significant losses.
In order to do so, I've added the possibility of creating a temporary memory spatialite DB that is used to temporarily store a symbol's full set of information (name, xml, favorite, and tags). ( @nyalldawson , this temporary db is very useful for the test unit, it avoids us clashing with symbols we ship by default will testing the QgsStyle class)
On the import front, this opens the door for symbol creators to ship a .XML with a pre-defined tagging structure (v. useful). For users uninterested by pre-defined tags, they are given the option to ignore tags:
![untitled2](https://cloud.githubusercontent.com/assets/1728657/20453513/94fcf37a-ae5a-11e6-8d11-af7e859265c8.png)
I've also cleaned up the UI a bit, mostly by making the import / export symbol preview list use padding for its icons, as well as making sure the icons are aligned to a grid to avoid a sense of chaos:
![untitled](https://cloud.githubusercontent.com/assets/1728657/20453512/779f9ad0-ae5a-11e6-805b-a57898b62101.png)
Ahhh, orderly presentation & symbol padding