From be70fd89be787e2b24604f9ba785b87c1f8f1d22 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Sat, 26 Jun 2010 07:59:23 +0000 Subject: Theme Editor: Added an edit menu with a find/replace function (copied from an LGPL library) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27137 a1c6a512-1295-4272-9138-f99709370657 --- .../themeeditor/findreplace/findreplacedialog.cpp | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 utils/themeeditor/findreplace/findreplacedialog.cpp (limited to 'utils/themeeditor/findreplace/findreplacedialog.cpp') diff --git a/utils/themeeditor/findreplace/findreplacedialog.cpp b/utils/themeeditor/findreplace/findreplacedialog.cpp new file mode 100644 index 0000000..547ad23 --- /dev/null +++ b/utils/themeeditor/findreplace/findreplacedialog.cpp @@ -0,0 +1,64 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * This file has been copied from Lorenzo Bettini, with minor modifications + * made available under the LGPL version 3, as the original file was licensed + * + **************************************************************************** + * + * Copyright (C) 2009 Lorenzo Bettini + * See COPYING file that comes with this distribution + */ + +#include "findreplacedialog.h" +#include "ui_findreplacedialog.h" + +FindReplaceDialog::FindReplaceDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::FindReplaceDialog) +{ + ui->setupUi(this); +} + +FindReplaceDialog::~FindReplaceDialog() +{ + delete ui; +} + +void FindReplaceDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void FindReplaceDialog::setTextEdit(QPlainTextEdit *textEdit) { + ui->findReplaceForm->setTextEdit(textEdit); +} + +void FindReplaceDialog::writeSettings(QSettings &settings, const QString &prefix) { + ui->findReplaceForm->writeSettings(settings, prefix); +} + +void FindReplaceDialog::readSettings(QSettings &settings, const QString &prefix) { + ui->findReplaceForm->readSettings(settings, prefix); +} + +void FindReplaceDialog::findNext() { + ui->findReplaceForm->findNext(); +} + +void FindReplaceDialog::findPrev() { + ui->findReplaceForm->findPrev(); +} -- cgit v1.1