Download it now!
Bug 51903 - Add check-box for primary key in table import dialogue
Summary: Add check-box for primary key in table import dialogue
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Tables
  Show dependency treegraph
 
Reported: 2012-07-09 10:01 UTC by Ulf Zibis
Modified: 2017-06-20 09:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Import Dialogue draft (11.50 KB, image/png)
2012-07-09 10:01 UTC, Ulf Zibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulf Zibis 2012-07-09 10:01:18 UTC
Created attachment 64014 [details]
Import Dialogue draft

In table import dialogue "Table Copy" on 3rd page one can set field properties.
To find the hidden context menu for setting a field as primary key IMHO is not intuitive.
Please add a check-box for primary key setting as shown in the attachment.
The current context menu then could be dropped.
Comment 1 Robert Großkopf 2012-07-09 10:40:33 UTC
The only point in this context-menue is "primarykey". I have also searched for this option a long time. A checkbox ore something else at the first page (where you should choose a new primary-key) or at the third page (where you choose the fields) is a good idea.
Changed Satus to "new".
Comment 2 Robert Großkopf 2012-07-09 15:16:53 UTC

*** This bug has been marked as a duplicate of bug 49554 ***
Comment 3 Muhammet Kara 2016-04-11 07:38:04 UTC
Reopening after suggestions on tdf#49554, and consulting on #libreoffice-qa. This bug is related to tdf#49554, but not a duplicate of it.
Comment 4 Lionel Elie Mamane 2016-04-11 07:52:46 UTC
I have no strong opinion on this. I defer to the UI experts.

IMO the label "Primary Key" would make one think that this will create a one-column primary key with this column. I would suggest something like "add to primary key" or "part of primary key".

IMO, the checkbox as presented on the mock-up would be less convenient for multi-column primary keys. I agree it has much better discoverability. However, we can allow both methods. They should obviously interact correctly: if a primary key is set using one method, it should be reflected in the other method.

Please keep this coherent between the "new table" wizard and the "copy table" wizard. If you change it in one place, then please change it in the other place, too.
Comment 5 Lionel Elie Mamane 2016-04-11 07:59:49 UTC
OTOH, the right-click is the same method as in the "edit table" dialog. So at least it is some consistency there.

Forget my comment about consistency with the "new table" wizard; it already does it differently, and probably better. How about we do it like that? Maybe we could even re-use the exact same page (dialog).
Comment 6 Muhammet Kara 2016-04-14 11:22:52 UTC
(In reply to Lionel Elie Mamane from comment #4)
> I have no strong opinion on this. I defer to the UI experts.
> 
> IMO the label "Primary Key" would make one think that this will create a
> one-column primary key with this column. I would suggest something like "add
> to primary key" or "part of primary key".
> 
> IMO, the checkbox as presented on the mock-up would be less convenient for
> multi-column primary keys. I agree it has much better discoverability.
> However, we can allow both methods. They should obviously interact
> correctly: if a primary key is set using one method, it should be reflected
> in the other method.
> 

Yeah, I agree with you about the phrasing. I think something like "add to primary key" would be okay.

(In reply to Lionel Elie Mamane from comment #5)
> OTOH, the right-click is the same method as in the "edit table" dialog. So
> at least it is some consistency there.
> 
> Forget my comment about consistency with the "new table" wizard; it already
> does it differently, and probably better. How about we do it like that?
> Maybe we could even re-use the exact same page (dialog).

I like the way "new table" wizard flows. But currently it crashes Base.( tdf#99272 ) I don't know if it is because of UI or something else. Maybe we should add the checkbox for now, or wait for the crash bug to be resolved?
Comment 7 Muhammet Kara 2016-06-24 11:27:48 UTC
(In reply to Lionel Elie Mamane from comment #5)
> OTOH, the right-click is the same method as in the "edit table" dialog. So
> at least it is some consistency there.
> 
> Forget my comment about consistency with the "new table" wizard; it already
> does it differently, and probably better. How about we do it like that?
> Maybe we could even re-use the exact same page (dialog).

Alright. Let's do that.

I have taken a look at the new table wizard, and it turns out that it was written in basic. So I guess we need to recreate the same behavior with glade/c++?

I think adding a new step ("Set Primary Key" step) to Copy Table wizard, getting rid of the right click option altogether would do the trick.

What do you think?
Comment 8 Lionel Elie Mamane 2016-06-24 12:46:28 UTC
(In reply to Muhammet Kara from comment #7)
> (In reply to Lionel Elie Mamane from comment #5)

>> Forget my comment about consistency with the "new table" wizard; it already
>> does it differently, and probably better. How about we do it like that?
>> Maybe we could even re-use the exact same page (dialog).

> Alright. Let's do that.

> I have taken a look at the new table wizard, and it turns out that it was
> written in basic. So I guess we need to recreate the same behavior with
> glade/c++?

I'd be surprised it is in Basic; it is probably either Java or Python. Where did you see such Basic code that you think is the New Table wizard?

It may be the code in wizards/com/sun/star/wizards/table/ which is Java. We have a general project to port Java wizards to Python. If you feel like taking this on... I suggest you ask on the mailing list for help of people that have been active in this Java-to-Python port.

It is probably not possible to share a dialog between a C++ wizard (like the copy table wizard) and a Java or Python wizard, though. So to achieve the sharing, either the New Table wizard has to be rewritten to C++ or the Copy Table rewritten to Java, or both to Python. Alternatively, you can just duplicate the behaviour in the different codebases without code sharing. I'll let you decide what path you want to pursue.

> I think adding a new step ("Set Primary Key" step) to Copy Table wizard,
> getting rid of the right click option altogether would do the trick.

Yes, that's nice. That's what the "new table" wizard does, with several choices that make sense: add a new column for that, use an existing column, ...
Comment 9 Muhammet Kara 2016-08-22 16:36:48 UTC
Deassigning due to lack of progress. I may continue working on this later; but in the meantime, please feel free to take it if you like.