fantasdic r342 - in trunk: . lib/fantasdic/sources lib/fantasdic/ui
- From: mblondel svn gnome org
- To: svn-commits-list gnome org
- Subject: fantasdic r342 - in trunk: . lib/fantasdic/sources lib/fantasdic/ui
- Date: Tue, 26 Aug 2008 18:23:14 +0000 (UTC)
Author: mblondel
Date: Tue Aug 26 18:23:14 2008
New Revision: 342
URL: http://svn.gnome.org/viewvc/fantasdic?rev=342&view=rev
Log:
* lib/fantasdic/ui/main_app.rb (selected_dictionary): Fixed bug.
* lib/fantasdic/sources/virtual_dictionary.rb: Handles the case when a
virtual dictionary uses a dictionary that was deleted in the meantime.
Modified:
trunk/ChangeLog
trunk/lib/fantasdic/sources/virtual_dictionary.rb
trunk/lib/fantasdic/ui/main_app.rb
Modified: trunk/lib/fantasdic/sources/virtual_dictionary.rb
==============================================================================
--- trunk/lib/fantasdic/sources/virtual_dictionary.rb (original)
+++ trunk/lib/fantasdic/sources/virtual_dictionary.rb Tue Aug 26 18:23:14 2008
@@ -95,6 +95,13 @@
def get_source(db)
config = @prefs.dictionaries_infos[db]
+
+ unless config
+ raise SourceError,
+ _("Dictionary \"%s\" does not exist anymore") % \
+ db
+ end
+
dbs = if config[:all_dbs]
[Source::Base::ALL_DATABASES]
else
Modified: trunk/lib/fantasdic/ui/main_app.rb
==============================================================================
--- trunk/lib/fantasdic/ui/main_app.rb (original)
+++ trunk/lib/fantasdic/ui/main_app.rb Tue Aug 26 18:23:14 2008
@@ -567,14 +567,16 @@
@dictionary_cb.model.clear
if @prefs.dictionaries.length >= 1
- @dictionary_cb.sensitive = true
+ sensitive = false
@prefs.dictionaries.each do |dic|
if @prefs.dictionaries_infos[dic][:selected] == 1
row = @dictionary_cb.model.append
row[0] = dic
+ sensitive = true
end
end
@dictionary_cb.active = 0
+ @dictionary_cb.sensitive = sensitive
else
@dictionary_cb.sensitive = false
end
@@ -587,7 +589,12 @@
end
def selected_dictionary
- @prefs dictionaries[ dictionary_cb active]
+ selected = @dictionary_cb.active
+ if selected >= 0
+ @dictionary_cb.model.get_iter(selected.to_s)[0]
+ else
+ nil
+ end
end
def selected_dictionary=(dicname)
@@ -599,6 +606,7 @@
end
n += 1
end
+ dicname
end
def dictionary_menu_append_search_item(menu, name, word)
@@ -869,11 +877,11 @@
PreferencesDialog.new(@main_app,
@statusicon) do
# This block is called when the dialog is closed
- #DICTClient.close_all_connections
+ #DICTClient.close_all_connections
update_dictionary_cb
- update_strategy_cb
load_dictionary_preferences
load_proxy_preferences
+ update_strategy_cb
@prefs.save!
end
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]