gnome setup: Set focus on address entry by default
This commit is contained in:
parent
ae2c11fc71
commit
dbf1367b22
|
@ -166,7 +166,7 @@ namespace SparkleShare {
|
||||||
Sensitive = (Controller.SelectedPlugin.Address == null),
|
Sensitive = (Controller.SelectedPlugin.Address == null),
|
||||||
ActivatesDefault = true
|
ActivatesDefault = true
|
||||||
};
|
};
|
||||||
|
|
||||||
Entry path_entry = new Entry () {
|
Entry path_entry = new Entry () {
|
||||||
Text = Controller.PreviousPath,
|
Text = Controller.PreviousPath,
|
||||||
Sensitive = (Controller.SelectedPlugin.Path == null),
|
Sensitive = (Controller.SelectedPlugin.Path == null),
|
||||||
|
@ -209,8 +209,8 @@ namespace SparkleShare {
|
||||||
tree_view.SetCursor (path, service_column, false);
|
tree_view.SetCursor (path, service_column, false);
|
||||||
SparklePlugin plugin = (SparklePlugin) model.GetValue (iter, 2);
|
SparklePlugin plugin = (SparklePlugin) model.GetValue (iter, 2);
|
||||||
|
|
||||||
if (plugin.Address != null) {
|
if (plugin.Address != null)
|
||||||
address_entry.Sensitive = false;}
|
address_entry.Sensitive = false;
|
||||||
|
|
||||||
if (plugin.Path != null)
|
if (plugin.Path != null)
|
||||||
path_entry.Sensitive = false;
|
path_entry.Sensitive = false;
|
||||||
|
@ -250,11 +250,19 @@ namespace SparkleShare {
|
||||||
layout_vertical.PackStart (scrolled_window, true, true, 0);
|
layout_vertical.PackStart (scrolled_window, true, true, 0);
|
||||||
layout_vertical.PackStart (layout_fields, false, false, 0);
|
layout_vertical.PackStart (layout_fields, false, false, 0);
|
||||||
|
|
||||||
tree_view.GrabFocus ();
|
|
||||||
tree_view.ScrollToCell (new TreePath ("" + Controller.SelectedPluginIndex), null, true, 0, 0);
|
tree_view.ScrollToCell (new TreePath ("" + Controller.SelectedPluginIndex), null, true, 0, 0);
|
||||||
|
|
||||||
Add (layout_vertical);
|
Add (layout_vertical);
|
||||||
|
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty (path_entry.Text)) {
|
||||||
|
address_entry.GrabFocus ();
|
||||||
|
address_entry.Position = -1;
|
||||||
|
} else {
|
||||||
|
path_entry.GrabFocus ();
|
||||||
|
path_entry.Position = -1;
|
||||||
|
}
|
||||||
|
|
||||||
Button cancel_button = new Button ("Cancel");
|
Button cancel_button = new Button ("Cancel");
|
||||||
Button add_button = new Button ("Add") { Sensitive = false };
|
Button add_button = new Button ("Add") { Sensitive = false };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue