Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Path bug...

Path bug...

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #30 on Sun 15 Apr 2007 10:00 PM (UTC)
Message
Quote:
ou expect it to know that you last saved the word document in foo\bar, the last spreadsheet in foo\rab and the last database in foo\dbs, and not confuse those.
I don't expect this behavior. On the contrary I want it to keep the last directory I used, and not try to be clever by guessing which directory I really meant.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #31 on Sun 15 Apr 2007 10:06 PM (UTC)
Message
Yeah, the thing I don't like about some products is they try to be too smart. For example the idea that it should keep its own internal "current directory" perhaps tied to a current world, or plugin, or notepad, or whatever you have in mind.

I remember a while ago I tried to write a simple letter using Office 98 or some such thing, and a little box popped up and said "I see you are trying to write a letter - would you like me to help you?". I replied "yes" which was one of the biggest mistakes I made that day.

From then on, I spent about half an hour wrestling with how *it* thought I should format the letter, compared to what I really wanted. I would left-justify something, and it would right-justify it and change the font. I would change it back, and it would do it again. I had to abandon that letter entirely.

I could give lots of examples, but basically I don't want software to try to be "too smart". As for the directories, if I change them, well they are changed.

A suggestion I *would* be prepared to look at is changing the flags in the file browser dialog boxes (however many of them there are) so that they do not switch directories. That way, the "current" directory will probably stay the same (unless a plugin changes it).

However if you try to open 10 different files in a non-standard directory, you will have to navigate to it every time.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #32 on Tue 17 Apr 2007 02:54 AM (UTC)
Message
Not sure they are flags per-say. Its a persistence function. When you close the object, persistent ones will either a) write information about their current state into the system registry (bad, since we are trying to get away from that, and worse, since I don't think this is necessarily a built in feature) or it fires an event of some sort that calls code in the object specific to saving that persistent data. If you don't have that code, then it may remember where it is *when running*, but it forgets where you had it the next time you load the application. I have no idea how MFC handles this issue.

And frankly, remembering where you where last is pretty dumb behavior. If I open a file of a specific type in Word/OpenOffice from the A: drive or a USB drive, etc. it will "try" to look there first, because that is the last place it remembered, instead of returning to a default location for that file type. The only ones that remember the specific location you *want* a type of file to go are ones where those files are directly linked to the application as part of its own design and mandate specific locations. That or ones that have no persistency at all and instead always default to their own application path, which is imho a major pain in the ass when the place you save everything for them is 10 directory clicks away from there. :( But no, remembering where you last put a file isn't that bright. If its something like, "Which paint brush would you like to load?", then I would expect it to always start with, "C:\Progra~1\MyPaint\Brushes", if its, "Which image do you want to load?", I don't want to have to navigate from "C:\Progra~1\MyPaint\Images" to "My Documents\Images" every bloody time. There is a right time and a wrong time to be that smart<>stupid. lol
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #33 on Tue 17 Apr 2007 03:02 AM (UTC)

Amended on Tue 17 Apr 2007 03:04 AM (UTC) by Nick Gammon

Message
It is a flag. See MSDN:

http://msdn2.microsoft.com/en-us/library/ms646839.aspx

The flag I am thinking of is this one:


OFN_NOCHANGEDIR

Restores the current directory to its original value if the user changed the directory while searching for files.


Quote:

And frankly, remembering where you where last is pretty dumb behavior.


I don't think it is that dumb. Say I have a folder of photos I took recently, and I open one up in Paint or some such program. I view it, and close it. Then I want to look at another one. I don't want to have to work my way from the "default" directory for pictures (whatever that is), to another drive maybe, and a deeply nested folder, just to get another one.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #34 on Tue 17 Apr 2007 03:06 AM (UTC)
Message
Quote:

I don't want to have to navigate from "C:\Progra~1\MyPaint\Images" to "My Documents\Images" every bloody time. There is a right time and a wrong time to be that smart<>stupid. lol


OK I see you acknowledge that point. So how does the program guess when to be "smart"?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #35 on Tue 17 Apr 2007 03:06 AM (UTC)
Message
Quote:
Another odd issue to go along with the default directories in the method that you suggested for going into the documents folder automatically, is that you may not always run the program from the same spot all the time.


Well, in the case of what I am talking about, it would only use a default location if you specify one. If you leave it blank, it should either a) remember the last place you where or b) use the normal path, if you haven't run it before. Right now.. Its not doing either, its letting everyone else tell it the place it should be. If it did either (a) or (b) we wouldn't be having the problem. I say this since some of the posts that follow your comments, including the post itself, seem to be implying something that I didn't say or intend.
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #36 on Tue 17 Apr 2007 03:28 AM (UTC)

Amended on Tue 17 Apr 2007 03:30 AM (UTC) by Shadowfyr

Message
Quote:
OK I see you acknowledge that point. So how does the program guess when to be "smart"?


You are already telling it when to be that smart, by allowing us to specify an exact default path for it. The problem is, its being even dumber than most, in that its ignoring its "own" box in favor of what is going on in someone else's. Think of it this way. Each application can either watch what everyone else is doing, or it can ignore everyone else. The method you are currently using to get the path, instead of using either a basic, "If you don't specify what the path is, then it should normally place it in X.", or a, "Oh, you last saved a file in Y, I will try to open it there (which in the case of logs doesn't imho make much more sense)", you are getting the path from something that keeps track of what everything else on the system may be doing. If I am opening a log file for Mushclient, I expect, as I suspect most people will, that, unless I say otherwise, its going to be where Mushclient's installer specified as the default location. I might, if I **manually** open a log file expect the world to "remember" where I want log files for that world. If I set it up to open automatically, then imho, it should be either the "last place" that one was opened, if I have done so before, the default path in global settings, or the normal Mushclient path if I have a) not opened any logs for that world and b) there is no default path specified for where to put them.

In other words. Good behavior would, and this is just my opinion, be to go:

Is this an auto open?
  Yes - Look for "Last Log Folder=" in world data.
    Was one found?
      Yes - Open the new file in this path.
      No - Is there a global "default"?
        Yes - Open in the global path and set "Last Log Folder" = "Global Default Path".
        No - Open in install default path (or what ever you decide Mushclient should use here).
             Right now that is "Application Path" + "\logs\.
             Set "Last Log Folder = Global Default Path.
  No - Open file dialog with path set as per same logic as above.
       If the user changes the path, then set "Last Log Folder" to where the user specified.


Note, this *may* require, to avoid the pitfalls of placing this data in the world file, which might not be saved, or in the registry, where its a pain in the rear, saving some settings in an old style .ini file for the client. Something like:

[World Log Paths]
b42313b380ebf45f5c61edce = "C:\Documents and Settings\Kagehi\MUSHclient\Logs\"

Also a good place like the current size/location of Muschlient's main window and other "global" settings. Frankly, I think that in some ways, their switch from .ini files to system registry, in a wide number of cases where it just doesn't make any bloody sense to have them, since they are not shared between applications, was a serious mistake. I mean, you want to register a component or provide other automation or intercommunications data, fine, but why add in the other 90% of the data that isn't relevant to any of that, and which just increases the size, complexity and odds of one accidental error fracking the whole bloody system? Damn silly if you ask me.
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #37 on Tue 17 Apr 2007 05:24 AM (UTC)
Message
Actually, it looks like one big problem is actually the difference between 9x and 2000 or XP.
Quote:
Otherwise, if the application has used an Open or Save As dialog box in the past, the path most recently used is selected as the initial directory. However, if an application is not run for a long time, its saved selected path is discarded.

This is found in the 2000/XP section of the OPENFILENAME Stucture link that's posted above. All the suggestions listed above are already implemented, but they are far down the queue. Might also explain why I haven't had any issues using my laptop with win98 on it.

Quote:
[World Log Paths]
b42313b380ebf45f5c61edce = "C:\Documents and Settings\Kagehi\MUSHclient\Logs\"

So in other words, like my suggestion of looking at what is set in the global preferences section...

Quote:
Also a good place like the current size/location of Muschlient's main window and other "global" settings. Frankly, I think that in some ways, their switch from .ini files to system registry, in a wide number of cases where it just doesn't make any bloody sense to have them, since they are not shared between applications, was a serious mistake.

The only issue with this is that you still have to have the .ini file stored somewhere that the computer can find. The registry seems to be as good a place as any for this data. Plus it takes less space to store and is faster to load than it would be to read a .ini file, since it just has to query the registry.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #38 on Tue 17 Apr 2007 06:05 AM (UTC)
Message
I'm not sure I totally agree with what Shadowfyr is saying, however he does have a good general case.

As an experiment, I have modified version 4.03 to have this new behaviour:

If it uses one of the following three global configuration strings:


  • Default world files directory
  • Default log files directory
  • Default plugins directory


and ... you attempt to open a file using one of those (eg. logging a session, adding a plugin, opening a world) and the directory name is a relative path, then it will prepend the MUSHclient startup directory (not the application executable path).

I think this is reasonable behaviour. In other words, if you start logging immediately after opening MUSHclient, and the log file directory is "./logs/", then the current behaviour is for "logs" to be under the startup directory.

In current versions, if you then change the directory (eg. by browsing for a file), then "logs" is no longer where we expect. So, the code above should make sure it actually is where it initially was.

I hope this works. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #39 on Tue 17 Apr 2007 06:06 AM (UTC)
Message
To clarify this, the change will not alter the current directory, so file browsing will still work, and if a plugin chooses to change the directory it can. However the specific cases of the MUSHclient's default directories will now work in a more natural way.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #40 on Tue 17 Apr 2007 06:11 AM (UTC)
Message
Quote:

Frankly, I think that in some ways, their switch from .ini files to system registry, in a wide number of cases where it just doesn't make any bloody sense to have them, since they are not shared between applications, was a serious mistake.


I agree with Shadowfyr here - I think personally the system registry is just one huge central point of (possible) failure, which is hard to read and virtually impossible to back up and restore. It is certainly hard to roll it back if you install something you no longer want.

One change that could make sense would be to put configuration stuff into a localized file (maybe the startup directory is a sensible place) and use Lua to read it in. After all, we already have Lua, and that was what it was initially designed for. It is incredibly fast at reading stuff like that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #41 on Wed 18 Apr 2007 02:55 AM (UTC)
Message
Yeah. Ini files where "always" in the execution path of the application, same with some other configuration files. Shifting them to the registry just created more things that could be bugged, suffer memory glitches, not save right, etc. And just one wrong entry could actually, in some cases, trash the whole registry, since there where no real protections against the system or another application, especially under 9x, accidentally killing data that didn't belong to the application in question, but *did* exist in something the user had access to, or which was available globally, when running in that mode.

You might as well just give viruses direct access to program code or paint a bullseye on the icon for registry files. lol

Quote:
"[World Log Paths]
b42313b380ebf45f5c61edce = "C:\Documents and Settings\Kagehi\MUSHclient\Logs\""

So in other words, like my suggestion of looking at what is set in the global preferences section...


Um, not really, since, presumably, if you decided to place it in something like "D:\My Logs\MUSHclient\Log Cabin", then what would be saved in there as the last log path used for that world would be:

[World Log Paths]
b42313b380ebf45f5c61edce = "D:\My Logs\MUSHclient\Log Cabin"

But yeah, there should be a logic hierarchy and some logical sense as to what happens in which cases. Nick's change should be fine, in that it creates the behavior I was expecting when I used it, even if it doesn't go "quite" as far as letting each world remember the place it is using independently.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


106,385 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.