Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Remove "Quit" from Mac OS X app's dock-menu

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

Scheduled Pinned Locked Moved General and Desktop
11 Posts 4 Posters 4.7k Views
  • 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 Offline
    K Offline
    Ketan Shah
    wrote on 16 Mar 2012, 13:57 last edited by
    #1

    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
    0
    • G Offline
      G Offline
      goetz
      wrote on 19 Mar 2012, 12:24 last edited by
      #2

      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
      0
      • K Offline
        K Offline
        Ketan Shah
        wrote on 19 Mar 2012, 12:35 last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mlong
          wrote on 19 Mar 2012, 15:28 last edited by
          #4

          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
          0
          • K Offline
            K Offline
            Ketan Shah
            wrote on 20 Mar 2012, 06:46 last edited by
            #5

            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
            0
            • F Offline
              F Offline
              fluca1978
              wrote on 20 Mar 2012, 06:53 last edited by
              #6

              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
              0
              • K Offline
                K Offline
                Ketan Shah
                wrote on 20 Mar 2012, 07:12 last edited by
                #7

                @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
                0
                • F Offline
                  F Offline
                  fluca1978
                  wrote on 20 Mar 2012, 07:16 last edited by
                  #8

                  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
                  0
                  • K Offline
                    K Offline
                    Ketan Shah
                    wrote on 20 Mar 2012, 07:23 last edited by
                    #9

                    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
                    0
                    • F Offline
                      F Offline
                      fluca1978
                      wrote on 20 Mar 2012, 07:27 last edited by
                      #10

                      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
                      0
                      • G Offline
                        G Offline
                        goetz
                        wrote on 20 Mar 2012, 09:44 last edited by
                        #11

                        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
                        0

                        1/11

                        16 Mar 2012, 13:57

                        • Login

                        • Login or register to search.
                        1 out of 11
                        • First post
                          1/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved