projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MainBar: Renamed from SamplingBar
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index f9aa81dfdc4e7bc2e4e843543091709821d96a0a..924e70581fa442d064413b2a9b6e5f862d8553aa 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-46,7
+46,7
@@
#include "dialogs/about.hpp"
#include "dialogs/connect.hpp"
#include "dialogs/storeprogress.hpp"
#include "dialogs/about.hpp"
#include "dialogs/connect.hpp"
#include "dialogs/storeprogress.hpp"
-#include "toolbars/
sampling
bar.hpp"
+#include "toolbars/
main
bar.hpp"
#include "view/logicsignal.hpp"
#include "view/view.hpp"
#ifdef ENABLE_DECODE
#include "view/logicsignal.hpp"
#include "view/view.hpp"
#ifdef ENABLE_DECODE
@@
-61,7
+61,6
@@
using std::list;
using std::map;
using std::list;
using std::map;
-using std::pair;
using std::shared_ptr;
using std::string;
using std::shared_ptr;
using std::string;
@@
-72,7
+71,7
@@
using sigrok::HardwareDevice;
namespace pv {
namespace view {
namespace pv {
namespace view {
-class
Selectable
Item;
+class
View
Item;
}
const char *MainWindow::SettingOpenDirectory = "MainWindow/OpenDirectory";
}
const char *MainWindow::SettingOpenDirectory = "MainWindow/OpenDirectory";
@@
-110,6
+109,20
@@
void MainWindow::run_stop()
}
}
}
}
+void MainWindow::select_device(shared_ptr<Device> device)
+{
+ try {
+ session_.set_device(device);
+ } catch(const QString &e) {
+ QMessageBox msg(this);
+ msg.setText(e);
+ msg.setInformativeText(tr("Failed to Select Device"));
+ msg.setStandardButtons(QMessageBox::Ok);
+ msg.setIcon(QMessageBox::Warning);
+ msg.exec();
+ }
+}
+
void MainWindow::setup_ui()
{
setObjectName(QString::fromUtf8("MainWindow"));
void MainWindow::setup_ui()
{
setObjectName(QString::fromUtf8("MainWindow"));
@@
-270,12
+283,12
@@
void MainWindow::setup_ui()
addToolBar(toolbar);
// Setup the sampling bar
addToolBar(toolbar);
// Setup the sampling bar
-
sampling_bar_ = new toolbars::Sampling
Bar(session_, *this);
+
main_bar_ = new toolbars::Main
Bar(session_, *this);
// Populate the device list and select the initially selected device
update_device_list();
// Populate the device list and select the initially selected device
update_device_list();
- addToolBar(
sampling
_bar_);
+ addToolBar(
main
_bar_);
// Set the title
setWindowTitle(tr("PulseView"));
// Set the title
setWindowTitle(tr("PulseView"));
@@
-364,7
+377,7
@@
void MainWindow::restore_ui_settings()
device = device_manager_.find_device_from_info(dev_info);
if (device) {
device = device_manager_.find_device_from_info(dev_info);
if (device) {
- se
ssion_.se
t_device(device);
+ se
lec
t_device(device);
update_device_list();
}
update_device_list();
}
@@
-381,7
+394,7
@@
void MainWindow::session_error(
void MainWindow::update_device_list()
{
void MainWindow::update_device_list()
{
- assert(
sampling
_bar_);
+ assert(
main
_bar_);
shared_ptr<Device> selected_device = session_.device();
list< shared_ptr<Device> > devices;
shared_ptr<Device> selected_device = session_.device();
list< shared_ptr<Device> > devices;
@@
-397,13
+410,7
@@
void MainWindow::update_device_list()
devices.push_back(selected_device);
assert(selected_device);
devices.push_back(selected_device);
assert(selected_device);
- list< pair< shared_ptr<Device>, string> > device_list;
-
- for (auto device : devices)
- device_list.push_back(make_pair(
- device, device_manager_.get_display_name(device)));
-
- sampling_bar_->set_device_list(device_list, selected_device);
+ main_bar_->set_device_list(devices, selected_device);
}
void MainWindow::closeEvent(QCloseEvent *event)
}
void MainWindow::closeEvent(QCloseEvent *event)
@@
-497,7
+504,7
@@
void MainWindow::on_actionConnect_triggered()
// If the user selected a device, select it in the device list. Select the
// current device otherwise.
if (dlg.exec())
// If the user selected a device, select it in the device list. Select the
// current device otherwise.
if (dlg.exec())
- se
ssion_.se
t_device(dlg.get_selected_device());
+ se
lec
t_device(dlg.get_selected_device());
update_device_list();
}
update_device_list();
}
@@
-556,7
+563,7
@@
void MainWindow::add_decoder(srd_decoder *decoder)
void MainWindow::capture_state_changed(int state)
{
void MainWindow::capture_state_changed(int state)
{
-
sampling
_bar_->set_capture_state((pv::Session::capture_state)state);
+
main
_bar_->set_capture_state((pv::Session::capture_state)state);
}
void MainWindow::device_selected()
}
void MainWindow::device_selected()