浏览代码

Add support for Ubuntu unity menu.

Change-Id: I7d165e8ac29b64068409f0b215534ac6e337193f
Reviewed-on: http://gerrit.dmdirc.com/2616
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.8
Greg Holmes 11 年前
父节点
当前提交
29b7f401a9
共有 4 个文件被更改,包括 38 次插入0 次删除
  1. 1
    0
      build.xml
  2. 二进制
      lib/java-swing-ayatana-1.2.4.jar
  3. 6
    0
      src/com/dmdirc/addons/ui_swing/MainFrame.java
  4. 31
    0
      src/com/dmdirc/addons/ui_swing/UnityMenu.java

+ 1
- 0
build.xml 查看文件

@@ -111,6 +111,7 @@ version:
111 111
             <zipfileset src="${plugins.lib}/jxlayer.jar" includes="org/jdesktop/jxlayer/**"/>
112 112
             <zipfileset src="${plugins.lib}/cinch.jar" includes="*/**"/>
113 113
             <zipfileset src="${plugins.lib}/cinchsupport.jar" includes="*/**"/>
114
+            <zipfileset src="${plugins.lib}/java-swing-ayatana-1.2.4.jar" includes="*/**"/>
114 115
         </jar>
115 116
 
116 117
         <jar destfile="${plugins.dist}/parser_twitter.jar" update="true">

二进制
lib/java-swing-ayatana-1.2.4.jar 查看文件


+ 6
- 0
src/com/dmdirc/addons/ui_swing/MainFrame.java 查看文件

@@ -67,6 +67,9 @@ import lombok.extern.slf4j.Slf4j;
67 67
 
68 68
 import net.miginfocom.swing.MigLayout;
69 69
 
70
+import org.java.ayatana.ApplicationMenu;
71
+import org.java.ayatana.AyatanaDesktop;
72
+
70 73
 /**
71 74
  * The main application frame.
72 75
  */
@@ -127,6 +130,9 @@ public final class MainFrame extends JFrame implements WindowListener,
127 130
 
128 131
         focusOrder = new QueuedLinkedHashSet<TextFrame>();
129 132
         initComponents();
133
+        if (AyatanaDesktop.isSupported()) {
134
+            ApplicationMenu.tryInstall(this, getJMenuBar(), new UnityMenu());
135
+        }
130 136
 
131 137
         imageIcon = new ImageIcon(new IconManager(controller.getGlobalConfig())
132 138
                 .getImage("icon"));

+ 31
- 0
src/com/dmdirc/addons/ui_swing/UnityMenu.java 查看文件

@@ -0,0 +1,31 @@
1
+/*
2
+ * Copyright (c) 2006-2013 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+package com.dmdirc.addons.ui_swing;
23
+
24
+import org.java.ayatana.DefaultExtraMenuAction;
25
+
26
+/**
27
+ * Customisations to the Unity menu for DMDirc.
28
+ */
29
+public class UnityMenu extends DefaultExtraMenuAction {
30
+
31
+}

正在加载...
取消
保存