ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.02k stars 271 forks source link

Remember last state of application (desktops) #357

Closed hsingfoo closed 8 years ago

hsingfoo commented 8 years ago

(Desktop Mac, zmNinja 2.2.28D)

When starting zmNinja, it defaults to the Montage view. I would like to start it in timeline view. Would it be possible to provide an option in settings to set the default starting modus (Montage, Event Montage, Timeline, Events or Monitors)? If this option is already available, I missed it!

TIA

pliablepixels commented 8 years ago

Instead of adding another option, I've just made the desktop version remember the last state before exit.

hsingfoo commented 8 years ago

I just compiled the latest master. Unfortunately when I start zmNinja, all it shows is the main window and the blue background of the top menubar. Nothing else.

pliablepixels commented 8 years ago

how are you compiling? using electron? can you look at developer tools -> console and tell me the error

pliablepixels commented 8 years ago

also please update from master again

hsingfoo commented 8 years ago

I compiled using the make_desktop script. Just (1 minute ago) got a fresh master copy and compiled again. Same issue. My electron skills or understanding of it are virtually zero.... Simply followed the how-to.

pliablepixels commented 8 years ago

Do you have "electron" installed as an independent app?

Open a terminal. Go to the directory where zmNinja-mac.app is installed, Try

electron  zmNinja-mac.app/Contents/Resources/app.asar

This should bring up a "View" menu item with a "Toggle Developer tools" -> toggle it and go to console and you should start seeing logs

If it can't find electron, do

sudo npm install -g  electron
hsingfoo commented 8 years ago

electron version is 1.4.4

I changed to directory /zmninja-src/zmNinja-mac.app/Contents/Resources

and issued 'electron app.asar'

Same result as per above description.

pliablepixels commented 8 years ago

I need to see logs - please follow the note on showing developer tools and looking at console logs

hsingfoo commented 8 years ago

I understand, but under the menu 'electron' there is just 'quit' option. There is nothing for me to choose from other then that...

pliablepixels commented 8 years ago
screen shot 2016-10-28 at 2 09 11 pm
hsingfoo commented 8 years ago

I do have the Electron menu item in the apple menu bar, but not the edit, view, Window nor help. Just Electron and 1 option under it 'quit.

I suspect it's me and my lack of knowledge of what I am doing with Electron and other dev tools. Sorry.

pliablepixels commented 8 years ago

The View/Window/Help only show up if you are running it from terminal with "electron app.asar" --> make sure you have killed the existing app before that or it won't work

hsingfoo commented 8 years ago

killing existing app did the trick....

file:///zmninja-src/zmNinja-mac.app/Contents/Resources/app.asar/cordova.js Failed to load resource: net::ERR_FILE_NOT_FOUND index.html:1 Uncaught (in promise) TypeError: function resolve() { [native code] } called on non-object(…) index.html:284 *** PLATFORM READY **** ionic.bundle.min.js:142 [native transition] The plugin is either disabled or nativepagetransitions plugin by telerik is not present. If you are getting this message in a browser, this is normal behavior, native transitions only work on device. filelogger.min.js:6 2016-10-28T21:19:45.503Z Device is ready filelogger.min.js:6 2016-10-28T21:19:45.512Z You are running on desktop filelogger.min.js:6 2016-10-28T21:19:45.600Z localforage driver for storage:asyncStorage filelogger.min.js:6 2016-10-28T21:19:45.758Z >>>>No data to import.... filelogger.min.js:6 Oct 28, 2016 11:19 PM Enabling native transitions... ionic.bundle.min.js:142 [native transition] is disabled or nativepagetransitions plugin is not present filelogger.min.js:6 Oct 28, 2016 11:19 PM Retrieving language before init is called... filelogger.min.js:6 Oct 28, 2016 11:19 PM Deleting old log file as it exceeds 20000 bytes filelogger.min.js:6 Oct 28, 2016 11:19 PM Language stored as:en filelogger.min.js:6 Oct 28, 2016 11:19 PM Device Language is:en filelogger.min.js:6 Oct 28, 2016 11:19 PM >>>>Language to be used:en app.js:1500 FOUND null

pliablepixels commented 8 years ago

hopefully fixed - please pull

hsingfoo commented 8 years ago

Up and running!

hsingfoo commented 8 years ago

I can confirm that the last state is being remembered. I suggest we can close this one.

pliablepixels commented 8 years ago

sounds good