0.4.00.4.10.4.2stable
|
Last change
on this file since c4401d6 was
c0522cd,
checked in by Michael Medin <michael@…>, 5 years ago
|
|
2008-08-16 MickeM
- *WARNING* THIS IS VERY VERY UNSTABEL (possibly)
- *WARNING* A lot of new untested code here so dont run in production enviornments :)
+ Added shared session so system tray can communicate with master
+ Added new system tray handlig (via TS so FUS should work with it)
+ Added new option [System] / shared_session=0 (or 1) to enable / disable the new shared memory framework (it is for now disabled by default)
If you want to try this remember to change that option but also beware! it is dagerous and not finnished and and also there is as of now no security at all.
|
-
Property mode set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #pragma once
|
|---|
| 2 |
|
|---|
| 3 | #include "NSCPlugin.h"
|
|---|
| 4 |
|
|---|
| 5 | namespace tray_manager {
|
|---|
| 6 | class tray_exception {
|
|---|
| 7 | std::wstring what_;
|
|---|
| 8 | public:
|
|---|
| 9 | tray_exception(std::wstring what) : what_(what) {
|
|---|
| 10 | #ifdef _DEBUG
|
|---|
| 11 | std::wcout << _T("TrayManager throw an exception: ") << what << std::endl;
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 | }
|
|---|
| 15 | std::wstring what() { return what_; }
|
|---|
| 16 | };
|
|---|
| 17 |
|
|---|
| 18 | class tray_manager {
|
|---|
| 19 | NSCPlugin *plugin_;
|
|---|
| 20 | event_handler event_;
|
|---|
| 21 | public:
|
|---|
| 22 | tray_manager(NSCPlugin *plugin) : plugin_(plugin), event_(_T("NSCTrayWaitStop")) {}
|
|---|
| 23 |
|
|---|
| 24 | boolean start_and_wait() {
|
|---|
| 25 | if (plugin_ == NULL)
|
|---|
| 26 | return false;
|
|---|
| 27 | try {
|
|---|
| 28 | plugin_->showTray();
|
|---|
| 29 | } catch (NSPluginException e) {
|
|---|
| 30 | throw tray_exception(_T("Systemtray manager failed to show tray: ") + e.error_);
|
|---|
| 31 | } catch (...) {
|
|---|
| 32 | throw tray_exception(_T("Systemtray manager failed to show tray: Unknown exception"));
|
|---|
| 33 | }
|
|---|
| 34 | event_.accuire(INFINITE);
|
|---|
| 35 | try {
|
|---|
| 36 | plugin_->hideTray();
|
|---|
| 37 | } catch (NSPluginException e) {
|
|---|
| 38 | throw tray_exception(_T("Systemtray manager failed to close tray: ") + e.error_);
|
|---|
| 39 | } catch (...) {
|
|---|
| 40 | throw tray_exception(_T("Systemtray manager failed to close tray: Unknown exception"));
|
|---|
| 41 | }
|
|---|
| 42 | return true;
|
|---|
| 43 | }
|
|---|
| 44 | void request_close() {
|
|---|
| 45 | event_.set();
|
|---|
| 46 | }
|
|---|
| 47 | };
|
|---|
| 48 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.