-
Notifications
You must be signed in to change notification settings - Fork 27
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
Added customize title bar options #212
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,20 +15,36 @@ variables: { | |
return this._appInfo; | ||
}, | ||
|
||
get titleversion() { return this.tabtitle + ' - ' + this.vendor + ' ' + this.name + ' ' + this.versionchannel + ' (' + this.appbuildid + ')'; }, | ||
get defaulttitle() { return nightlyApp.defaultTitle; }, | ||
get tabtitle() { return nightlyApp.tabTitle; }, | ||
get appid() this.appInfo.ID, | ||
brandname: null, | ||
get vendor() { | ||
// Fix for vendor not being set in Mozilla Thunderbird | ||
return this.appInfo.name == "Thunderbird" && this.appInfo.vendor == "" ? "Mozilla" : this.appInfo.vendor; | ||
}, | ||
get name() this.appInfo.name, | ||
get version() this.appInfo.version, | ||
get appbuildid() this.appInfo.appBuildID, | ||
get platformbuildid() this.appInfo.platformBuildID, | ||
get versionpretty() { return nightly.makeVersionPretty(this.version); }, | ||
get displayversion() { | ||
var ver = this.version; | ||
try { | ||
// The import is only required in Mozilla Thunderbird | ||
Components.utils.import("resource://gre/modules/AppConstants.jsm"); | ||
if (AppConstants.MOZ_APP_VERSION_DISPLAY) { ver = AppConstants.MOZ_APP_VERSION_DISPLAY; } | ||
} | ||
catch (e) {} | ||
return ver; | ||
}, | ||
get channel() { return nightly.updateChannel(); }, | ||
get channelpretty() { return nightly.updateChannelPretty(); }, | ||
get betaversion() { return nightly.betaVersion(this.version, this.displayversion); }, | ||
get versionchannel() { return nightly.versionAndChannel(this.version, this.displayversion); }, | ||
get platformversion() this.appInfo.platformVersion, | ||
get geckobuildid() this.appInfo.platformBuildID, | ||
get geckoversion() this.appInfo.platformVersion, | ||
get platformbuildid() this.appInfo.platformBuildID, | ||
get appbuildid() this.appInfo.appBuildID, | ||
get changeset() { return nightly.getChangeset(); }, | ||
brandname: null, | ||
get useragent() navigator.userAgent, | ||
get locale() { | ||
var registry = Components.classes["@mozilla.org/chrome/chrome-registry;1"] | ||
|
@@ -38,11 +54,9 @@ variables: { | |
get os() this.appInfo.OS, | ||
get processor() this.appInfo.XPCOMABI.split("-")[0], | ||
get compiler() this.appInfo.XPCOMABI.split(/-(.*)$/)[1], | ||
get defaulttitle() { return nightlyApp.defaultTitle; }, | ||
get tabscount() { return nightlyApp.tabsCount; }, | ||
get tabtitle() { return nightlyApp.tabTitle; }, | ||
profile: null, | ||
toolkit: "cairo", | ||
profile: null, | ||
get tabscount() { return nightlyApp.tabsCount; }, | ||
flags: "" | ||
}, | ||
|
||
|
@@ -259,6 +273,41 @@ parseHTML: function(url, callback) { | |
frame.contentDocument.location.href = url; | ||
}, | ||
|
||
makeVersionPretty: function(ver) { | ||
ver = ver.replace('0a2','0.0.0'); | ||
ver = ver.replace('0a1','0.0.0'); | ||
while (ver.match(new RegExp('\\.','g')).length < 3) { ver += '.0'; } | ||
return ver; | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the benefit of that? It would not allow to see what version is actually in use. I don't think this is useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function provides an additional variable, in which all version numbers have the same format (x.x.x.x). So is doesn't change version 2.0.0.20, but for example version 48.0 becomes 48.0.0.0 (so it's easier to see you're not running for example 48.0.1) and version 48.0.2 becomes 48.0.2.0, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't see a benefit here. We should keep the version numbers as used by Firefox and should not modify them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just an optional additional variable with the version number in a fixed format, next to the variable with the unmodified (non-fixed) format as used by Firefox (etc.), for those who prefer to display the version number in a fixed format. Or do you want me to remove this additional variable from this PR? |
||
updateChannel: function() { | ||
return Services.prefs.getCharPref("app.update.channel"); | ||
}, | ||
updateChannelPretty: function() { | ||
var channel = nightly.updateChannel(); | ||
if (channel == 'release') { channel = 'Release' } | ||
else if (channel == 'esr') { channel = 'ESR' } | ||
else if (channel == 'beta') { channel = 'beta' } | ||
else if (channel == 'aurora') { channel = 'Aurora' } | ||
else if (channel == 'nightly') { channel = 'Nighty' } | ||
else if (channel == 'default') { channel = 'Default' } | ||
else channel = ''; | ||
return channel; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question as above. Is that method useful? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function provides an additional variable with a more readable channel name, with or in uppercase where needed, to show in the title bar. I prefer this above the all lowercase channel name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What makes it better readable? We could implement a general "make first letter uppercase" checkbox instead for all variable types later. But I don't see that it is necessary for all of our users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A general "make first letter uppercase" would result in for example |
||
}, | ||
betaVersion: function(ver, displayversion) { | ||
var beta = displayversion.replace(ver + 'b',''); | ||
if (beta == displayversion) { beta = ''; }; | ||
return beta; | ||
}, | ||
versionAndChannel: function(ver, displayversion) { | ||
var channel = nightly.updateChannelPretty(); | ||
var beta = nightly.betaVersion(ver, displayversion); | ||
if (channel == 'Release' || channel == 'Default') { channel = ''; } | ||
if (channel == 'beta' && beta != '') { channel += ' ' + beta; } | ||
ver = nightly.makeVersionPretty(ver); | ||
if (channel != '') { ver += ' ' + channel; } | ||
return ver; | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar as above. I'm not such a fun of all this combined strings. It will be better to allow the user to configure it in any order he/she wants. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function provides an additional variable, which displays the channel only when it's special (ESR, beta, Aurora, Nighty), but otherwise (Release, Default) not. In that case this variable only displays the version number. Also this function displays the beta revision (for example " So I think this additional variable is useful, without combining too many strings. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like that we break down variables to every little fraction. We should have application name, version, channel which should cover this all like:
Lets not overcomplicate everthing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's |
||
|
||
pastebinAboutSupport: function() { | ||
nightly.parseHTML("about:support", function(doc) { | ||
var contents = doc.getElementById("contents"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,26 +83,33 @@ init: function(aEvent) | |
|
||
paneTitle.bundle=document.getElementById("variablesBundle"); | ||
|
||
paneTitle.addVariable("AppBuildID"); | ||
paneTitle.addVariable("TitleVersion"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This completely messed-up the alphabetical order. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of the variables is per kind now, to make it easier to pick the preferred values between the various similar values to display in the title bar. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as said above. I would prefer to discuss this separately in a different issue if that is necessary to do for the ui. Also adding new variables and changing so many existing ones in a single commit makes it very hard to review. In the future you should try to splitup individual changes across different commits. |
||
paneTitle.addVariable("DefaultTitle"); | ||
paneTitle.addVariable("TabTitle"); | ||
paneTitle.addVariable("AppID"); | ||
paneTitle.addVariable("BrandName"); | ||
paneTitle.addVariable("Vendor"); | ||
paneTitle.addVariable("Name"); | ||
paneTitle.addVariable("Version"); | ||
paneTitle.addVariable("VersionPretty"); | ||
paneTitle.addVariable("DisplayVersion"); | ||
paneTitle.addVariable("Channel"); | ||
paneTitle.addVariable("ChannelPretty"); | ||
paneTitle.addVariable("BetaVersion"); | ||
paneTitle.addVariable("VersionChannel"); | ||
paneTitle.addVariable("PlatformVersion"); | ||
paneTitle.addVariable("PlatformBuildID"); | ||
paneTitle.addVariable("AppBuildID"); | ||
paneTitle.addVariable("Changeset"); | ||
paneTitle.addVariable("Compiler"); | ||
paneTitle.addVariable("DefaultTitle"); | ||
paneTitle.addVariable("GeckoVersion"); | ||
paneTitle.addVariable("UserAgent"); | ||
paneTitle.addVariable("Locale"); | ||
paneTitle.addVariable("Name"); | ||
paneTitle.addVariable("OS"); | ||
paneTitle.addVariable("PlatformBuildID"); | ||
paneTitle.addVariable("PlatformVersion"); | ||
paneTitle.addVariable("Processor"); | ||
paneTitle.addVariable("Compiler"); | ||
paneTitle.addVariable("Toolkit"); | ||
paneTitle.addVariable("Profile"); | ||
paneTitle.addVariable("TabsCount"); | ||
paneTitle.addVariable("TabTitle"); | ||
paneTitle.addVariable("Toolkit"); | ||
paneTitle.addVariable("UserAgent"); | ||
paneTitle.addVariable("Vendor"); | ||
paneTitle.addVariable("Version"); | ||
|
||
paneTitle.setupTree(); | ||
}, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to review if you wouldn't have moved around existing lines. Another commit would have been good for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also moving those lines would have made sense if those would be in alphabetical order now. But that is still not the case. Mind doing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Title bar Variables are grouped per kind now.
I don't think an alphabetical order would provide a clear overview of the different variables with (partly) similar values (and if you would sort alphabetically, which row would you sort alphabetically? Variable? Description? Value?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common identifiers could be used first eg. titleDefault, titleTab. But whatever we use then other related variables like for tabs in this case are no longer grouped together. So whatever you do it will not be perfect.