# HG changeset patch # User Chris Cannam # Date 1308151941 -3600 # Node ID 939701b848e50feffffbc29adc773b7de4e67443 # Parent 2a19d57066730b9f4ad63cba80070d9a0a91e76e Start to introduce HgIgnoreDialog diff -r 2a19d5706673 -r 939701b848e5 easyhg.pro --- a/easyhg.pro Mon Jun 13 17:28:49 2011 +0100 +++ b/easyhg.pro Wed Jun 15 16:32:21 2011 +0100 @@ -4,6 +4,9 @@ TEMPLATE = app TARGET = EasyMercurial +QMAKE_CXX = clang++ +QMAKE_LINK = clang++ + # We use the 10.4 SDK and Carbon for all 32-bit OS/X, # and 10.6 with Cocoa for all 64-bit macx-g++40 { @@ -61,7 +64,8 @@ src/clickablelabel.h \ src/workstatuswidget.h \ src/moreinformationdialog.h \ - src/annotatedialog.h + src/annotatedialog.h \ + src/hgignoredialog.h SOURCES = \ src/main.cpp \ src/mainwindow.cpp \ @@ -95,7 +99,8 @@ src/settingsdialog.cpp \ src/workstatuswidget.cpp \ src/moreinformationdialog.cpp \ - src/annotatedialog.cpp + src/annotatedialog.cpp \ + src/hgignoredialog.cpp macx-* { SOURCES += src/common_osx.mm diff -r 2a19d5706673 -r 939701b848e5 src/hgignoredialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hgignoredialog.cpp Wed Jun 15 16:32:21 2011 +0100 @@ -0,0 +1,54 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + EasyMercurial + + Based on hgExplorer by Jari Korhonen + Copyright (c) 2010 Jari Korhonen + Copyright (c) 2011 Chris Cannam + Copyright (c) 2011 Queen Mary, University of London + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "hgignoredialog.h" +#include "common.h" +#include "debug.h" + +HgIgnoreDialog::IgnoreType +HgIgnoreDialog::confirmIgnore(QStringList files, QStringList suffixes) +{ + QString text = ""; + + if (files.size() < 10) { + text += tr("You have asked to ignore the following files:"); + text += "

"; + foreach (QString f, files) { + text += "   " + xmlEncode(f) + "
"; + } + text += "
"; + } else { + text += "

"; + text += tr("You have asked to ignore %1 file(s).", "", files.size()); + text += "

"; + } + + if (suffixes.size() > 0) { + + text += "

"; + text += tr("Would you like to:"); + text += "