FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 01-30-2012, 12:48 PM
Vratislav Podzimek
 
Default Allow to add multiple layouts at once (KeyboardSpoke)

---
pyanaconda/ui/gui/spokes/keyboard.py | 24 +++++++++++++++---------
pyanaconda/ui/gui/spokes/keyboard.ui | 4 +++-
2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index 8e9e56d..30b7925 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -75,14 +75,17 @@ class AddLayoutDialog(UIObject):
return rc

@property
- def chosen_layout(self):
- return self._chosen_layout
+ def chosen_layouts(self):
+ return self._chosen_layouts

def on_confirm_add_clicked(self, *args):
treeview = self.builder.get_object("newLayoutView")
selection = treeview.get_selection()
- (model, itr) = selection.get_selected()
- self._chosen_layout = model[itr][0]
+ (store, pathlist) = selection.get_selected_rows()
+ self._chosen_layouts = []
+ for path in pathlist:
+ itr = store.get_iter(path)
+ self._chosen_layouts.append(store[itr][0])

def on_cancel_clicked(self, *args):
print "CANCELING"
@@ -155,13 +158,16 @@ class KeyboardSpoke(NormalSpoke):
response = dialog.run()
lightbox.destroy()
if response == 1:
- found = False
+ duplicates = set()
itr = self._store.get_iter_first()
- while itr and not found:
- found = self._store[itr][0] == dialog.chosen_layout
+ while itr:
+ item = self._store[itr][0]
+ if item in dialog.chosen_layouts:
+ duplicates.add(item)
itr = self._store.iter_next(itr)
- if not found:
- self._addLayout(self._store, dialog.chosen_layout)
+ for layout in dialog.chosen_layouts:
+ if layout not in duplicates:
+ self._addLayout(self._store, layout)

def on_remove_clicked(self, button):
selection = self.builder.get_object("layoutSelection")
diff --git a/pyanaconda/ui/gui/spokes/keyboard.ui b/pyanaconda/ui/gui/spokes/keyboard.ui
index c471287..6fd9bfd 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.ui
+++ b/pyanaconda/ui/gui/spokes/keyboard.ui
@@ -110,7 +110,9 @@
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="newLayoutSelection"/>
+ <object class="GtkTreeSelection" id="newLayoutSelection">
+ <property name="mode">multiple</property>
+ </object>
</child>
<child>
<object class="GtkTreeViewColumn" id="name">
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org