JNIEXPORT jstring JNICALL
Java_org_gnome_gtk_GtkRecentChooser_gtk_1recent_1chooser_1get_1current_1uri
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	gchar* result;
	jstring _result;
	GtkRecentChooser* self;

	// convert parameter self
	self = (GtkRecentChooser*) _self;

	// call function
	result = gtk_recent_chooser_get_current_uri(self);

	// cleanup parameter self

	// translate return value to JNI type
	_result = (jstring) bindings_java_newString(env, result);

	// cleanup return value
	if (result != NULL) {
		g_free(result);
	}

	// and finally
	return _result;
}
void reopen_recent(GtkRecentChooser *chooser, gpointer data) {
    gchar *filename = gtk_recent_chooser_get_current_uri  (chooser);
    if (!filename) return;
    gphpedit_debug_message(DEBUG_MAIN_WINDOW,"filename: %s", filename);
    document_manager_switch_to_file_or_open(main_window.docmg, filename, 0);
    g_free(filename);
}
Exemple #3
0
static void
jump_menu_select (GtkWidget *recentchooser, char *unused)
{
	char *filename = gtk_recent_chooser_get_current_uri (GTK_RECENT_CHOOSER (recentchooser));
	if (strncmp (filename, "file://", sizeof ("file://") - 1))
		return;
	board_load_popup (win, 0, filename + sizeof ("file://") - 1);
}
Exemple #4
0
static gchar *
gtk_recent_action_get_current_uri (GtkRecentChooser *chooser)
{
  GtkRecentAction *recent_action = GTK_RECENT_ACTION (chooser);
  GtkRecentActionPrivate *priv = recent_action->priv;

  if (priv->current_chooser)
    return gtk_recent_chooser_get_current_uri (priv->current_chooser);

  return NULL;
}
Exemple #5
0
static void
glide_window_recent_item_activated (GtkRecentChooser *chooser,
				    gpointer user_data)
{
  GlideWindow *w = (GlideWindow *)user_data;
  gchar *uri = gtk_recent_chooser_get_current_uri (chooser);
  
  glide_window_close_document (w);
  /* TODO: Uris everywhere... Oh dirty hack*/
  glide_window_open_document (w, uri+7);
  
}
Exemple #6
0
void
recent_chooser_menu_activated_cb(GtkRecentChooser *chooser,
                                 gpointer          user_data)
{
  gchar *uri = NULL;
  gchar *path = NULL;

  uri = gtk_recent_chooser_get_current_uri(chooser);
  path = g_filename_from_uri(uri, NULL, NULL);
  sample_load(path);

  g_free (path);
}
//This is how a recent document is opened
static void
recent_activated (GtkRecentChooser *chooser,
                  gchar     *command)
{
	GError *error = NULL;
	gchar *full_command, *file;
	file = gtk_recent_chooser_get_current_uri (chooser);
	full_command = get_full_command(command, file);

	if (!gdk_spawn_command_line_on_screen (gdk_screen_get_default (), parse_expand_tilde(full_command), &error))
	{
		deskmenu_widget_error(error);
	}
}
Exemple #8
0
static void recent_item_cb(GtkRecentChooser *chooser, EDITOR *e)
{
	gchar *file_uri = gtk_recent_chooser_get_current_uri(chooser);

	XI_message(("file_uri: %s", file_uri));
	if (e->filename)
		g_free(e->filename);
	e->filename = g_strdup(file_uri);

	//editor_open_recent (file_uri, e);
	_load_file(e, file_uri);
	xml_set_value("Xiphos", "studypad", "lastfile", e->filename);
	settings.studypadfilename = xml_get_value("studypad", "lastfile");

	change_window_title(e->window, e->filename);
}
Exemple #9
0
void recentFileMenu(GtkRecentChooser *chooser,gpointer *data)
{
	gchar	*uri=NULL;
	char	*filename;

	uri=gtk_recent_chooser_get_current_uri((GtkRecentChooser*)chooser);
	if(uri!=NULL)
		{
			filename=g_filename_from_uri((const gchar*)uri,NULL,NULL);
			closePage(NULL,NULL);
			doOpenManpage(filename);
			dirty=false;
			setSensitive();
			g_free(uri);
			g_free(filename);
		}
}
Exemple #10
0
/**
 * gtk_recent_chooser_get_current_item:
 * @chooser: a #GtkRecentChooser
 * 
 * Gets the #GtkRecentInfo currently selected by @chooser.
 *
 * Return value: a #GtkRecentInfo.  Use gtk_recent_info_unref() when
 *   when you have finished using it.
 *
 * Since: 2.10
 */
GtkRecentInfo *
gtk_recent_chooser_get_current_item (GtkRecentChooser *chooser)
{
  GtkRecentManager *manager;
  GtkRecentInfo *retval;
  gchar *uri;
  
  g_return_val_if_fail (GTK_IS_RECENT_CHOOSER (chooser), NULL);
  
  uri = gtk_recent_chooser_get_current_uri (chooser);
  if (!uri)
    return NULL;
  
  manager = _gtk_recent_chooser_get_recent_manager (chooser);
  retval = gtk_recent_manager_lookup_item (manager, uri, NULL);
  g_free (uri);
  
  return retval;
}
void open_recent(GtkRecentChooser *chooser, gpointer user_data) {
  /** The user select an item from the recent file list. **/

  #ifdef DEBUG
    DEBUG_FUNC_MARK
  #endif



  /** retrieve the file URI from the selected item. **/
  gchar *uri = gtk_recent_chooser_get_current_uri(GTK_RECENT_CHOOSER(chooser)) ;

  if (uri) {

    /** Convert the URI in a filepath. **/
    gchar *filepath = g_filename_from_uri(uri, NULL, NULL) ;

    /** Storing last opened file folder. **/
    if (open_file_dirname != NULL) {
      free(open_file_dirname) ;
    }

    open_file_dirname = g_strdup(g_path_get_dirname(filepath)) ;

    /** Every file has an associated File_Editor structure which hold the Scrolled Window, TextView and GtkSourceBuffer. **/
    File_Editor *file_editor = g_malloc0(sizeof(File_Editor)) ;

    /** Add file content to the editor has an new notebook page. @NOTE: this function does more than the initalisation work, take a look at it. **/
    add_file_to_editor(gui->editor_notebook, file_editor , filepath, false) ;

    /** Setting the filepath text in the bottom bar. **/
    gtk_label_set_text(GTK_LABEL(gui->bottom_bar->filename_label), g_path_get_basename(filepath)) ;

    g_free(uri) ;
  }

  return ;

}
static VALUE
rc_get_current_uri(VALUE self)
{
    return CSTR2RVAL(gtk_recent_chooser_get_current_uri(_SELF(self)));
}
static gchar *
delegate_get_current_uri (GtkRecentChooser *chooser)
{
  return gtk_recent_chooser_get_current_uri (get_delegate (chooser));
}
Exemple #14
0
void gtkui_open_recent(GtkWidget *widget, gpointer userdata) {
	// Open a recently used item
	gchar *uri = gtk_recent_chooser_get_current_uri((GtkRecentChooser*)widget);
	nst_load(g_filename_from_uri(uri, NULL, NULL));
}