Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes - prepping for Baragon update (1.1.1) #77

Merged
merged 16 commits into from Jun 29, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 19 additions & 9 deletions src/components/MouseEventTool/MouseEventTool-win32.cpp
Expand Up @@ -30,7 +30,7 @@ static MouseEventTool* myself;
static HWND mainHWND;
static DWORD mainPID;

#define _DEBUG_
//#define _DEBUG_

#ifdef _DEBUG_
static std::wofstream _log;
Expand Down Expand Up @@ -187,19 +187,23 @@ NS_IMETHODIMP MouseEventTool::RemapButton(const char *processName, PRInt16 input
{
// get vector for input event
AppSignalPairVec* aspv = getVecFromInputValue(inputEvent);

// if process name exists in vector, reset its output
for (AppSignalPairVec::iterator i = aspv->begin(); i != aspv->end(); ++i)
for (AppSignalPairVec::iterator i = aspv->begin(); i != aspv->end();)
{
AppSignalPair p = *i;
if (strcmp(p.first, processName) == 0)
if (strcmp(p.first.c_str(), processName) == 0)
{
p.second = outputEvent;
return S_OK;
#ifdef _DEBUG_
_log << "Replacing button map for " << processName << " input: " << inputEvent << " output: " << outputEvent << std::endl;
#endif
aspv->erase(i);
} else {
++i;
}
}

aspv->push_back(std::make_pair(processName, outputEvent));
aspv->push_back(std::make_pair(std::string(processName), outputEvent));

// otherwise, add a new pair to the vector
return S_OK;
Expand All @@ -212,13 +216,15 @@ NS_IMETHODIMP MouseEventTool::UnmapButton(const char *processName, PRInt16 input
AppSignalPairVec* aspv = getVecFromInputValue(inputEvent);

// if process name exists in vector, remove it
for (AppSignalPairVec::iterator i = aspv->begin(); i != aspv->end(); ++i)
for (AppSignalPairVec::iterator i = aspv->begin(); i != aspv->end();)
{
AppSignalPair p = *i;
if (strcmp(p.first, processName) == 0)
if (strcmp(p.first.c_str(), processName) == 0)
{
aspv->erase(i);
return S_OK;
} else {
++i;
}
}

Expand Down Expand Up @@ -328,6 +334,10 @@ bool MouseEventTool::HandleMouseEvent(WPARAM wParam, LPARAM lParam)
return false;
}


#ifdef _DEBUG_
_log << "number of mappings for " << wParam << ": " << aspv->size() << std::endl;
#endif
if (aspv->size() > 0) {
AppSignalPair p = aspv->at(0);
short signalToSend = p.second;
Expand Down
2 changes: 1 addition & 1 deletion src/components/MouseEventTool/MouseEventTool.h
Expand Up @@ -25,7 +25,7 @@
#include <fstream>
#include "windows.h"

typedef std::pair<const char*,short> AppSignalPair;
typedef std::pair<std::string, short> AppSignalPair;
typedef std::vector<AppSignalPair> AppSignalPairVec;
#else //WIN32
#ifdef __APPLE__
Expand Down
Binary file modified src/components/MouseEventTool/bin/MouseEventTool.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion src/kylo/application.ini
Expand Up @@ -16,7 +16,7 @@ Vendor=Hillcrest Labs
Name=Kylo
;
; This field specifies your application's version. This field is optional.
Version=1.1.0
Version=1.1.1

; This field specifies your application's build ID (timestamp). This field is
; required.
Expand Down
46 changes: 45 additions & 1 deletion src/kylo/chrome/polo/content/about/help.xul
Expand Up @@ -228,12 +228,38 @@
<vbox flex="1">
<description>&help.shortcutBookmark;</description>
</vbox>
</hbox>
</hbox>

<hbox class="faq-item">
<description class="faq-title">&help.keyboardTitle;</description>
</hbox>

<hbox class="faq-item" hint="menu">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.shortcutHelp;</description>
</vbox>
</hbox>

<!-- Windows specific keyboard shortcuts -->
<hbox class="faq-item os-win32" hint="menu">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.win32.shortcutSettings;</description>
</vbox>
</hbox>
<hbox class="faq-item os-win32" hint="menu">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.win32.shortcutDownloads;</description>
</vbox>
</hbox>
<hbox class="faq-item os-win32" hint="bookmarks">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.win32.shortcutBookmarks;</description>
</vbox>
</hbox>
<hbox class="faq-item os-win32" hint="keyboard">
<image class="icon-keyboard" />
<vbox flex="1">
Expand Down Expand Up @@ -302,6 +328,24 @@
</hbox>

<!-- Mac OSX specific keyboard shortcuts -->
<hbox class="faq-item os-osx" hint="menu">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.osx.shortcutSettings;</description>
</vbox>
</hbox>
<hbox class="faq-item os-osx" hint="menu">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.osx.shortcutDownloads;</description>
</vbox>
</hbox>
<hbox class="faq-item os-osx" hint="bookmarks">
<image class="icon-keyboard" />
<vbox flex="1">
<description>&help.osx.shortcutBookmarks;</description>
</vbox>
</hbox>
<hbox class="faq-item os-osx" hint="keyboard">
<image class="icon-keyboard" />
<vbox flex="1">
Expand Down
41 changes: 38 additions & 3 deletions src/kylo/chrome/polo/content/about/settings.js
Expand Up @@ -408,9 +408,6 @@ var ZoomSettings = {
setDefaultZoom: function () {
var radioGroup = document.getElementById("default-zoom");
gPrefService.getBranch("polo.").setCharPref("defaultZoomLevel", radioGroup.value);
// This is duplicated when the setting change is observed, but this is visually
// better because it shows instantly.
chromeWin_.browser_.getCurrentBrowserObject().setZoomLevel(radioGroup.value);
},

observe: function (subject, topic, pref) {
Expand Down Expand Up @@ -617,6 +614,44 @@ var Settings = {
gPrefService.setBoolPref("keyboard.autolaunch.focusLock", elem.value);
},

promptRestart: function (elem) {
if (Settings.promptRestart._isPrompting) {
return;
}
Settings.promptRestart._isPrompting = true;

if (gPromptService.confirm(window,
i18nStrings_.getString("settings.promptRestartTitle"),
i18nStrings_.getString("settings.promptRestartBody").replace("%S",
document.getElementById("brandStrings").getString("brandShortName"))
)) {
// Restart the app
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
"restart");
if (cancelQuit.data)
return; // somebody canceled our quit request

elem.valueToPreference();

let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
getService(Ci.nsIAppStartup);
appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
} else {
switch (elem.type) {
case "bool":
elem.value = !elem.value;
elem.valueToPreference();
break;
default:
break;
}
}

Settings.promptRestart._isPrompting = false;
},

showOpenTabChooser: function (title, ok, cancel, cb) {

var okBtn = document.getElementById("tab-chooser-ok");
Expand Down