ux_icebox - michaelkirk/QGIS GitHub Wiki

unintuitive failure while editing layer

While working on: http://hub.qgis.org/issues/9464

Trying to "Add a column" but notice that the button is disabled. Notice that "Delete a column" is enabled When I push the "Delete a Column" button Then the "Delete Attributes" dialog pops up with a list of Attributes And I'm told:

  • Provider fields can only be deleted when the layer is in edit mode
  • Provider does not support deleting attributes And there is a button to "OK" and "Cancel"

Questions

  1. Why is Add a column disabled? 1.1. Maybe because the provider doesn't support adding columns
  2. Why is Delete a column enabled when I can't do anything? 2.1. Maybe because it exposes the reason I can't delete: i.e. because they provider doesn't support this feature

Suggested Flow

  Given I'm viewing the attributes table for a layer
  And the layer's provider doesn't support editing attributes
  When I press "Add a column" or "Remove a column"
  Then I should see a modal that says "Provider #{specific provider} doesn't support this feature"

Keyboard Shortcuts should be Discoverable

Make it easier to graduate QGIS users to power users by making the keyboard shortcuts discoverable. For example, display the hotkeys in tooltips like is done in the attribute editor.

Incorrect Keyboard Shortcuts on Mac in Attribute editor tooltips

Qt translates shortcuts for mac to use cmd instead of ctrl. For example, saving is configured for "Ctrl+S" but on a mac you press "Cmd+s". This is working fine in QGIS, but there are discoverable keybaord shortcuts in the attribute editor that say "Ctrl+L" even though the actual shortcut is "Cmd+L".

Note that Hotkeys are correctly translated in the main menus of the QGIS app. Can we hook into that mechanism somehow?

From stack overflow:

As noted in the Qt::Modifier enum documentation:

Note: On Mac OS X, the CTRL value corresponds to the Command keys on the
Macintosh keyboard, and the META value corresponds to the Control keys
The QKeySequence documentation is more detailed:

Note: On Mac OS X, references to "Ctrl", Qt::CTRL, Qt::Control and
Qt::ControlModifier correspond to the Command keys on the Macintosh
keyboard, and references to "Meta", Qt::META, Qt::Meta and
Qt::MetaModifier correspond to the Control keys. Developers on Mac OS X
can use the same shortcut descriptions across all platforms, and their
applications will automatically work as expected on Mac OS X.
So if you are just using Ctrl on Windows/Linux and Cmd on MacOS, you
don't need to change anything just use the Windows sequence.

In Attribute Editor "New Column" keyboard shortcut (Ctrl+w) clashes with

"close window"

ctrl+w is one of those keys that should behave the same in every app. In fact, maybe it's just delegated to the window manager unless you override it. In any case, we should pick a different keyboard shortcut, lest our users get frustrated when they can't close their window.

There is a risk that people will be surprised when they've been trained to use the existing shortcut and then accidentally close the attribute editor window. Yikes! Can they lose data that way? Do we confirm a save or anything?