gui: Create a common ocarina_init()
To initialize the needed backend modules, shared by normal main() and testing main(). Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
e0770030d5
commit
3d1e8872d3
15
gui/main.cpp
15
gui/main.cpp
|
@ -1,17 +1,24 @@
|
|||
/*
|
||||
* Copyright 2014 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <deck.h>
|
||||
#include <ocarina.h>
|
||||
|
||||
Gtk::Window *ocarina_init()
|
||||
{
|
||||
Gtk::Window *window = connect_wires();
|
||||
deck::init();
|
||||
library::init();
|
||||
return window;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_TEST
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Gtk::Window *window;
|
||||
|
||||
Gtk::Main ocarina(argc, argv);
|
||||
window = connect_wires();
|
||||
|
||||
Gtk::Window *window = ocarina_init();
|
||||
Gtk::Main::run(*window);
|
||||
cleanup_tabs();
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_TEST */
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
Gtk::TreeModelColumn<unsigned int> q_col_count;
|
||||
Gtk::TreeModelColumn<std::string> q_col_played;
|
||||
} queue_cols;
|
||||
static unsigned int q_col_width[] = { 20, 300, 1, 125, 125, 1, 125, 1, 1 };
|
||||
static unsigned int q_col_width[] = { 20, 300, 60, 125, 125, 1, 125, 60, 1 };
|
||||
|
||||
|
||||
/*
|
||||
|
@ -131,6 +131,7 @@ void OcarinaTab::setup_columns()
|
|||
for (unsigned int i = 0; i < columns.size(); i++) {
|
||||
columns[i]->set_resizable();
|
||||
columns[i]->set_fixed_width(q_col_width[i]);
|
||||
columns[i]->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
#include <playqueue.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
/* main.cpp */
|
||||
Gtk::Window *ocarina_init();
|
||||
|
||||
/* model.cpp */
|
||||
class PlayqueueModel : public Gtk::TreeModel, public Glib::Object {
|
||||
private:
|
||||
|
|
|
@ -131,14 +131,11 @@ bool test_0()
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
Gtk::Window *window;
|
||||
|
||||
Gtk::Main ocarina(argc, argv);
|
||||
|
||||
deck :: init();
|
||||
window = connect_wires();
|
||||
Gtk::Window *window = ocarina_init();
|
||||
|
||||
schedule_test(test_0);
|
||||
|
||||
Gtk::Main::run(*window);
|
||||
cleanup_tabs();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue