[kate/frameworks] part: port from KDialog to QDialog (KateGlobal::configDialog)
Dominik Haumann
dhaumann at kde.org
Thu Dec 19 14:28:27 UTC 2013
On Thursday, December 19, 2013 15:12:01 Michal Humpula wrote:
> On Thursday 19 of December 2013 14:57:33 Dominik Haumann wrote:
> > On Wednesday, December 18, 2013 19:42:43 Michal Humpula wrote:
> > > Git commit 4e6c1c3d8cd6dbe4d826ce6720169fd94d8848f6 by Michal Humpula.
> > > Committed on 18/12/2013 at 19:42.
> > > Pushed by michalhumpula into branch 'frameworks'.
> > >
> > > port from KDialog to QDialog (KateGlobal::configDialog)
> > >
> > > M +1 -4 part/utils/kateglobal.cpp
> > > M +2 -1 part/view/kateview.cpp
> > >
> > > http://commits.kde.org/kate/4e6c1c3d8cd6dbe4d826ce6720169fd94d8848f6
> > >
> > > diff --git a/part/utils/kateglobal.cpp b/part/utils/kateglobal.cpp
> > > index e576f12..94de177 100644
> > > --- a/part/utils/kateglobal.cpp
> > > +++ b/part/utils/kateglobal.cpp
> > > @@ -310,10 +310,7 @@ void KateGlobal::configDialog(QWidget *parent)
> > > -#if 0 //FIXME KF5
> > > - kd->setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Help );
> > > - kd->setHelp( QString(), KGlobal::mainComponent().componentName() );
> > > -#endif
> > > + kd->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply | QDialogButtonBox::Help );
> >
> > If I'm not mistaken, we can use setStandardButtons() in a lot of other
> > places as well instead of adding the respective buttons manually.
> >
> > Is that correct?
> >
> > If so, we really should do that, to always keep the correct button order
> > (e.g. Cancel on the very right or similar).
> >
> > Greetings,
> > Dominik
>
> The drawback is that currently the buttons are not styled the KDE way:( I'm
> guessing this will be fixed in the future in frameworks QPA?
Hm, no idea. CCing frameworks-devel.
> Sometimes the buttons have different text or icon then standard, so the need
> for creating buttons manually is still there, imho.
That's fine: You can still get the respective button with:
QPushButton * QDialogButtonBox::button(StandardButton which);
And then change the icon or text. But this way, the order at least is
kind of automatically set. I'm not sure though, whether this is of
importance in all cases.
> But yes, the dialogs are perfect place for code simplification/removal in
> the future (hopefully near future:)
>
> The QDialogButtonBox, which is used by KPageDialog now, should take kare of
> the ordering in the case above, see
>
> http://doc-snapshot.qt-project.org/qdoc/qdialogbuttonbox.html
>
> Cheers
>
> Michal
Greetings,
Dominik
More information about the Kde-frameworks-devel
mailing list