projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved decoder config into the popup
[pulseview.git]
/
pv
/
mainwindow.cpp
diff --git
a/pv/mainwindow.cpp
b/pv/mainwindow.cpp
index 0397c7f4a6076de6782f364be497ae8f462ad560..e1f831408a54385d7b12da34999e92a6f6956e2d 100644
(file)
--- a/
pv/mainwindow.cpp
+++ b/
pv/mainwindow.cpp
@@
-39,9
+39,8
@@
#include "devicemanager.h"
#include "dialogs/about.h"
#include "dialogs/connect.h"
#include "devicemanager.h"
#include "dialogs/about.h"
#include "dialogs/connect.h"
-#include "dialogs/decoder.h"
-#include "toolbars/contextbar.h"
#include "toolbars/samplingbar.h"
#include "toolbars/samplingbar.h"
+#include "view/logicsignal.h"
#include "view/view.h"
/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
#include "view/view.h"
/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
@@
-98,8
+97,6
@@
void MainWindow::setup_ui()
setCentralWidget(_central_widget);
_view = new pv::view::View(_session, this);
setCentralWidget(_central_widget);
_view = new pv::view::View(_session, this);
- connect(_view, SIGNAL(selection_changed()), this,
- SLOT(view_selection_changed()));
_vertical_layout->addWidget(_view);
_vertical_layout->addWidget(_view);
@@
-217,21
+214,15
@@
void MainWindow::setup_ui()
addToolBar(_toolbar);
// Setup the sampling bar
addToolBar(_toolbar);
// Setup the sampling bar
- _sampling_bar = new toolbars::SamplingBar(this);
+ _sampling_bar = new toolbars::SamplingBar(
_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();
- connect(_sampling_bar, SIGNAL(device_selected()), this,
- SLOT(device_selected()));
connect(_sampling_bar, SIGNAL(run_stop()), this,
SLOT(run_stop()));
addToolBar(_sampling_bar);
connect(_sampling_bar, SIGNAL(run_stop()), this,
SLOT(run_stop()));
addToolBar(_sampling_bar);
- // Setup the context bar
- _context_bar = new toolbars::ContextBar(this);
- addToolBar(_context_bar);
-
// Set the title
setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0,
QApplication::UnicodeUTF8));
// Set the title
setWindowTitle(QApplication::translate("MainWindow", "PulseView", 0,
QApplication::UnicodeUTF8));
@@
-305,7
+296,8
@@
void MainWindow::setup_add_decoders(QMenu *parent)
{
GSList *l = g_slist_sort(g_slist_copy(
(GSList*)srd_decoder_list()), decoder_name_cmp);
{
GSList *l = g_slist_sort(g_slist_copy(
(GSList*)srd_decoder_list()), decoder_name_cmp);
- while ((l = l->next)) {
+ for(; l; l = l->next)
+ {
QAction *const action = parent->addAction(QString(
((srd_decoder*)l->data)->name));
action->setData(qVariantFromValue(l->data));
QAction *const action = parent->addAction(QString(
((srd_decoder*)l->data)->name));
action->setData(qVariantFromValue(l->data));
@@
-376,11
+368,6
@@
void MainWindow::on_actionAbout_triggered()
dlg.exec();
}
dlg.exec();
}
-void MainWindow::device_selected()
-{
- _session.set_device(_sampling_bar->get_selected_device());
-}
-
void MainWindow::add_decoder(QObject *action)
{
assert(action);
void MainWindow::add_decoder(QObject *action)
{
assert(action);
@@
-388,13
+375,6
@@
void MainWindow::add_decoder(QObject *action)
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
(srd_decoder*)((QAction*)action)->data().value<void*>();
assert(dec);
- const std::vector< boost::shared_ptr<view::Signal> > &sigs =
- _session.get_signals();
-
- dialogs::Decoder dlg(this, dec, sigs);
- if(dlg.exec() != QDialog::Accepted)
- return;
-
_session.add_decoder(dec);
}
_session.add_decoder(dec);
}
@@
-419,13
+399,4
@@
void MainWindow::capture_state_changed(int state)
_sampling_bar->set_capture_state((pv::SigSession::capture_state)state);
}
_sampling_bar->set_capture_state((pv::SigSession::capture_state)state);
}
-void MainWindow::view_selection_changed()
-{
- assert(_context_bar);
-
- const list<weak_ptr<pv::view::SelectableItem> > items(
- _view->selected_items());
- _context_bar->set_selected_items(items);
-}
-
} // namespace pv
} // namespace pv