- // Initialise the main window
- pv::MainWindow w(device_manager, open_file, open_file_format,
- restore_sessions);
- w.show();
+ // Create the device manager, initialise the drivers
+ pv::DeviceManager device_manager(context, driver, do_scan);
+
+ // Initialise the main window
+ pv::MainWindow w(device_manager);
+ w.show();
+
+ if (restore_sessions)
+ w.restore_sessions();
+
+ if (!open_file.empty())
+ w.add_session_with_file(open_file, open_file_format);
+ else
+ w.add_default_session();