Proposal for updated “Ad Block”

Forum Forums General Software Proposal for updated “Ad Block”

  • This topic has 38 replies, 8 voices, and was last updated Nov 28-6:13 pm by Wallon.
Viewing 15 posts - 1 through 15 (of 39 total)
  • Author
    Posts
  • #123602
    Member
    PPC

      On another thread, now blocked, I proposed a small change to the Ad Block script.

      Last night, I tackled the script even more, making some changes:
      – The main window got changed, now using a completely different way to input the user selection…
      – This allows the script to have a button, right between “Exit” and “OK” that allows users to “UNBLOCK EVERYTHING”, avoiding user confusion
      – Added a network confirmation, before running the script, to avoid creating empty additions to the hosts file- yeah, it could have been better, but this is what I managed to do
      – All windows now show the correct images
      – Removed “cancel” buttons from windows where that made no sense at all (i.e. there is nothing to “cancel”, we are just getting an error)

      The previous localization file works perfectly with this script, but there are 2 new strings that require localization (the 2 new buttons on the main screen, to make sure users understand everything, I improved the “cancel” button’s text)

      The script is now, in fact, shorter and easier to understand than before, while providing an easier to understand GUI (or so I hope).

      IMPORTANT:
      Please test carefully!!! I tested it (with the hosts file being displayed in geany) and it seems to run just fine.

      P.

      • This topic was modified 2 weeks, 2 days ago by PPC.
      #123621
      Member
      anti-apXos
        Helpful
        Up
        0
        ::

        Yeah, it’s a much better user interface this way.

        I noticed that two backup files are created, hosts.saved and hosts.ORIGINAL. If hosts.ORIGINAL is deleted, choosing UNBLOCK EVERYTHING fails, but still reports success. It’s even possible that this was the problem the user had in that other thread since the original script also has this bug. Deleting hosts.saved seems to have no effect.

        I don’t know what the best solution is to a missing hosts.ORIGINAL. I suppose the user should just be notified so that they can manually remove the list of blocked domains. In case the original hosts file had custom entries added, the default host list probably shouldn’t be written from within the script itself.

        #123731
        Member
        PPC
          Helpful
          Up
          0
          ::

          PLEASE DO NOT DOWNLOAD THE VERSION OF THE FILE ATTACHED HERE – SEE MY NEXT POST!!!

          Thanks for the input.
          I added a check for the hosts.ORIGINAL. It it’s missing, the user is warned that the hosts file will have to be manually edited and the script will exit, avoiding the erroneous message that everything went fine…

          Note: I did not analyze how the complete script works. I just “fixed” the yad windows, and reworked how data was entered in the main window, and simplified how the selection was processed. Other than that, I added the IP check, to test for connectivity and now, this check for the hosts.ORIGINAL file.

          @anticapitalista – if no other remaining problems are found, if you want, I think it’s safe to replace the original version of the script with this one. Give it a couple more days, to see if anyone else stops any problem with it…

          P.

          • This reply was modified 2 weeks, 1 day ago by PPC.
          • This reply was modified 2 weeks, 1 day ago by PPC.
          • This reply was modified 2 weeks, 1 day ago by PPC.
          #123744
          Member
          PPC
            Helpful
            Up
            0
            ::

            Sorry, everyone!

            My last upload was of a testing version (without the flags that really allowed to download the block list). Here is the final version…

            Please do test carefully…

            P.

            • This reply was modified 2 weeks, 1 day ago by PPC.
            #123748
            Member
            PPC
              Helpful
              Up
              0
              ::

              Since I really, really, enjoy apps with visual polish, I tweaked the script to have a slightly better looking main screen (with icons on all buttons, less empty space, no clickable header in the column)

              Unless a bug is found, this is probably the final version of this script (I have not yet tested if the icons are available in antiX 23, for example).

              P.

              #123751
              Member
              PPC
                Helpful
                Up
                0
                ::

                @anticapitalista, just in case you are interested, in using the newer version of the script, I already commited the new code to antiX’s git (I’ll be busy during the week-end).
                I advise waiting a few days, for someone else other than me to test the latest version, but I *think* it’s bug free, simpler than the original script, and with checks that the original did not have (for network connectivity and for the existence of the ORIGINAL file).

                I know this script is not that much used (folks usually stick with the default setting), but it’s nice to have an improved script, that does check for several things that can go wrong and also looks quite a bit better, while doing that, and is less confusing to use (i.e. – the Unblock option is not listed in the list of things that can be blocked – that always “cringed” me)

                Screenshot:

                https://i.imgur.com/qgRdbnn.jpg

                P.

                • This reply was modified 2 weeks, 1 day ago by PPC.
                • This reply was modified 2 weeks, 1 day ago by PPC.
                #123783
                Member
                PPC
                  Helpful
                  Up
                  0
                  ::

                  A tester called my attention to getting the “Unblock Everything” error, so I tweaked the message a little bit, to make it clear why users get that error: it’s because, very probably, they already have everything unblocked (i.e., the script already replaced the default hosts file with the “virgin” hosts.ORIGINAL file, so no hosts.ORIGINAL file currently exists- it will only be generated when users choose the block anything, once again).
                  I also added the changes displayed in the previous screenshot, that I already commited in the git page.

                  P.

                  #123785
                  Member
                  PPC
                    Helpful
                    Up
                    0
                    ::

                    Editing scripts that I did not create myself cab be very frustrating… I found a huge bug – a category that was not correctly blocked, due to copy and paste error from me…
                    I fixed the bug and also:
                    – Made the categories that can be blocked just regular text, marked for localization (so strings have spaces, not just underscores, we are not in the middle ages!)
                    – Marked the title of the window for localization.
                    So now, the script *should* work perfectly, as well as the original, without any bugs (so I hope), and be fully localizable…

                    P.

                    #123790
                    Forum Admin
                    anticapitalista
                      Helpful
                      Up
                      0
                      ::

                      @PPC – Has this been uploaded to Gitlab?
                      Are the pot and .desktop files up to date at Gitlab?

                      Philosophers have interpreted the world in many ways; the point is to change it.

                      antiX with runit - leaner and meaner.

                      #123797
                      Member
                      PPC
                        Helpful
                        Up
                        0
                        ::

                        @anticapitalista – a previous version (with the bug I mentioned) was commited to gitlab, over at https://gitlab.com/antiX-Linux/advert-block-antix – there’s still an open merge request.
                        The .desktop file seems up to date, and matches the Control Centre entry, at least in pt
                        The current localization is 100% compatible with my proposed version of the script, it even got recently added, the warning I initially suggested to be included in the first screen.
                        The current version of the script, has some more localizable strings – ex: the Title of the windows was marked for localization, there’s a new warning for when hosts.ORIGINAL is not found, the categories for sites to be blocked now are also marked for localization, etc…

                        I’m just waiting for you to accept my initial commit, so I can replace it with the latest version of the script (of course, you can do it yourself, if you want to).

                        P.

                        #123798
                        Forum Admin
                        anticapitalista
                          Helpful
                          Up
                          0
                          ::

                          @PPC merged commit

                          Philosophers have interpreted the world in many ways; the point is to change it.

                          antiX with runit - leaner and meaner.

                          #123801
                          Member
                          PPC
                            Helpful
                            Up
                            0
                            ::

                            @anticapitalista – I trully, trully hate gitlab – once I commit a change to your git, I can no longer, ever merge anything without getting errors…
                            I tried to upload the most recent, bug free, version of the script, the merge is blocked…

                            P.

                            #123802
                            Forum Admin
                            anticapitalista
                              Helpful
                              Up
                              0
                              ::

                              @PPC Post the final script here and I’ll merge it.

                              Philosophers have interpreted the world in many ways; the point is to change it.

                              antiX with runit - leaner and meaner.

                              #123806
                              Member
                              PPC
                                Helpful
                                Up
                                0
                                ::

                                @anticapitalista: here you go… Thanks. Git always gets on my nerves…

                                The main window now looks like this:

                                P.

                                • This reply was modified 2 weeks ago by PPC.
                                #123838
                                Member
                                marcelocripe
                                  Helpful
                                  Up
                                  0
                                  ::

                                  The Transifex “.pot” file can be updated when the final version is reached in GitLab. New texts and buttons can also be translated.

                                  – – – – –

                                  O arquivo “.pot” do Transifex poderá ser atualizado quando a versão final for alcançada no GitLab. Os textos novos e botão também poderão ser traduzidos.

                                Viewing 15 posts - 1 through 15 (of 39 total)
                                • You must be logged in to reply to this topic.