diff options
| author | Chris Lumens <clumens@redhat.com> | 2012-07-05 17:26:15 -0400 |
|---|---|---|
| committer | Chris Lumens <clumens@redhat.com> | 2012-07-05 17:26:15 -0400 |
| commit | 0b2efc8c47125c349cbcb3f89f034712376e091f (patch) | |
| tree | f3270bc0c01dcf801b7764a52374399da3dac6ec /pyanaconda | |
| parent | 6939748166a4da3d260f248f2475881d10d6e665 (diff) | |
| download | anaconda-0b2efc8c47125c349cbcb3f89f034712376e091f.tar.gz anaconda-0b2efc8c47125c349cbcb3f89f034712376e091f.tar.xz anaconda-0b2efc8c47125c349cbcb3f89f034712376e091f.zip | |
Add the entry box back under the language list.
This basically reverts a commit of mine from January. Keeping the entry
and the list in sync is really not a big deal, and we need to provide a more
full-featured search capability than the default GTK model one anyway.
Diffstat (limited to 'pyanaconda')
| -rw-r--r-- | pyanaconda/ui/gui/TODO | 3 | ||||
| -rw-r--r-- | pyanaconda/ui/gui/spokes/welcome.py | 29 | ||||
| -rw-r--r-- | pyanaconda/ui/gui/spokes/welcome.ui | 28 |
3 files changed, 46 insertions, 14 deletions
diff --git a/pyanaconda/ui/gui/TODO b/pyanaconda/ui/gui/TODO index 90badf635..36e01c052 100644 --- a/pyanaconda/ui/gui/TODO +++ b/pyanaconda/ui/gui/TODO @@ -13,9 +13,6 @@ - Test handling of inconsistent LVM/RAID, and uninitialized disks. - The Install Destination "Back" button is the only one that cancels everything instead of applies. Do something about this. -- There are three different free space displays - on lower left of install destination, on - disk shopping cart, and on lower left of custom partition. They're all different. Which - is correct? + Update exception handling. This requires updating python-meh to use gtk3, which also requires updating firstboot and s-c-ks to gtk3. I want to turn s-c-ks into an anaconda wrapper first, though. diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py index f1b696363..fb519df2d 100644 --- a/pyanaconda/ui/gui/spokes/welcome.py +++ b/pyanaconda/ui/gui/spokes/welcome.py @@ -39,7 +39,7 @@ from pyanaconda import localization __all__ = ["WelcomeLanguageSpoke", "LanguageSpoke"] class LanguageMixIn(object): - builderObjects = ["languageStore"] + builderObjects = ["languageStore", "languageEntryCompletion"] def __init__(self, labelName = "welcomeLabel", viewName = "languageView", selectionName = "languageViewSelection"): @@ -104,6 +104,9 @@ class LanguageMixIn(object): # select the preferred translation self._selectLanguage(store, self.language.preferred_translation.short_name) + self._view = self.builder.get_object(self._viewName) + self._selection = self.builder.get_object(self._selectionName) + def retranslate(self): welcomeLabel = self.builder.get_object(self._labelName) @@ -118,6 +121,11 @@ class LanguageMixIn(object): store = self.builder.get_object("languageStore") self._selectLanguage(store, self.data.lang.lang) + # I shouldn't have to do this outside of GtkBuilder, but see: + # https://bugzilla.gnome.org/show_bug.cgi?id=614150 + completion = self.builder.get_object("languageEntryCompletion") + completion.set_text_column(1) + # Rip the label and language selection window # from where it is right now and add it to this # spoke. @@ -127,11 +135,13 @@ class LanguageMixIn(object): langList.get_parent().remove(langList) langLabel = self.builder.get_object("pickLanguageLabel") langLabel.get_parent().remove(langLabel) + langEntry = self.builder.get_object("languageEntry") + langEntry.get_parent().remove(langEntry) content = self.builder.get_object(displayArea) content.pack_start(child = langLabel, fill = True, expand = False, padding = 0) content.pack_start(child = langList, fill = True, expand = True, padding = 0) - + content.pack_start(child = langEntry, fill = True, expand = False, padding = 0) def _addLanguage(self, store, native, english, setting): store.append([native, english, setting]) @@ -163,6 +173,21 @@ class LanguageMixIn(object): self.language.set_system_lang(lang) self.retranslate() + languageEntry = self.builder.get_object("languageEntry") + languageEntry.set_text("") + + def on_clear_icon_clicked(self, entry, icon_pos, event): + if icon_pos == Gtk.EntryIconPosition.SECONDARY: + entry.set_text("") + + def on_completion_matched(self, completion, model, itr): + # If the user uses the entry underneath the list of languages to pick + # language, make sure the list stays in sync. + self._selection.select_iter(itr) + + # And keep the selected item in the middle of the view. + path = model.get_path(itr) + self._view.scroll_to_cell(path, None, True, 0.5, 0.5) class WelcomeLanguageSpoke(LanguageMixIn, StandaloneSpoke): mainWidgetName = "welcomeWindow" diff --git a/pyanaconda/ui/gui/spokes/welcome.ui b/pyanaconda/ui/gui/spokes/welcome.ui index 25b667f77..d050af10c 100644 --- a/pyanaconda/ui/gui/spokes/welcome.ui +++ b/pyanaconda/ui/gui/spokes/welcome.ui @@ -2,6 +2,10 @@ <interface> <!-- interface-requires gtk+ 3.0 --> <!-- interface-requires AnacondaWidgets 1.0 --> + <object class="GtkEntryCompletion" id="languageEntryCompletion"> + <property name="model">languageStore</property> + <signal name="match-selected" handler="on_completion_matched" swapped="no"/> + </object> <object class="GtkDialog" id="betaWarnDialog"> <property name="can_focus">False</property> <property name="border_width">5</property> @@ -119,15 +123,6 @@ OS you can rely on. It's for testing purposes only.</property> <child> <placeholder/> </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </object> <packing> <property name="expand">True</property> @@ -333,6 +328,21 @@ OS you can rely on. It's for testing purposes only.</property> <property name="position">2</property> </packing> </child> + <child> + <object class="GtkEntry" id="languageEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="secondary_icon_name">edit-clear-symbolic</property> + <property name="completion">languageEntryCompletion</property> + <signal name="icon-release" handler="on_clear_icon_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> </child> </object> |
