Bug 76412 - JJ: Completing dialog action does not return to the document (or dialog) window from whence dialog commenced
Summary: JJ: Completing dialog action does not return to the document (or dialog) wind...
Status: RESOLVED FIXED
Alias: None
Product: koffice
Classification: Applications
Component: general (show other bugs)
Version: 1.3
Platform: Debian testing Linux
: NOR minor
Target Milestone: ---
Assignee: KOffice Bug Wranglers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-29 14:40 UTC by alan
Modified: 2006-10-23 16:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to solve the problem with this bug and the "edit data" action of kchart (2.00 KB, patch)
2004-07-22 07:28 UTC, James Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alan 2004-02-29 14:40:12 UTC
Version:           1.3 (using KDE 3.2 BRANCH >= 20040204,  (testing/unstable))
Compiler:          gcc version 3.3.3 20040214 (prerelease) (Debian)
OS:          Linux (i686) release 2.6.3-1-k7

I am editing a document, and then create a new document from the file new menu.

Whilst working on this new document, when ever I call up a dialog box (for instance format page layout) kword brings the older documents window as the highest document window behind the dialog box, so that when the dialog box is dismissed the wrong document is displayed.

It is even worse than this.  If I call up a dialog box that then calls up a subsidiary dialog box
(for instance File/Create Template From Document and then select the "select" button related to the custom picture) when I return from the subsidiary dialog box, the original dialog box is hidden behind the old document window - both giving the impression that both dialogs have been dismissed, but also confusing the user who now can't enter anything into the old document.  It is necessary to manually select the new document to get back to the dialog box.
Comment 1 Nicolas Goutte 2004-03-02 19:11:58 UTC
Can you reproduce it on KSpread or KPresenter?

It would be important to know if the problem is KWord-specific or if it is in the KOffice libraries?

(Custom pictures for templates were broken since recently, so it might be that they are other bugs. Thank you for testing the fixed code.)

Have a nice day!
Comment 2 Nicolas Goutte 2004-03-02 20:19:24 UTC
I cannot confirm. I have tried to reproduce it with KWord and also with KPresenter. Both work as expected. The focus return to the correct document after ending the dialog.

But perhaps it is a KDE 3.2.x problem (mine is from 2004-02-21.)

Have a nice day!
Comment 3 alan 2004-03-02 21:04:11 UTC
I can reproduce in Word and in KPresenter, but it is not happening with KSpread

These are the debian packages put together by Ben Burton (formal debian maintainer), running with the debian kdelibs from the debian experimental release

As you can see above these packages are from 20040204




Comment 4 Nicolas Goutte 2004-03-02 22:19:30 UTC
Good, as the bug is not only with KWord but with KPresenter too, I am moving it to KOffice/General.

As for the 2004-02-04, it does not tell much, just that the version is from after that date.

Have a nice day!
Comment 5 David Faure 2004-03-08 11:15:16 UTC
On Sunday 29 February 2004 14:40, alan@chandlerfamily.org.uk wrote:
> Whilst working on this new document, when ever I call up a dialog box (for instance format page layout) kword brings the older documents window as the highest document window behind the dialog box, so that when the dialog box is dismissed the wrong document is displayed.
This sounds like a KWin bug/misbehavior to me. It doesn't happen here, 
so I guess it was fixed in KWin.

However the cause for this problem is a missing parent widget in the dialog,
which I just fixed for the "page layout" dialog. Any other dialog showing the same problem?

> It is even worse than this.  If I call up a dialog box that then calls up a subsidiary dialog box
> (for instance File/Create Template From Document and then select the "select" button related to the custom picture)
> when I return from the subsidiary dialog box, the original dialog box is hidden
> behind the old document window - both giving the impression that both dialogs
> have been dismissed, but also confusing the user who now can't enter anything
> into the old document.  It is necessary to manually select the new document to get back to the dialog box.    

That was another missing parent widget - fixed as well.

However I'm sure KWin was improved to handle such cases better, since it
all works fine here. I suggest a kdelibs/kdebase upgrade...

Comment 6 David Faure 2004-03-08 11:15:18 UTC
CVS commit by faure: 

Pass parent widget to page layout dialog (and to the filedialog from the
template-creation dialog). Should fix 76412... but kwin seems to handle such
cases better nowadays anyway, doesn't it?
CCMAIL: 76412@bugs.kde.org


  M +4 -4      koPageLayoutDia.cc   1.82
  M +2 -3      koPageLayoutDia.h   1.41
  M +2 -2      koTemplateCreateDia.cc   1.48


--- koffice/lib/kofficeui/koPageLayoutDia.cc  #1.81:1.82
@@ -184,8 +184,8 @@ KoPageLayoutDia::~KoPageLayoutDia()
 
 /*======================= show dialog ============================*/
-bool KoPageLayoutDia::pageLayout( KoPageLayout& _layout, KoHeadFoot& _hf, int _tabs, KoUnit::Unit& unit )
+bool KoPageLayoutDia::pageLayout( KoPageLayout& _layout, KoHeadFoot& _hf, int _tabs, KoUnit::Unit& unit, QWidget* parent )
 {
     bool res = false;
-    KoPageLayoutDia *dlg = new KoPageLayoutDia( 0, "PageLayout", _layout, _hf, _tabs, unit );
+    KoPageLayoutDia *dlg = new KoPageLayoutDia( parent, "PageLayout", _layout, _hf, _tabs, unit );
 
     if ( dlg->exec() == QDialog::Accepted ) {
@@ -203,8 +203,8 @@ bool KoPageLayoutDia::pageLayout( KoPage
 /*======================= show dialog ============================*/
 bool KoPageLayoutDia::pageLayout( KoPageLayout& _layout, KoHeadFoot& _hf, KoColumns& _cl,
-                                  KoKWHeaderFooter &_kwhf, int _tabs, KoUnit::Unit& unit )
+                                  KoKWHeaderFooter &_kwhf, int _tabs, KoUnit::Unit& unit, QWidget* parent )
 {
     bool res = false;
-    KoPageLayoutDia *dlg = new KoPageLayoutDia( 0, "PageLayout", _layout, _hf, _cl, _kwhf, _tabs, unit );
+    KoPageLayoutDia *dlg = new KoPageLayoutDia( parent, "PageLayout", _layout, _hf, _cl, _kwhf, _tabs, unit );
 
     if ( dlg->exec() == QDialog::Accepted ) {

--- koffice/lib/kofficeui/koPageLayoutDia.h  #1.40:1.41
@@ -137,5 +137,5 @@ public:
      *  See constructor for documentation on the parameters
      */
-    static bool pageLayout( KoPageLayout&, KoHeadFoot&, int tabs, KoUnit::Unit& unit);
+    static bool pageLayout( KoPageLayout&, KoHeadFoot&, int tabs, KoUnit::Unit& unit, QWidget* parent = 0 );
 
     /**
@@ -143,6 +143,5 @@ public:
      *  See constructor for documentation on the parameters
      */
-    static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit );
-
+    static bool pageLayout( KoPageLayout&, KoHeadFoot&, KoColumns&, KoKWHeaderFooter&, int tabs, KoUnit::Unit& unit, QWidget* parent = 0 );
     /**
      *  Retrieves a standard page layout.

--- koffice/lib/kofficeui/koTemplateCreateDia.cc  #1.47:1.48
@@ -330,5 +330,5 @@ void KoTemplateCreateDia::slotSelect() {
     d->m_custom->setChecked(true);
 
-    KFileDialog fd(QString::null, KImageIO::pattern(KImageIO::Reading), 0, 0, true);
+    KFileDialog fd(QString::null, KImageIO::pattern(KImageIO::Reading), this, 0, true);
     fd.setCaption(i18n("Select Picture"));
     KURL url;


Comment 7 alan 2004-03-13 09:02:40 UTC
First - I am running kde 3.2.1 from the debian unstable package - so I would have assumed kwin is pretty up to date.

I have done an exhaustive run through of the top level menus that call up dialog boxes and the following cause me problems in KWORD (not tried KPresented yet).  

File/Print Preview
Insert/Link
Insert/Picture
Insert/Scan Image
Format/Page Layout
Frames/Text Background Color
Frames/Configure Frame Border/Border Color
Tools/Configure Shortcuts
Tools/Configure Toolbars
Tools/Configure KWord
Comment 8 alan 2004-03-13 09:17:13 UTC
Now been through KSPREAD - which I reported above did not have probems, but it does

Following top level menu dialogs cause this

File/Print Preview
Insert/Link
Tools/Spelling (although I didn't have Ispell installed so I first got an error message)
Tools/Protect Document/Protect Sheet
Tools/Protect Document/Protect Doc
Settings/Configure/Shortcuts
Settings/Configure/Toolbars
Settings/Configure/Kspread
Comment 9 alan 2004-03-13 09:26:01 UTC
Now KPresenter - the following top level menus cause the problem

File/Print Preview
Insert/File
Insert/Picture
Insert/Scan Image
Format/Page Layout
Settings/Shortcuts
Settings/Toolbars
Settings/KPresenter
Comment 10 alan 2004-03-13 09:35:47 UTC
Now tried KVIVIO

Following toplevel menus cause the problem

File/Print Preview
Edit/Edit Stencil Text
Page/Export Page
Format/Page Layout
Tools/Edit Stencil Text
Settings/Configure Shortcuts
Settings/Configure Toolbars

given the other packages do, suprisingly Settings/Configure Kvivio does not cause a problem
Comment 11 alan 2004-03-13 09:43:31 UTC
Karbon 14

Following toplevel menus cause the problem

File/Import Graphics
File/Print Preview

All the Plugin Menus

Settings/Configure Page Layout
Settings/Configure Settings
Settings/Configure Toolbars
Settings/Configure Karbon14

Comment 12 alan 2004-03-13 09:50:02 UTC
KChart and KFormula

Standard menu items (Print Preview/Configure menus) cause problems

in addition

KChart Edit/Edit Data

Comment 13 David Faure 2004-03-15 12:35:34 UTC
CVS commit by faure: 

Give parent widget to "configure shortcuts" and "configure toolbars" in all KOffice applications.
Although kwin got improved since #76412, this still improves the behavior when having
two mainwindows (modal dialogs without parent stay on top of all windows, whereas
modal dialogs with a proper parent only stay on top of the correct window).
CCMAIL: 76412@bugs.kde.org


  M +6 -6      koMainWindow.cc   1.324


--- koffice/lib/kofficecore/koMainWindow.cc  #1.323:1.324
@@ -1223,5 +1223,5 @@ void KoMainWindow::slotConfigureKeys()
         return;
 
-    KKeyDialog dlg;
+    KKeyDialog dlg( this );
     dlg.insert( actionCollection() );
     dlg.insert( view->actionCollection() );
@@ -1235,5 +1235,5 @@ void KoMainWindow::slotConfigureToolbars
     if (rootDocument())
         saveMainWindowSettings( KGlobal::config(), rootDocument()->instance()->instanceName() );
-    KEditToolbar edit(factory());
+    KEditToolbar edit(factory(), this);
     connect(&edit,SIGNAL(newToolbarConfig()),this,SLOT(slotNewToolbarConfig()));
     (void) edit.exec();


Comment 14 David Faure 2004-03-15 12:57:33 UTC
CVS commit by faure: 

parent widget pointer for
- insert picture
- save picture, change picture (file dialog)
- insert file (file dialog)
- export to html presentation (file dialog)
- configure kpresenter
CCMAIL: 76412@bugs.kde.org


  M +1 -1      kpresenter_dlg_config.cc   1.116
  M +22 -22    kpresenter_view.cc   1.1000


--- koffice/kpresenter/kpresenter_dlg_config.cc  #1.115:1.116
@@ -69,5 +69,5 @@ KPConfig::KPConfig( KPresenterView* pare
     : KDialogBase(KDialogBase::IconList,i18n("Configure KPresenter") ,
                   KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel| KDialogBase::Default,
-                  KDialogBase::Ok)
+                  KDialogBase::Ok, parent)
 
 {

--- koffice/kpresenter/kpresenter_view.cc  #1.999:1.1000
@@ -645,5 +645,5 @@ void KPresenterView::insertPicture()
     mimetypes += KoPictureFilePreview::clipartMimeTypes();
 
-    KFileDialog fd( m_pKPresenterDoc->picturePath(), QString::null, 0, 0, true );
+    KFileDialog fd( m_pKPresenterDoc->picturePath(), QString::null, this, 0, true );
     fd.setCaption( i18n( "Insert Picture" ) );
     fd.setMimeFilter( mimetypes );
@@ -697,5 +697,5 @@ void KPresenterView::savePicture( const 
     mimetypes << mimetype;
 
-    KFileDialog fd( oldFile, QString::null, 0, 0, TRUE );
+    KFileDialog fd( oldFile, QString::null, this, 0, TRUE );
     fd.setMimeFilter( mimetypes );
     fd.setCaption(i18n("Save Picture"));
@@ -1294,5 +1294,5 @@ void KPresenterView::extraWebPres()
     else if ( ret == KMessageBox::Yes )
     {
-        url = KFileDialog::getOpenURL( QString::null, i18n("*.kpweb|KPresenter HTML Presentation (*.kpweb)") );
+        url = KFileDialog::getOpenURL( QString::null, i18n("*.kpweb|KPresenter HTML Presentation (*.kpweb)"), this );
 
         if( url.isEmpty() )
@@ -3739,5 +3739,5 @@ void KPresenterView::changePicture( cons
     mimetypes += KoPictureFilePreview::clipartMimeTypes();
 
-    KFileDialog fd( filename, QString::null, 0, 0, true );
+    KFileDialog fd( filename, QString::null, this, 0, true );
     fd.setCaption(i18n("Select New Picture"));
     fd.setMimeFilter( mimetypes );
@@ -4676,5 +4676,5 @@ void KPresenterView::insertLink()
     QString link;
     QString ref;
-    if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false))
+    if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false, this))
     {
         if(!link.isEmpty() && !ref.isEmpty())
@@ -4695,5 +4695,5 @@ void KPresenterView::changeLink()
             QString link=oldLinkName;
             QString ref=oldhref;
-            if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false))
+            if(KoInsertLinkDia::createLinkDia(link, ref, QStringList(), false, this))
             {
                 if(!link.isEmpty() && !ref.isEmpty())
@@ -6800,5 +6800,5 @@ void KPresenterView::autoSpellCheck()
 void KPresenterView::insertFile(  )
 {
-    KFileDialog fd( QString::null, QString::null, 0, 0, TRUE );
+    KFileDialog fd( QString::null, QString::null, this, 0, TRUE );
     fd.setMimeFilter( "application/x-kpresenter" );
     fd.setCaption(i18n("Insert File"));


Comment 15 David Faure 2004-03-15 13:02:27 UTC
Status:

> Insert/Scan Image
> Tools/Configure Shortcuts
> Tools/Configure Toolbars
Done once for all apps.

> File/Print Preview
Requires kdeprint change.

> Frames/Text Background Color
> Frames/Configure Frame Border/Border Color
Need tkcoloractions change.

All the other KWord/KPresenter ones have been fixed.
Enough for today :)
If anyone feels like continuing this job, it's a rather easy one, just go through
the rest of the dialogs listed in this BR and pass them a parent widget pointer
(usually the view).

Comment 16 Peter Simonsson 2004-03-31 16:10:07 UTC
All the kivio specific dialogs already have a parent widget.
Comment 17 Nicolas Goutte 2004-05-19 16:51:52 UTC
Let's mark this bug as "junior job" (the first one in KOffice?)

Have a nice day!
Comment 18 James Rose 2004-07-22 07:28:06 UTC
Created attachment 6778 [details]
Patch to solve the problem with this bug and the "edit data" action of kchart

This patch fixes the problem with kchart and "edit data". The attached patch
applies to the directory koffice/kchart .

I believe this is the only place in the kchart directory that has this bug, but
the "Configure Shortcuts" still has it, though previous patches have fixed all
the other "Configure ..." dialogs.
Comment 19 Nicolas Goutte 2004-07-22 21:37:17 UTC
Attachement #6778 patched to KOffice CVS HEAD
Comment 20 Anne-Marie Mahfouf 2005-12-09 20:30:36 UTC
I am not sure what's the exact state of that bug report for koffice next 1.5 in trunk. I could not reproduce the bug but i did not try all koffice apps and all dialogs, just a few reported here.
Alan, if you have a newer version (1.4.x), can you point the still buggy dialogs please? Thanks in advance.
Comment 21 alan 2005-12-09 21:55:26 UTC
On Friday 09 Dec 2005 19:30, Anne-Marie Mahfouf wrote:

> I am not sure what's the exact state of that bug report for koffice next
> 1.5 in trunk. I could not reproduce the bug but i did not try all koffice
> apps and all dialogs, just a few reported here. Alan, if you have a newer
> version (1.4.x), can you point the still buggy dialogs please? Thanks in
> advance.


I am now running Koffice 1.4.2 (Debian Unstable) and the bug as I originally 
reported it seems to have been fixed.  I haven't done an exhaustive test.
Comment 22 Inge Wallin 2006-10-23 16:26:23 UTC
I don't think anybody will bother to do it.  Let's just call it a day, kthxbye?