java – How to replace EditText of Material Dialog with an AutoCompleteText?

I need to create a dialog that has an AutoCompleteTextView, instead of the EditText that comes as standard. Is there a way to convert this EditText to AutoComplete?

dynamic – System dialog input with button

the Method -> "Queued" Choice is important.

I also suggest using the current or data file directory as a starting point.

Also, be sure to check the file for "$ Canceled" (in case of cancellation).

Here is an example copied from one of my programs:

Button("Load", file = SystemDialogInput("FileOpen", {NotebookDirectory() <> "data\",
      {"Data files" -> {"*.txt"}}});
      If( file != "$Canceled", data = Get(file); ), Method -> "Queued")

script: how do I add a confirmation dialog to warn me before closing a Safari window and all macOS application windows?

This involves adding a warning confirmation dialog window before closing to Safari and all other application windows in macOS.

How do I add a confirmation dialog window when I click the red X circle button close in the upper left corner of a Safari window to warn me before closing a Safari window? This is basically what Firefox has or at least I had it when I used it a couple of years ago. When you click the X button for a window in Firefox with multiple tabs open and try to close that window, it would indicate the following: "You are about to close 83 tabs. Are you sure you want to continue?"

This is an image of the warning confirmation dialog window before closing FireFox I was talking about.
enter the description of the image here

I want to add a confirmation dialog like that for Safari because sometimes I accidentally press the red button x close circle to close a window, the same red buttons x circle that are in all macOS windows to close a respective window. When I click or press the red circle button x close to close a Safari window by accident, I want to see a confirmation dialog that confirms if I really want to close it or not. Except, I want some minor changes compared to how Firefox does it or how it used to be done in Firefox.

I will list the minor changes I want compared to how it is done in Firefox in these confirmation dialog windows for Safari. To warn before closing a Safari window:

  1. I want a confirmation dialog box to appear when you click on the red button x closing circle to close a window, even if you only have an eyelash In that window Firefox only has that confirmation dialog that appears when the user closes several tabs. That is not just what I want. I want a confirmation dialog box to appear even when I try to close a window with just 1 tab, but further with more than one tab, that is, several tabs in a single window.

This is an image of a Safari window that only has 1 tab. I would still like to receive an alert before closing when I click on the close button of the red circle x for windows like this one that only have 1 tab, unlike how it is done in Firefox where more than one tab is needed to bring up a confirmation window to alert the user before closing a window.

This also shows the Red X Circle Close button in the upper left corner of the window I was talking about for Safari Windows.

enter the description of the image here

This is a picture of Safari with multiple The tabs open in a single window. I'm showing this because I would further you want the warning confirmation warning window to appear before closing when you accidentally press the red circle close button x for a window that has multiple tabs, not only for windows that have only 1 tab.

enter the description of the image here

  1. If possible I want to be forced into a password (maybe my administrator password) to confirm my selection for the warning confirmation dialog before closing. And I'd like to configure it to work if I don't enter my password, it won't allow me to confirm that I close that window in the confirmation dialog box. I would have to enter my password in the same confirmation dialog window and then, if it was correct, I could press "OK" to confirm that I would close the selected window and then successfully close that respective window that I selected.

This is an image of a password request window of how I would like the warning dialog request window to look like before closing. I would just like the text in the request window to change to "You are about to close X (number of) tabs. Are you sure you want to continue?" And so that the title of the window title is "Confirm Close", as shown above in the image of the FireFox request window.

enter the description of the image here

  1. I don't know if this is a problem, but I want this to work in Private windows in Safari too.

  2. I would like a warning confirmation dialog box to appear before closing when I accidentally press the x button to each tab Inside a safari window. And to clarify, I mean the X button that is actually inside the tab, not the red x button, but the X button that is on the left end of each tab. I will attach a picture of what I am talking about. But I want it to work exactly as I mentioned to close a Safari window with a warning confirmation dialog before closing when I accidentally press the X button on any tab, just for each and every tab instead of the entire window of eyelashes

This is an image of the X close button for each tab I was talking about. It is located on the left end of each tab.

enter the description of the image here

I would also like this warning confirmation dialog box to appear before closing to close NONE application window in macOS. And I would like it to work in each and every browser, such as Chrome, Vivaldi and Brave, exactly as I mentioned that it should work for Safari. Of course, non-browser applications should not and should not say "You are about to close X number of tabs" as they would not have tabs, so it would be necessary to exclude them as text in the dialog box for browser applications.

This is an image of the application preview as an example to show that I would also like this warning confirmation dialog before closing to appear when you click on the Close button of the red X circle before closing NONE macOS application window. Not only for Safari.

enter the description of the image here

I found an article by a person named John Gruber who runs a site called DaringFireball.net. He created a warning window "Warn before closing" apparently similar to Safari, but it's not exactly how I described how I would like the warning window to work before closing, apparently he did it for people who accidentally pressed the Cmd-Q buttons to exit of the Safari application and I really didn't want to leave. So he created this script that would warn users who pressed the Cmd-Q shortcut about quitting smoking before confirming that they do. That doesn't seem to do what I'm talking about, but it's something similar. Your script is to accidentally press Cmd-Q, my requested script function is to accidentally press the Close button of the red X circle in a Safari window and the Close Tab X button for individual Safari tabs instead of your problem .

I will post the link to your article that is something similar to what I am talking about. Here:

DaringFireball Abandon Confirmation Script for Safari on MacOS by John Gruber

Also, just for the record, I have contacted John Gruber to help me make a script as I described it, but he has not responded, so I am making this post on Ask Different.

This is an image of the DaringFireball John Gruber warning confirmation window before leaving for Safari.

enter the description of the image here

Let me know if you would need to update to the latest version of Safari and / or macOS to do this. Or if I can use the previous versions of Safari and macOS that I have installed on my computer.

Does anyone know if all this is possible? Thank you.

hang: the process cannot be deleted in Catalina 10.15.3 due to the freezing of the secondary dialog

(MacOS Catalina 10.15.3)

How can i kill?
1. secondary windows of a process that appear to be preventing the main process from ending after using kill -9 ####? (At least this is what I think should be done in the next step: I can't eliminate the main process).
2. How can I kill / restart Activity Monitor?

Here is an explanation of what happened:

i ran McGimp-2.10.4-std To do some image manipulation I needed to do. When I tried to upload the images I intended to work with, Catalina's new permission system did not allow me to access my desktop folder and, therefore, I could not upload the images I wanted to manipulate. So, I worked around this by moving my images to another folder that Gimp could read.

I did what I had to do, but when I tried to save my new image, Catalina's permission system worked again and she denied me access to my Documents folder (or that is what I think it was) and presented me with a dialogue that Reported the problem. . After clicking on the dialog box, I discovered that the window for saving gimp files did not respond to any of my actions.

Then I opened the Activity Monitor with the intention of killing Gimp. However, the Activity Monitor, after rendering its window frame, stopped responding even before it had filled out the usual process table (CPU tab). Unable to finish the gimp process through the GUI, I opened a terminal with the intention of killing it through CLI.

After running ps aux filtration gimp using grep, I had two instances of gimp, one was the image I was editing and the other was the frame & # 39; root & # 39; of gimp. Using kill I could close the frame & # 39; root & # 39 ;, but kill In the framework of my image, the process did not end. * So now I have a Save File dialog box on the main Gimp user interface along with the two tool windows stuck on my desktop that I can't get rid of. Although I cannot execute any gimp command, I can drag the file windows but not close them.

So I switched to the root user and tried again without luck. So, not even the root user can kill this process, and I still have to figure out how to kill / restart Activity Monitor.

Has anyone had a problem? Is there any way to overcome this without having to restart? (At the moment, I have moved them to a separate desk).

I have to restart since the process is in a busy loop and will eventually fry my CPU.

    root@host:( 0:38):~# uname -a
    Darwin host 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
    root@host:( 0:38):~# ps aux | grep "gimp"
    user             34432   0.0  0.8  4755632 140352   ??  TX   12:09am   1:54.20 /Applications/McGimp-2.10.4-std.app/Contents/MacOS/../Resources/bin/gimp-2.10 --verbose
    root             34786   0.0  0.0  4286728    712 s004  S+   12:38am   0:00.00 grep gimp
    root@host:( 0:38):~# kill -9 34432
    root@host:( 0:38):~# ps aux | grep "gimp"
    user             34432   0.0  0.8  4755632 140352   ??  TX   12:09am   1:54.20 /Applications/McGimp-2.10.4-std.app/Contents/MacOS/../Resources/bin/gimp-2.10 --verbose
    root             34790   0.0  0.0  4277512    692 s004  S+   12:38am   0:00.00 grep gimp
    root@host:( 0:38):~#

enter the description of the image here

modal windows: to remember dialog sizes or not

You can change the size of many program dialogs. Some programs remember the new size of the dialog box after resizing it. Then, the next time you open the same dialog box, the new size will be used.

At this time in the software I am designing for this is not the case, the dialog boxes do not remember their size. I have discussed it with a colleague and his position is that users often do this temporarily just to see truncated things or outside the dialog box. I believe that changing the size of the dialogue is a conscious action of the user that is not satisfied with the default size of the dialogue, and that should be remembered.

I wonder if there is any guidance on what would be the best practice.

How a show message Dialog works

I have a question about a method and hopefully they can help me.

I already use the showMessageDialog method, but what I don't understand is because you have to place "null" before the text you want to appear.

Thank you

Fill spinner with firebase in dialog

I am trying to fill in a spinner (name selection spinner) in a dialog box with data coming from firefase. I get the data well in the array, since the spinner shows me the options to correctly select each user; however, it does not show the result of the selection in the spinner and the events derived from the selection. I changed the color of letters to ensure that chance did not make me show it in white, without result. I deduce that I must have the error in the adapter, but I can't find the solution. The other spinner (shift selection) located in the dialog box works well, although its data comes directly from an array. I would appreciate suggestions for finding the solution. Thank you.

private fun capturarNombres() {
    // al iniciar la función se limpian los array para evitar acumulaciones
    arrayNombresCT.clear()
    arrayNombresSeleccion.clear()
    //obtiene los nombres guardados para hacer los cambios
    nombresCambioColeccion
        .orderBy("nombre", Query.Direction.DESCENDING)
        .addSnapshotListener(object : EventListener, com.google.firebase.firestore.EventListener {
            override fun onEvent(snapshotdos: QuerySnapshot?, exception: FirebaseFirestoreException?) {
                exception?.let {
                    activity?.toast("Excepcion")
                    return
                }
                snapshotdos?.let {
                    val message = it.toObjects(com.carlosegea.calendarioturnos.DatosModelos.ArrayNombresCambiosTurnos::class.java)
                    arrayNombresCT.addAll(message.asReversed())
                    for (arrayNombresCT in arrayNombresCT) {
                        if (arrayNombresCT.email == email) {
                            val nombre = arrayNombresCT.nombre
                            arrayNombresSeleccion.add("$nombre")

                        }
                    }
                }

            }
        })
}

private fun onCreateDialog(): Dialog {
    //Dialogo para añadir cambios en los tunos
    return activity?.let {
        val builder = AlertDialog.Builder(it)
        val inflater = requireActivity().layoutInflater
        val dialogView = inflater.run { inflate(R.layout.dialog_cambio_turnos, null) }
       //spinner selección de turnos
        val cambioTurno = dialogView.findViewById(R.id.cambioTurnoTurno) as Spinner
        val arraySeleccionado = R.array.TurnosSeleccionCambios_array
        val cambioTurnoAdapter = ArrayAdapter.createFromResource(
            this.context, arraySeleccionado, android.R.layout.simple_spinner_item)
        cambioTurnoAdapter.setDropDownViewResource(R.layout.spinner_item)
        cambioTurno.adapter = cambioTurnoAdapter
        cambioTurno.onItemSelectedListener= object : AdapterView.OnItemSelectedListener {
            override fun onNothingSelected(parent: AdapterView<*>?) {
            }
            override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
                posicionSeleccionTurnoSpinner = position
            }
        }
        //spinner selección de nombres
        capturarNombres()   //obtiene los nombres guardados para hacer los cambios
        val arrayNombres = dialogView.findViewById(R.id.cambioTurnoNombre) as Spinner
        val arrayAdapter = ArrayAdapter(context,
            android.R.layout.simple_spinner_item,
            arrayNombresSeleccion
        )
        arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
        arrayNombres.setAdapter(arrayAdapter)
        arrayNombres.onItemSelectedListener= object : AdapterView.OnItemSelectedListener {
            override fun onNothingSelected(parent: AdapterView<*>?) {
            }
            override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
                posicionSeleccionNombresSpinner = position
                val nombre = arrayNombresSeleccion(position)
                activity?.toast("$nombre")
            }
        }

spinner code:

s

online sharepoint: the click of the SPFx JQuery dialog button does not find a public function

I am new to the development of TypeScript and SPFx.

I have a jquery UI dialog box and a public function in the same class that makes some MSGRAPH calls after clicking the button.

The button click returns with error:

this.addAlert is not a function

I think the problem is that the dialogue code is executed outside the context of the web part and therefore does not know the function available in the context of the web part.

How can I use the click of the button to execute within the context of the web part?

Here is the dialogue code.

    public render(): void {

    this.domElement.innerHTML = AlertTemplate.templateHtml;
    const dialogOptions: JQueryUI.DialogOptions = {
      width: "50%",
      height: "auto",
      buttons: {
        "Subscribe": function (e) {
          this.addAlert("Yes");
          jQuery(this).dialog("close");
        },
        "No Thanks": function (e) {
          console.log("moo");
          this.addAlert("No");
          jQuery(this).dialog("close");
        },
        "Ask me later": function (e) {
          this.addAlert("Ask Me Later");
          jQuery(this).dialog("close");
        }
      }
    };

    jQuery('.dialog', this.domElement).dialog(dialogOptions);
    jQuery(".ui-dialog-titlebar").hide();
  }

addAlert function

public addAlert(status: string): void {
var url = "/sites/" + this.context.pageContext.site.id + "/lists";
var listId = "";
var email = this.getCurrentUserEmail();
var recordExists = false;
let item: SubscriptionListItem;
this.context.msGraphClientFactory
  .getClient()
  .then((client: MSGraphClient): void => {
    client
      .api(url)
      .top(1)
      .filter("equals=(displayName, 'Subscriptions'")
      .version("v1.0")
      .get((err, res) => {
        if (err) {
          console.error(err);
          return;
        }
        console.log(res);
        listId = res.id;
      });
  });

Print: The Headers and Footers dialog box displays an error message

I want to print all or selections from my notebook. The notebook has been edited and saved many times, and currently prints pages with a header that shows a file name that is almost 10 years old and a footer that appears to be a file that is even older.
However, when I used the Print Settings menu item (on my Mac) to change the header / footer to the name of the current file or anything else, it did not change. The printed pages still showed the old file name.
Now I receive error messages when I even try to access the Header and Footer dialog box. When I create a new document, I get the same errors, although the headers and footer are blank.
Header and footer error message

dialog – Should I delete the "Name" field in the registration form of my newsletter?

To personalize the email or not?

Well, there is a lot of controversy surrounding this question. Here is a list of studies:

Advantage:

Studies (Heerwegh et al. 2006, Experian study, 2013) on the subject suggest that personalizing an email results in higher response rates (around 5-10%). There are numerous studies on the subject: look for email personalization studies.

Here is a quick summary of the Experian study:

  • Custom emails generated transaction fees and revenue six times higher by email compared to emails that were not
    personalized.

  • Custom promotional emails had unique opening rates 29% higher and single click rates 41% higher.

  • Similarly, personalized activated emails had unique opening rates 25% higher and single click rates 51% higher.

  • Custom activated email campaigns demonstrated transaction rates for campaigns that were not customized more than twice.

  • Emails with personalized subject lines from multi-channel retailers had 37% higher unique opening rates compared to emails without
    Custom subject lines.

Disadvantages

Entering the name reduces subscription rates

An additional input field must be submitted on the subscription form to obtain the subscriber's name. But we know that the more fields you need to fill in, the lower the conversion rate. Therefore, getting the subscriber's name has a price, a slightly lower conversion rate. This leads to fewer people subscribing due to the more complex way.

Users sometimes put fake names just to complete the form

Imagine sending an email with the following greeting:

Hello Dawdasda,

Privacy issues

Some users may not want to share personal information such as name. Therefore, this field must be optional.

Solution

The best thing you can do is do an A / B test. Put a form that asks for the name and another one that doesn't. Put 50% of the traffic to the first variation and 50% to the second. Try to keep track of everything you can, such as click rates, conversion rate, etc. See which of these two variants gives you the highest amount of income. This way you will have objective data to base your decision.

I advise you to design an A / B test because your case is unique and different from the studies described above. Therefore, you cannot take your data and expect it to work for you. Trust your data.