Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from ridaamirini/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ridaamirini authored Apr 2, 2018
2 parents e372c1a + 7e576bb commit 97b4840
Show file tree
Hide file tree
Showing 17 changed files with 8,644 additions and 309 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ npm-debug.log
npm-debug.log.*
thumbs.db
!.gitkeep
auth.json
.idea/*
768 changes: 536 additions & 232 deletions .idea/workspace.xml

Large diffs are not rendered by default.

69 changes: 42 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,51 @@
osx_image: xcode8.3
sudo: required
dist: trusty
language: c
matrix:
include:
- os: osx
- os: linux
env: CC=clang CXX=clang++ npm_config_clang=1
compiler: clang
- os: osx
osx_image: xcode9.2
language: node_js
node_js: "9"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder

- os: linux
services: docker
language: generic

cache:
directories:
- node_modules
- "$HOME/.electron"
- "$HOME/.cache"
addons:
apt:
packages:
- libgnome-keyring-dev
- icnsutils
- $HOME/.cache/electron
- $HOME/.cache/electron-builder

before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
"$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
| tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
install:
- nvm install 7
- curl -o- -L https://yarnpkg.com/install.sh | bash
- source ~/.bashrc
- npm install -g xvfb-maybe
- yarn
- openssl aes-256-cbc -K $encrypted_720ad0b35daf_key -iv $encrypted_720ad0b35daf_iv -in auth.json.enc -out auth.json -d
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
export PATH="/tmp/git-lfs:$PATH"
fi
before_script:
- git lfs pull

script:
- yarn run build
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
docker run --rm \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn release --linux --win"
else
yarn release
fi
before_cache:
- rm -rf $HOME/.cache/electron-builder/wine

branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"
only:
- master
- master
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ImapSyncClient
# ImapSync Client [![Build Status](https://travis-ci.org/ridaamirini/ImapSyncClient.svg?branch=master)](https://travis-ci.org/ridaamirini/ImapSyncClient)

[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://forthebadge.com)
[![forthebadge](http://forthebadge.com/images/badges/uses-html.svg)](http://forthebadge.com)
Expand Down
Binary file added auth.json.enc
Binary file not shown.
File renamed without changes.
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "imapsyncclient",
"displayName": "ImapSync Client",
"productName": "ImapSync Client",
"version": "0.0.1",
"version": "0.0.2",
"author": "Rida Am. <rida-amirini@gmx.de>",
"description": "An electron-vue project",
"description": "It's only an Internet Message Access Protocol Synchronization Client",
"license": "MIT",
"main": "./dist/electron/main.js",
"scripts": {
"revision": "node .electron-vue/revision.js",
"release": "node .electron-vue/build.js && electron-builder",
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
Expand Down Expand Up @@ -65,8 +66,8 @@
},
"linux": {
"icon": "build/icons",
"executableName": "githoard",
"synopsis": "Imapy Sync",
"executableName": "imapsyncclient",
"synopsis": "ImapSync Client",
"category": "Development",
"target": [
"AppImage",
Expand All @@ -81,7 +82,9 @@
"vue": "^2.3.3",
"vue-electron": "^1.0.6",
"vue-router": "^2.5.3",
"vuex": "^2.3.1"
"vuex": "^2.3.1",
"electron-log": "^1.3.0",
"electron-updater": "^2.18.2"
},
"devDependencies": {
"babel-core": "^6.25.0",
Expand Down
6 changes: 3 additions & 3 deletions revision.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rev": "c4d8eaa",
"version": "0.0.1.c4d8eaa",
"date": "2018-3-25 18:31:23"
"rev": "796bdcf",
"version": "0.0.2.796bdcf",
"date": "2018-3-26 00:58:08"
}
63 changes: 32 additions & 31 deletions src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

import { app, BrowserWindow } from 'electron';
import { app, BrowserWindow, ipcMain } from 'electron';
import { checkForUpdates } from './updater';

/**
* Set `__static` path to static files in production
Expand All @@ -20,28 +21,30 @@ function createWindow () {
* Initial window options
*/

// Linux & Windows
// Linux & Windows
let options = {
title: 'ImapSync Client',
height: 680,
width: 1050,
useContentSize: true,
resizable: false,
fullscreen: false,
backgroundColor: '#272d33'
};
title: app.getName(),
height: 680,
width: 1050,
useContentSize: true,
resizable: false,
fullscreen: false,
backgroundColor: '#272d33',
show: false
};

if (process.platform === 'darwin') {
options = {
title: 'ImapSync Client',
title: app.getName(),
height: 680,
width: 1050,
useContentSize: true,
resizable: false,
frame: true,
titleBarStyle: 'hiddenInset',
fullscreen: false,
backgroundColor: '#272d33'
backgroundColor: '#272d33',
show: false
};
}

Expand All @@ -53,13 +56,27 @@ function createWindow () {
mainWindow = null;
});

mainWindow.once('ready-to-show', () => {
mainWindow.show();
});

// @todo Disable Zoom in/out with mouse and pinch
/* let webFrame = require('electron').webFrame;
webFrame.setVisualZoomLevelLimits(1,1);
webFrame.setLayoutZoomLevelLimits(0, 0); */
}

app.on('ready', createWindow);
// Single Instance
let instanceToQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});

if (instanceToQuit) app.quit();

// app.on('ready', createWindow);

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
Expand All @@ -73,22 +90,6 @@ app.on('activate', () => {
}
});

/**
* Auto Updater
*
* Uncomment the following code below and install `electron-updater` to
* support auto updating. Code Signing with a valid certificate is required.
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-electron-builder.html#auto-updating
*/

/*
import { autoUpdater } from 'electron-updater'
autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall()
})
app.on('ready', createWindow);

app.on('ready', () => {
if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates()
})
*/
ipcMain.once('check-update', checkForUpdates);
67 changes: 67 additions & 0 deletions src/main/updater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { autoUpdater } from 'electron-updater';
import log from 'electron-log';
import { app, ipcMain } from 'electron';

app.once('browser-window-focus', (event, win) => {
let __updateWin;

// Set logger
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';

// Configure updater
autoUpdater.allowPrerelease = false;
autoUpdater.autoDownload = false;

autoUpdater.on('update-available', ({version, releaseNotes}) => {
if (__updateWin) {
return;
}

win.webContents.send('update-available', {
version,
releaseNotes,
currentVersion: app.getVersion()
});

__updateWin = win;

__updateWin.on('close', () => {
__updateWin = null;
});
});

autoUpdater.on('update-not-available', () => {
if (__updateWin) return;

win.webContents.send('update-not-available');
});

autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall();
});

autoUpdater.on('download-progress', progress => {
if (__updateWin) {
__updateWin.webContents.send('download-progress', progress);
}
});

autoUpdater.on('error', error => {
if (__updateWin) {
__updateWin.webContents.send('update-error', error);
}
});

ipcMain.on('download-update', () => {
if (process.env.NODE_ENV === 'production') autoUpdater.downloadUpdate();
});

ipcMain.on('check-update-manually', () => {
if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates();
});
});

export function checkForUpdates () {
if (process.env.NODE_ENV === 'production') autoUpdater.checkForUpdates();
}
10 changes: 10 additions & 0 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@

<style>
/* CSS */
:not(input):not(textarea),
:not(input):not(textarea)::after,
:not(input):not(textarea)::before {
-webkit-user-select: none;
user-select: none;
cursor: default;
}
input, button, textarea, :focus {
outline: none;
}
</style>
Loading

0 comments on commit 97b4840

Please sign in to comment.