projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c2ce645
)
Don't create status dialog until it's needed, otherwise we don't get an icon on Linux.
author
Carl Hetherington
<cth@carlh.net>
Fri, 9 Oct 2015 10:22:47 +0000
(11:22 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 9 Oct 2015 12:45:11 +0000
(13:45 +0100)
src/tools/dcpomatic_server.cc
patch
|
blob
|
history
diff --git
a/src/tools/dcpomatic_server.cc
b/src/tools/dcpomatic_server.cc
index 1d6c0bef70a6b7a95b96e9909afa9249aaf7dc45..e7579f74b166648227c0e53bfc74396909a3a3a2 100644
(file)
--- a/
src/tools/dcpomatic_server.cc
+++ b/
src/tools/dcpomatic_server.cc
@@
-27,6
+27,7
@@
#include <wx/taskbar.h>
#include <wx/icon.h>
#include <boost/thread.hpp>
#include <wx/taskbar.h>
#include <wx/icon.h>
#include <boost/thread.hpp>
+#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
#include <iostream>
using std::cout;
@@
-49,6
+50,14
@@
class MemoryLog : public Log, public Signaller
{
public:
{
public:
+ string get () const {
+ string a;
+ BOOST_FOREACH (string const & i, _log) {
+ a += i + "\n";
+ }
+ return a;
+ }
+
string head_and_tail (int) const {
/* Not necessary */
return "";
string head_and_tail (int) const {
/* Not necessary */
return "";
@@
-60,15
+69,15
@@
public:
private:
void do_log (string m)
{
private:
void do_log (string m)
{
- _l
engths.push_back (m.length ()
);
+ _l
og.push_back (m
);
emit (boost::bind (boost::ref (Appended), m));
emit (boost::bind (boost::ref (Appended), m));
- if (_l
engths
.size() > log_lines) {
- emit (boost::bind (boost::ref (Removed), _l
engths.front
()));
- _l
engths
.pop_front ();
+ if (_l
og
.size() > log_lines) {
+ emit (boost::bind (boost::ref (Removed), _l
og.front().length
()));
+ _l
og
.pop_front ();
}
}
}
}
- list<s
ize_t> _lengths
;
+ list<s
tring> _log
;
};
static shared_ptr<MemoryLog> memory_log (new MemoryLog);
};
static shared_ptr<MemoryLog> memory_log (new MemoryLog);
@@
-92,7
+101,7
@@
public:
SetSize (700, height + DCPOMATIC_SIZER_GAP * 2);
_text = new wxTextCtrl (
SetSize (700, height + DCPOMATIC_SIZER_GAP * 2);
_text = new wxTextCtrl (
- this, wxID_ANY,
wxT(""
), wxDefaultPosition, wxSize (-1, height),
+ this, wxID_ANY,
std_to_wx (memory_log->get()
), wxDefaultPosition, wxSize (-1, height),
wxTE_READONLY | wxTE_MULTILINE
);
wxTE_READONLY | wxTE_MULTILINE
);
@@
-124,6
+133,7
@@
class TaskBarIcon : public wxTaskBarIcon
{
public:
TaskBarIcon ()
{
public:
TaskBarIcon ()
+ : _status (0)
{
#ifdef DCPOMATIC_WINDOWS
wxIcon icon (std_to_wx ("taskbar_icon"));
{
#ifdef DCPOMATIC_WINDOWS
wxIcon icon (std_to_wx ("taskbar_icon"));
@@
-136,8
+146,6
@@
public:
SetIcon (icon, std_to_wx ("DCP-o-matic encode server"));
SetIcon (icon, std_to_wx ("DCP-o-matic encode server"));
- _status = new StatusDialog ();
-
Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::status, this), ID_status);
Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::quit, this), ID_quit);
}
Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::status, this), ID_status);
Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::quit, this), ID_quit);
}
@@
-153,6
+161,7
@@
public:
private:
void status ()
{
private:
void status ()
{
+ _status = new StatusDialog ();
_status->Show ();
}
_status->Show ();
}