Review Request: A Simple patch adding automatic Changing of the Current ToolbarTab when Switching to Design mode for forms/report respectively.
Jarosław Staniek
staniek at kde.org
Fri Oct 21 08:47:59 BST 2011
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102928/#review7521
-----------------------------------------------------------
kexi/main/KexiMainWindow.h
<http://git.reviewboard.kde.org/r/102928/#comment6496>
Good catch. I am impressed you started doing useful things in the core that fast!
We haven't discussed how to implement this feature though. If you look at openObject(Item*, ViewMode) here, it is place where you can look if viewMode is DesignViewMode and if the 'item' is of proper class, then do your work. To check, do not look compare string but use:
if (viewMode == Kexi::DesignViewMode && d->prj->idForClass(item->partClass()) == KexiPart::FormObjectType) { ... }
(yes, classes have identifiers reflectinf their UIDs in current master database)
kexi/main/KexiMainWindow.h
<http://git.reviewboard.kde.org/r/102928/#comment6497>
since you do not intend to modify the value, better is passing as: const QString &
kexi/main/KexiMainWindow.h
<http://git.reviewboard.kde.org/r/102928/#comment6500>
<coding style>: no space between method name and ( ) please
kexi/main/KexiMainWindow.cpp
<http://git.reviewboard.kde.org/r/102928/#comment6498>
assuming the signature changes to (const QString &), it is enough to use "normalized" signal signature SIGNAL(openObjectInDesignView(QString)).
The same for the slot.
kexi/main/KexiMainWindow.cpp
<http://git.reviewboard.kde.org/r/102928/#comment6499>
Good one! Some improvement though: instead of hardcoding index, we'll Iave to somewhat find tab by name to avoid problems when someone inserts tabs later. We also plan to have autohiding Design tabs, so index would not be a constant.
- Jarosław Staniek
On Oct. 21, 2011, 12:06 a.m., Dimitrios Tanis wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102928/
> -----------------------------------------------------------
>
> (Updated Oct. 21, 2011, 12:06 a.m.)
>
>
> Review request for Calligra and Jarosław Staniek.
>
>
> Description
> -------
>
> A Simple patch adding automatic Changing of the Current ToolbarTab when Switching to Design mode for forms/report respectively.
>
>
> Diffs
> -----
>
> kexi/main/KexiMainWindow.h d5187de
> kexi/main/KexiMainWindow.cpp 1f1065c
> kexi/widget/navigator/KexiProjectNavigator.h 009ff78
> kexi/widget/navigator/KexiProjectNavigator.cpp cefa3be
>
> Diff: http://git.reviewboard.kde.org/r/102928/diff/diff
>
>
> Testing
> -------
>
> Compiles and runs without errors.
>
> Minor issue. It works when switching to design view from the Project Navigator, but it does NOT work when switching from the objects toolbar (ie the toolbar displayed under the object tab).
> Maybe switching to design is implemented by two different slots? Looking into it.
>
>
> Thanks,
>
> Dimitrios Tanis
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20111021/c7e8b17c/attachment.htm>
More information about the calligra-devel
mailing list