Browse Source

Major changes

Added Bassa translation
Added a notification window
master
Sogomn 9 years ago
parent
commit
0cbe9ab5a4
  1. 44
      Ratty/res/language/lang_bsq.properties
  2. 4
      Ratty/src/de/sogomn/rat/GUISettings.java
  3. 76
      Ratty/src/de/sogomn/rat/server/gui/Notification.java
  4. 7
      Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

44
Ratty/res/language/lang_bsq.properties

@ -0,0 +1,44 @@
debug.question=Foo't'ah dud Yoow'a'h?
debug.server=Foo't'ah
debug.client=Yoow'a'h
server.port_question=Tri'a'am yuwe Joom?
server.port_error=Imy Tri'a'am.
server.free_warning=Lmbona yuwe connect yuw reyt device jipon.\r\n\
Kimu?
server.yes=Yime
server.no=Yuwe
server.upload_execute_warning=File fi qo'wehn pol Imy file.\r\n\
Kimu?
builder.address_question=Ui number fi Imy reyt?
builder.port_question=jipon?
builder.error=Yuwe g'a'ah.
action.popup=Gu oop
action.screenshot=Screenshoot
action.desktop=Des'top
action.voice=g'v'oocan
action.files=File g'can
action.command=Gu action
action.clipboard=Bood lmbona
action.website=Website gu
action.audio=Fun o'tqov
action.free=Impy gu
action.build=Impy build
action.attack=K'ontad gu
action.request_files=Gu file
action.download=Download file
action.upload=Gu file fi dehn
action.execute=M'at eh file
action.delete=Yuwe file
action.new_directory=Nuun file
action.upload_execute=Dehn fi M'at file
column.name=Cu'a'ahn
column.location=Place
column.address=IP number
column.os=Operating system
column.version=Ve'son
column.desktop=Stre'm'in' des'top
column.voice=Stre'm'in v'ocan

4
Ratty/src/de/sogomn/rat/GUISettings.java

@ -24,7 +24,7 @@ final class GUISettings {
private static final Color BASE = new Color(235, 205, 185); private static final Color BASE = new Color(235, 205, 185);
private static final Color BRIGHTER = new Color(245, 220, 200); private static final Color BRIGHTER = new Color(245, 220, 200);
private static final Color DARKER = new Color(215, 185, 165); private static final Color DARKER = new Color(215, 185, 165);
private static final Color ALTERNATIVE = new Color(245, 235, 225);
private static final Color ALTERNATIVE = new Color(245, 235, 230);
private static final Color SELECTION = new Color(120, 120, 135); private static final Color SELECTION = new Color(120, 120, 135);
private static final EmptyBorder TABLE_CELL_BORDER = new EmptyBorder(2, 5, 2, 5); private static final EmptyBorder TABLE_CELL_BORDER = new EmptyBorder(2, 5, 2, 5);
@ -74,6 +74,8 @@ final class GUISettings {
try { try {
newFont = Font.createFont(Font.TRUETYPE_FONT, Ratty.class.getResourceAsStream("/lato.ttf")).deriveFont(13f); newFont = Font.createFont(Font.TRUETYPE_FONT, Ratty.class.getResourceAsStream("/lato.ttf")).deriveFont(13f);
} catch (final IOException | FontFormatException ex) { } catch (final IOException | FontFormatException ex) {
ex.printStackTrace();
newFont = new Font("Trebuchet MS", Font.PLAIN, 13); newFont = new Font("Trebuchet MS", Font.PLAIN, 13);
} }

76
Ratty/src/de/sogomn/rat/server/gui/Notification.java

@ -0,0 +1,76 @@
package de.sogomn.rat.server.gui;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.border.EmptyBorder;
public final class Notification {
private JDialog dialog;
private JLabel label;
private static final EmptyBorder PADDING = new EmptyBorder(10, 50, 10, 50);
private static final int INTERVAL = 3;
private static final int WAIT_TIME = 3000;
public Notification(final String text) {
dialog = new JDialog();
label = new JLabel(text);
label.setHorizontalAlignment(JLabel.CENTER);
label.setVerticalAlignment(JLabel.CENTER);
label.setBorder(PADDING);
dialog.setUndecorated(true);
dialog.setContentPane(label);
dialog.pack();
dialog.setLocation(-dialog.getWidth(), 0);
dialog.setAlwaysOnTop(true);
}
public Notification() {
this("");
}
public void trigger() {
if (dialog.isVisible() || !dialog.isDisplayable()) {
return;
}
final Runnable runnable = () -> {
try {
while (dialog.getX() < 0) {
final int x = dialog.getX() + 1;
final int y = dialog.getY();
dialog.setLocation(x, y);
Thread.sleep(INTERVAL);
}
Thread.sleep(WAIT_TIME);
while (dialog.getX() > -dialog.getWidth()) {
final int x = dialog.getX() - 1;
final int y = dialog.getY();
dialog.setLocation(x, y);
Thread.sleep(INTERVAL);
}
} catch (final Exception ex) {
ex.printStackTrace();
}
dialog.setVisible(false);
dialog.dispose();
};
final Thread thread = new Thread(runnable);
dialog.setVisible(true);
thread.setDaemon(true);
thread.start();
}
}

7
Ratty/src/de/sogomn/rat/server/gui/RattyGuiController.java

@ -421,11 +421,16 @@ public final class RattyGuiController extends AbstractRattyController implements
final String location = packet.getLocation(); final String location = packet.getLocation();
final String os = packet.getOs(); final String os = packet.getOs();
final String version = packet.getVersion(); final String version = packet.getVersion();
final String address = client.getAddress();
final Notification notification = new Notification(name + " " + address);
client.logIn(name, location, os, version); client.logIn(name, location, os, version);
client.addListener(this); client.addListener(this);
gui.addRow(client); gui.addRow(client);
notification.trigger();
PING.play();
} }
@Override @Override
@ -453,8 +458,6 @@ public final class RattyGuiController extends AbstractRattyController implements
super.connected(server, connection); super.connected(server, connection);
clients.put(connection, client); clients.put(connection, client);
PING.play();
} }
@Override @Override

Loading…
Cancel
Save