Skip to content

Commit

Permalink
Correct tray icon preferences being changed accidentally.
Browse files Browse the repository at this point in the history
  • Loading branch information
baumgarr committed Aug 8, 2017
1 parent 82865e0 commit c347bfd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
30 changes: 15 additions & 15 deletions dialog/preferences/appearancepreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ AppearancePreferences::AppearancePreferences(QWidget *parent) :
fontPreviewInDialog->setChecked(global.previewFontsInDialog());

traySingleClickAction = new QComboBox();
traySingleClickAction->addItem(tr("Do Nothing"), -1);
traySingleClickAction->addItem(tr("Show/Hide NixNote"), 0);
traySingleClickAction->addItem(tr("New Text Note"), 1);
traySingleClickAction->addItem(tr("New Quick Note"), 2);
traySingleClickAction->addItem(tr("Screen Capture"), 3);
traySingleClickAction->addItem(tr("Do Nothing"), 0);
traySingleClickAction->addItem(tr("Show/Hide NixNote"), 1);
traySingleClickAction->addItem(tr("New Text Note"), 2);
traySingleClickAction->addItem(tr("New Quick Note"), 3);
traySingleClickAction->addItem(tr("Screen Capture"), 4);

trayMiddleClickAction = new QComboBox();
trayMiddleClickAction->addItem(tr("Do Nothing"), -1);
trayMiddleClickAction->addItem(tr("Show/Hide NixNote"), 0);
trayMiddleClickAction->addItem(tr("New Text Note"), 1);
trayMiddleClickAction->addItem(tr("New Quick Note"), 2);
trayMiddleClickAction->addItem(tr("Screen Capture"), 3);
trayMiddleClickAction->addItem(tr("Do Nothing"), 0);
trayMiddleClickAction->addItem(tr("Show/Hide NixNote"), 1);
trayMiddleClickAction->addItem(tr("New Text Note"), 2);
trayMiddleClickAction->addItem(tr("New Quick Note"), 3);
trayMiddleClickAction->addItem(tr("Screen Capture"), 4);

trayDoubleClickAction = new QComboBox();
trayDoubleClickAction->addItem(tr("Do Nothing"), -1);
trayDoubleClickAction->addItem(tr("Show/Hide NixNote"), 0);
trayDoubleClickAction->addItem(tr("New Text Note"), 1);
trayDoubleClickAction->addItem(tr("New Quick Note"), 2);
trayDoubleClickAction->addItem(tr("Screen Capture"), 3);
trayDoubleClickAction->addItem(tr("Do Nothing"), 0);
trayDoubleClickAction->addItem(tr("Show/Hide NixNote"), 1);
trayDoubleClickAction->addItem(tr("New Text Note"), 2);
trayDoubleClickAction->addItem(tr("New Quick Note"), 3);
trayDoubleClickAction->addItem(tr("Screen Capture"), 4);

mouseMiddleClickAction = new QComboBox();
mouseMiddleClickAction->addItem(tr("Open New Tab"), MOUSE_MIDDLE_CLICK_NEW_TAB);
Expand Down
16 changes: 8 additions & 8 deletions nixnote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2842,15 +2842,15 @@ void NixNote::toggleVisible() {
// The tray icon was activated. If it was double clicked we restore the
// gui.
void NixNote::trayActivated(QSystemTrayIcon::ActivationReason reason) {
int doNothing = -1;
int showHide = 0;
int newNote = 1;
int newQuickNote = 2;
int screenCapture = 3;
int doNothing = 0;
int showHide = 1;
int newNote = 2;
int newQuickNote = 3;
int screenCapture = 4;

if (reason == QSystemTrayIcon::DoubleClick) {
global.settings->beginGroup("Appearance");
int value = global.settings->value("trayDoubleClickAction", 0).toInt();
int value = global.settings->value("trayDoubleClickAction", -1).toInt();
global.settings->endGroup();
if (value == doNothing)
return;
Expand All @@ -2868,7 +2868,7 @@ void NixNote::trayActivated(QSystemTrayIcon::ActivationReason reason) {
}
if (reason == QSystemTrayIcon::MiddleClick) {
global.settings->beginGroup("Appearance");
int value = global.settings->value("trayMiddleClickAction", 0).toInt();
int value = global.settings->value("trayMiddleClickAction", -1).toInt();
global.settings->endGroup();
if (value == doNothing)
return;
Expand All @@ -2886,7 +2886,7 @@ void NixNote::trayActivated(QSystemTrayIcon::ActivationReason reason) {
}
if (reason == QSystemTrayIcon::Trigger) {
global.settings->beginGroup("Appearance");
int value = global.settings->value("traySingleClickAction", 0).toInt();
int value = global.settings->value("traySingleClickAction", -1).toInt();
global.settings->endGroup();
if (value == doNothing)
return;
Expand Down

0 comments on commit c347bfd

Please sign in to comment.