Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Remove "Quit" from Mac OS X app's dock-menu

    General and Desktop
    4
    11
    4122
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Ketan Shah last edited by

      Hi, I am building a Qt application on Mac OS X using Qt-4.7.
      In my application there is a Dock Menu, I want to remove the "Quit" option from it.
      How can I achieve this?
      Please help.
      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

        I don't know exactly and I never tried myself, but I would expect that it is added by Mac OS X. Why do you try to annoy the users of your application in the first place? I would expect that menu entry to be available for any application.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • K
          Ketan Shah last edited by

          I am making an update application for existing application, so during the update process I don't want the user to quit as it can corrupt the software, that is why I want to hide the "quit" option from dock-menu.

          1 Reply Last reply Reply Quote 0
          • M
            mlong last edited by

            I think the proper solution would be to make sure that there is a rollback path in case the update is interrupted, then simply catch the closeEvent for your application and make sure that it cleans up after itself properly if there is an interruption. This also can lead you down the path of recovery in the case that the install should fail for some other reason (perhaps the user's laptop battery dies in the middle of the install, or something along those lines.)

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply Reply Quote 0
            • K
              Ketan Shah last edited by

              Hi, thanks for the suggestion, but the problem is that there is a zip/unzip process while updating.
              So while extracting if the user quits at that time, some part of extraction is already done and it would be difficult to know what data has been extracted. Also the extraction replaces the existing files. This is the reason why I am wanting the "quit" option to be hidden from the user.

              1 Reply Last reply Reply Quote 0
              • F
                fluca1978 last edited by

                I think your program is working bad. You have to unzip the data to a temp folder, and then apply it (i.e., overwrite files). Catch the close event, as already suggested, that is the only chance you have to interact with an user. And remember that a user could also kill immediately your application, so you are going to have a "crash" in any case. Be prepared to it.

                1 Reply Last reply Reply Quote 0
                • K
                  Ketan Shah last edited by

                  @fluca1978 : Ya you are write, but the problem is, the zip file that I am downloading is around 70Mb and after unzipping its around 450-500Mb, so that unzipping in a temp folder and then copying it to original location would take a lot of time. Would you like to suggest any other possiblity?

                  1 Reply Last reply Reply Quote 0
                  • F
                    fluca1978 last edited by

                    If possible, extract only parts out of the zip and replace them. However, consider that a lot of upgrading tools require a lot of space on the hard drive in order to act properly. For instance, an ubuntu updater asks for 1.5 GB in the /var partition, so I don't see a real problem in asking the user to have such free space on its computer.

                    1 Reply Last reply Reply Quote 0
                    • K
                      Ketan Shah last edited by

                      I am not talking about space, I am talking about the time it will take.

                      1. Download 70Mb zip from internet.
                      2. extract it in a temp folder.
                      3. Copy around 500Mb files in the original location.

                      This all process would take a long time.

                      1 Reply Last reply Reply Quote 0
                      • F
                        fluca1978 last edited by

                        First of all, are you sure all the data need to be replaced? Instead of copy, doing an rsync could speed up data substitution in the case some of it is already up to date.
                        Second, there is no good solution to your upgrade system, you cannot ask the user to wait for a long process even removing the quit option from the menu, because the battery (for instance) could empty its charge....
                        So you have to do the copy in sub-steps, each one recoverable in case of failure. That is the only way to ensure you can apply all the configuration at once or replay it if interrupted.

                        1 Reply Last reply Reply Quote 0
                        • G
                          goetz last edited by

                          You don't need to copy the data from the temp folder to the final destination if both are on the same disk, a move/rename is sufficient in this case.

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post