Start of DBus sessionmanager.py support
git-svn-id: file:///home/vcs/svn/jsweeper/trunk@10 6611ac79-6612-48ef-a1e9-b906f853523emaster
parent
242d908852
commit
5c7f2794e0
|
@ -8,6 +8,7 @@ INCLUDE( ${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake )
|
||||||
pkg_check_modules(JACK jack>=0.118)
|
pkg_check_modules(JACK jack>=0.118)
|
||||||
pkg_check_modules(GTKMM gtkmm-2.4>=2.4)
|
pkg_check_modules(GTKMM gtkmm-2.4>=2.4)
|
||||||
pkg_check_modules(CAIROMM cairomm-1.0>=1.0)
|
pkg_check_modules(CAIROMM cairomm-1.0>=1.0)
|
||||||
|
pkg_check_modules(DBUS dbus-glib-1)
|
||||||
|
|
||||||
SET(SOURCES
|
SET(SOURCES
|
||||||
src/config.cpp
|
src/config.cpp
|
||||||
|
@ -27,18 +28,22 @@ SET(SOURCES
|
||||||
src/port.h
|
src/port.h
|
||||||
src/portmanager.cpp
|
src/portmanager.cpp
|
||||||
src/portmanager.h
|
src/portmanager.h
|
||||||
|
src/session.cpp
|
||||||
|
src/session.h
|
||||||
)
|
)
|
||||||
|
|
||||||
LINK_DIRECTORIES(
|
LINK_DIRECTORIES(
|
||||||
${JACK_LIBRARY_DIRS}
|
${JACK_LIBRARY_DIRS}
|
||||||
${GTKMM_LIBRARY_DIRS}
|
${GTKMM_LIBRARY_DIRS}
|
||||||
${CAIROMM_LIBRARY_DIRS}
|
${CAIROMM_LIBRARY_DIRS}
|
||||||
|
${DBUS_LIBRARY_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
${JACK_INCLUDE_DIRS}
|
${JACK_INCLUDE_DIRS}
|
||||||
${GTKMM_INCLUDE_DIRS}
|
${GTKMM_INCLUDE_DIRS}
|
||||||
${CAIROMM_INCLUDE_DIRS}
|
${CAIROMM_INCLUDE_DIRS}
|
||||||
|
${DBUS_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-g -Wall -Wextra -ansi -pedantic)
|
ADD_DEFINITIONS(-g -Wall -Wextra -ansi -pedantic)
|
||||||
|
@ -48,4 +53,5 @@ TARGET_LINK_LIBRARIES(jsweeper
|
||||||
${JACK_LIBRARIES}
|
${JACK_LIBRARIES}
|
||||||
${GTKMM_LIBRARIES}
|
${GTKMM_LIBRARIES}
|
||||||
${CAIROMM_LIBRARIES}
|
${CAIROMM_LIBRARIES}
|
||||||
|
${DBUS_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
11
src/gui.cpp
11
src/gui.cpp
|
@ -5,6 +5,7 @@
|
||||||
#include "portmanager.h"
|
#include "portmanager.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "session.h"
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::Builder> g_builder;
|
Glib::RefPtr<Gtk::Builder> g_builder;
|
||||||
|
|
||||||
|
@ -158,33 +159,43 @@ void Gui::on_quit()
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_session_open()
|
void Gui::on_session_open()
|
||||||
{
|
{
|
||||||
|
SessionOpenGui *sgui = SessionOpenGui::Open();
|
||||||
|
sgui->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_session_save()
|
void Gui::on_session_save()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_session_save_as()
|
void Gui::on_session_save_as()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_session_close()
|
void Gui::on_session_close()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_preferences()
|
void Gui::on_preferences()
|
||||||
{
|
{
|
||||||
Preferences *p = Preferences::Open();
|
Preferences *p = Preferences::Open();
|
||||||
p->show();
|
p->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_connect()
|
void Gui::on_connect()
|
||||||
{
|
{
|
||||||
jack.Connect();
|
jack.Connect();
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_disconnect()
|
void Gui::on_disconnect()
|
||||||
{
|
{
|
||||||
jack.Disconnect();
|
jack.Disconnect();
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_about()
|
void Gui::on_about()
|
||||||
{
|
{
|
||||||
Gtk::AboutDialog *about; g_builder->get_widget("aboutdialog1", about);
|
Gtk::AboutDialog *about; g_builder->get_widget("aboutdialog1", about);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||||
<!--Generated with glade3 3.4.5 on Thu Nov 26 16:17:28 2009 -->
|
<!--Generated with glade3 3.4.5 on Fri Nov 27 15:54:25 2009 -->
|
||||||
<glade-interface>
|
<glade-interface>
|
||||||
<widget class="GtkWindow" id="window1">
|
<widget class="GtkWindow" id="window1">
|
||||||
<property name="title" translatable="yes">JACK Sweeper</property>
|
<property name="title" translatable="yes">JACK Sweeper</property>
|
||||||
|
@ -750,12 +750,27 @@
|
||||||
<property name="column_spacing">6</property>
|
<property name="column_spacing">6</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="row_spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label6">
|
<widget class="GtkSpinButton" id="spin_cell_padding">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Font:</property>
|
<property name="adjustment">0 0 100 1 10 10</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label8">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Cell padding:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -772,30 +787,15 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label8">
|
<widget class="GtkLabel" id="label6">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Cell padding:</property>
|
<property name="label" translatable="yes">Font:</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<widget class="GtkSpinButton" id="spin_cell_padding">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="adjustment">0 0 100 1 10 10</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
|
@ -847,169 +847,73 @@
|
||||||
<property name="column_spacing">6</property>
|
<property name="column_spacing">6</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="row_spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label7">
|
<widget class="GtkLabel" id="label34">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Background:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label9">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Client tabs:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label10">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Port group tabs:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="bottom_attach">3</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label11">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Audio port tabs:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">3</property>
|
|
||||||
<property name="bottom_attach">4</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkColorButton" id="colorbutton_background">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="x_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkColorButton" id="colorbutton_clients">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_EXPAND</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkColorButton" id="colorbutton_port_groups">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="bottom_attach">3</property>
|
|
||||||
<property name="x_options">GTK_EXPAND</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkColorButton" id="colorbutton_ports_audio">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">3</property>
|
|
||||||
<property name="bottom_attach">4</property>
|
|
||||||
<property name="x_options">GTK_EXPAND</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label13">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">MIDI port tabs:</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">4</property>
|
|
||||||
<property name="bottom_attach">5</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkColorButton" id="colorbutton_ports_midi">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">4</property>
|
|
||||||
<property name="bottom_attach">5</property>
|
|
||||||
<property name="x_options">GTK_EXPAND</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label14">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Foreground:</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
<property name="bottom_attach">5</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkColorButton" id="colorbutton_text">
|
<widget class="GtkLabel" id="label33">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="xalign">0</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="label" translatable="yes">Grid lines (ports):</property>
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="color">#000000000000</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">2</property>
|
||||||
<property name="right_attach">4</property>
|
<property name="right_attach">3</property>
|
||||||
<property name="x_options"></property>
|
<property name="top_attach">3</property>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkColorButton" id="colorbutton_grid_client">
|
<widget class="GtkLabel" id="label32">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Grid lines (groups):</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label31">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Grid lines (clients):</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label30">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">3</property>
|
||||||
|
<property name="right_attach">4</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
<property name="bottom_attach">5</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkColorButton" id="colorbutton_grid_port">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
@ -1019,8 +923,8 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="right_attach">4</property>
|
<property name="right_attach">4</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="x_options"></property>
|
<property name="x_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -1041,7 +945,7 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkColorButton" id="colorbutton_grid_port">
|
<widget class="GtkColorButton" id="colorbutton_grid_client">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
|
@ -1051,74 +955,170 @@
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="right_attach">4</property>
|
<property name="right_attach">4</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">4</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options"></property>
|
<property name="x_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label30">
|
<widget class="GtkColorButton" id="colorbutton_text">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">3</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="right_attach">4</property>
|
<property name="right_attach">4</property>
|
||||||
|
<property name="x_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label14">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Foreground:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="x_options">GTK_FILL</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkColorButton" id="colorbutton_ports_midi">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
<property name="bottom_attach">5</property>
|
||||||
|
<property name="x_options">GTK_EXPAND</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label13">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">MIDI port tabs:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
<property name="bottom_attach">5</property>
|
<property name="bottom_attach">5</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label31">
|
<widget class="GtkColorButton" id="colorbutton_ports_audio">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Grid lines (clients):</property>
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
|
<property name="x_options">GTK_EXPAND</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkColorButton" id="colorbutton_port_groups">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</property>
|
||||||
|
<property name="x_options">GTK_EXPAND</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkColorButton" id="colorbutton_clients">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">GTK_EXPAND</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkColorButton" id="colorbutton_background">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="color">#000000000000</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="x_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label11">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Audio port tabs:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label32">
|
<widget class="GtkLabel" id="label10">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Grid lines (groups):</property>
|
<property name="label" translatable="yes">Port group tabs:</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">3</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label33">
|
<widget class="GtkLabel" id="label9">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Grid lines (ports):</property>
|
<property name="label" translatable="yes">Client tabs:</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="right_attach">3</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="top_attach">3</property>
|
|
||||||
<property name="bottom_attach">4</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label34">
|
<widget class="GtkLabel" id="label7">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Background:</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">4</property>
|
|
||||||
<property name="bottom_attach">5</property>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
@ -1236,25 +1236,29 @@
|
||||||
<property name="column_spacing">6</property>
|
<property name="column_spacing">6</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="row_spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="entry_destination_rule">
|
<widget class="GtkCheckButton" id="check_connections_stop">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Stop after matching rule</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="entry_source_rule">
|
<widget class="GtkLabel" id="label29">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">_Source match rule:</property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="right_attach">2</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -1272,29 +1276,25 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label29">
|
<widget class="GtkEntry" id="entry_source_rule">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">_Source match rule:</property>
|
|
||||||
<property name="use_markup">True</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkCheckButton" id="check_connections_stop">
|
<widget class="GtkEntry" id="entry_destination_rule">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Stop after matching rule</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -1359,25 +1359,29 @@
|
||||||
<property name="column_spacing">6</property>
|
<property name="column_spacing">6</property>
|
||||||
<property name="row_spacing">6</property>
|
<property name="row_spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="entry_replace_rule">
|
<widget class="GtkCheckButton" id="check_aliases_stop">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Stop after matching rule</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="entry_match_rule">
|
<widget class="GtkLabel" id="label26">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">_Match rule:</property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="right_attach">2</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -1395,29 +1399,25 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label26">
|
<widget class="GtkEntry" id="entry_match_rule">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">_Match rule:</property>
|
|
||||||
<property name="use_markup">True</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkCheckButton" id="check_aliases_stop">
|
<widget class="GtkEntry" id="entry_replace_rule">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label" translatable="yes">Stop after matching rule</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<property name="draw_indicator">True</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -1462,4 +1462,102 @@
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="GtkDialog" id="dialog_session_open">
|
||||||
|
<property name="border_width">5</property>
|
||||||
|
<property name="title" translatable="yes">Open Session</property>
|
||||||
|
<property name="resizable">False</property>
|
||||||
|
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||||
|
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||||
|
<property name="has_separator">False</property>
|
||||||
|
<child internal-child="vbox">
|
||||||
|
<widget class="GtkVBox" id="dialog-vbox6">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkVBox" id="vbox17">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">5</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label36">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes"><b>Open session</b></property>
|
||||||
|
<property name="use_markup">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkHBox" id="hbox11">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label35">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes">
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkComboBox" id="combobox_session_open">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child internal-child="action_area">
|
||||||
|
<widget class="GtkHButtonBox" id="dialog-action_area6">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="button_session_open_cancel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="label" translatable="yes">gtk-cancel</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="button_session_open_okay">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">True</property>
|
||||||
|
<property name="label" translatable="yes">gtk-ok</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="pack_type">GTK_PACK_END</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "rect.h"
|
#include "rect.h"
|
||||||
#include "colour.h"
|
#include "colour.h"
|
||||||
|
|
||||||
|
struct Base;
|
||||||
typedef std::list<Base *> BaseList;
|
typedef std::list<Base *> BaseList;
|
||||||
|
|
||||||
enum PortType {
|
enum PortType {
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
#include <string>
|
||||||
|
#include <dbus/dbus-glib.h>
|
||||||
|
#include "session.h"
|
||||||
|
#include "gui.h"
|
||||||
|
|
||||||
|
DBusGConnection *connection;
|
||||||
|
DBusGProxy *proxy;
|
||||||
|
|
||||||
|
Session::Session()
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_type_init();
|
||||||
|
|
||||||
|
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
|
||||||
|
|
||||||
|
if (connection == NULL) return;
|
||||||
|
|
||||||
|
proxy = dbus_g_proxy_new_for_name(
|
||||||
|
connection, "org.jackaudio.sessionmanager",
|
||||||
|
"/org/jackaudio/sessionmanager", "org.jackaudio.sessionmanager");
|
||||||
|
}
|
||||||
|
|
||||||
|
Session::~Session()
|
||||||
|
{
|
||||||
|
g_object_unref(proxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Session::SaveAs(std::string name)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (proxy == NULL) return -1;
|
||||||
|
|
||||||
|
dbus_g_proxy_call(proxy, "save_as", &error,
|
||||||
|
G_TYPE_STRING, name.c_str(),
|
||||||
|
G_TYPE_INVALID,
|
||||||
|
G_TYPE_INT, &ret,
|
||||||
|
G_TYPE_INVALID);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Session::Load(std::string name)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (proxy == NULL) return -1;
|
||||||
|
|
||||||
|
dbus_g_proxy_call(proxy, "load", &error,
|
||||||
|
G_TYPE_STRING, name.c_str(),
|
||||||
|
G_TYPE_INVALID,
|
||||||
|
G_TYPE_INT, &ret,
|
||||||
|
G_TYPE_INVALID);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::list<std::string> Session::List()
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
char **session_list;
|
||||||
|
char **session_list_ptr;
|
||||||
|
std::list<std::string> list;
|
||||||
|
|
||||||
|
if (proxy == NULL) return list;
|
||||||
|
|
||||||
|
dbus_g_proxy_call(proxy, "list", &error,
|
||||||
|
G_TYPE_INVALID,
|
||||||
|
G_TYPE_STRV, &session_list,
|
||||||
|
G_TYPE_INVALID);
|
||||||
|
|
||||||
|
if (session_list == NULL) return list;
|
||||||
|
|
||||||
|
for (session_list_ptr = session_list; *session_list_ptr; session_list_ptr++) {
|
||||||
|
list.push_back(*session_list_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_strfreev(session_list);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
Session s;
|
||||||
|
|
||||||
|
// Session Open window
|
||||||
|
|
||||||
|
SessionOpenGui *SessionOpenGui::Open()
|
||||||
|
{
|
||||||
|
SessionOpenGui *window = NULL;
|
||||||
|
g_builder->get_widget_derived("dialog_session_open", window);
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
|
||||||
|
SessionOpenGui::SessionOpenGui(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder)
|
||||||
|
: Gtk::Dialog(cobject)
|
||||||
|
{
|
||||||
|
builder->get_widget("combobox_session_open", combobox_session_open);
|
||||||
|
builder->get_widget("button_session_open_cancel", button_session_open_cancel);
|
||||||
|
builder->get_widget("button_session_open_okay", button_session_open_okay);
|
||||||
|
|
||||||
|
m_tree_model = Gtk::ListStore::create(m_columns);
|
||||||
|
combobox_session_open->set_model(m_tree_model);
|
||||||
|
|
||||||
|
Gtk::TreeModel::Row row;
|
||||||
|
std::list<std::string> sessions = s.List();
|
||||||
|
std::list<std::string>::iterator it;
|
||||||
|
for (it = sessions.begin(); it != sessions.end(); ++it) {
|
||||||
|
row = *(m_tree_model->append());
|
||||||
|
row[m_columns.m_name] = *it;
|
||||||
|
}
|
||||||
|
|
||||||
|
combobox_session_open->pack_start(m_columns.m_name);
|
||||||
|
|
||||||
|
button_session_open_cancel->signal_clicked().connect(sigc::mem_fun(*this, &SessionOpenGui::on_cancel));
|
||||||
|
button_session_open_okay->signal_clicked().connect(sigc::mem_fun(*this, &SessionOpenGui::on_okay));
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionOpenGui::on_cancel()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionOpenGui::on_okay()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
#ifndef SESSION_H
|
||||||
|
#define SESSION_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <list>
|
||||||
|
#include <gtkmm.h>
|
||||||
|
#include "glib.h"
|
||||||
|
|
||||||
|
class Session
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Session();
|
||||||
|
~Session();
|
||||||
|
|
||||||
|
int SaveAs(std::string name);
|
||||||
|
int Load(std::string name);
|
||||||
|
std::list<std::string> List();
|
||||||
|
};
|
||||||
|
|
||||||
|
class SessionOpenGui : public Gtk::Dialog
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Gtk::ComboBox *combobox_session_open;
|
||||||
|
Gtk::Button *button_session_open_cancel;
|
||||||
|
Gtk::Button *button_session_open_okay;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SessionOpenGui(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder);
|
||||||
|
|
||||||
|
static SessionOpenGui *Open();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void on_cancel();
|
||||||
|
void on_okay();
|
||||||
|
|
||||||
|
class ModelColumns : public Gtk::TreeModel::ColumnRecord
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ModelColumns()
|
||||||
|
{
|
||||||
|
add(m_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::TreeModelColumn<std::string> m_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
ModelColumns m_columns;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> m_tree_model;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SESSION_H
|
Loading…
Reference in New Issue