<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>125116</bug_id>
          
          <creation_ts>2006-04-07 15:25:16 +0000</creation_ts>
          <short_desc>please add ability to &quot;open in the same window&quot; config GUI to KolourPaint</short_desc>
          <delta_ts>2014-09-30 21:12:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kolourpaint</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Technologov">al4321</reporter>
          <assigned_to>kolourpaint-support</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>5</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>428764</commentid>
    <comment_count>0</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-04-07 15:25:16 +0000</bug_when>
    <thetext>Version:           1.4.3_light-pre (using KDE 3.4.2 Level &quot;b&quot; , SUSE 10.0)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15-default

Currently, when you open a bitmap in KolourPaint it opens in a new window. I ask the developers, to make KolourPaint configurable - so the user can choose if he wants to open bitmaps in current window (like MS Paint) or in a new window (like it&apos;s current way).

OS: SUSE Linux 10.0. KDE 3.4.2, KolourPaint 1.4.3 light-pre.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>429443</commentid>
    <comment_count>1</comment_count>
    <who name="Thiago Macieira">thiago</who>
    <bug_when>2006-04-10 02:26:27 +0000</bug_when>
    <thetext>I don&apos;t agree. All KDE applications open new windows when opening other documents if they don&apos;t support tabbing or another MDI mechanism. KolourPaint shouldn&apos;t behave differently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>429607</commentid>
    <comment_count>2</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-04-10 16:18:24 +0000</bug_when>
    <thetext>I understand, but this behavior should be configurable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>429609</commentid>
    <comment_count>3</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-04-10 16:23:01 +0000</bug_when>
    <thetext>Maybe I should change the topic to &quot;All KDE software&quot; instead of &quot;Kolourpaint&quot; ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>429640</commentid>
    <comment_count>4</comment_count>
    <who name="Thiago Macieira">thiago</who>
    <bug_when>2006-04-10 18:14:55 +0000</bug_when>
    <thetext>No. The KDE HIG says it should open a new window. It&apos;s not a bug report that will change that. You&apos;ll need to convince our usability people first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493830</commentid>
    <comment_count>5</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2006-12-15 00:58:56 +0000</bug_when>
    <thetext>Closed as per Comment #1: KolourPaint should be consistent with other KDE applications.

However, if you *really* want this, let me know and I will implement a hidden configuration option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493833</commentid>
    <comment_count>6</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-12-15 01:19:47 +0000</bug_when>
    <thetext>Yes, please. Some people are used to MS Paint (including me and my father), and we prefer to open new image in same window (actually replacing what we have editing).

When I need to edit 2 pictures simulatenously, then I manually open 2 MS Paints, and can edit (copy-paste) between those.

I am not asking to make this default, just an option.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493834</commentid>
    <comment_count>7</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-12-15 01:21:31 +0000</bug_when>
    <thetext>After all - it looks &amp; feels so similar to MS Paint (which is good), so that even such small thing is noticeable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493868</commentid>
    <comment_count>8</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2006-12-15 08:07:53 +0000</bug_when>
    <thetext>SVN commit 613781 by dang:

Add hidden configuration option &quot;Open Images in the Same Window&quot; which,
when enabled, forces &quot;File / New&quot;, &quot;File / Open ...&quot; and &quot;File / Open Recent&quot;
to never open a new window.


Given that it violates the KDE UI standards, I don&apos;t think it should have a
user-visible config option - do you agree or disagree?


Testing has been limited due to my checkout of kdelibs 4.0 having far too
many bugs.


Technical details:
- Removed kpMainWindow::shouldOpenInNewWindow() and inlined the code as
  the method would be too confusing if this configuration option was on


Support for the feature:

1.
CCMAIL: 125116-done@bugs.kde.org

2. 
Frank Wieduwilt, Linux Magazine Issue #44 (Jul &apos;04) p77:

&quot;Unfortunately, the program [KolourPaint] opens up each image in a separate
window.  This tends to clutter up the screen while working with multiple
images.  The developers have promised to change this in the imminent 1.1
version, however.&quot;

3.
And the feature was also silented requested by me :)



 M  +3 -0      NEWS  
 M  +1 -0      kpdefs.h  
 M  +20 -0     mainwindow/kpmainwindow.cpp  
 M  +0 -1      mainwindow/kpmainwindow.h  
 M  +47 -13    mainwindow/kpmainwindow_file.cpp  
 M  +2 -0      mainwindow/kpmainwindow_p.h  


--- trunk/KDE/kdegraphics/kolourpaint/NEWS #613780:613781
@@ -15,7 +15,10 @@
      - Centre image on page
      [also in branches/KDE/3.5/]
 
+   * Add hidden configuration option &quot;Open Images in the Same Window&quot;
+     (Bug #125116)
 
+
 KolourPaint 1.4_relight Series (branches/KDE/3.5/)
 ===============================
 
--- trunk/KDE/kdegraphics/kolourpaint/kpdefs.h #613780:613781
@@ -72,6 +72,7 @@
 #define kpSettingColorSimilarity QString::fromLatin1 (&quot;Color Similarity&quot;)
 #define kpSettingDitherOnOpen QString::fromLatin1 (&quot;Dither on Open if Screen is 15/16bpp and Image Num Colors More Than&quot;)
 #define kpSettingPrintImageCenteredOnPage QString::fromLatin1 (&quot;Print Image Centered On Page&quot;)
+#define kpSettingOpenImagesInSameWindow QString::fromLatin1 (&quot;Open Images in the Same Window&quot;)
 
 #define kpSettingsGroupFileSaveAs QString::fromLatin1 (&quot;File/Save As&quot;)
 #define kpSettingsGroupFileExport QString::fromLatin1 (&quot;File/Export&quot;)
--- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow.cpp #613780:613781
@@ -124,7 +124,26 @@
     d-&gt;m_moreEffectsDialogLastEffect = cfg.readEntry (kpSettingMoreEffectsLastEffect, 0);
     d-&gt;m_resizeScaleDialogLastKeepAspect = cfg.readEntry (kpSettingResizeScaleLastKeepAspect, false);
 
+    if (cfg.hasKey (kpSettingOpenImagesInSameWindow))
+    {
+        d-&gt;configOpenImagesInSameWindow = cfg.readEntry (kpSettingOpenImagesInSameWindow, false);
+    }
+    else
+    {
+        d-&gt;configOpenImagesInSameWindow = false;
+#if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\tconfigOpenImagesInSameWindow: first time&quot;
+                  &lt;&lt; &quot; - writing default: &quot; &lt;&lt; d-&gt;configOpenImagesInSameWindow
+                  &lt;&lt; endl;
+#endif
+        // TODO: More hidden options have to write themselves out on startup,
+        //       not on use, to be discoverable (e.g. printing centered on page).
+        cfg.writeEntry (kpSettingOpenImagesInSameWindow,
+                        d-&gt;configOpenImagesInSameWindow);
+        cfg.sync ();
+    }
 
+
 #if DEBUG_KP_MAIN_WINDOW
     kDebug () &lt;&lt; &quot;\t\tGeneral Settings: firstTime=&quot; &lt;&lt; m_configFirstTime
                &lt;&lt; &quot; showGrid=&quot; &lt;&lt; m_configShowGrid
@@ -132,6 +151,7 @@
                &lt;&lt; &quot; colorSimilarity=&quot; &lt;&lt; m_configColorSimilarity
                &lt;&lt; &quot; moreEffectsDialogLastEffect=&quot; &lt;&lt; d-&gt;m_moreEffectsDialogLastEffect
                &lt;&lt; &quot; resizeScaleDialogLastKeepAspect=&quot; &lt;&lt; d-&gt;m_resizeScaleDialogLastKeepAspect
+               &lt;&lt; &quot; openImagesInSameWindow=&quot; &lt;&lt; d-&gt;configOpenImagesInSameWindow
                &lt;&lt; endl;
 #endif
 }
--- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow.h #613780:613781
@@ -296,7 +296,6 @@
     bool m_exportFirstTime;
 
 private:
-    bool shouldOpenInNewWindow () const;
     void addRecentURL (const KUrl &amp;url);
     void setRecentURLs (const QStringList &amp;items);
 
--- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow_file.cpp #613780:613781
@@ -27,6 +27,7 @@
 
 
 #include &lt;kpmainwindow.h&gt;
+#include &lt;kpmainwindow_p.h&gt;
 
 #include &lt;qdatastream.h&gt;
 #include &lt;qpainter.h&gt;
@@ -126,12 +127,6 @@
 
 
 // private
-bool kpMainWindow::shouldOpenInNewWindow () const
-{
-    return (m_document &amp;&amp; !m_document-&gt;isEmpty ());
-}
-
-// private
 void kpMainWindow::addRecentURL (const KUrl &amp;url)
 {
 #if DEBUG_KP_MAIN_WINDOW
@@ -202,13 +197,19 @@
 
 
 // private slot
+// TODO: Disable action if
+//       (d-&gt;configOpenImagesInSameWindow &amp;&amp; m_document &amp;&amp; m_document-&gt;isEmpty())
+//       as it does nothing if this is true.
 void kpMainWindow::slotNew ()
 {
     if (toolHasBegunShape ())
         tool ()-&gt;endShapeInternal ();
 
-    if (m_document)
+    if (m_document &amp;&amp; !d-&gt;configOpenImagesInSameWindow)
     {
+        // A document -- empty or otherwise -- is open.
+        // Force open a new window.  In contrast, open() might not open
+        // a new window in this case.
         kpMainWindow *win = new kpMainWindow ();
         win-&gt;show ();
     }
@@ -262,31 +263,64 @@
 // private
 bool kpMainWindow::open (const KUrl &amp;url, bool newDocSameNameIfNotExist)
 {
-    QSize docSize = defaultDocSize ();
+#if DEBUG_KP_MAIN_WINDOW
+    kDebug () &lt;&lt; &quot;kpMainWindow::open(&quot; &lt;&lt; url
+              &lt;&lt; &quot;,newDocSameNameIfNotExist=&quot; &lt;&lt; newDocSameNameIfNotExist
+              &lt;&lt; &quot;)&quot; &lt;&lt; endl;
+#endif
 
-    // create doc
+    if (d-&gt;configOpenImagesInSameWindow)
+    {
+    #if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\topenImagesInSameWindow&quot; &lt;&lt; endl;
+    #endif
+        // (this brings up a dialog and might save the current doc)
+        if (!queryClose ())
+        {
+        #if DEBUG_KP_MAIN_WINDOW
+            kDebug () &lt;&lt; &quot;\t\tqueryClose() aborts open&quot; &lt;&lt; endl;
+        #endif
+            return false;
+        }
+    }
+
+    // Create/open doc.
+    const QSize docSize = defaultDocSize ();
     kpDocument *newDoc = new kpDocument (docSize.width (), docSize.height (), this);
     if (newDoc-&gt;open (url, newDocSameNameIfNotExist))
     {
+    #if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\topen OK&quot; &lt;&lt; endl;
+    #endif
         if (newDoc-&gt;isFromURL (false/*don&apos;t bother checking exists*/))
             addRecentURL (url);
     }
     else
     {
+    #if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\topen failed&quot; &lt;&lt; endl;
+    #endif
         delete newDoc;
         return false;
     }
 
-    // need new window?
-    if (shouldOpenInNewWindow ())
+    // Want new window?
+    if (m_document &amp;&amp; !m_document-&gt;isEmpty () &amp;&amp;
+        !d-&gt;configOpenImagesInSameWindow)
     {
-        // send doc to new window
+    #if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\topen in new window&quot; &lt;&lt; endl;
+    #endif
+        // Send doc to new window.
         kpMainWindow *win = new kpMainWindow (newDoc);
         win-&gt;show ();
     }
     else
     {
-        // set up views, doc signals
+    #if DEBUG_KP_MAIN_WINDOW
+        kDebug () &lt;&lt; &quot;\topen in same window&quot; &lt;&lt; endl;
+    #endif
+        // (sets up views, doc signals)
         setDocument (newDoc);
     }
 
--- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow_p.h #613780:613781
@@ -51,6 +51,8 @@
     int m_moreEffectsDialogLastEffect;
     bool m_resizeScaleDialogLastKeepAspect;
 
+    bool configOpenImagesInSameWindow;
+
     QActionGroup *toolsActionGroup;
 };
 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493870</commentid>
    <comment_count>9</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2006-12-15 08:10:39 +0000</bug_when>
    <thetext>Thurston, please add a section on &quot;Hidden Configuration Options&quot; to the manual.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493895</commentid>
    <comment_count>10</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-12-15 09:54:17 +0000</bug_when>
    <thetext>Since this is intended to (ex-)Windows user, Please make it user configurable in the menus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493896</commentid>
    <comment_count>11</comment_count>
    <who name="Technologov">al4321</who>
    <bug_when>2006-12-15 09:56:14 +0000</bug_when>
    <thetext>..And thank you very much for implement it.

If I understood you correctly, the version with such a feature will only be available for KDE 4 ?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494027</commentid>
    <comment_count>12</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2006-12-16 01:44:55 +0000</bug_when>
    <thetext>Yes, it&apos;s only for KDE 4 as KDE 3.x is permanently feature frozen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494306</commentid>
    <comment_count>13</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2006-12-17 04:26:16 +0000</bug_when>
    <thetext>Reassigning bugs to KolourPaint support email address. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525539</commentid>
    <comment_count>14</comment_count>
    <who name="Clarence Dang">dang</who>
    <bug_when>2007-05-13 06:59:00 +0000</bug_when>
    <thetext>&gt; Since this is intended to (ex-)Windows user, Please make it user configurable
&gt; in the menus.

Can we simply document this in the manual under &quot;Hidden Configuration Options&quot;?

I&apos;d prefer to not to make it configurable via the GUI because:

1. The feature violates the KDE UI standards :)

2. It&apos;s too obscure and most people will live without it.

3. We don&apos;t have a config dialog and don&apos;t want to add one just for this feature :)  In any case, I want to minimize user-visible config options / GUI clutter by using sane defaults.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>