Exemplo n.º 1
0
/**
 * thunar_navigator_set_current_directory:
 * @navigator         : a #ThunarNavigator instance.
 * @current_directory : the new directory to display or %NULL.
 *
 * Sets a new current directory that should be displayed by
 * the @navigator.
 **/
void
thunar_navigator_set_current_directory (ThunarNavigator *navigator,
                                        ThunarFile      *current_directory)
{
  _thunar_return_if_fail (THUNAR_IS_NAVIGATOR (navigator));
  _thunar_return_if_fail (current_directory == NULL || THUNAR_IS_FILE (current_directory));
  THUNAR_NAVIGATOR_GET_IFACE (navigator)->set_current_directory (navigator, current_directory);
}
Exemplo n.º 2
0
void
thunar_navigator_open_new_tab (ThunarNavigator *navigator,
                               ThunarFile      *directory)
{
  _thunar_return_if_fail (THUNAR_IS_NAVIGATOR (navigator));
  _thunar_return_if_fail (THUNAR_IS_FILE (directory));
  _thunar_return_if_fail (thunar_file_is_directory (directory));

  g_signal_emit (G_OBJECT (navigator), navigator_signals[OPEN_NEW_TAB], 0, directory);
}
Exemplo n.º 3
0
/**
 * thunar_navigator_change_directory:
 * @navigator : a #ThunarNavigator instance.
 * @directory : a #ThunarFile referring to a directory.
 *
 * Emits the "change-directory" signal on @navigator with
 * the specified @directory.
 *
 * Derived classes should invoke this method whenever the user
 * selects a new directory from within @navigator. The derived
 * class should not perform any directory changing operations
 * itself, but leave it up to the surrounding module (usually
 * a #ThunarWindow instance) to change the directory.
 *
 * It should never ever be called from outside a #ThunarNavigator
 * implementation, as that may led to unexpected results!
 **/
void
thunar_navigator_change_directory (ThunarNavigator *navigator,
                                   ThunarFile      *directory)
{
  _thunar_return_if_fail (THUNAR_IS_NAVIGATOR (navigator));
  _thunar_return_if_fail (THUNAR_IS_FILE (directory));
  _thunar_return_if_fail (thunar_file_is_directory (directory));

  g_signal_emit (G_OBJECT (navigator), navigator_signals[CHANGE_DIRECTORY], 0, directory);
}
Exemplo n.º 4
0
static void
thunar_location_bar_set_current_directory (ThunarNavigator      *navigator,
                                           ThunarFile           *current_directory)
{
  ThunarLocationBar *bar = THUNAR_LOCATION_BAR (navigator);
  GtkWidget         *child;

  if (bar->current_directory) g_object_unref (bar->current_directory);
  bar->current_directory = current_directory;

  if (current_directory) g_object_ref (current_directory);

  if ((child = gtk_bin_get_child (GTK_BIN (bar))) && THUNAR_IS_NAVIGATOR (child))
    thunar_navigator_set_current_directory (THUNAR_NAVIGATOR (child), current_directory);

  g_object_notify (G_OBJECT (bar), "current-directory");
}
Exemplo n.º 5
0
/**
 * thunar_navigator_get_current_directory:
 * @navigator : a #ThunarNavigator instance.
 *
 * Returns the directory currently displayed by @navigator
 * or %NULL, if @navigator does not currently display and
 * directory.
 *
 * Return value: the current directory of @navigator or %NULL.
 **/
ThunarFile*
thunar_navigator_get_current_directory (ThunarNavigator *navigator)
{
  _thunar_return_val_if_fail (THUNAR_IS_NAVIGATOR (navigator), NULL);
  return THUNAR_NAVIGATOR_GET_IFACE (navigator)->get_current_directory (navigator);
}