Skip to content

Commit

Permalink
Remove the option move-to-systray
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Oct 7, 2015
1 parent e14599c commit e7fca1b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 161 deletions.
50 changes: 0 additions & 50 deletions src/main/java/net/sf/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ void addAction(Action a) {

private final FileHistory fileHistory = new FileHistory(prefs, this);

private SysTray sysTray;

// The help window.
public final HelpDialog helpDiag = new HelpDialog(this);

Expand Down Expand Up @@ -850,11 +848,6 @@ private void tearDownJabRef(Vector<String> filenames) {

prefs.flush();

// hide systray because the JVM can only shut down when no systray icon is shown
if (sysTray != null) {
sysTray.hide();
}

// dispose all windows, even if they are not displayed anymore
for (Window window : Window.getWindows()) {
window.dispose();
Expand Down Expand Up @@ -1229,7 +1222,6 @@ private void fillMenu() {

file.addSeparator();
file.add(close);
file.add(new MinimizeToSysTrayAction());
file.add(quit);
mb.add(file);
//edit.add(test);
Expand Down Expand Up @@ -1875,10 +1867,6 @@ public void run() {
openInNew);
diag.addEntries(entries);
diag.entryListComplete();
// On the one hand, the following statement could help at issues when JabRef is minimized to the systray
// On the other hand, users might dislake modality and this is not required to let the GUI work.
// Therefore, it is disabled.
// diag.setModal(true);
Util.placeDialog(diag, JabRefFrame.this);
diag.setVisible(true);
diag.toFront();
Expand Down Expand Up @@ -2478,44 +2466,6 @@ public void actionPerformed(ActionEvent event) {
}
}

class MinimizeToSysTrayAction extends MnemonicAwareAction {

public MinimizeToSysTrayAction() {
putValue(Action.NAME, Localization.menuTitle("Minimize to system tray"));
putValue(Action.ACCELERATOR_KEY, Globals.prefs.getKey("Minimize to system tray"));
}

@Override
public void actionPerformed(ActionEvent event) {
if (sysTray == null) {
sysTray = new SysTray(JabRefFrame.this);
}
SwingUtilities.invokeLater(new Runnable() {

@Override
public void run() {
sysTray.show();
JabRefFrame.this.setVisible(false);
}
});
}
}


public void showIfMinimizedToSysTray() {
// TODO: does not work correctly when a dialog is shown
// Workaround: put into invokeLater queue before a dialog is added to that queue
if (!this.isVisible()) {
// isVisible() is false if minimized to systray
if (sysTray != null) {
sysTray.hide();
}
setVisible(true);
this.isActive();
toFront();
}
}

private static class MyGlassPane extends JPanel {

//ForegroundLabel infoLabel = new ForegroundLabel("Showing search");
Expand Down
97 changes: 0 additions & 97 deletions src/main/java/net/sf/jabref/gui/SysTray.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/net/sf/jabref/gui/keyboard/KeyBinds.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class KeyBinds {
public static final String INCREMENTAL_SEARCH = "Incremental search";
public static final String LOAD_SESSION = "Load session";
public static final String MARK_ENTRIES = "Mark entries";
public static final String MINIMIZE_TO_SYSTEM_TRAY = "Minimize to system tray";
public static final String NEW_ARTICLE = "New article";
public static final String NEW_BOOK = "New book";
public static final String NEW_ENTRY = "New entry";
Expand Down Expand Up @@ -212,7 +211,6 @@ public KeyBinds() {
keyBindMap.put(REFRESH_OO, "ctrl alt O");
keyBindMap.put(FILE_LIST_EDITOR_MOVE_ENTRY_UP, "ctrl UP");
keyBindMap.put(FILE_LIST_EDITOR_MOVE_ENTRY_DOWN, "ctrl DOWN");
keyBindMap.put(MINIMIZE_TO_SYSTEM_TRAY, "ctrl alt W");
keyBindMap.put(HIDE_SHOW_TOOLBAR, "ctrl alt T");
}

Expand Down
12 changes: 0 additions & 12 deletions src/main/java/net/sf/jabref/gui/remote/JabRefMessageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ public void handleMessage(String message) {
throw new IllegalStateException("Could not start JabRef with arguments " + message);
}

// put "bringToFront" in the queue
// it has to happen before the call to import as the import might open a dialog
// --> Globals.prefs.getBoolean(JabRefPreferences.USE_IMPORT_INSPECTION_DIALOG)
// this dialog has to be shown AFTER JabRef has been brought to front
SwingUtilities.invokeLater(new Runnable() {

@Override
public void run() {
JabRef.jrf.showIfMinimizedToSysTray();
}
});

for (int i = 0; i < loaded.size(); i++) {
ParserResult pr = loaded.elementAt(i);
JabRef.jrf.addParserResult(pr, i == 0);
Expand Down

0 comments on commit e7fca1b

Please sign in to comment.