Menu

Why is there a save as type pulldown?

2007-09-12
2012-11-13
  • Nobody/Anonymous

    All file types in the pulldown menu are basically text files with a different extension. For example I usually start with making a new empty txt file and then change the extension as desired. But basically its all the same file with another extension. True the pulldown would be usefull if it actually made any difference at all but as it doesnt do anything it seems a bit useless in my opinion.

    Saving as type textfile, html, xml or php just generates excactly the same file. So maybe its just a part of the windows save dialoge, but what use does it have when selecting a filetype doesnt change anything? It might suggest to the user that an extension is added, or maybe just as reference what extension he should add himself.

    I think it's not conform the Windows protocol to offer a type and not use it. Now it's not more than a filter for files that show up in the files list. And requests to add other formats to supported files is merely adding another filetype in the pulldown without anything more than use it as file filter. (As it is, Notepad++ supports ALL text based files already, requests to add additional formats is utterly cosmetic)

    I am not familar with coding C or C++ but I think the only problem is detecting the filetype chosen and adding the extension after the user presses the save button. I might try to look at the part of the source that does the saving bit soon to see if I could add the extension to the filename just before saving.

    Knowing this surely has been brought up before I might as well see if the filetypes list can be transformed into a more usefull option for creating a new file on disk. Maybe someone could give me a pointer in what part I can find the save part. Just adding a extension string ($filename = $filename+"."+$selectedextension) to the filename seems like a small addition that even I as unexperienced programmer could look into.

    Maybe it needs a small check to see if there is already an extension on the filename present, and if so, dont add it again. I havent encountered an application yet that offers a type selection and then ignores the choice made. This will be most usefull for new users.

    Any pointers what file I should start looking at?

     
    • young

      young - 2007-09-14

      >>I know javascript, lol, so mayby writing the routine in javscript will help me convert it into C++

      well, javascript is a c-like language, so you should be able to get a grasp on  c/c++, and c# (or java which is similar to c#)

       
    • Nobody/Anonymous

      I noticed the source files for v4.2.2 are not present! Downloading 4.2.1 source to take a peek at.

       
      • Nobody/Anonymous

        Sources for 4.2.2 are on SVN, revision 7.

         
    • Nobody/Anonymous

      This is a very generous offer. My sentiments exactly (about 20 times). If I were the developer(s) and I cried about not having enough time to do this I would jump at this offer. But, I have a feeling no one will respond to this offer. And, if my assumption is correct, no one will want you to do this simple implementation. I hope I am wrong. Your post was very eloquent. May I point out one thing? If I am correct, I think all other programs add the extension AND filter the files to show only those of the extension type. I know some of them do.

      Bob

       
    • Nobody/Anonymous

      I have found the file tht references the file dialouge list. \PowerEditor\src the file called Notepad_plus.cpp

      I'm using NotePad++ to snoop through the code a little. The file save code seems quite elaborate. I don't know if I'm able to add it but I'm willing to look at the source code. I first gotta get a feeling of the source code and made a copy to fiddle in.

      Bob: try (m)any applications. See which ones do and don't save with extension... (oh try looking at the code yourself might also be helpfull ;) The save as dialog code begins at line 1019.

       
      • Nobody/Anonymous

        Nobody (a first name would help), why should I look at the code? It is no secret that I do not know c or c++. I have stated that in more than one post. I know assembler, VFP, COBOL, and fortran. Not the creme of the crop, but I like coding in those languages. You volunteered to try and take on the project. By the way, who is this? If I did know anything about c or c++ I would gladly take a look at it. I do not have any time to learn any new languages right now. The one question I have consistently asked is: Is this easy or hard. After two months (or is it three) I have yet to get an answer to that question. Are you saying this is too hard and complex to do? If so, that is all I need to know (all I ever asked for). Is it easy or hard? If it can't be done right now maybe it could be put on the wish list.

         
        • Nobody/Anonymous

          I don't know C++ either but knowing some other languages might help me understand it anyway. I assume it's a breeze for someone who knows C++ but still I look in the code to see if I can find a solution. (Even google might help). I know javascript, lol, so mayby writing the routine in javscript will help me convert it into C++. I dont have a compiler installed but I might install one. (Bah, visual studio is a couple of GB to install).

          I was thinking to split the filename at the dot into an array, and if array length is 0, add an extension to the filename. If array is greater than 0, a dot in filename exists and *might* check is the extension is valid (or just a dot used in the filename).

          Because I never programmed in C++ I find it complex, but it could be a experienced C++ programmer might laugh at it because it might be easy. So only a C++ programmer can answer this.

          Looking at the code won't hurt ;)