static void on_remove_external_dir(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { GtkTreeSelection *treesel; GtkTreeModel *model; GtkTreeIter iter, parent; gchar *name; treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(s_file_view)); if (!gtk_tree_selection_get_selected(treesel, &model, &iter)) return; if (gtk_tree_model_iter_parent(model, &parent, &iter)) return; gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1); prjorg_project_remove_external_dir(name); prjorg_sidebar_update(TRUE); project_write_config(); g_free(name); }
static void on_add_external(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer user_data) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new(_("Add External Directory"), GTK_WINDOW(geany->main_widgets->window), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Cancel"), GTK_RESPONSE_CANCEL, _("Add"), GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), get_project_base_path()); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); prjorg_project_add_external_dir(filename); prjorg_sidebar_update(TRUE); project_write_config(); g_free (filename); } gtk_widget_destroy(dialog); }
static gboolean write_config_cb(gpointer user_data) { if (geany_data->app->project && !prj_org) project_write_config(); return FALSE; }