projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update main window and dock widget titles as session name changes
[pulseview.git]
/
pv
/
mainwindow.hpp
diff --git
a/pv/mainwindow.hpp
b/pv/mainwindow.hpp
index bf491156f7552781c4f3456228a478c5fa78f334..3cd269f4ff50c162e6868cddd6741a1f9fb91115 100644
(file)
--- a/
pv/mainwindow.hpp
+++ b/
pv/mainwindow.hpp
@@
-18,24
+18,22
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_MAINWINDOW_H
-#define PULSEVIEW_PV_MAINWINDOW_H
+#ifndef PULSEVIEW_PV_MAINWINDOW_H
PP
+#define PULSEVIEW_PV_MAINWINDOW_H
PP
#include <list>
#include <list>
+#include <map>
#include <memory>
#include <QMainWindow>
#include "session.hpp"
#include <memory>
#include <QMainWindow>
#include "session.hpp"
+#include "view/viewwidget.hpp"
struct srd_decoder;
class QVBoxLayout;
struct srd_decoder;
class QVBoxLayout;
-namespace sigrok {
-class Device;
-}
-
namespace pv {
class DeviceManager;
namespace pv {
class DeviceManager;
@@
-50,7
+48,9
@@
class View;
}
namespace widgets {
}
namespace widgets {
+#ifdef ENABLE_DECODE
class DecoderMenu;
class DecoderMenu;
+#endif
}
class MainWindow : public QMainWindow
}
class MainWindow : public QMainWindow
@@
-58,26
+58,28
@@
class MainWindow : public QMainWindow
Q_OBJECT
private:
Q_OBJECT
private:
- /**
- * Name of the setting used to remember the directory
- * containing the last file that was opened.
- */
- static const char *SettingOpenDirectory;
-
- /**
- * Name of the setting used to remember the directory
- * containing the last file that was saved.
- */
- static const char *SettingSaveDirectory;
+ static const QString WindowTitle;
public:
explicit MainWindow(DeviceManager &device_manager,
public:
explicit MainWindow(DeviceManager &device_manager,
- const char *open_file_name = NULL,
+ std::string open_file_name = std::string(),
+ std::string open_file_format = std::string(),
QWidget *parent = 0);
QWidget *parent = 0);
- void run_stop();
+ ~MainWindow();
+
+ QAction* action_view_sticky_scrolling() const;
+ QAction* action_view_coloured_bg() const;
+ QAction* action_about() const;
+
+ std::shared_ptr<pv::view::View> get_active_view() const;
- void select_device(std::shared_ptr<sigrok::Device> device);
+ std::shared_ptr<pv::view::View> add_view(const QString &title,
+ view::ViewType type, Session &session);
+
+ std::shared_ptr<Session> add_session();
+
+ void remove_session(std::shared_ptr<Session> session);
private:
void setup_ui();
private:
void setup_ui();
@@
-86,57
+88,43
@@
private:
void restore_ui_settings();
void restore_ui_settings();
- void session_error(const QString text, const QString info_text);
-
- /**
- * Updates the device list in the sampling bar
- */
- void update_device_list();
-
+private:
void closeEvent(QCloseEvent *event);
void closeEvent(QCloseEvent *event);
-private Q_SLOTS:
- void load_file(QString file_name);
-
- void show_session_error(
- const QString text, const QString info_text);
-
- void on_actionOpen_triggered();
- void on_actionSaveAs_triggered();
- void on_actionQuit_triggered();
+ virtual QMenu* createPopupMenu();
- v
oid on_actionConnect_triggered(
);
+ v
irtual bool restoreState(const QByteArray &state, int version = 0
);
- void on_actionViewZoomIn_triggered();
+private Q_SLOTS:
+ void on_add_view(const QString &title, view::ViewType type,
+ Session *session);
- void on_
actionViewZoomOut_trigger
ed();
+ void on_
focus_chang
ed();
- void on_actionViewZoomFit_triggered();
+ void on_new_session();
+ void on_session_name_changed();
+ void on_new_view(Session *session);
+ void on_view_close_clicked();
- void on_actionView
ZoomOneToOne
_triggered();
+ void on_actionView
StickyScrolling
_triggered();
- void on_actionView
ShowCursors
_triggered();
+ void on_actionView
ColouredBg
_triggered();
void on_actionAbout_triggered();
void on_actionAbout_triggered();
- void add_decoder(srd_decoder *decoder);
-
- void capture_state_changed(int state);
- void device_selected();
-
private:
DeviceManager &device_manager_;
private:
DeviceManager &device_manager_;
- Session session_;
-
- pv::view::View *view_;
+ std::list< std::shared_ptr<Session> > sessions_;
- QWidget *central_widget_;
-
QVBoxLayout *vertical_layout
_;
+ std::map< std::shared_ptr<QDockWidget>,
+
std::shared_ptr<pv::view::View> > view_docks
_;
- toolbars::MainBar *main_bar_;
+ QAction *const action_view_sticky_scrolling_;
+ QAction *const action_view_coloured_bg_;
+ QAction *const action_about_;
};
} // namespace pv
};
} // namespace pv
-#endif // PULSEVIEW_PV_MAINWINDOW_H
+#endif // PULSEVIEW_PV_MAINWINDOW_H
PP