Summary: | please add ability to "open in the same window" config GUI to KolourPaint | ||
---|---|---|---|
Product: | [Applications] kolourpaint | Reporter: | Technologov <al4321> |
Component: | general | Assignee: | kolourpaint-support |
Status: | CONFIRMED --- | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Technologov
2006-04-07 15:25:16 UTC
I don't agree. All KDE applications open new windows when opening other documents if they don't support tabbing or another MDI mechanism. KolourPaint shouldn't behave differently. I understand, but this behavior should be configurable. Maybe I should change the topic to "All KDE software" instead of "Kolourpaint" ? No. The KDE HIG says it should open a new window. It's not a bug report that will change that. You'll need to convince our usability people first. 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. 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. After all - it looks & feels so similar to MS Paint (which is good), so that even such small thing is noticeable. SVN commit 613781 by dang: Add hidden configuration option "Open Images in the Same Window" which, when enabled, forces "File / New", "File / Open ..." and "File / Open Recent" to never open a new window. Given that it violates the KDE UI standards, I don'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 '04) p77: "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." 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 "Open Images in the Same Window" + (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 ("Color Similarity") #define kpSettingDitherOnOpen QString::fromLatin1 ("Dither on Open if Screen is 15/16bpp and Image Num Colors More Than") #define kpSettingPrintImageCenteredOnPage QString::fromLatin1 ("Print Image Centered On Page") +#define kpSettingOpenImagesInSameWindow QString::fromLatin1 ("Open Images in the Same Window") #define kpSettingsGroupFileSaveAs QString::fromLatin1 ("File/Save As") #define kpSettingsGroupFileExport QString::fromLatin1 ("File/Export") --- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow.cpp #613780:613781 @@ -124,7 +124,26 @@ d->m_moreEffectsDialogLastEffect = cfg.readEntry (kpSettingMoreEffectsLastEffect, 0); d->m_resizeScaleDialogLastKeepAspect = cfg.readEntry (kpSettingResizeScaleLastKeepAspect, false); + if (cfg.hasKey (kpSettingOpenImagesInSameWindow)) + { + d->configOpenImagesInSameWindow = cfg.readEntry (kpSettingOpenImagesInSameWindow, false); + } + else + { + d->configOpenImagesInSameWindow = false; +#if DEBUG_KP_MAIN_WINDOW + kDebug () << "\tconfigOpenImagesInSameWindow: first time" + << " - writing default: " << d->configOpenImagesInSameWindow + << 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->configOpenImagesInSameWindow); + cfg.sync (); + } + #if DEBUG_KP_MAIN_WINDOW kDebug () << "\t\tGeneral Settings: firstTime=" << m_configFirstTime << " showGrid=" << m_configShowGrid @@ -132,6 +151,7 @@ << " colorSimilarity=" << m_configColorSimilarity << " moreEffectsDialogLastEffect=" << d->m_moreEffectsDialogLastEffect << " resizeScaleDialogLastKeepAspect=" << d->m_resizeScaleDialogLastKeepAspect + << " openImagesInSameWindow=" << d->configOpenImagesInSameWindow << 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 &url); void setRecentURLs (const QStringList &items); --- trunk/KDE/kdegraphics/kolourpaint/mainwindow/kpmainwindow_file.cpp #613780:613781 @@ -27,6 +27,7 @@ #include <kpmainwindow.h> +#include <kpmainwindow_p.h> #include <qdatastream.h> #include <qpainter.h> @@ -126,12 +127,6 @@ // private -bool kpMainWindow::shouldOpenInNewWindow () const -{ - return (m_document && !m_document->isEmpty ()); -} - -// private void kpMainWindow::addRecentURL (const KUrl &url) { #if DEBUG_KP_MAIN_WINDOW @@ -202,13 +197,19 @@ // private slot +// TODO: Disable action if +// (d->configOpenImagesInSameWindow && m_document && m_document->isEmpty()) +// as it does nothing if this is true. void kpMainWindow::slotNew () { if (toolHasBegunShape ()) tool ()->endShapeInternal (); - if (m_document) + if (m_document && !d->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->show (); } @@ -262,31 +263,64 @@ // private bool kpMainWindow::open (const KUrl &url, bool newDocSameNameIfNotExist) { - QSize docSize = defaultDocSize (); +#if DEBUG_KP_MAIN_WINDOW + kDebug () << "kpMainWindow::open(" << url + << ",newDocSameNameIfNotExist=" << newDocSameNameIfNotExist + << ")" << endl; +#endif - // create doc + if (d->configOpenImagesInSameWindow) + { + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\topenImagesInSameWindow" << endl; + #endif + // (this brings up a dialog and might save the current doc) + if (!queryClose ()) + { + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\t\tqueryClose() aborts open" << endl; + #endif + return false; + } + } + + // Create/open doc. + const QSize docSize = defaultDocSize (); kpDocument *newDoc = new kpDocument (docSize.width (), docSize.height (), this); if (newDoc->open (url, newDocSameNameIfNotExist)) { + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\topen OK" << endl; + #endif if (newDoc->isFromURL (false/*don't bother checking exists*/)) addRecentURL (url); } else { + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\topen failed" << endl; + #endif delete newDoc; return false; } - // need new window? - if (shouldOpenInNewWindow ()) + // Want new window? + if (m_document && !m_document->isEmpty () && + !d->configOpenImagesInSameWindow) { - // send doc to new window + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\topen in new window" << endl; + #endif + // Send doc to new window. kpMainWindow *win = new kpMainWindow (newDoc); win->show (); } else { - // set up views, doc signals + #if DEBUG_KP_MAIN_WINDOW + kDebug () << "\topen in same window" << 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; }; Thurston, please add a section on "Hidden Configuration Options" to the manual. Since this is intended to (ex-)Windows user, Please make it user configurable in the menus. ..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 ? Yes, it's only for KDE 4 as KDE 3.x is permanently feature frozen. Reassigning bugs to KolourPaint support email address. > Since this is intended to (ex-)Windows user, Please make it user configurable
> in the menus.
Can we simply document this in the manual under "Hidden Configuration Options"?
I'd prefer to not to make it configurable via the GUI because:
1. The feature violates the KDE UI standards :)
2. It's too obscure and most people will live without it.
3. We don't have a config dialog and don'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.
|