From 72f6cf7ca0d0baaef7fb0171e0d14cce50d1ef04 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Aug 2004 01:01:12 +0000 Subject: add support for statwindow git-svn-id: file:///home/lennart/svn/public/paman/trunk@15 cdefa82f-4ce1-0310-97f5-ab6066f37c3c --- src/MainWindow.cc | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'src/MainWindow.cc') 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::RefPtrget_widget("statusLabel", statusLabel); refGlade->get_widget("serverNameLabel", serverNameLabel); @@ -38,6 +44,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrget_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::RefPtrget_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::RefPtrsignal_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(); +} -- cgit