diff options
author | 2012-01-05 10:24:51 -0500 | |
---|---|---|
committer | 2012-01-05 10:24:51 -0500 | |
commit | 7cf43c7dd653ef28c2212975f81b14be6473e06f (patch) | |
tree | 251c33430f492d8780ab22cd69a9abe0af02f0c3 /core/gui.lua | |
parent | bd351f0bef198d981b67830ddb5e4cd42c3aca37 (diff) |
Code cleanup.
Diffstat (limited to 'core/gui.lua')
-rw-r--r-- | core/gui.lua | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/core/gui.lua b/core/gui.lua index ab7d0909..51af5b71 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -216,6 +216,7 @@ function gui.select_theme() local theme = gui.filteredlist(_L['Select Theme'], _L['Name'], themes) if not theme then return end gui.set_theme(theme) + -- Write the theme to the user's theme file. local f = io.open(_USERHOME..'/theme', 'wb') if not f then return end f:write(theme) @@ -394,17 +395,14 @@ events_connect(events.QUIT, function() list[#list + 1] = buffer.filename or buffer._type or _L['Untitled'] end end - if #list > 0 and gui.dialog('msgbox', - '--title', _L['Quit without saving?'], - '--text', - _L['The following buffers are unsaved:'], - '--informative-text', table.concat(list, '\n'), - '--button1', 'gtk-cancel', - '--button2', _L['Quit _without saving'], - '--no-newline') ~= '2' then - return false - end - return true + return #list < 1 or gui.dialog('msgbox', + '--title', _L['Quit without saving?'], + '--text', + _L['The following buffers are unsaved:'], + '--informative-text', table.concat(list, '\n'), + '--button1', 'gtk-cancel', + '--button2', _L['Quit _without saving'], + '--no-newline') == '2' end) events_connect(events.ERROR, |