X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=2558cb07692fe497e87d262fad574bc81ad70bfd;hb=26f209b713171014a4f6dc3546b64bf691727cfd;hp=1a05907c9c1a4470be862fdf2691887411b915e3;hpb=744aa24fc5a7084461e4e70595b96f1c3eac65e4;p=pulseview.git diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 1a05907..2558cb0 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -74,6 +74,7 @@ using std::cerr; using std::endl; using std::list; using std::map; +using std::max; using std::pair; using std::shared_ptr; using std::string; @@ -257,7 +258,8 @@ void MainWindow::export_file(shared_ptr format, const pv::util::Timestamp& start_time = view_->cursors()->first()->time(); const pv::util::Timestamp& end_time = view_->cursors()->second()->time(); - const uint64_t start_sample = start_time.convert_to() * samplerate; + const uint64_t start_sample = + std::max((double)0, start_time.convert_to() * samplerate); const uint64_t end_sample = end_time.convert_to() * samplerate; sample_range = std::make_pair(start_sample, end_sample); @@ -880,8 +882,11 @@ void MainWindow::device_selected() { // Set the title to include the device/file name const shared_ptr device = session_.device(); - if (!device) + + if (!device) { + main_bar_->reset_device_selector(); return; + } const string display_name = device->display_name(device_manager_); setWindowTitle(tr("%1 - PulseView").arg(display_name.c_str()));