Mercurial > minori
comparison src/gui/window.cc @ 315:34347fd2a2de
session: allow printing status messages
...!
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 11 Jun 2024 14:16:40 -0400 |
parents | bf89fbf7ff38 |
children | d928ec7b6a0d |
comparison
equal
deleted
inserted
replaced
314:76d7315504c4 | 315:34347fd2a2de |
---|---|
30 #include <QMainWindow> | 30 #include <QMainWindow> |
31 #include <QMenuBar> | 31 #include <QMenuBar> |
32 #include <QMessageBox> | 32 #include <QMessageBox> |
33 #include <QPlainTextEdit> | 33 #include <QPlainTextEdit> |
34 #include <QStackedWidget> | 34 #include <QStackedWidget> |
35 #include <QStatusBar> | |
35 #include <QTextStream> | 36 #include <QTextStream> |
36 #include <QThread> | 37 #include <QThread> |
37 #include <QThreadPool> | 38 #include <QThreadPool> |
38 #include <QTimer> | 39 #include <QTimer> |
39 #include <QToolBar> | 40 #include <QToolBar> |
77 MainWindow::MainWindow(QWidget* parent) | 78 MainWindow::MainWindow(QWidget* parent) |
78 : QMainWindow(parent) | 79 : QMainWindow(parent) |
79 , async_synchronize_thread_(nullptr, nullptr) { | 80 , async_synchronize_thread_(nullptr, nullptr) { |
80 sidebar_.setFixedWidth(128); | 81 sidebar_.setFixedWidth(128); |
81 sidebar_.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); | 82 sidebar_.setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); |
83 | |
84 statusBar(); | |
82 | 85 |
83 new QHBoxLayout(&main_widget_); | 86 new QHBoxLayout(&main_widget_); |
84 | 87 |
85 CreateBars(); | 88 CreateBars(); |
86 | 89 |
128 if (!osx::AskForPermissions()) | 131 if (!osx::AskForPermissions()) |
129 return; | 132 return; |
130 #endif | 133 #endif |
131 | 134 |
132 playing_thread_timer_.start(5000); | 135 playing_thread_timer_.start(5000); |
136 } | |
137 | |
138 void MainWindow::SetStatusMessage(const std::string& message) { | |
139 statusBar()->showMessage(Strings::ToQString(message), 2000); | |
133 } | 140 } |
134 | 141 |
135 /* Does the main part of what Qt's generic "RetranslateUI" function would do */ | 142 /* Does the main part of what Qt's generic "RetranslateUI" function would do */ |
136 void MainWindow::AddMainWidgets() { | 143 void MainWindow::AddMainWidgets() { |
137 int page = sidebar_.GetCurrentItem(); | 144 int page = sidebar_.GetCurrentItem(); |