Split session gui from session (dbus) code
git-svn-id: file:///home/vcs/svn/jsweeper/trunk@13 6611ac79-6612-48ef-a1e9-b906f853523emaster
parent
c5e15fbf08
commit
ff7286ebec
|
@ -31,6 +31,8 @@ SET(SOURCES
|
||||||
src/portmanager.h
|
src/portmanager.h
|
||||||
src/session.cpp
|
src/session.cpp
|
||||||
src/session.h
|
src/session.h
|
||||||
|
src/session_gui.cpp
|
||||||
|
src/session_gui.h
|
||||||
)
|
)
|
||||||
|
|
||||||
LINK_DIRECTORIES(
|
LINK_DIRECTORIES(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "portmanager.h"
|
#include "portmanager.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "session.h"
|
#include "session_gui.h"
|
||||||
|
|
||||||
Glib::RefPtr<Gtk::Builder> g_builder;
|
Glib::RefPtr<Gtk::Builder> g_builder;
|
||||||
|
|
||||||
|
@ -172,6 +172,8 @@ void Gui::on_session_save()
|
||||||
|
|
||||||
void Gui::on_session_save_as()
|
void Gui::on_session_save_as()
|
||||||
{
|
{
|
||||||
|
SessionSaveGui *sgui = SessionSaveGui::Open();
|
||||||
|
sgui->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::on_session_close()
|
void Gui::on_session_close()
|
||||||
|
|
|
@ -20,10 +20,11 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
g = Gui::Open();
|
g = Gui::Open();
|
||||||
kit.run(*g);
|
kit.run(*g);
|
||||||
delete g;
|
|
||||||
|
|
||||||
jack.Disconnect();
|
jack.Disconnect();
|
||||||
|
|
||||||
cfg.Write();
|
cfg.Write();
|
||||||
|
|
||||||
|
delete g;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 Fri Nov 27 18:40:27 2009 -->
|
<!--Generated with glade3 3.4.5 on Sat Nov 28 15:24:09 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>
|
||||||
|
@ -775,12 +775,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>
|
||||||
|
@ -797,30 +812,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>
|
||||||
|
@ -872,169 +872,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>
|
||||||
|
@ -1044,8 +948,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>
|
||||||
|
@ -1066,7 +970,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>
|
||||||
|
@ -1076,74 +980,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>
|
||||||
|
@ -1261,25 +1261,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>
|
||||||
|
@ -1297,29 +1301,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>
|
||||||
|
@ -1384,25 +1384,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>
|
||||||
|
@ -1420,29 +1424,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>
|
||||||
|
@ -1585,4 +1585,101 @@
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="GtkDialog" id="dialog_session_save">
|
||||||
|
<property name="border_width">5</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-vbox7">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="spacing">2</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkVBox" id="vbox18">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="border_width">5</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label37">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes"><b>Save session as</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="hbox12">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label38">
|
||||||
|
<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="GtkEntry" id="entry_session_name">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">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_area7">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="button_session_save_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_save_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>
|
||||||
|
|
|
@ -1,29 +1,35 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <dbus/dbus-glib.h>
|
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "gui.h"
|
|
||||||
|
|
||||||
DBusGConnection *connection;
|
std::string Session::m_last_name;
|
||||||
DBusGProxy *proxy;
|
|
||||||
|
|
||||||
Session::Session()
|
Session::Session()
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
g_type_init();
|
m_connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
|
||||||
|
m_proxy = NULL;
|
||||||
|
|
||||||
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
|
if (m_connection == NULL) return;
|
||||||
|
|
||||||
if (connection == NULL) return;
|
m_proxy = dbus_g_proxy_new_for_name(
|
||||||
|
m_connection, "org.jackaudio.sessionmanager",
|
||||||
proxy = dbus_g_proxy_new_for_name(
|
|
||||||
connection, "org.jackaudio.sessionmanager",
|
|
||||||
"/org/jackaudio/sessionmanager", "org.jackaudio.sessionmanager");
|
"/org/jackaudio/sessionmanager", "org.jackaudio.sessionmanager");
|
||||||
|
|
||||||
|
if (m_proxy == NULL) {
|
||||||
|
g_object_unref(m_connection);
|
||||||
|
m_connection = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Session::~Session()
|
Session::~Session()
|
||||||
{
|
{
|
||||||
g_object_unref(proxy);
|
if (m_proxy) g_object_unref(m_proxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Session::Save()
|
||||||
|
{
|
||||||
|
return SaveAs(m_last_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Session::SaveAs(std::string name)
|
int Session::SaveAs(std::string name)
|
||||||
|
@ -31,14 +37,16 @@ int Session::SaveAs(std::string name)
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (proxy == NULL) return -1;
|
if (m_proxy == NULL) return -1;
|
||||||
|
|
||||||
dbus_g_proxy_call(proxy, "save_as", &error,
|
dbus_g_proxy_call(m_proxy, "save_as", &error,
|
||||||
G_TYPE_STRING, name.c_str(),
|
G_TYPE_STRING, name.c_str(),
|
||||||
G_TYPE_INVALID,
|
G_TYPE_INVALID,
|
||||||
G_TYPE_INT, &ret,
|
G_TYPE_INT, &ret,
|
||||||
G_TYPE_INVALID);
|
G_TYPE_INVALID);
|
||||||
|
|
||||||
|
m_last_name = name;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,27 +55,29 @@ int Session::Load(std::string name)
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (proxy == NULL) return -1;
|
if (m_proxy == NULL) return -1;
|
||||||
|
|
||||||
dbus_g_proxy_call(proxy, "load", &error,
|
dbus_g_proxy_call(m_proxy, "load", &error,
|
||||||
G_TYPE_STRING, name.c_str(),
|
G_TYPE_STRING, name.c_str(),
|
||||||
G_TYPE_INVALID,
|
G_TYPE_INVALID,
|
||||||
G_TYPE_INT, &ret,
|
G_TYPE_INT, &ret,
|
||||||
G_TYPE_INVALID);
|
G_TYPE_INVALID);
|
||||||
|
|
||||||
|
m_last_name = name;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<std::string> Session::List()
|
std::list<std::string> Session::List()
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
char **session_list;
|
char **session_list = NULL;
|
||||||
char **session_list_ptr;
|
char **session_list_ptr;
|
||||||
std::list<std::string> list;
|
std::list<std::string> list;
|
||||||
|
|
||||||
if (proxy == NULL) return list;
|
if (m_proxy == NULL) return list;
|
||||||
|
|
||||||
dbus_g_proxy_call(proxy, "list", &error,
|
dbus_g_proxy_call(m_proxy, "list", &error,
|
||||||
G_TYPE_INVALID,
|
G_TYPE_INVALID,
|
||||||
G_TYPE_STRV, &session_list,
|
G_TYPE_STRV, &session_list,
|
||||||
G_TYPE_INVALID);
|
G_TYPE_INVALID);
|
||||||
|
@ -82,48 +92,3 @@ std::list<std::string> Session::List()
|
||||||
|
|
||||||
return 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();
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <gtkmm.h>
|
#include <dbus/dbus-glib.h>
|
||||||
#include "glib.h"
|
|
||||||
|
|
||||||
class Session
|
class Session
|
||||||
{
|
{
|
||||||
|
@ -12,40 +11,15 @@ public:
|
||||||
Session();
|
Session();
|
||||||
~Session();
|
~Session();
|
||||||
|
|
||||||
|
int Save();
|
||||||
int SaveAs(std::string name);
|
int SaveAs(std::string name);
|
||||||
int Load(std::string name);
|
int Load(std::string name);
|
||||||
std::list<std::string> List();
|
std::list<std::string> List();
|
||||||
};
|
|
||||||
|
|
||||||
class SessionOpenGui : public Gtk::Dialog
|
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
Gtk::ComboBox *combobox_session_open;
|
DBusGConnection *m_connection;
|
||||||
Gtk::Button *button_session_open_cancel;
|
DBusGProxy *m_proxy;
|
||||||
Gtk::Button *button_session_open_okay;
|
static std::string m_last_name;
|
||||||
|
|
||||||
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
|
#endif // SESSION_H
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
#include <string>
|
||||||
|
#include "session_gui.h"
|
||||||
|
#include "session.h"
|
||||||
|
#include "gui.h"
|
||||||
|
|
||||||
|
// Session Open window
|
||||||
|
|
||||||
|
SessionOpenGui *SessionOpenGui::Open()
|
||||||
|
{
|
||||||
|
SessionOpenGui *window = NULL;
|
||||||
|
g_builder->get_widget_derived("dialog_session_open", window);
|
||||||
|
if (window != NULL) window->Refresh();
|
||||||
|
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);
|
||||||
|
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::Refresh()
|
||||||
|
{
|
||||||
|
Session *s = new Session();
|
||||||
|
std::list<std::string> sessions = s->List();
|
||||||
|
delete s;
|
||||||
|
|
||||||
|
bool active = sessions.size() > 0;
|
||||||
|
combobox_session_open->set_sensitive(active);
|
||||||
|
button_session_open_okay->set_sensitive(active);
|
||||||
|
|
||||||
|
if (active) {
|
||||||
|
m_tree_model->clear();
|
||||||
|
|
||||||
|
Gtk::TreeModel::Row row;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionOpenGui::on_cancel()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionOpenGui::on_okay()
|
||||||
|
{
|
||||||
|
Gtk::TreeModel::iterator iter = combobox_session_open->get_active();
|
||||||
|
if (iter) {
|
||||||
|
Gtk::TreeModel::Row row = *iter;
|
||||||
|
|
||||||
|
Session *s = new Session();
|
||||||
|
s->Load(row[m_columns.m_name]);
|
||||||
|
delete s;
|
||||||
|
}
|
||||||
|
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Session Save window
|
||||||
|
|
||||||
|
SessionSaveGui *SessionSaveGui::Open()
|
||||||
|
{
|
||||||
|
SessionSaveGui *window = NULL;
|
||||||
|
g_builder->get_widget_derived("dialog_session_save", window);
|
||||||
|
if (window != NULL) window->Refresh();
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
|
||||||
|
SessionSaveGui::SessionSaveGui(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder)
|
||||||
|
: Gtk::Dialog(cobject)
|
||||||
|
{
|
||||||
|
builder->get_widget("entry_session_name", entry_session_name);
|
||||||
|
builder->get_widget("button_session_save_cancel", button_session_save_cancel);
|
||||||
|
builder->get_widget("button_session_save_okay", button_session_save_okay);
|
||||||
|
|
||||||
|
button_session_save_cancel->signal_clicked().connect(sigc::mem_fun(*this, &SessionSaveGui::on_cancel));
|
||||||
|
button_session_save_okay->signal_clicked().connect(sigc::mem_fun(*this, &SessionSaveGui::on_okay));
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionSaveGui::Refresh()
|
||||||
|
{
|
||||||
|
entry_session_name->set_text("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionSaveGui::on_cancel()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SessionSaveGui::on_okay()
|
||||||
|
{
|
||||||
|
Session *s = new Session();
|
||||||
|
s->SaveAs(entry_session_name->get_text());
|
||||||
|
delete s;
|
||||||
|
|
||||||
|
hide();
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
#ifndef SESSION_GUI_H
|
||||||
|
#define SESSION_GUI_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <gtkmm.h>
|
||||||
|
|
||||||
|
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();
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class SessionSaveGui : public Gtk::Dialog
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Gtk::Entry *entry_session_name;
|
||||||
|
Gtk::Button *button_session_save_cancel;
|
||||||
|
Gtk::Button *button_session_save_okay;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SessionSaveGui(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder);
|
||||||
|
|
||||||
|
static SessionSaveGui *Open();
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void on_cancel();
|
||||||
|
void on_okay();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SESSION_GUI_H
|
Loading…
Reference in New Issue