assert(main_window);
+ shared_ptr<MainBar> main_bar = session.main_bar();
+
QDockWidget* dock = new QDockWidget(title, main_window);
dock->setObjectName(title);
main_window->addDockWidget(Qt::TopDockWidgetArea, dock);
dock_main->setWindowFlags(Qt::Widget); // Remove Qt::Window flag
if (type == views::ViewTypeTrace)
- v = make_shared<views::TraceView::View>(session, dock_main);
+ // This view will be the main view if there's no main bar yet
+ v = make_shared<views::TraceView::View>(session,
+ (main_bar ? false : true), dock_main);
if (!v)
return nullptr;
tv->enable_sticky_scrolling(true);
tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool());
- shared_ptr<MainBar> main_bar = session.main_bar();
if (!main_bar) {
/* Initial view, create the main bar */
main_bar = make_shared<MainBar>(session, this, tv);
}
}
-View::View(Session &session, QWidget *parent) :
- ViewBase(session, parent),
+View::View(Session &session, bool is_main_view, QWidget *parent) :
+ ViewBase(session, is_main_view, parent),
viewport_(new Viewport(*this)),
ruler_(new Ruler(*this)),
header_(new Header(*this)),
static const int ScaleUnits[3];
public:
- explicit View(Session &session, QWidget *parent = 0);
+ explicit View(Session &session, bool is_main_view=false, QWidget *parent = 0);
Session& session();
const Session& session() const;
namespace pv {
namespace views {
-ViewBase::ViewBase(Session &session, QWidget *parent) :
- session_(session)
+ViewBase::ViewBase(Session &session, bool is_main_view, QWidget *parent) :
+ session_(session),
+ is_main_view_(is_main_view)
{
(void)parent;
Q_OBJECT
public:
- explicit ViewBase(Session &session, QWidget *parent = 0);
+ explicit ViewBase(Session &session, bool is_main_view=false, QWidget *parent = 0);
Session& session();
const Session& session() const;
protected:
Session &session_;
+ const bool is_main_view_;
+
util::TimeUnit time_unit_;
};