OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 151 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 151 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 210... Line 210...
210
    }
210
    }
211
 
211
 
212
    private void update(int toVersion) {
212
    private void update(int toVersion) {
213
 
213
 
214
        try {
214
        try {
-
 
215
            if (SystemTray.isSupported()) {
215
            SystemTray.getSystemTray().add(new TrayIcon(new ImageIcon(UpdateManager.class.getResource("tray.png")).getImage()));
216
                SystemTray.getSystemTray().add(new TrayIcon(new ImageIcon(UpdateManager.class.getResource("tray.png")).getImage()));
-
 
217
            }
216
        } catch (AWTException e2) {
218
        } catch (AWTException e2) {
217
            e2.printStackTrace();
219
            e2.printStackTrace();
218
        }
220
        }
219
        displayMessage("Préparation de la mise à jour");
221
        displayMessage("Préparation de la mise à jour");
220
        System.out.println("Update application");
222
        System.out.println("Update application");
Line 297... Line 299...
297
 
299
 
298
    }
300
    }
299
 
301
 
300
    void displayMessage(String s) {
302
    void displayMessage(String s) {
301
        try {
303
        try {
-
 
304
            if (SystemTray.isSupported()) {
302
            SystemTray.getSystemTray().getTrayIcons()[0].displayMessage("Mise à jour en cours", s, TrayIcon.MessageType.INFO);
305
                SystemTray.getSystemTray().getTrayIcons()[0].displayMessage("Mise à jour en cours", s, TrayIcon.MessageType.INFO);
-
 
306
            }
303
        } catch (Throwable e) {
307
        } catch (Throwable e) {
304
            e.printStackTrace();
308
            e.printStackTrace();
305
        }
309
        }
306
    }
310
    }
307
}
311
}