gui/treeview: Add an init function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
c49b77a24a
commit
df43010766
|
@ -12,6 +12,7 @@
|
||||||
#include <gui/playlist.h>
|
#include <gui/playlist.h>
|
||||||
#include <gui/queue.h>
|
#include <gui/queue.h>
|
||||||
#include <gui/sidebar.h>
|
#include <gui/sidebar.h>
|
||||||
|
#include <gui/treeview.h>
|
||||||
#include <gui/view.h>
|
#include <gui/view.h>
|
||||||
#include <gui/window.h>
|
#include <gui/window.h>
|
||||||
|
|
||||||
|
@ -105,6 +106,7 @@ static void __ocarina_startup(GApplication *application, gpointer data)
|
||||||
gui_window_init(icon);
|
gui_window_init(icon);
|
||||||
gui_model_init();
|
gui_model_init();
|
||||||
gui_filter_init();
|
gui_filter_init();
|
||||||
|
gui_treeview_init();
|
||||||
gui_view_init();
|
gui_view_init();
|
||||||
gui_queue_init();
|
gui_queue_init();
|
||||||
gui_sidebar_init();
|
gui_sidebar_init();
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 (c) Anna Schumaker.
|
||||||
|
*/
|
||||||
|
#include <gui/filter.h>
|
||||||
|
#include <gui/treeview.h>
|
||||||
|
|
||||||
|
void gui_treeview_init()
|
||||||
|
{
|
||||||
|
gtk_tree_view_set_model(gui_treeview(),
|
||||||
|
GTK_TREE_MODEL(gui_filter_get()));
|
||||||
|
}
|
|
@ -390,8 +390,6 @@ void gui_view_init()
|
||||||
if (col && pos > 0)
|
if (col && pos > 0)
|
||||||
gtk_tree_view_column_set_fixed_width(col, pos);
|
gtk_tree_view_column_set_fixed_width(col, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_tree_view_set_model(view_treeview, GTK_TREE_MODEL(gui_filter_get()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gui_view_set_playlist(struct playlist *playlist)
|
void gui_view_set_playlist(struct playlist *playlist)
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
*/
|
*/
|
||||||
#ifndef OCARINA_GUI_TREEVIEW_H
|
#ifndef OCARINA_GUI_TREEVIEW_H
|
||||||
#define OCARINA_GUI_TREEVIEW_H
|
#define OCARINA_GUI_TREEVIEW_H
|
||||||
|
#include <gui/builder.h>
|
||||||
|
|
||||||
|
/* Called to initialize the treeview widget. */
|
||||||
|
void gui_treeview_init();
|
||||||
|
|
||||||
/* Called to access the treeview widget. */
|
/* Called to access the treeview widget. */
|
||||||
static inline GtkTreeView *gui_treeview()
|
static inline GtkTreeView *gui_treeview()
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <gui/filter.h>
|
#include <gui/filter.h>
|
||||||
#include <gui/model.h>
|
#include <gui/model.h>
|
||||||
#include <gui/playlist.h>
|
#include <gui/playlist.h>
|
||||||
|
#include <gui/treeview.h>
|
||||||
#include <gui/view.h>
|
#include <gui/view.h>
|
||||||
#include <gui/window.h>
|
#include <gui/window.h>
|
||||||
#include <tests/test.h>
|
#include <tests/test.h>
|
||||||
|
@ -109,6 +110,7 @@ int main(int argc, char **argv)
|
||||||
core_init(&argc, NULL, &init_data);
|
core_init(&argc, NULL, &init_data);
|
||||||
gui_model_init();
|
gui_model_init();
|
||||||
gui_filter_init();
|
gui_filter_init();
|
||||||
|
gui_treeview_init();
|
||||||
gui_view_init();
|
gui_view_init();
|
||||||
gui_playlist_init();
|
gui_playlist_init();
|
||||||
playlist_new(PL_LIBRARY, "tests/Music/Hyrule Symphony");
|
playlist_new(PL_LIBRARY, "tests/Music/Hyrule Symphony");
|
||||||
|
|
|
@ -14,6 +14,9 @@ void test_treeview()
|
||||||
{
|
{
|
||||||
g_assert_nonnull(gui_treeview());
|
g_assert_nonnull(gui_treeview());
|
||||||
g_assert_true(GTK_IS_TREE_VIEW(gui_treeview()));
|
g_assert_true(GTK_IS_TREE_VIEW(gui_treeview()));
|
||||||
|
|
||||||
|
g_assert(gtk_tree_view_get_model(gui_treeview()) ==
|
||||||
|
GTK_TREE_MODEL(gui_filter_get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -25,6 +28,7 @@ int main(int argc, char **argv)
|
||||||
gui_builder_init("share/ocarina/ocarina.ui");
|
gui_builder_init("share/ocarina/ocarina.ui");
|
||||||
gui_model_init();
|
gui_model_init();
|
||||||
gui_filter_init();
|
gui_filter_init();
|
||||||
|
gui_treeview_init();
|
||||||
while (idle_run_task()) {}
|
while (idle_run_task()) {}
|
||||||
|
|
||||||
g_test_init(&argc, &argv, NULL);
|
g_test_init(&argc, &argv, NULL);
|
||||||
|
|
Loading…
Reference in New Issue