Added version and platform to the update check user agent, and

rearranged some settings and strings.
This commit is contained in:
casey langen 2017-06-28 10:14:08 -07:00
parent 81d38a9688
commit 311909db2e
3 changed files with 17 additions and 11 deletions

View File

@ -255,9 +255,9 @@ void SettingsLayout::OnLayout() {
this->localeDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->outputDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->transportDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->pluginsDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->themeDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->hotkeyDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
this->pluginsDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
if (serverAvailable) {
this->serverDropdown->MoveAndResize(column1, y++, columnCx, LABEL_HEIGHT);
@ -276,7 +276,6 @@ void SettingsLayout::OnLayout() {
this->startMinimizedCheckbox->MoveAndResize(column2, y++, columnCx, LABEL_HEIGHT);
#endif
++y;
this->updateDropdown->MoveAndResize(column2, y++, columnCx, LABEL_HEIGHT);
}
@ -345,10 +344,6 @@ void SettingsLayout::InitializeWindows() {
this->transportDropdown.reset(new TextLabel());
this->transportDropdown->Activated.connect(this, &SettingsLayout::OnTransportDropdownActivate);
this->pluginsDropdown.reset(new TextLabel());
this->pluginsDropdown->SetText(arrow + _TSTR("settings_enable_disable_plugins"));
this->pluginsDropdown->Activated.connect(this, &SettingsLayout::OnPluginsDropdownActivate);
this->themeDropdown.reset(new TextLabel());
this->themeDropdown->SetText(arrow + _TSTR("settings_color_theme") + _TSTR("settings_default_theme_name"));
this->themeDropdown->Activated.connect(this, &SettingsLayout::OnThemeDropdownActivate);
@ -357,6 +352,10 @@ void SettingsLayout::InitializeWindows() {
this->hotkeyDropdown->SetText(arrow + _TSTR("settings_hotkey_tester"));
this->hotkeyDropdown->Activated.connect(this, &SettingsLayout::OnHotkeyDropdownActivate);
this->pluginsDropdown.reset(new TextLabel());
this->pluginsDropdown->SetText(arrow + _TSTR("settings_enable_disable_plugins"));
this->pluginsDropdown->Activated.connect(this, &SettingsLayout::OnPluginsDropdownActivate);
if (this->serverAvailable) {
this->serverDropdown.reset(new TextLabel());
this->serverDropdown->SetText(arrow + _TSTR("settings_server_setup"));
@ -386,9 +385,9 @@ void SettingsLayout::InitializeWindows() {
this->localeDropdown->SetFocusOrder(order++);
this->outputDropdown->SetFocusOrder(order++);
this->transportDropdown->SetFocusOrder(order++);
this->pluginsDropdown->SetFocusOrder(order++);
this->themeDropdown->SetFocusOrder(order++);
this->hotkeyDropdown->SetFocusOrder(order++);
this->pluginsDropdown->SetFocusOrder(order++);
if (this->serverAvailable) {
this->serverDropdown->SetFocusOrder(order++);
@ -414,7 +413,6 @@ void SettingsLayout::InitializeWindows() {
this->AddWindow(this->localeDropdown);
this->AddWindow(this->outputDropdown);
this->AddWindow(this->transportDropdown);
this->AddWindow(this->pluginsDropdown);
this->AddWindow(this->themeDropdown);
if (this->serverAvailable) {
@ -425,6 +423,8 @@ void SettingsLayout::InitializeWindows() {
this->AddWindow(this->paletteCheckbox);
#endif
this->AddWindow(this->hotkeyDropdown);
this->AddWindow(this->pluginsDropdown);
this->AddWindow(this->dotfileCheckbox);
this->AddWindow(this->syncOnStartupCheckbox);
this->AddWindow(this->removeCheckbox);

View File

@ -78,6 +78,12 @@ static inline std::string formattedVersion(short major, short minor, short patch
return boost::str(boost::format("%d.%d.%d") % major % minor % patch);
}
static inline std::string getUserAgent() {
return boost::str(boost::format("musikbox %s (%s)")
% formattedVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
% PLATFORM);
}
size_t UpdateCheck::curlWriteCallback(char *ptr, size_t size, size_t nmemb, void *userdata) {
if (ptr && userdata) {
UpdateCheck* context = static_cast<UpdateCheck*>(userdata);
@ -113,7 +119,7 @@ bool UpdateCheck::Run(Callback callback) {
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "musikcube UpdateCheck");
curl_easy_setopt(curl, CURLOPT_USERAGENT, getUserAgent().c_str());
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curlWriteCallback);

View File

@ -27,7 +27,7 @@
"settings_space_to_add": "browse (SPACE to add)",
"settings_backspace_to_remove": "indexed paths (BACKSPACE to remove)",
"settings_enable_disable_plugins": "enable/disable plugins",
"settings_enable_disable_plugins": "plugin manager",
"settings_color_theme": "color theme: ",
"settings_hotkey_tester": "hotkey tester",
"settings_output_device": "output device: ",
@ -102,7 +102,7 @@
"visualizer_overlay_title": "visualizers",
"visualizer_overlay_no_visualizers_message": "no visualizers found!",
"plugin_overlay_title": "plugins",
"plugin_overlay_title": "configure plugins",
"shortcuts_settings": "settings",
"shortcuts_library": "library",