Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.84k stars 321 forks source link

Get rid of no-File-Browser mode (simpleEditor) #2238

Open Beep6581 opened 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 2254

When an image is passed to RawTherapee either on the command-line or by right-clicking
on an image and using RawTherapee to open it, it starts in an Editor-tab-only mode,
without a File Browser tab or a Filmstrip.
This issue is a feature request to get rid of that mode.

In the situation above, the desired behavior is for RawTherapee to start with that
image opened in the Editor tab (or for a new Editor tab with that image to be added
to an already-running instance of RT if using Multiple Editor Tabs Mode), and for the
File Browser tree to expand the folder which contains that image.

Reported by entertheyoni on 2014-02-19 14:01:56

Beep6581 commented 9 years ago
I like this feature request:)

Reported by michaelezra000 on 2014-02-20 03:15:58

Beep6581 commented 9 years ago
This is duplicate of the https://code.google.com/p/rawtherapee/issues/detail?id=1849

Reported by michal.thoma on 2014-02-20 19:16:27

Beep6581 commented 9 years ago
Issue 1833 has been merged into this issue.

Reported by entertheyoni on 2014-02-20 19:29:09

Beep6581 commented 9 years ago
Will this not mean significantly longer startup time in the case of a new instance being
started, though?

Reported by nobrowser on 2014-04-24 01:23:16

Beep6581 commented 9 years ago
It won't in case the all files in active folder are not accessed on startup.

Reported by michal.thoma on 2014-04-24 07:52:56

Beep6581 commented 9 years ago

Reported by entertheyoni on 2014-05-22 12:22:04

Beep6581 commented 9 years ago
Ideally:
1- simpleEditor should be removed from the code,
2- If a single file is passed, open it respecting the SETM/METM setting the user chose,
3- If more than one file is passed, force RT to open in METM and load each file in
a tab.
4- Perhaps ask for confirmation if more than 3 files are to be loaded.
5- If opening multiple files and METM if forced, this is temporary. The SETM/METM choice
in options should not be touched.
6- The folder containing the passed file should not be opened in the File Browser,
as that could be the web browser download cache, full of potentially crashy things.
If a folder is to be opened when multiple files are passed, its arbitrary which one
it is (first image? last image? no matter imho). Maybe populate the "Recent folders"
list with the paths.
7- If the user navigates to a different folder, that folder should be remembered in
options just as normal.
8- Fix Issue 1274 - File browser's "Recent folders" list not persistent over restart.
9- Low priority: possibility to pass images and a folder on the command line -> images
get opened in tabs, the folder in the file browser.

Reported by entertheyoni on 2014-10-04 00:13:24

Beep6581 commented 9 years ago
Issue 1055 has been merged into this issue.

Reported by entertheyoni on 2014-10-31 14:33:22

Beep6581 commented 9 years ago
Please note that there is nothing obvious in the documentation of the settings button
to point out that it is not available when in simpleEditor mode.  This can lead to
a lot of confusion, e.g. New User tries "Open in External Editor" and is told path
to gimp is not configured in settings, spends a time looking for the settings button,
checks the online documentation, still can't find the button, (this new user only found
the button when allowing autostart following a fresh install).

If this issue remains a low priority please at least add a note in the documentation
on where to find the settings button that it is only available when no image is loaded!

Reported by GadgetSteve@hotmail.com on 2015-05-31 05:09:23

Beep6581 commented 9 years ago
RawPedia updated.

Reported by entertheyoni on 2015-05-31 09:50:53

Beep6581 commented 9 years ago
Very fast response to the Rawpedia issue - thank-you entertheyoni.

Reported by GadgetSteve@hotmail.com on 2015-05-31 18:28:09

gkuenning commented 7 years ago

Getting rid of the editor-only mode is a terrible idea. The file browser mode is inherently slow in a directory with thousands of images. If I come back from a long day of shooting and only want to process one file, rawtherapee starts up about 6 seconds (still too slow, but acceptable). If I fire it up in file browser mode in a directory that contains 2800+ files, it comes up in the same 6 seconds but then won't respond to something simple like clicking the preferences button for as much as 5 more seconds.

The correct solution is to separate controls that are actually related to file browsing from global controls such as preferences. Removing a useful mode is a Bad Idea.

heckflosse commented 7 years ago

@agriggio Alberto, doesn't solve #3946 this issue?

agriggio commented 7 years ago

I'd say so, yes. the only thing that is not possible is to open the new image in a new "full" instance of RT. either you open it in an already running instance, or you open it in single editor mode. I don't think this is a problem, but I wanted to point this out

Beep6581 commented 7 years ago

@agriggio would you consider flipping the behavior to act in "remote" mode without -R? In other words, when someone double-clicks on a photo or right-clicks and selects "open with", it should open in a fully-fledged RT. If someone wants the much disliked no-file-browser mode, then they can use -R (or -s for "simple", or some such). I think opening a photo in a vanilla instance should be the default behavior, and its special modes like no-fb which should require a switch.

This would be for 5.2.

Ping @heckflosse @Hombre57 @Floessie @Desmis

agriggio commented 7 years ago

that's fine for me -- but I'm currently traveling, not sure I will be able to commit before Sunday

heckflosse commented 7 years ago

@Beep6581

This would be for 5.2.

really?

gkuenning commented 7 years ago

I think a separate "suppress file browser" switch would be a good solution. (Of course, preferences should still be available in the no-file-browser mode!)

Beep6581 commented 7 years ago

@heckflosse yes - the -R switch hasn't been in any stable version yet, allowing us to change it without breaking things downstream. Once 5.2 is out, changing it would cause problems for package maintainers and users.

Beep6581 commented 7 years ago

Something like this - seems to work here:

diff --git a/rtgui/main.cc b/rtgui/main.cc
index 099751f0..8ae7bbc5 100644
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -63,7 +63,7 @@ Glib::ustring argv1;
 Glib::ustring argv2;
 bool simpleEditor = false;
 bool gimpPlugin = false;
-bool remote = false;
+bool lite = false;
 Glib::RefPtr<Gtk::CssProvider> cssForced;
 Glib::RefPtr<Gtk::CssProvider> cssRT;
 //Glib::Threads::Thread* mainThread;
@@ -71,7 +71,7 @@ Glib::RefPtr<Gtk::CssProvider> cssRT;
 namespace
 {

-// For an unknown reason, Glib::filename_to_utf8 doesn't work on reliably Windows,
+// For an unknown reason, Glib::filename_to_utf8 doesn't work reliably on Windows,
 // so we're using Glib::filename_to_utf8 for Linux/Apple and Glib::locale_to_utf8 for Windows.
 Glib::ustring fname_to_utf8 (const char* fname)
 {
@@ -135,19 +135,15 @@ int processLineParams( int argc, char **argv )
             case 'v':
                 return 0;

-#ifndef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
-            case 'R':
-                if (!gimpPlugin) {
-                    remote = true;
-                }
+            case 'l':
+                lite = true;
                 break;
-#endif
-                
+
             case 'g':
                 if (currParam == "-gimp") {
                     gimpPlugin = true;
                     simpleEditor = true;
-                    remote = false;
+                    lite = true;
                     break;
                 }
                 // no break here on purpose
@@ -175,13 +171,13 @@ int processLineParams( int argc, char **argv )
                 std::cout << std::endl;
                 std::cout << "Options:" << std::endl;
 #ifdef WIN32
-                std::cout << "  -w Do not open the Windows console" << std::endl;
+                std::cout << "  -w Do not open the Windows console." << std::endl;
 #endif
-                std::cout << "  -v Print RawTherapee version number and exit" << std::endl;
+                std::cout << "  -v Print RawTherapee version number and exit." << std::endl;
 #ifndef __APPLE__
-                std::cout << "  -R Raise an already running RawTherapee instance (if available)" << std::endl;
+                std::cout << "  -l Lite mode - no File Browser, Queue or Preferences." << std::endl;
 #endif
-                std::cout << "  -h -? Display this help message" << std::endl;
+                std::cout << "  -h -? Display this help message." << std::endl;
                 return -1;
             }
             }
@@ -420,7 +416,7 @@ int main(int argc, char **argv)

     simpleEditor = false;
     gimpPlugin = false;
-    remote = false;
+    lite = false;
     argv0 = "";
     argv1 = "";
     argv2 = "";
@@ -473,8 +469,8 @@ int main(int argc, char **argv)
     creditsPath = CREDITS_SEARCH_PATH;
     licensePath = LICENCE_SEARCH_PATH;
 #endif
-    
-    
+
+
 #ifdef WIN32
     bool consoleOpened = false;

@@ -483,7 +479,12 @@ int main(int argc, char **argv)

     if(argc > 1) {
         int ret = processLineParams( argc, argv);
-        if (options.rtSettings.verbose || (!remote && !Glib::file_test (argv1, Glib::FILE_TEST_EXISTS ) && !Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR))) {
+
+#ifdef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
+        lite = true;
+#endif
+
+        if (options.rtSettings.verbose || (lite && !Glib::file_test (argv1, Glib::FILE_TEST_EXISTS ) && !Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR))) {
             bool stdoutRedirectedtoFile = (GetFileType(GetStdHandle(STD_OUTPUT_HANDLE)) == 0x0001);
             bool stderrRedirectedtoFile = (GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == 0x0001);

@@ -577,12 +578,12 @@ int main(int argc, char **argv)
             printf("Error: -gimp requires two arguments\n");
             return 1;
         }
-    } else if (!remote && Glib::file_test(argv1, Glib::FILE_TEST_EXISTS)) {
+    } else if (lite && Glib::file_test(argv1, Glib::FILE_TEST_EXISTS)) {
         simpleEditor = true;
     }

     int ret = 0;
-    if (remote) {
+    if (!lite) {
         char *app_argv[2] = { const_cast<char *>(argv0.c_str()) };
         int app_argc = 1;
         if (!argv1.empty()) {
@@ -606,7 +607,7 @@ int main(int argc, char **argv)
                 sf.tiffBits = 16;
                 sf.tiffUncompressed = true;
                 sf.saveParams = true;
-            
+
                 if (!rtWindow->epanel->saveImmediately(argv2, sf)) {
                     ret = -2;
                 }
diff --git a/rtgui/options.h b/rtgui/options.h
index 9253b7e2..dd2e722f 100644
--- a/rtgui/options.h
+++ b/rtgui/options.h
@@ -367,7 +367,7 @@ extern Glib::ustring argv0;
 extern Glib::ustring argv1;
 extern bool simpleEditor;
 extern bool gimpPlugin;
-extern bool remote;
+extern bool lite;
 extern Glib::ustring versionString;
 extern Glib::ustring paramFileExtension;

diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc
index c51d1b7f..6316cb13 100644
--- a/rtgui/rtwindow.cc
+++ b/rtgui/rtwindow.cc
@@ -271,7 +271,7 @@ RTWindow::RTWindow ()

         bpanel->init (this);

-        if (!argv1.empty() && !remote) {
+        if (!argv1.empty() && lite) {
             Thumbnail* thm = cacheMgr->getEntry(argv1);
             if (thm) {
                 fpanel->fileCatalog->openRequested({thm});
heckflosse commented 7 years ago

@Beep6581 This:

+#ifdef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
+        lite = true;
+#endif

is an #ifdef __APPLE__ inside an #ifdef WIN32, which does not make sense

agriggio commented 7 years ago

How about this instead?

diff --git a/rtgui/main.cc b/rtgui/main.cc
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -135,13 +135,9 @@
             case 'v':
                 return 0;

-#ifndef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
-            case 'R':
-                if (!gimpPlugin) {
-                    remote = true;
-                }
+            case 's':
+                remote = false;
                 break;
-#endif

             case 'g':
                 if (currParam == "-gimp") {
@@ -178,9 +174,7 @@
                 std::cout << "  -w Do not open the Windows console" << std::endl;
 #endif
                 std::cout << "  -v Print RawTherapee version number and exit" << std::endl;
-#ifndef __APPLE__
-                std::cout << "  -R Raise an already running RawTherapee instance (if available)" << std::endl;
-#endif
+                std::cout << "  -s Open the file in a new \"simple editor\" instance of RawTherapee (no file browser, no queue)" << std::endl;
                 std::cout << "  -h -? Display this help message" << std::endl;
                 return -1;
             }
@@ -420,7 +414,11 @@

     simpleEditor = false;
     gimpPlugin = false;
+#ifndef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
+    remote = true;
+#else
     remote = false;
+#endif
     argv0 = "";
     argv1 = "";
     argv2 = "";
heckflosse commented 7 years ago

@agriggio @Beep6581 Before this patches it was possible to open >=2 full instances (with file browser and queue) of RT. With this patches that seems impossible now to me. Is that intended? Do I miss something?

Hombre57 commented 7 years ago

@heckflosse That's what @Beep6581 asked for.

However it would be better to mimic e.g. Firfox behavior, i.e.

We're almost there ! I'd keep this last patch so it can open a single editor instance on request (with -s), or get ride of this mode completely (I wouldn't miss it, but maybe someone with tons of images in a single folder would). @agriggio It would be nice if you could also set remote based on the command line (i.e. if file or folder is provided).

Beep6581 commented 7 years ago

Maybe it's better if we first define the desired behavior:

  1. ./rawtherapee -> full mode
  2. ./rawtherapee folder -> full mode
  3. ./rawtherapee photo1.raw -> full mode
  4. ./rawtherapee photo1.raw & ./rawtherapee photo2.raw -> full mode, same instance if METM, different instances if SETM
  5. ./rawtherapee -s -> abort, can't open nothing in slim mode
  6. ./rawtherapee -s folder -> abort, can't open folder in slim mode
  7. ./rawtherapee -s photo1.raw -> slim mode
  8. ./rawtherapee -s photo1.raw & ./rawtherapee -s photo2.raw -> slim mode, different instances (slim mode cannot have same instances)
agriggio commented 7 years ago

@Beep6581 what you ask might require a bit more than a simple patch -- not sure I'll have time before 5.2.

I think that an explicit -R is the best compromise. it's actually easy to edit launchers (on Linux at least, I suppose also on win) to run RT with -R automatically. we can probably ask packagers to consider this of we think it should be the default, or just document it properly on rawpedia...

heckflosse commented 7 years ago

@agriggio @Beep6581 @Hombre57

I vote for keeping as is now (with the explicit -R flag) for 5.2 because it just adds a new mode and for the other modes it behaves like before.

Hombre57 commented 7 years ago

Considering the release date, yes, we can keep it as is for now.

Beep6581 commented 7 years ago

Alright. Let's leave this for the future, and not stress about it now. I'll pump 5.2 out tonight.

Beep6581 commented 6 years ago

Re-opened due to public demand for the default being a full-feature RT and requiring an argument to use the no-File-Browser mode.

agriggio commented 6 years ago

ok, but should we just have -R be the default and add an explicit -s? would this be ok?

heckflosse commented 6 years ago

@agriggio

Or just default to -R always and remove the option?

agriggio commented 6 years ago

I remember someone requesting to still be able to run in no file browser mode when we first announced -R on pixls...

heckflosse commented 6 years ago

@agriggio I also remember that request. But I can't find it

gaaned92 commented 6 years ago

Don't forget that the GIMP plugin opens RT in no-File-Browser mode

jbruchon commented 5 years ago

Is this the reason that when I only want to work on one file I have to wait as RawTherapee locks up while reading all 493 files totaling 6GB of data across a ~28MiB/sec wireless network connection? I vote strongly that opening a single image should never invoke ANYTHING that results in reading the entire contents of the single image's directory. Make the people who want a file browser mode enabled even when editing a single image explicitly request one; the rest of us are tired of waiting 5 minutes for RT to start up at all as it iterates through every single file for no useful reason. I keep UFRaw around because of this, but it's not kept updated so for some files I simply can't use UFRaw since it's not maintained anymore.

Thanatomanic commented 5 years ago

@jbruchon Are you certain that this happens every time you start RT? I can imagine that when RT needs to generate thumbnails it starts processing all files in the folder (not saying that it should, but it might), but once this is done, these thumbnails exist locally and should reload really fast.

gaaned92 commented 5 years ago
jbruchon commented 5 years ago

It touches every file in the directory every time a file is opened. It does so if I have it already opened and hit the preferences button in the bottom left corner. This is consistent across all right-click - Open with RT invocations. I have confirmed with Process Explorer that this is what is happening. If there is some kind of caching going on, it's not changing anything. Even if there was, it should be showing a user interface of some sort explaining what it's doing. It's not good to be running in the background for five minutes before popping up any sort of indication that the invocation was successful. It's also using a substantial amount of CPU (2 cores at full usage plus some of a third) during this process. Bear in mind that all of this is happening while all I want to do is develop a single raw file to a JPEG.

gaaned92 commented 5 years ago
jbruchon commented 5 years ago

I should not have to do either of those.

gaaned92 commented 5 years ago

@jbruchon @Beep6581 @heckflosse I should not have to do either of those. I am not far to agree with you but it was a frequent request by users that "open with rawtherapee" opens Rawtherapee in full mode. So when generating the installer, the -R option permitting to open in full mode is added. Effectively it can be a pain if you want to process a file on a remote drive

I didn't really understand the request as there also exist a browse with rawtherapee permitting to open a folder.

heckflosse commented 5 years ago

There is clearly a bug:

To reproduce:

This is fast 1) open cmd.exe 2) cd to your rawtherapee folder 3) rawtherapee -R {filename of a raw file}

This is slow: 1) open cmd.exe 2) cd to your image folder 3) {path to your rawtherapee installation}\rawtherapee -R {filename of a raw file}

@gaaned92 Can you confirm?

heckflosse commented 5 years ago

Here the taskmanager view of my above test: grafik

jbruchon commented 5 years ago

@heckflosse If you run Process Explorer and open the bottom panel that shows open file handles and click on RawTherapee.exe after "open with RT", you'll be able to watch it iterating through every single file in the folder.

image

heckflosse commented 5 years ago

@jbruchon What happens if you copy a raw file into your rawtherapee installation folder and open this file using open with RT?

Edit: Scratch that. But what happens, when you do the above tests I mentioned to reproduce?

jbruchon commented 5 years ago

@heckflosse The first one opens quickly, though it initially shows a populating file browser and it still populates the browser in the background (which I do not want to happen.) I cannot cd to my image folder because you can't cd to UNC paths in CMD.

jbruchon commented 5 years ago

Good news! I've worked around the problem. I created a file rt-open.bat and placed it in the RT program folder (note on %~dp0):

@echo off
cd "%~dp0"
rawtherapee.exe -R "%1"

I then edited HKEY_CLASSES_ROOT\*\shell\Open with RawTherapee\command to have a (Default) of C:\Program Files\RawTherapee\5.6\rt-open.bat "%1" and now right-click - "Open with RawTherapee" opens quickly.

heckflosse commented 5 years ago

@jbruchon I found it:

to fix it:

1) create a folder with name 'empty' 2) start rt 3) open preferences 4) go to image processing tab 5) set this folder as in the following screenshot 6) push ok button 7) close rt

Should be fixed then

grafik

Edit: If you already set a HaldCLUT folder, you can keep it of course, just avoid that any of this folders is set to 'none'

gaaned92 commented 5 years ago

@heckflosse I can hardly see a difference on W10. But I have to recheck.

@jbruchon I should have provided you with solution to open in no-file-browser with open with rawtherapee

now open with rawtherapee opens in no-file browse mode. Inconvenience: you dont'have the processing queue.