OSDN Git Service

Altered the close/minimize to tray options to allow close to tray and minimize to...
authorRandy Baumgarte <randy@fbn.cx>
Thu, 5 Apr 2012 12:16:22 +0000 (08:16 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Thu, 5 Apr 2012 12:16:22 +0000 (08:16 -0400)
src/cx/fbn/nevernote/NeverNote.java
src/cx/fbn/nevernote/dialog/ConfigAppearancePage.java

index 0c3faf0..47c5fe8 100644 (file)
@@ -712,7 +712,7 @@ public class NeverNote extends QMainWindow{
                if (QSystemTrayIcon.isSystemTrayAvailable()) {
                        setWindowIcon(appIcon);
                        trayIcon.setIcon(appIcon);
                if (QSystemTrayIcon.isSystemTrayAvailable()) {
                        setWindowIcon(appIcon);
                        trayIcon.setIcon(appIcon);
-                       if (Global.showTrayIcon())
+                       if (Global.showTrayIcon() || Global.minimizeOnClose())
                                trayIcon.show();
                        else
                                trayIcon.hide();
                                trayIcon.show();
                        else
                                trayIcon.hide();
@@ -1000,7 +1000,7 @@ public class NeverNote extends QMainWindow{
     // Exit point
        @Override
        public void closeEvent(QCloseEvent event) {     
     // Exit point
        @Override
        public void closeEvent(QCloseEvent event) {     
-               if (Global.minimizeOnClose() && !closeAction && Global.showTrayIcon()) {
+               if (Global.minimizeOnClose() && !closeAction) {
                        event.ignore();
                        hide();
                        return;
                        event.ignore();
                        hide();
                        return;
@@ -1247,7 +1247,7 @@ public class NeverNote extends QMainWindow{
         indexRunner.indexNoteTitle = Global.indexNoteTitle();
         indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
         indexRunner.indexImageRecognition = Global.indexImageRecognition();
         indexRunner.indexNoteTitle = Global.indexNoteTitle();
         indexRunner.specialIndexCharacters = Global.getSpecialIndexCharacters();
         indexRunner.indexImageRecognition = Global.indexImageRecognition();
-        if (Global.showTrayIcon())
+        if (Global.showTrayIcon() || Global.minimizeOnClose())
                trayIcon.show();
         else
                trayIcon.hide();
                trayIcon.show();
         else
                trayIcon.hide();
@@ -2748,11 +2748,12 @@ public class NeverNote extends QMainWindow{
                QMessageBox.about(this, 
                                                tr("About NixNote"),
                                                tr("<h4><center><b>NixNote</b></center></h4><hr><center>Version ")
                QMessageBox.about(this, 
                                                tr("About NixNote"),
                                                tr("<h4><center><b>NixNote</b></center></h4><hr><center>Version ")
-                                               +Global.version
+                                               //+Global.version
+                                               +"1.2.120404"
                                                +tr("<hr>"
                                                                +"Open Source Evernote Client.<br><br>" 
                                                                +"Licensed under GPL v2.  <br><hr><br>"
                                                +tr("<hr>"
                                                                +"Open Source Evernote Client.<br><br>" 
                                                                +"Licensed under GPL v2.  <br><hr><br>"
-                                                               +"</center>Evernote is copyright 2001-2010 by Evernote Corporation<br>"
+                                                               +"</center>Evernote is copyright 2001-2012 by Evernote Corporation<br>"
                                                                +"Jambi and QT are the licensed trademark of Nokia Corporation<br>"
                                                                +"PDFRenderer is licened under the LGPL<br>"
                                                                +"JTidy is copyrighted under the World Wide Web Consortium<br>"
                                                                +"Jambi and QT are the licensed trademark of Nokia Corporation<br>"
                                                                +"PDFRenderer is licened under the LGPL<br>"
                                                                +"JTidy is copyrighted under the World Wide Web Consortium<br>"
@@ -6356,7 +6357,7 @@ public class NeverNote extends QMainWindow{
        public void changeEvent(QEvent e) {
                if (e.type() == QEvent.Type.WindowStateChange) {
                        if (QSystemTrayIcon.isSystemTrayAvailable()) {
        public void changeEvent(QEvent e) {
                if (e.type() == QEvent.Type.WindowStateChange) {
                        if (QSystemTrayIcon.isSystemTrayAvailable()) {
-                               if (isMinimized() && Global.showTrayIcon()) {
+                               if (isMinimized() && (Global.showTrayIcon() || Global.showTrayIcon())) {
                                        e.accept();
                                        QTimer.singleShot(10, this, "hide()");
                                        return;
                                        e.accept();
                                        QTimer.singleShot(10, this, "hide()");
                                        return;
index bef269e..75b7369 100644 (file)
@@ -142,7 +142,7 @@ public class ConfigAppearancePage extends QWidget {
                mimicEvernote = new QCheckBox(tr("Mimic Evernote Selection Behavior (Requires Restart)"));\r
                showSplashScreen = new QCheckBox(tr("Show Splash Screen on Startup"));\r
                showTrayIcon = new QCheckBox(tr("Minimize To Tray"));\r
                mimicEvernote = new QCheckBox(tr("Mimic Evernote Selection Behavior (Requires Restart)"));\r
                showSplashScreen = new QCheckBox(tr("Show Splash Screen on Startup"));\r
                showTrayIcon = new QCheckBox(tr("Minimize To Tray"));\r
-               minimizeOnClose = new QCheckBox(tr("Minimize On Close"));\r
+               minimizeOnClose = new QCheckBox(tr("Close To Tray"));\r
                if (!QSystemTrayIcon.isSystemTrayAvailable()) { \r
                        showTrayIcon.setEnabled(false);\r
                        minimizeOnClose.setEnabled(false);\r
                if (!QSystemTrayIcon.isSystemTrayAvailable()) { \r
                        showTrayIcon.setEnabled(false);\r
                        minimizeOnClose.setEnabled(false);\r
@@ -214,14 +214,14 @@ public class ConfigAppearancePage extends QWidget {
        }\r
        \r
        private void showTrayIconClicked(Boolean checked) {\r
        }\r
        \r
        private void showTrayIconClicked(Boolean checked) {\r
-               if (!checked) {\r
-                       minimizeOnClose.setEnabled(false);\r
-                       minimizeOnClose.setChecked(false);\r
-               } else\r
-                       if (QSystemTrayIcon.isSystemTrayAvailable()) \r
-                               minimizeOnClose.setEnabled(true);\r
-                       else\r
-                               minimizeOnClose.setEnabled(false);\r
+//             if (!checked) {\r
+//                     minimizeOnClose.setEnabled(false);\r
+//                     minimizeOnClose.setChecked(false);\r
+//             } else\r
+//                     if (QSystemTrayIcon.isSystemTrayAvailable()) \r
+//                             minimizeOnClose.setEnabled(true);\r
+//                     else\r
+//                             minimizeOnClose.setEnabled(false);\r
        }\r
 \r
        \r
        }\r
 \r
        \r