示例#1
0
static void
gtk_plugin_manager_menu_init (GtkPluginManagerMenu *menu)
{
  GtkPluginManagerMenuPrivate *priv;
  
  priv = GTK_PLUGIN_MANAGER_MENU_GET_PRIVATE (menu);
  
  menu->priv = priv;

  priv->plugmg = plugin_manager_new ();

  /* we create a placeholder menuitem, to be used in case
   * the menu is empty. this placeholder will stay around
   * for the entire lifetime of the menu, and we just hide it
   * when it's not used. we have to do this, and do it here,
   * because we need a marker for the beginning of the recent
   * items list, so that we can insert the new items at the
   * right place when idly populating the menu in case the
   * user appended or prepended custom menu items to the
   * recent chooser menu widget.
   */
  priv->placeholder = gtk_menu_item_new_with_label (_("No items found"));
  gtk_widget_set_sensitive (priv->placeholder, FALSE);
  g_object_set_data (G_OBJECT (priv->placeholder),
                     "gtk-recent-menu-placeholder",
                     GINT_TO_POINTER (TRUE));

  gtk_menu_shell_insert (GTK_MENU_SHELL (menu), priv->placeholder, 0);
  gtk_widget_set_no_show_all (priv->placeholder, TRUE);
  gtk_widget_show (priv->placeholder);
}
示例#2
0
void gtk_syntax_check_window_run_check(GtkSyntax_Check_Window *win, Document *document)
{
  g_return_if_fail(win);
  if (!document){
   syntax_window(win, document, _("You don't have any files open to check\n"));
   return;
  }
  gchar *res = syntax_check_manager_run(document);
  if (res){
     syntax_window(win, document, res);
     g_free(res);
  } else {
      /* try plugins */
      PluginManager *plugmg = plugin_manager_new ();
      if (!run_syntax_plugin_by_ftype(plugmg, document)){
      gphpedit_debug_message(DEBUG_SYNTAX, "syntax check not implement\n");
      }
    g_object_unref(plugmg);
  }
}