summaryrefslogtreecommitdiffstats
path: root/src/MainWindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MainWindow.cc')
-rw-r--r--src/MainWindow.cc38
1 files changed, 35 insertions, 3 deletions
diff --git a/src/MainWindow.cc b/src/MainWindow.cc
index 9e385f3..ae6836c 100644
--- a/src/MainWindow.cc
+++ b/src/MainWindow.cc
@@ -24,13 +24,19 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
defaultSampleTypeLabel(NULL),
userNameLabel(NULL),
hostNameLabel(NULL),
+ linkLibraryVersionLabel(NULL),
+ compiledLibraryVersionLabel(NULL),
+ titleLabel(NULL),
deviceOpenButton(NULL),
clientOpenButton(NULL),
moduleOpenButton(NULL),
connectButton(NULL),
+ disconnectButton(NULL),
+ statButton(NULL),
deviceTreeView(NULL),
clientTreeView(NULL),
- moduleTreeView(NULL) {
+ moduleTreeView(NULL),
+ titleEventBox(NULL) {
refGlade->get_widget("statusLabel", statusLabel);
refGlade->get_widget("serverNameLabel", serverNameLabel);
@@ -38,6 +44,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
refGlade->get_widget("defaultSampleTypeLabel", defaultSampleTypeLabel);
refGlade->get_widget("hostNameLabel", hostNameLabel);
refGlade->get_widget("userNameLabel", userNameLabel);
+ refGlade->get_widget("titleLabel", titleLabel);
refGlade->get_widget("deviceTreeView", deviceTreeView);
refGlade->get_widget("clientTreeView", clientTreeView);
refGlade->get_widget("moduleTreeView", moduleTreeView);
@@ -45,6 +52,11 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
refGlade->get_widget("clientOpenButton", clientOpenButton);
refGlade->get_widget("moduleOpenButton", moduleOpenButton);
refGlade->get_widget("connectButton", connectButton);
+ refGlade->get_widget("disconnectButton", disconnectButton);
+ refGlade->get_widget("linkLibraryVersionLabel", linkLibraryVersionLabel);
+ refGlade->get_widget("compiledLibraryVersionLabel", compiledLibraryVersionLabel);
+ refGlade->get_widget("statButton", statButton);
+ refGlade->get_widget("titleEventBox", titleEventBox);
deviceTreeStore = Gtk::TreeStore::create(deviceTreeModelColumns);
deviceTreeView->set_model(deviceTreeStore);
@@ -65,14 +77,23 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
moduleTreeView->signal_row_activated().connect(sigc::mem_fun(*this, &MainWindow::onModuleTreeViewRowActivated));
connectButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onConnectButton));
+ disconnectButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onDisconnectButton));
deviceOpenButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onDeviceOpenButton));
clientOpenButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onClientOpenButton));
moduleOpenButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onModuleOpenButton));
+ statButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onStatButton));
+
+ linkLibraryVersionLabel->set_text(pa_get_library_version());
+ compiledLibraryVersionLabel->set_text(pa_get_headers_version());
statusLabel->set_text("Connecting ...");
clearAllData();
+
+ Gdk::Color c("black");
+ titleEventBox->modify_bg(Gtk::STATE_NORMAL, c);
}
+
MainWindow::~MainWindow() {
}
@@ -246,7 +267,7 @@ void MainWindow::updateInfo(const struct pa_server_info &i) {
char t[PA_SAMPLE_SNPRINT_MAX_LENGTH];
serverNameLabel->set_text(i.server_name);
serverVersionLabel->set_text(i.server_version);
- pa_sample_snprint(t, sizeof(t), &i.sample_spec);
+ pa_sample_spec_snprint(t, sizeof(t), &i.sample_spec);
defaultSampleTypeLabel->set_text(t);
hostNameLabel->set_text(i.host_name);
userNameLabel->set_text(i.user_name);
@@ -313,7 +334,11 @@ void MainWindow::onModuleOpenButton() {
}
void MainWindow::onConnectButton() {
- create_connection();
+ createConnection();
+}
+
+void MainWindow::onDisconnectButton() {
+ killConnection();
}
void MainWindow::showDeviceWindow(const Gtk::TreePath &p) {
@@ -347,3 +372,10 @@ void MainWindow::showModuleWindow(const Gtk::TreePath &p) {
Gtk::TreeModel::Row row = *(moduleTreeStore->get_iter(p));
serverInfoManager->showModuleWindow(row[moduleTreeModelColumns.index]);
}
+
+void MainWindow::onStatButton() {
+ if (!serverInfoManager)
+ return;
+
+ serverInfoManager->showStatWindow();
+}