FileChooserSignalName

public enum FileChooserSignalName : String, SignalNameProtocol

Undocumented

  • This signal gets emitted whenever it is appropriate to present a confirmation dialog when the user has selected a file name that already exists. The signal only gets emitted when the file chooser is in GTK_FILE_CHOOSER_ACTION_SAVE mode.

    Most applications just need to turn on the GtkFileChooser:do-overwrite-confirmation property (or call the gtk_file_chooser_set_do_overwrite_confirmation() function), and they will automatically get a stock confirmation dialog. Applications which need to customize this behavior should do that, and also connect to the GtkFileChooser::confirm-overwrite signal.

    A signal handler for this signal must return a GtkFileChooserConfirmation value, which indicates the action to take. If the handler determines that the user wants to select a different filename, it should return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines that the user is satisfied with his choice of file name, it should return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. On the other hand, if it determines that the stock confirmation dialog should be used, it should return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example illustrates this.

    Custom confirmation ##

    (C Language Example):

    static GtkFileChooserConfirmation
    confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
    {
      char *uri;
    
      uri = gtk_file_chooser_get_uri (chooser);
    
      if (is_uri_read_only (uri))
        {
          if (user_wants_to_replace_read_only_file (uri))
            return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
          else
            return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
        } else
          return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog
    }
    
    ...
    
    chooser = gtk_file_chooser_dialog_new (...);
    
    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
    g_signal_connect (chooser, "confirm-overwrite",
                      G_CALLBACK (confirm_overwrite_callback), NULL);
    
    if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
            save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
    
    gtk_widget_destroy (chooser);
    

    Declaration

    Swift

    case confirmOverwrite = "confirm-overwrite"
  • This signal is emitted when the current folder in a GtkFileChooser changes. This can happen due to the user performing some action that changes folders, such as selecting a bookmark or visiting a folder on the file list. It can also happen as a result of calling a function to explicitly change the current folder in a file chooser.

    Normally you do not need to connect to this signal, unless you need to keep track of which folder a file chooser is showing.

    See also: gtk_file_chooser_set_current_folder(), gtk_file_chooser_get_current_folder(), gtk_file_chooser_set_current_folder_uri(), gtk_file_chooser_get_current_folder_uri().

    Declaration

    Swift

    case currentFolderChanged = "current-folder-changed"
  • This signal is emitted when the user “activates” a file in the file chooser. This can happen by double-clicking on a file in the file list, or by pressing Enter.

    Normally you do not need to connect to this signal. It is used internally by GtkFileChooserDialog to know when to activate the default button in the dialog.

    See also: gtk_file_chooser_get_filename(), gtk_file_chooser_get_filenames(), gtk_file_chooser_get_uri(), gtk_file_chooser_get_uris().

    Declaration

    Swift

    case fileActivated = "file-activated"
  • This signal is emitted when there is a change in the set of selected files in a GtkFileChooser. This can happen when the user modifies the selection with the mouse or the keyboard, or when explicitly calling functions to change the selection.

    Normally you do not need to connect to this signal, as it is easier to wait for the file chooser to finish running, and then to get the list of selected files using the functions mentioned below.

    See also: gtk_file_chooser_select_filename(), gtk_file_chooser_unselect_filename(), gtk_file_chooser_get_filename(), gtk_file_chooser_get_filenames(), gtk_file_chooser_select_uri(), gtk_file_chooser_unselect_uri(), gtk_file_chooser_get_uri(), gtk_file_chooser_get_uris().

    Declaration

    Swift

    case selectionChanged = "selection-changed"
  • This signal is emitted when the preview in a file chooser should be regenerated. For example, this can happen when the currently selected file changes. You should use this signal if you want your file chooser to have a preview widget.

    Once you have installed a preview widget with gtk_file_chooser_set_preview_widget(), you should update it when this signal is emitted. You can use the functions gtk_file_chooser_get_preview_filename() or gtk_file_chooser_get_preview_uri() to get the name of the file to preview. Your widget may not be able to preview all kinds of files; your callback must call gtk_file_chooser_set_preview_widget_active() to inform the file chooser about whether the preview was generated successfully or not.

    Please see the example code in Using a Preview Widget.

    See also: gtk_file_chooser_set_preview_widget(), gtk_file_chooser_set_preview_widget_active(), gtk_file_chooser_set_use_preview_label(), gtk_file_chooser_get_preview_filename(), gtk_file_chooser_get_preview_uri().

    Declaration

    Swift

    case updatePreview = "update-preview"
  • Undocumented

    Declaration

    Swift

    case notifyAction = "notify::action"
  • Whether a file chooser not in GTK_FILE_CHOOSER_ACTION_OPEN mode will offer the user to create new folders.

    Declaration

    Swift

    case notifyCreateFolders = "notify::create-folders"
  • Whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present an overwrite confirmation dialog if the user selects a file name that already exists.

    Declaration

    Swift

    case notifyDoOverwriteConfirmation = "notify::do-overwrite-confirmation"
  • Undocumented

    Declaration

    Swift

    case notifyExtraWidget = "notify::extra-widget"
  • Undocumented

    Declaration

    Swift

    case notifyFilter = "notify::filter"
  • Undocumented

    Declaration

    Swift

    case notifyLocalOnly = "notify::local-only"
  • Undocumented

    Declaration

    Swift

    case notifyPreviewWidget = "notify::preview-widget"
  • Undocumented

    Declaration

    Swift

    case notifyPreviewWidgetActive = "notify::preview-widget-active"
  • Undocumented

    Declaration

    Swift

    case notifySelectMultiple = "notify::select-multiple"
  • Undocumented

    Declaration

    Swift

    case notifyShowHidden = "notify::show-hidden"
  • Undocumented

    Declaration

    Swift

    case notifyUsePreviewLabel = "notify::use-preview-label"