~ubuntu-branches/ubuntu/karmic/wesnoth-1.8/karmic-backports

« back to all changes in this revision

Viewing changes to src/addon_management.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Backport
  • Date: 2010-11-01 12:37:12 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20101101123712-4x9k931r5bsdjp3z
Tags: 1:1.8.5-1~karmic1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: addon_management.cpp 43265 2010-06-10 22:35:15Z shadowmaster $ */
 
1
/* $Id: addon_management.cpp 46627 2010-09-20 08:10:30Z shadowmaster $ */
2
2
/*
3
3
   Copyright (C) 2003 - 2008 by David White <dave@whitevine.net>
4
4
                 2008 - 2010 by Ignacio R. Morelle <shadowm2006@gmail.com>
236
236
        cfg["contents"] = encode_binary(strip_cr(read_file(path + '/' + fname),is_cfg));
237
237
}
238
238
 
 
239
inline bool looks_like_pbl(const std::string& file)
 
240
{
 
241
        return utils::wildcard_string_match(utils::lowercase(file), "*.pbl");
 
242
}
 
243
 
239
244
static void archive_dir(const std::string& path, const std::string& dirname, config& cfg, std::pair<std::vector<std::string>, std::vector<std::string> >& ignore_patterns)
240
245
{
241
246
        cfg["name"] = dirname;
244
249
        std::vector<std::string> files, dirs;
245
250
        get_files_in_dir(dir,&files,&dirs);
246
251
        for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
247
 
                bool valid = true;
 
252
                bool valid = !looks_like_pbl(*i);
248
253
                for(std::vector<std::string>::const_iterator p = ignore_patterns.first.begin(); p != ignore_patterns.first.end(); ++p) {
249
254
                        if (utils::wildcard_string_match(*i, *p)) {
250
255
                                valid = false;
512
517
                                count_missing), &symbols);
513
518
                        std::string msg_reminder = utils::interpolate_variables_into_string(_("Do you still want to download $addon_title|? (You will have to install all the dependencies in order to play.)"), &symbols);
514
519
 
515
 
                        if(!gui2::show_message(disp.video()
 
520
                        if(!(gui2::show_message(disp.video()
516
521
                                        , msg_title
517
522
                                        , msg_entrytxt + "\n \n" + missing + "\n \n" + msg_reminder
518
 
                                        , gui2::tmessage::ok_cancel_buttons) == gui2::twindow::OK) {
 
523
                                        , gui2::tmessage::ok_cancel_buttons) == gui2::twindow::OK)) {
519
524
 
520
525
                                return false;
521
526
                        }