* Bugfix on tray icon updating

* Some more work on the general configuration menu
      (currently not added to the tray icon menu yet, needs more work)
    * Tweaked the desktopgui logo
This commit is contained in:
mathiasdm
2009-04-13 17:27:35 +00:00
parent 8eedcb039a
commit 834fdfe9b3
10 changed files with 171 additions and 52 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -10,5 +10,5 @@ package desktopgui;
* @author mathias
*/
public class GUIVersion {
public static final String VERSION = "0.0.1";
public static final String VERSION = "0.0.1.1";
}

View File

@ -23,13 +23,16 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
<Component id="jTabbedPane1" alignment="0" pref="564" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="12" pref="12" max="12" attributes="0"/>
<Component id="jTabbedPane1" pref="566" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jTabbedPane1" pref="309" max="32767" attributes="0"/>
<Component id="jTabbedPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
</Group>
@ -46,7 +49,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="461" max="32767" attributes="0"/>
<EmptySpace pref="475" max="32767" attributes="0"/>
<Component id="ok" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancel" min="-2" max="-2" attributes="0"/>
@ -280,15 +283,16 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="20" pref="20" max="20" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jToggleButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jToggleButton2" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jToggleButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jToggleButton2" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="40" pref="40" max="40" attributes="0"/>
@ -302,7 +306,7 @@
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="337" max="32767" attributes="0"/>
<EmptySpace pref="339" max="32767" attributes="0"/>
<Component id="jToggleButton3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -311,20 +315,20 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="20" pref="20" max="20" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jRadioButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jRadioButton2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jRadioButton3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jToggleButton1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jToggleButton2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="48" max="32767" attributes="0"/>
<EmptySpace pref="181" max="32767" attributes="0"/>
<Component id="jToggleButton3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -391,15 +395,71 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="560" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane2" alignment="1" pref="538" max="32767" attributes="0"/>
<Component id="jLabel9" alignment="0" pref="538" max="32767" attributes="0"/>
<Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="538" max="32767" attributes="0"/>
<Component id="jLabel11" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="278" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="119" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="122" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" pref="65" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<Properties>
<Property name="name" type="java.lang.String" value="jScrollPane2" noResource="true"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
</Container>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="jLabel9.text"/>
<Property name="name" type="java.lang.String" value="jLabel9" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="jLabel10.text"/>
<Property name="name" type="java.lang.String" value="jLabel10" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="jLabel11.text"/>
<Property name="name" type="java.lang.String" value="jLabel11" noResource="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel5">
<Properties>
@ -416,12 +476,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="560" max="32767" attributes="0"/>
<EmptySpace min="0" pref="562" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="278" max="32767" attributes="0"/>
<EmptySpace min="0" pref="388" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -441,12 +501,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="560" max="32767" attributes="0"/>
<EmptySpace min="0" pref="562" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="278" max="32767" attributes="0"/>
<EmptySpace min="0" pref="388" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>

View File

@ -55,6 +55,11 @@ public class GeneralConfiguration extends javax.swing.JFrame {
jToggleButton2 = new javax.swing.JToggleButton();
jToggleButton3 = new javax.swing.JToggleButton();
jPanel4 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jScrollPane2 = new javax.swing.JScrollPane();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
jPanel6 = new javax.swing.JPanel();
@ -75,7 +80,7 @@ public class GeneralConfiguration extends javax.swing.JFrame {
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(461, Short.MAX_VALUE)
.addContainerGap(475, Short.MAX_VALUE)
.addComponent(ok)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancel)
@ -193,12 +198,12 @@ public class GeneralConfiguration extends javax.swing.JFrame {
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel8))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jToggleButton1)
.addGap(18, 18, 18)
.addComponent(jToggleButton2))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jToggleButton1)
.addGap(18, 18, 18)
.addComponent(jToggleButton2))))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -207,26 +212,26 @@ public class GeneralConfiguration extends javax.swing.JFrame {
.addComponent(jRadioButton3))))
.addGap(9, 9, 9))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap(337, Short.MAX_VALUE)
.addContainerGap(339, Short.MAX_VALUE)
.addComponent(jToggleButton3)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addContainerGap()
.addComponent(jLabel8)
.addGap(5, 5, 5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jRadioButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRadioButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jRadioButton3)
.addGap(40, 40, 40)
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jToggleButton1)
.addComponent(jToggleButton2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 181, Short.MAX_VALUE)
.addComponent(jToggleButton3)
.addContainerGap())
);
@ -235,15 +240,47 @@ public class GeneralConfiguration extends javax.swing.JFrame {
jPanel4.setName("jPanel4"); // NOI18N
jScrollPane1.setName("jScrollPane1"); // NOI18N
jScrollPane2.setName("jScrollPane2"); // NOI18N
jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
jLabel9.setName("jLabel9"); // NOI18N
jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
jLabel10.setName("jLabel10"); // NOI18N
jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
jLabel11.setName("jLabel11"); // NOI18N
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 560, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
.addComponent(jLabel10)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE)
.addComponent(jLabel11))
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 278, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N
@ -254,11 +291,11 @@ public class GeneralConfiguration extends javax.swing.JFrame {
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 560, Short.MAX_VALUE)
.addGap(0, 562, Short.MAX_VALUE)
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 278, Short.MAX_VALUE)
.addGap(0, 388, Short.MAX_VALUE)
);
jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N
@ -269,11 +306,11 @@ public class GeneralConfiguration extends javax.swing.JFrame {
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 560, Short.MAX_VALUE)
.addGap(0, 562, Short.MAX_VALUE)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 278, Short.MAX_VALUE)
.addGap(0, 388, Short.MAX_VALUE)
);
jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N
@ -283,12 +320,14 @@ public class GeneralConfiguration extends javax.swing.JFrame {
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE)
.addComponent(jTabbedPane1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
@ -302,6 +341,8 @@ public class GeneralConfiguration extends javax.swing.JFrame {
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
@ -309,6 +350,7 @@ public class GeneralConfiguration extends javax.swing.JFrame {
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
@ -318,6 +360,8 @@ public class GeneralConfiguration extends javax.swing.JFrame {
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton jRadioButton2;
private javax.swing.JRadioButton jRadioButton3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;

View File

@ -185,11 +185,18 @@ public class Tray {
//Add tray icon
trayIcon = new JPopupTrayIcon(image, "I2P: the anonymous network", popup);
try {
tray.add(trayIcon);
} catch (AWTException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
PeerHelper.addReachabilityListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
trayIcon.setToolTip("I2P Network status: " + PeerHelper.getReachability());
updateTooltip();
}
});
@ -197,6 +204,7 @@ public class Tray {
@Override
public void actionPerformed(ActionEvent arg0) {
updateTooltip();
int activePeers = PeerHelper.getActivePeers();
if(activePeers == 0)
trayIcon.setImage(Toolkit.getDefaultToolkit().getImage("desktopgui/resources/logo/logo_red.jpg"));
@ -208,12 +216,10 @@ public class Tray {
}
});
try {
tray.add(trayIcon);
} catch (AWTException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void updateTooltip() {
trayIcon.setToolTip("I2P Network status: " + PeerHelper.getReachability() + " / " + "Active Peers: " + PeerHelper.getActivePeers());
}
private SystemTray tray = null;

View File

@ -24,3 +24,6 @@ jRadioButton3.text=Download, verify and restart
jToggleButton1.text=Check for updates now
jToggleButton2.text=Update available: update now
jToggleButton3.text=Advanced update configuration
jLabel9.text=Tunnel explanation
jLabel10.text=Client tunnels:
jLabel11.text=Server tunnels:

View File

@ -94,7 +94,7 @@ public class PeerHelper {
}
}
};
activePeerTimer.schedule(t, 60*1000);
activePeerTimer.schedule(t, 0, 60*1000);
}
}
}
@ -134,7 +134,7 @@ public class PeerHelper {
}
};
reachabilityTimer.schedule(t, 60*1000);
reachabilityTimer.schedule(t, 0, 60*1000);
}
}
}

View File

@ -1,3 +1,9 @@
2009-04-13 Mathiasdm
* Bugfix on tray icon updating
* Some more work on the general configuration menu
(currently not added to the tray icon menu yet, needs more work)
* Tweaked the desktopgui logo
2009-04-13 Mathiasdm
* Added I2P version and GUI version to desktopgui
* Tweaks to the tray icon menu