Tooltips to every element!

This commit is contained in:
Stanislav Nikitin 2016-10-04 19:21:48 +05:00
parent 1394724a43
commit d6765501a8
3 changed files with 38 additions and 4 deletions

View File

@ -150,6 +150,7 @@ func (m *MainWindow) Initialize() {
// Profile selection. // Profile selection.
profiles_label := gtk.NewLabel("Game profile:") profiles_label := gtk.NewLabel("Game profile:")
m.profiles = gtk.NewComboBoxText() m.profiles = gtk.NewComboBoxText()
m.profiles.SetTooltipText("Profile which will be used for launching")
profile_and_launch_hbox.PackStart(profiles_label, false, true, 5) profile_and_launch_hbox.PackStart(profiles_label, false, true, 5)
profile_and_launch_hbox.PackStart(m.profiles, false, true, 5) profile_and_launch_hbox.PackStart(m.profiles, false, true, 5)
@ -162,6 +163,7 @@ func (m *MainWindow) Initialize() {
// Game launching button. // Game launching button.
m.launch_button = gtk.NewButtonWithLabel("Launch!") m.launch_button = gtk.NewButtonWithLabel("Launch!")
m.launch_button.SetTooltipText("Launch Urban Terror")
m.launch_button.Clicked(m.launchGame) m.launch_button.Clicked(m.launchGame)
profile_and_launch_hbox.PackStart(m.launch_button, false, true, 5) profile_and_launch_hbox.PackStart(m.launch_button, false, true, 5)
@ -311,6 +313,7 @@ func (m *MainWindow) InitializeTabs() {
// Checkbox for hiding offline servers. // Checkbox for hiding offline servers.
m.all_servers_hide_offline = gtk.NewCheckButtonWithLabel("Hide offline servers") m.all_servers_hide_offline = gtk.NewCheckButtonWithLabel("Hide offline servers")
m.all_servers_hide_offline.SetTooltipText("Hide offline servers on Servers tab")
tab_all_srv_ctl_vbox.PackStart(m.all_servers_hide_offline, false, true, 5) tab_all_srv_ctl_vbox.PackStart(m.all_servers_hide_offline, false, true, 5)
m.all_servers_hide_offline.Clicked(m.hideOfflineAllServers) m.all_servers_hide_offline.Clicked(m.hideOfflineAllServers)
@ -342,6 +345,7 @@ func (m *MainWindow) InitializeTabs() {
// Checkbox for hiding offline servers. // Checkbox for hiding offline servers.
m.fav_servers_hide_offline = gtk.NewCheckButtonWithLabel("Hide offline servers") m.fav_servers_hide_offline = gtk.NewCheckButtonWithLabel("Hide offline servers")
m.fav_servers_hide_offline.SetTooltipText("Hide offline servers on Favorites tab")
tab_fav_srv_ctl_vbox.PackStart(m.fav_servers_hide_offline, false, true, 5) tab_fav_srv_ctl_vbox.PackStart(m.fav_servers_hide_offline, false, true, 5)
m.fav_servers_hide_offline.Clicked(m.hideOfflineFavoriteServers) m.fav_servers_hide_offline.Clicked(m.hideOfflineFavoriteServers)
@ -362,6 +366,7 @@ func (m *MainWindow) InitializeToolbar() {
// Update servers button. // Update servers button.
button_update_all_servers := gtk.NewToolButtonFromStock(gtk.STOCK_REFRESH) button_update_all_servers := gtk.NewToolButtonFromStock(gtk.STOCK_REFRESH)
button_update_all_servers.SetLabel("Update all servers") button_update_all_servers.SetLabel("Update all servers")
button_update_all_servers.SetTooltipText("Update all servers in all tabs")
button_update_all_servers.OnClicked(m.UpdateServers) button_update_all_servers.OnClicked(m.UpdateServers)
m.toolbar.Insert(button_update_all_servers, 0) m.toolbar.Insert(button_update_all_servers, 0)
@ -372,6 +377,7 @@ func (m *MainWindow) InitializeToolbar() {
// Add server to favorites button. // Add server to favorites button.
fav_button := gtk.NewToolButtonFromStock(gtk.STOCK_ADD) fav_button := gtk.NewToolButtonFromStock(gtk.STOCK_ADD)
fav_button.SetLabel("Add to favorites") fav_button.SetLabel("Add to favorites")
fav_button.SetTooltipText("Add selected server to favorites")
fav_button.OnClicked(m.addToFavorites) fav_button.OnClicked(m.addToFavorites)
m.toolbar.Insert(fav_button, 2) m.toolbar.Insert(fav_button, 2)
} }

View File

@ -111,10 +111,12 @@ func (o *OptionsDialog) initializeGeneralTab() {
// Tray icon checkbox. // Tray icon checkbox.
o.show_tray_icon = gtk.NewCheckButtonWithLabel("Show tray icon?") o.show_tray_icon = gtk.NewCheckButtonWithLabel("Show tray icon?")
o.show_tray_icon.SetTooltipText("Show icon in tray")
general_vbox.PackStart(o.show_tray_icon, false, true, 5) general_vbox.PackStart(o.show_tray_icon, false, true, 5)
// Autoupdate checkbox. // Autoupdate checkbox.
o.autoupdate = gtk.NewCheckButtonWithLabel("Automatically update URTrator?") o.autoupdate = gtk.NewCheckButtonWithLabel("Automatically update URTrator?")
o.autoupdate.SetTooltipText("Should URTrator check for updates and update itself? Not working now.")
general_vbox.PackStart(o.autoupdate, false, true, 5) general_vbox.PackStart(o.autoupdate, false, true, 5)
o.tab_widget.AppendPage(general_vbox, gtk.NewLabel("General")) o.tab_widget.AppendPage(general_vbox, gtk.NewLabel("General"))
@ -156,6 +158,7 @@ func (o *OptionsDialog) initializeUrtTab() {
// Profiles list. // Profiles list.
o.profiles_list = gtk.NewTreeView() o.profiles_list = gtk.NewTreeView()
o.profiles_list.SetTooltipText("All available profiles")
urt_hbox.Add(o.profiles_list) urt_hbox.Add(o.profiles_list)
o.profiles_list.SetModel(o.profiles_list_store) o.profiles_list.SetModel(o.profiles_list_store)
o.profiles_list.AppendColumn(gtk.NewTreeViewColumnWithAttributes("Profile name", gtk.NewCellRendererText(), "text", 0)) o.profiles_list.AppendColumn(gtk.NewTreeViewColumnWithAttributes("Profile name", gtk.NewCellRendererText(), "text", 0))
@ -167,10 +170,12 @@ func (o *OptionsDialog) initializeUrtTab() {
urt_profiles_buttons_vbox := gtk.NewVBox(false, 0) urt_profiles_buttons_vbox := gtk.NewVBox(false, 0)
button_add := gtk.NewButtonWithLabel("Add") button_add := gtk.NewButtonWithLabel("Add")
button_add.SetTooltipText("Add new profile")
button_add.Clicked(o.addProfile) button_add.Clicked(o.addProfile)
urt_profiles_buttons_vbox.PackStart(button_add, false, true, 5) urt_profiles_buttons_vbox.PackStart(button_add, false, true, 5)
button_edit := gtk.NewButtonWithLabel("Edit") button_edit := gtk.NewButtonWithLabel("Edit")
button_edit.SetTooltipText("Edit selected profile. Do nothing if no profile was selected.")
button_edit.Clicked(o.editProfile) button_edit.Clicked(o.editProfile)
urt_profiles_buttons_vbox.PackStart(button_edit, false, true, 5) urt_profiles_buttons_vbox.PackStart(button_edit, false, true, 5)
@ -179,6 +184,7 @@ func (o *OptionsDialog) initializeUrtTab() {
urt_profiles_buttons_vbox.PackStart(sep, true, true, 5) urt_profiles_buttons_vbox.PackStart(sep, true, true, 5)
button_delete := gtk.NewButtonWithLabel("Delete") button_delete := gtk.NewButtonWithLabel("Delete")
button_delete.SetTooltipText("Delete selected profile. Do nothing if no profile was selected.")
button_delete.Clicked(o.deleteProfile) button_delete.Clicked(o.deleteProfile)
urt_profiles_buttons_vbox.PackStart(button_delete, false, true, 5) urt_profiles_buttons_vbox.PackStart(button_delete, false, true, 5)

View File

@ -128,20 +128,28 @@ func (op *OptionsProfile) Initialize(update bool, lp func()) {
// Profile name. // Profile name.
profile_name_tooltip := "This how you will see profile on profiles lists."
pn_hbox := gtk.NewHBox(false, 0) pn_hbox := gtk.NewHBox(false, 0)
pn_label := gtk.NewLabel("Profile name:") pn_label := gtk.NewLabel("Profile name:")
sep1 := gtk.NewHSeparator() pn_label.SetTooltipText(profile_name_tooltip)
profile_name_sep := gtk.NewHSeparator()
profile_name_sep.SetTooltipText(profile_name_tooltip)
op.profile_name = gtk.NewEntry() op.profile_name = gtk.NewEntry()
op.profile_name.SetTooltipText(profile_name_tooltip)
pn_hbox.PackStart(pn_label, false, true, 5) pn_hbox.PackStart(pn_label, false, true, 5)
pn_hbox.PackStart(sep1, true, true, 5) pn_hbox.PackStart(profile_name_sep, true, true, 5)
pn_hbox.PackStart(op.profile_name, true, true, 5) pn_hbox.PackStart(op.profile_name, true, true, 5)
op.vbox.PackStart(pn_hbox, false, true, 5) op.vbox.PackStart(pn_hbox, false, true, 5)
// Urban Terror version. // Urban Terror version.
urt_version_tooltip := "Urban Terror version for which this profile applies."
urt_version_hbox := gtk.NewHBox(false, 0) urt_version_hbox := gtk.NewHBox(false, 0)
urt_version_label := gtk.NewLabel("Urban Terror version:") urt_version_label := gtk.NewLabel("Urban Terror version:")
urt_version_label.SetTooltipText(urt_version_tooltip)
urt_version_sep := gtk.NewHSeparator() urt_version_sep := gtk.NewHSeparator()
urt_version_sep.SetTooltipText(urt_version_tooltip)
op.urt_version_combo = gtk.NewComboBoxText() op.urt_version_combo = gtk.NewComboBoxText()
op.urt_version_combo.SetTooltipText(urt_version_tooltip)
op.urt_version_combo.AppendText("4.2.023") op.urt_version_combo.AppendText("4.2.023")
op.urt_version_combo.AppendText("4.3.0") op.urt_version_combo.AppendText("4.3.0")
op.urt_version_combo.SetActive(1) op.urt_version_combo.SetActive(1)
@ -151,20 +159,27 @@ func (op *OptionsProfile) Initialize(update bool, lp func()) {
op.vbox.PackStart(urt_version_hbox, false, true, 5) op.vbox.PackStart(urt_version_hbox, false, true, 5)
// Urban Terror binary path. // Urban Terror binary path.
select_binary_tooltip := "Urban Terror binary. Some checks will be executed, so make sure you have selected right binary:\n\nQuake3-UrT.i386 for linux-x86\nQuake3-UrT.x86_64 for linux-amd64\nQuake3-UrT.app for macOS"
binpath_hbox := gtk.NewHBox(false, 0) binpath_hbox := gtk.NewHBox(false, 0)
binpath_label := gtk.NewLabel("Urban Terror binary:") binpath_label := gtk.NewLabel("Urban Terror binary:")
sep2 := gtk.NewHSeparator() binpath_label.SetTooltipText(select_binary_tooltip)
binpath_sep := gtk.NewHSeparator()
binpath_sep.SetTooltipText(select_binary_tooltip)
op.binary_path = gtk.NewEntry() op.binary_path = gtk.NewEntry()
op.binary_path.SetTooltipText(select_binary_tooltip)
button_select_binary := gtk.NewButtonWithLabel("Browse") button_select_binary := gtk.NewButtonWithLabel("Browse")
button_select_binary.SetTooltipText(select_binary_tooltip)
button_select_binary.Clicked(op.browseForBinary) button_select_binary.Clicked(op.browseForBinary)
binpath_hbox.PackStart(binpath_label, false, true, 5) binpath_hbox.PackStart(binpath_label, false, true, 5)
binpath_hbox.PackStart(sep2, true, true, 5) binpath_hbox.PackStart(binpath_sep, true, true, 5)
binpath_hbox.PackStart(op.binary_path, true, true, 5) binpath_hbox.PackStart(op.binary_path, true, true, 5)
binpath_hbox.PackStart(button_select_binary, false, true, 5) binpath_hbox.PackStart(button_select_binary, false, true, 5)
op.vbox.PackStart(binpath_hbox, false, true, 5) op.vbox.PackStart(binpath_hbox, false, true, 5)
// Should we use additional X session? // Should we use additional X session?
another_x_tooltip := "If this is checked, Urban Terror will be launched in another X session.\n\nThis could help if you're experiencing visual lag, glitches and FPS drops under compositing WMs, like Mutter and KWin."
op.another_x_session = gtk.NewCheckButtonWithLabel("Start Urban Terror in another X session?") op.another_x_session = gtk.NewCheckButtonWithLabel("Start Urban Terror in another X session?")
op.another_x_session.SetTooltipText(another_x_tooltip)
op.vbox.PackStart(op.another_x_session, false, true, 5) op.vbox.PackStart(op.another_x_session, false, true, 5)
// macOS can't do that :). // macOS can't do that :).
if runtime.GOOS == "darwin" { if runtime.GOOS == "darwin" {
@ -172,10 +187,14 @@ func (op *OptionsProfile) Initialize(update bool, lp func()) {
} }
// Additional game parameters. // Additional game parameters.
params_tooltip := "Additional parameters that will be passed to Urban Terror executable."
params_hbox := gtk.NewHBox(false, 0) params_hbox := gtk.NewHBox(false, 0)
params_label := gtk.NewLabel("Additional parameters:") params_label := gtk.NewLabel("Additional parameters:")
params_label.SetTooltipText(params_tooltip)
params_sep := gtk.NewHSeparator() params_sep := gtk.NewHSeparator()
params_sep.SetTooltipText(params_tooltip)
op.additional_parameters = gtk.NewEntry() op.additional_parameters = gtk.NewEntry()
op.additional_parameters.SetTooltipText(params_tooltip)
params_hbox.PackStart(params_label, false, true, 5) params_hbox.PackStart(params_label, false, true, 5)
params_hbox.PackStart(params_sep, true, true, 5) params_hbox.PackStart(params_sep, true, true, 5)
params_hbox.PackStart(op.additional_parameters, true, true, 5) params_hbox.PackStart(op.additional_parameters, true, true, 5)
@ -190,6 +209,7 @@ func (op *OptionsProfile) Initialize(update bool, lp func()) {
buttons_sep := gtk.NewHSeparator() buttons_sep := gtk.NewHSeparator()
cancel_button := gtk.NewButtonWithLabel("Cancel") cancel_button := gtk.NewButtonWithLabel("Cancel")
cancel_button.SetTooltipText("Close without saving")
cancel_button.Clicked(op.closeByCancel) cancel_button.Clicked(op.closeByCancel)
buttons_box.PackStart(cancel_button, false, true, 5) buttons_box.PackStart(cancel_button, false, true, 5)
@ -198,8 +218,10 @@ func (op *OptionsProfile) Initialize(update bool, lp func()) {
add_button := gtk.NewButton() add_button := gtk.NewButton()
if op.update { if op.update {
add_button.SetLabel("Update") add_button.SetLabel("Update")
add_button.SetTooltipText("Update profile")
} else { } else {
add_button.SetLabel("Add") add_button.SetLabel("Add")
add_button.SetTooltipText("Add profile")
} }
add_button.Clicked(op.saveProfile) add_button.Clicked(op.saveProfile)
buttons_box.PackStart(add_button, false, true, 5) buttons_box.PackStart(add_button, false, true, 5)