diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-02 00:45:51 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-03 22:46:26 +0200 |
| commit | b885c21a4639842a856483d1867843b03500efc8 (patch) | |
| tree | 9d40d316ce56ca59f1b1aa8f53a03c528c30a306 /src | |
| parent | 601bfb3156741ceab087e9acd24faf5ca3e37ee7 (diff) | |
Only show "notify" checkbox on jobs if it's possible for that job type.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/job_view.cc | 14 | ||||
| -rw-r--r-- | src/wx/job_view.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc index aa175816d..954989130 100644 --- a/src/wx/job_view.cc +++ b/src/wx/job_view.cc @@ -87,10 +87,12 @@ JobView::setup() _controls = new wxBoxSizer(wxVERTICAL); _controls->Add(_buttons); - _notify = new CheckBox(_container, _("Notify when complete")); - _notify->bind(&JobView::notify_clicked, this); - _notify->SetValue(Config::instance()->default_notify()); - _controls->Add(_notify, 0, wxTOP, DCPOMATIC_BUTTON_STACK_GAP); + if (_job->enable_notify()) { + _notify = new CheckBox(_container, _("Notify when complete")); + _notify->bind(&JobView::notify_clicked, this); + _notify->SetValue(Config::instance()->default_notify()); + _controls->Add(_notify, 0, wxTOP, DCPOMATIC_BUTTON_STACK_GAP); + } _table->Insert(n, _controls, 1, wxALIGN_CENTER_VERTICAL | wxALL, 3); @@ -154,7 +156,9 @@ JobView::finished() } _cancel->Enable(false); - _notify->Enable(false); + if (_notify) { + _notify->Enable(false); + } if (!_job->error_details().empty()) { _details->Enable(true); } diff --git a/src/wx/job_view.h b/src/wx/job_view.h index a3ec59bf5..2d8ac77fc 100644 --- a/src/wx/job_view.h +++ b/src/wx/job_view.h @@ -85,7 +85,7 @@ private: wxStaticText* _message; wxButton* _cancel; wxButton* _details; - CheckBox* _notify; + CheckBox* _notify = nullptr; /** sizer for all right-hand-size controls */ wxBoxSizer* _controls; std::string _last_message; |
