예제 #1
0
void
AddonMenu::refresh()
{
  m_installed_addons = m_addon_manager.get_installed_addons();
  m_repository_addons = m_addon_manager.get_repository_addons();

  rebuild_menu();
}
예제 #2
0
void
AddonMenu::refresh()
{
  m_installed_addons = m_addon_manager.get_installed_addons();
  m_repository_addons = m_addon_manager.get_repository_addons();

  m_addons_enabled.reset(new bool[m_installed_addons.size()]);

  rebuild_menu();
}
예제 #3
0
void
AddonMenu::refresh()
{
  m_installed_addons = m_addon_manager.get_installed_addons();
  m_repository_addons = m_addon_manager.get_repository_addons();

  delete[] m_addons_enabled;
  m_addons_enabled = new bool[m_installed_addons.size()];

  rebuild_menu();
}
예제 #4
0
static void
rows_reordered_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer new_order, RBDisplayPageMenu *menu)
{
	GtkTreePath *root;
	root = get_root_path (menu);
	if (root != NULL) {
		if (gtk_tree_path_compare (path, root) == 0)
			rebuild_menu (menu);

		gtk_tree_path_free (root);
	}
}
예제 #5
0
static void
impl_constructed (GObject *object)
{
	RBDisplayPageMenu *menu;

	RB_CHAIN_GOBJECT_METHOD (rb_display_page_menu_parent_class, constructed, object);

	menu = RB_DISPLAY_PAGE_MENU (object);

	g_signal_connect (menu->priv->real_model, "row-inserted", G_CALLBACK (row_inserted_cb), menu);
	g_signal_connect (menu->priv->real_model, "row-deleted", G_CALLBACK (row_deleted_cb), menu);
	g_signal_connect (menu->priv->real_model, "row-changed", G_CALLBACK (row_changed_cb), menu);
	g_signal_connect (menu->priv->real_model, "rows-reordered", G_CALLBACK (rows_reordered_cb), menu);

	rebuild_menu (menu);
}
예제 #6
0
static void
impl_constructed (GObject *object)
{
	RBDisplayPageMenu *menu;
	GtkTreeModel *real_model;

	RB_CHAIN_GOBJECT_METHOD (rb_display_page_menu_parent_class, constructed, object);

	menu = RB_DISPLAY_PAGE_MENU (object);

	real_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (menu->priv->model));
	g_signal_connect (real_model, "row-inserted", G_CALLBACK (row_inserted_cb), menu);
	g_signal_connect (real_model, "row-deleted", G_CALLBACK (row_deleted_cb), menu);
	g_signal_connect (real_model, "row-changed", G_CALLBACK (row_changed_cb), menu);
	g_signal_connect (real_model, "rows-reordered", G_CALLBACK (rows_reordered_cb), menu);

	rebuild_menu (menu);
}
예제 #7
0
void
AddonMenu::menu_action(MenuItem* item)
{
  if (item->id == MNID_CHECK_ONLINE) // check if "Check Online" was chosen
  {
    check_online();
  }
  else if(item->id == MNID_LANGPACK_MODE)
  {
    m_language_pack_mode = !m_language_pack_mode;
    rebuild_menu();
    on_window_resize();
    return;
  }
  else if (MNID_ADDON_LIST_START <= item->id)
  {
    if (IS_INSTALLED_MENU_ID(item->id))
    {
      int idx = UNPACK_INSTALLED_MENU_ID(item->id);
      if (0 <= idx && idx < static_cast<int>(m_installed_addons.size()))
      {
        const Addon& addon = m_addon_manager.get_installed_addon(m_installed_addons[idx]);
        toggle_addon(addon);
      }
    }
    else if (IS_REPOSITORY_MENU_ID(item->id))
    {
      int idx = UNPACK_REPOSITORY_MENU_ID(item->id);
      if (0 <= idx && idx < static_cast<int>(m_repository_addons.size()))
      {
        const Addon& addon = m_addon_manager.get_repository_addon(m_repository_addons[idx]);
        install_addon(addon);
      }
    }
  }
  else
  {
    log_warning << "Unknown menu item clicked: " << item->id << std::endl;
  }
}
예제 #8
0
static void
rows_reordered_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer new_order, RBDisplayPageMenu *menu)
{
	rebuild_menu (menu);
}
예제 #9
0
static void
row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, RBDisplayPageMenu *menu)
{
	rebuild_menu (menu);
}
예제 #10
0
static void
row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, RBDisplayPageMenu *menu)
{
	rebuild_menu (menu);
}