Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding file monitoring and the ability to recursively open folders #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into filemon_and_trees
sjoblomj authored Nov 3, 2020
commit 95988c8aad4b0291144af9cbaba9815d60963135
1 change: 1 addition & 0 deletions src/vnr-file.c
Original file line number Diff line number Diff line change
@@ -52,6 +52,7 @@ static void vnr_file_set_file_info(VnrFile *vnrfile,
vnrfile->path = g_strdup(path);
vnrfile->is_directory = is_directory;
vnr_file_set_display_name(vnrfile, display_name);

}

VnrFile* vnr_file_create_new(gchar *path,
10 changes: 4 additions & 6 deletions src/vnr-window.c
Original file line number Diff line number Diff line change
@@ -1148,9 +1148,8 @@ file_open_dialog_response_cb (GtkWidget *dialog,
{
if (response_id == GTK_RESPONSE_ACCEPT)
{
GSList *uri_list = NULL;
gboolean open_recursively = FALSE;
uri_list = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (dialog));
GSList *uri_list = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (dialog));
g_return_if_fail(uri_list != NULL);

GtkWidget *toggle_btn = gtk_file_chooser_get_extra_widget(GTK_FILE_CHOOSER(dialog));
@@ -1159,6 +1158,7 @@ file_open_dialog_response_cb (GtkWidget *dialog,
}

vnr_window_open_from_list(window, uri_list, open_recursively);
g_slist_free_full(uri_list, g_free);
}

gtk_widget_destroy (dialog);
@@ -1359,10 +1359,9 @@ vnr_window_cmd_open(GtkAction *action, VnrWindow *window)
g_signal_connect(GTK_FILE_CHOOSER(dialog), "update-preview",
G_CALLBACK(update_preview_cb), preview);

gchar *dirname;
if(window->tree != NULL)
{
dirname = g_path_get_dirname (VNR_FILE(window->tree->data)->path);
gchar *dirname = g_path_get_dirname (VNR_FILE(window->tree->data)->path);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog), dirname);
g_free(dirname);
}
@@ -1395,10 +1394,9 @@ vnr_window_cmd_open_dir(GtkAction *action, VnrWindow *window)
open_recursively_checkbox = gtk_check_button_new_with_label(_("Include subfolders"));
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), open_recursively_checkbox);

gchar *dirname;
if(window->tree != NULL)
{
dirname = g_path_get_dirname (VNR_FILE(window->tree->data)->path);
gchar *dirname = g_path_get_dirname (VNR_FILE(window->tree->data)->path);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dialog), dirname);
g_free(dirname);
}
You are viewing a condensed version of this merge commit. You can view the full changes here.