forked from I2P_Developers/i2p.i2p
Added the option to disable desktopgui.
This commit is contained in:
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P desktopgui\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-02-13 11:54+0000\n"
|
||||
"POT-Creation-Date: 2011-02-16 17:10+0000\n"
|
||||
"PO-Revision-Date: 2010-06-15 14:09+0100\n"
|
||||
"Last-Translator: duck <duck@mail.i2p>\n"
|
||||
"Language-Team: duck <duck@mail.i2p>\n"
|
||||
@ -29,14 +29,23 @@ msgstr ""
|
||||
msgid "Starting"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:25
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:26
|
||||
msgid "Launch I2P Browser"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:49
|
||||
msgid "Restart I2P"
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:50
|
||||
msgid "Configure desktopgui"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
msgid "Restart I2P"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:85
|
||||
msgid "Stop I2P"
|
||||
msgstr ""
|
||||
|
||||
#. Translate interface
|
||||
#: src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java:26
|
||||
msgid "Should tray icon be enabled?"
|
||||
msgstr ""
|
||||
|
@ -1,15 +1,16 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-02-16 17:10+0000\n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
# NL
|
||||
|
||||
# NL
|
||||
#: src/net/i2p/desktopgui/ExternalTrayManager.java:23
|
||||
msgid "Start I2P"
|
||||
msgstr "I2P starten"
|
||||
@ -22,20 +23,29 @@ msgstr "I2P is aan het starten!"
|
||||
msgid "Starting"
|
||||
msgstr "Bezig met starten"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:25
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:26
|
||||
msgid "Launch I2P Browser"
|
||||
msgstr "Start I2P Browser"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:49
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:50
|
||||
msgid "Configure desktopgui"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
msgid "Restart I2P"
|
||||
msgstr "I2P herstarten"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:85
|
||||
msgid "Stop I2P"
|
||||
msgstr "I2P stoppen"
|
||||
|
||||
#. Translate interface
|
||||
#: src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java:26
|
||||
msgid "Should tray icon be enabled?"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Browser not found"
|
||||
#~ msgstr "Browser niet gevonden"
|
||||
|
||||
#~ msgid "The default browser for your system was not found."
|
||||
#~ msgstr "De standaard webbrowser voor je systeem werd niet gevonden."
|
||||
|
||||
|
@ -8,14 +8,14 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: I2P desktopgui\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-02-14 18:14+0000\n"
|
||||
"POT-Creation-Date: 2011-02-16 17:10+0000\n"
|
||||
"PO-Revision-Date: 2011-02-15 00:18+0500\n"
|
||||
"Last-Translator: Hidden Z <hiddenz@mail.i2p>\n"
|
||||
"Language-Team: duck <duck@mail.i2p>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: \n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
#: src/net/i2p/desktopgui/ExternalTrayManager.java:23
|
||||
@ -31,15 +31,23 @@ msgstr "I2P запускается!"
|
||||
msgid "Starting"
|
||||
msgstr "Запускается"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:25
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:26
|
||||
msgid "Launch I2P Browser"
|
||||
msgstr "Запустить I2P браузер"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:49
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:50
|
||||
msgid "Configure desktopgui"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
msgid "Restart I2P"
|
||||
msgstr "Перезапустить I2P"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:85
|
||||
msgid "Stop I2P"
|
||||
msgstr "Остановить I2P"
|
||||
|
||||
#. Translate interface
|
||||
#: src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java:26
|
||||
msgid "Should tray icon be enabled?"
|
||||
msgstr ""
|
||||
|
@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-02-12 11:40+0000\n"
|
||||
"POT-Creation-Date: 2011-02-16 17:10+0000\n"
|
||||
"PO-Revision-Date: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
@ -22,18 +22,27 @@ msgstr "正在启动 I2P !"
|
||||
msgid "Starting"
|
||||
msgstr "正在启动"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:25
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:26
|
||||
msgid "Launch I2P Browser"
|
||||
msgstr "正在启动I2P浏览器"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:49
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:50
|
||||
msgid "Configure desktopgui"
|
||||
msgstr ""
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
msgid "Restart I2P"
|
||||
msgstr "重启 I2P"
|
||||
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:67
|
||||
#: src/net/i2p/desktopgui/InternalTrayManager.java:85
|
||||
msgid "Stop I2P"
|
||||
msgstr "停止 I2P"
|
||||
|
||||
#. Translate interface
|
||||
#: src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java:26
|
||||
msgid "Should tray icon be enabled?"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Browser not found"
|
||||
#~ msgstr "Browser niet gevonden"
|
||||
|
||||
|
@ -6,6 +6,7 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.SwingWorker;
|
||||
import net.i2p.desktopgui.gui.DesktopguiConfigurationFrame;
|
||||
|
||||
import net.i2p.desktopgui.router.RouterManager;
|
||||
import net.i2p.desktopgui.util.BrowseException;
|
||||
@ -46,6 +47,23 @@ public class InternalTrayManager extends TrayManager {
|
||||
}.execute();
|
||||
}
|
||||
});
|
||||
MenuItem desktopguiConfigurationLauncher = new MenuItem(_("Configure desktopgui"));
|
||||
desktopguiConfigurationLauncher.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
new SwingWorker<Object, Object>() {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
new DesktopguiConfigurationFrame().setVisible(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
}.execute();
|
||||
}
|
||||
|
||||
});
|
||||
MenuItem restartItem = new MenuItem(_("Restart I2P"));
|
||||
restartItem.addActionListener(new ActionListener() {
|
||||
|
||||
@ -85,6 +103,8 @@ public class InternalTrayManager extends TrayManager {
|
||||
|
||||
popup.add(browserLauncher);
|
||||
popup.addSeparator();
|
||||
popup.add(desktopguiConfigurationLauncher);
|
||||
popup.addSeparator();
|
||||
popup.add(restartItem);
|
||||
popup.add(stopItem);
|
||||
|
||||
|
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ConfigurationFrame.java
|
||||
*
|
||||
* Created on Feb 16, 2011, 8:03:14 AM
|
||||
*/
|
||||
|
||||
package net.i2p.desktopgui.gui;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.i2p.desktopgui.i18n.DesktopguiTranslator;
|
||||
import net.i2p.desktopgui.router.RouterManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author mathias
|
||||
*/
|
||||
public class DesktopguiConfigurationFrame extends javax.swing.JFrame {
|
||||
|
||||
/** Creates new form ConfigurationFrame */
|
||||
public DesktopguiConfigurationFrame() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
* initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is
|
||||
* always regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
desktopguiEnabled = new javax.swing.JCheckBox();
|
||||
okButton = new javax.swing.JButton();
|
||||
cancelButton = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setTitle(_("Tray icon configuration"));
|
||||
|
||||
desktopguiEnabled.setSelected(true);
|
||||
desktopguiEnabled.setText(_("Should tray icon be enabled?"));
|
||||
desktopguiEnabled.setActionCommand("shouldDesktopguiBeEnabled");
|
||||
|
||||
okButton.setText("OK");
|
||||
okButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
okButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
cancelButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(desktopguiEnabled)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(okButton)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(cancelButton)))
|
||||
.addContainerGap(237, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(desktopguiEnabled)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(okButton)
|
||||
.addComponent(cancelButton))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void okButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_okButtonMouseClicked
|
||||
String property = "desktopgui.enabled";
|
||||
String value;
|
||||
if(!desktopguiEnabled.isSelected()) {
|
||||
value = "false";
|
||||
System.out.println("Disabling desktopgui");
|
||||
}
|
||||
else {
|
||||
value = "true";
|
||||
System.out.println("Enabling desktopgui");
|
||||
}
|
||||
try {
|
||||
RouterManager.getRouterContext().setProperty(property, value);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(DesktopguiConfigurationFrame.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
System.out.println("Applying desktopgui configuration!");
|
||||
this.dispose();
|
||||
}//GEN-LAST:event_okButtonMouseClicked
|
||||
|
||||
private void cancelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelButtonMouseClicked
|
||||
System.out.println("Cancelling configuration!");
|
||||
this.dispose();
|
||||
}//GEN-LAST:event_cancelButtonMouseClicked
|
||||
|
||||
protected static String _(String s) {
|
||||
return DesktopguiTranslator._(s);
|
||||
}
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton cancelButton;
|
||||
private javax.swing.JCheckBox desktopguiEnabled;
|
||||
private javax.swing.JButton okButton;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
@ -329,7 +329,9 @@ public class RouterConsoleRunner {
|
||||
//TODO: move away from routerconsole into a separate application.
|
||||
//ApplicationManager?
|
||||
VersionComparator v = new VersionComparator();
|
||||
if(v.compare(System.getProperty("java.runtime.version"), "1.6") >= 0) {
|
||||
String desktopguiEnabled = I2PAppContext.getGlobalContext().getProperty("desktopgui.enabled");
|
||||
int recentJava = v.compare(System.getProperty("java.runtime.version"), "1.6");
|
||||
if(recentJava >= 0 && (desktopguiEnabled == null || desktopguiEnabled.equalsIgnoreCase("true"))) {
|
||||
String[] args = new String[0];
|
||||
net.i2p.desktopgui.Main.beginStartup(args);
|
||||
}
|
||||
|
Reference in New Issue
Block a user