SVN commit 678388 by cgilles:
digikam/libs/dialogs is now ported completly to KDE4 CCMAIL: [hidden email] M +44 -28 ctrlpaneldlg.cpp M +5 -1 imagedlgbase.cpp M +7 -10 imageguidedlg.cpp --- trunk/extragear/graphics/digikam/libs/dialogs/ctrlpaneldlg.cpp #678387:678388 @@ -100,8 +100,10 @@ }; CtrlPanelDlg::CtrlPanelDlg(QWidget* parent, QString title, QString name, - bool loadFileSettings, bool tryAction, bool progressBar, - int separateViewMode, Q3Frame* bannerFrame) + bool loadFileSettings, + bool tryAction, + bool progressBar, + int separateViewMode) : KDialog(parent) { kapp->setOverrideCursor( Qt::WaitCursor ); @@ -198,12 +200,18 @@ void CtrlPanelDlg::setAboutData(KAboutData *about) { + disconnect(this, SIGNAL(helpClicked()), + this, SLOT(slotHelp())); + d->aboutData = about; - QPushButton *helpButton = actionButton( Help ); + KPushButton *helpButton = button( Help ); KHelpMenu* helpMenu = new KHelpMenu(this, d->aboutData, false); - helpMenu->menu()->removeItemAt(0); - helpMenu->menu()->insertItem(i18n("digiKam Handbook"), this, SLOT(slotHelp()), 0, -1, 0); - helpButton->setPopup( helpMenu->menu() ); + helpMenu->menu()->removeAction(helpMenu->menu()->actions().first()); + QAction *handbook = new QAction(i18n("digiKam Handbook"), this); + connect(handbook, SIGNAL(triggered(bool)), + this, SLOT(slotHelp())); + helpMenu->menu()->insertAction(helpMenu->menu()->actions().first(), handbook); + helpButton->setDelayedMenu( helpMenu->menu() ); } void CtrlPanelDlg::abortPreview() @@ -249,8 +257,10 @@ kapp->restoreOverrideCursor(); } - - saveDialogSize(d->name + QString(" Tool Dialog")); + + KSharedConfig::Ptr config = KGlobal::config(); + KConfigGroup group = config->group(d->name + QString(" Tool Dialog")); + saveDialogSize(group); done(Cancel); } @@ -264,7 +274,9 @@ kapp->restoreOverrideCursor(); } - saveDialogSize(d->name + QString(" Tool Dialog")); + KSharedConfig::Ptr config = KGlobal::config(); + KConfigGroup group = config->group(d->name + QString(" Tool Dialog")); + saveDialogSize(group); e->accept(); } @@ -291,8 +303,6 @@ if (d->aboutData) KToolInvocation::invokeHelp(d->name, "digikam"); - else - KDialog::slotHelp(); } void CtrlPanelDlg::slotTimer() @@ -306,7 +316,8 @@ d->timer = new QTimer( this ); connect( d->timer, SIGNAL(timeout()), this, SLOT(slotEffect()) ); - d->timer->start(500, true); + d->timer->setSingleShot(true); + d->timer->start(500); } void CtrlPanelDlg::slotEffect() @@ -342,7 +353,10 @@ { d->currentRenderingMode = CtrlPanelDlgPriv::FinalRendering; DDebug() << "Final " << d->name << " started..." << endl; - saveDialogSize(d->name + QString(" Tool Dialog")); + + KSharedConfig::Ptr config = KGlobal::config(); + KConfigGroup group = config->group(d->name + QString(" Tool Dialog")); + saveDialogSize(group); writeUserSettings(); m_imagePreviewWidget->setEnable(false); @@ -365,11 +379,11 @@ prepareFinal(); } -void CtrlPanelDlg::customEvent(QCustomEvent *event) +void CtrlPanelDlg::customEvent(QEvent *event) { if (!event) return; - DImgThreadedFilter::EventData *ed = (DImgThreadedFilter::EventData*) event->data(); + DImgThreadedFilter::EventData *ed = (DImgThreadedFilter::EventData*) event; if (!ed) return; @@ -425,29 +439,31 @@ // Backport KDialog::keyPressEvent() implementation from KDELibs to ignore Enter/Return Key events // to prevent any conflicts between dialog keys events and SpinBox keys events. +// TODO: KDE4PORT: Check if this code work fine with KDE4::KDialog() + void CtrlPanelDlg::keyPressEvent(QKeyEvent *e) { - if ( e->state() == 0 ) + if ( e->modifiers() == 0 ) { switch ( e->key() ) { - case Qt::Key_Escape: - e->accept(); - reject(); - break; - case Qt::Key_Enter: - case Qt::Key_Return: - e->ignore(); - break; - default: - e->ignore(); - return; + case Qt::Key_Escape: + e->accept(); + reject(); + break; + case Qt::Key_Enter: + case Qt::Key_Return: + e->ignore(); + break; + default: + e->ignore(); + return; } } else { // accept the dialog when Ctrl-Return is pressed - if ( e->state() == Qt::ControlModifier && + if ( e->modifiers() == Qt::ControlModifier && (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) ) { e->accept(); --- trunk/extragear/graphics/digikam/libs/dialogs/imagedlgbase.cpp #678387:678388 @@ -98,7 +98,8 @@ }; ImageDlgBase::ImageDlgBase(QWidget* parent, QString title, QString name, - bool loadFileSettings, bool tryAction) + bool loadFileSettings, + bool tryAction) : KDialog(parent) { setButtons(Help|Default|User1|User2|User3|Try|Ok|Cancel); @@ -238,6 +239,9 @@ void ImageDlgBase::setAboutData(KAboutData *about) { + disconnect(this, SIGNAL(helpClicked()), + this, SLOT(slotHelp())); + d->aboutData = about; KPushButton *helpButton = button( Help ); KHelpMenu* helpMenu = new KHelpMenu(this, d->aboutData, false); --- trunk/extragear/graphics/digikam/libs/dialogs/imageguidedlg.cpp #678387:678388 @@ -299,16 +299,10 @@ ImageGuideDlg::~ImageGuideDlg() { - if (d->timer) - delete d->timer; - - if (m_threadedFilter) - delete m_threadedFilter; - - if (d->aboutData) - delete d->aboutData; - + delete d->aboutData; + delete d->timer; delete d->settingsSideBar; + delete m_threadedFilter; delete d; } @@ -364,6 +358,9 @@ void ImageGuideDlg::setAboutData(KAboutData *about) { + disconnect(this, SIGNAL(helpClicked()), + this, SLOT(slotHelp())); + d->aboutData = about; KPushButton *helpButton = button( Help ); KHelpMenu* helpMenu = new KHelpMenu(this, d->aboutData, false); @@ -440,7 +437,7 @@ kapp->restoreOverrideCursor(); } - + writeSettings(); done(Cancel); } _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |