Skip to content

Commit a740b3a

Browse files
committed
Check GUI availability and fallback to CUI mode
1 parent fc46be2 commit a740b3a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

bin/rbphoto-import

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,16 @@ def main
211211
exit
212212
end
213213

214+
# load and check GUI availability
215+
begin
216+
require 'gtk2'
217+
rescue
218+
opt.no_gui = true
219+
end
220+
214221
if ( opt.no_gui || ARGV.size >= 3 )
215222
RbPhoto::Import::Cui.new(opt)
216223
else
217-
require 'gtk2'
218224
RbPhoto::Import::Gui.new(opt)
219225
end
220226
end

debian/changelog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ rbphoto (0.2.1) unstable; urgency=low
44
* Change 'help' and 'version' instance method to class method on
55
RbPhoto::Import class
66
* Change load timing for gtk library
7+
* Check GUI availability and fallback to CUI mode
78

8-
-- Taku YASUI <[email protected]> Mon, 08 Jun 2009 22:27:19 +0900
9+
-- Taku YASUI <[email protected]> Mon, 08 Jun 2009 22:38:28 +0900
910

1011
rbphoto (0.2.0) unstable; urgency=low
1112

0 commit comments

Comments
 (0)