diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-07-03 06:08:59 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-03 06:08:59 +0000 |
| commit | fb09d6354c0b6badb449f532f40af9a8037377a3 (patch) | |
| tree | efe8844d87a8dec2239a7f88ca161583ebd6c869 /utils/themeeditor/gui/findreplacedialog.cpp | |
| parent | 4b321649a8bf3879a33051e63f250985b97007e3 (diff) | |
| download | rockbox-fb09d6354c0b6badb449f532f40af9a8037377a3.zip rockbox-fb09d6354c0b6badb449f532f40af9a8037377a3.tar.gz rockbox-fb09d6354c0b6badb449f532f40af9a8037377a3.tar.bz2 rockbox-fb09d6354c0b6badb449f532f40af9a8037377a3.tar.xz | |
Theme Editor: Removed some old debug code in skindocument.cpp, began implementing a new find/replace dialog, due to licensing issues
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27252 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/findreplacedialog.cpp')
| -rw-r--r-- | utils/themeeditor/gui/findreplacedialog.cpp | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/findreplacedialog.cpp b/utils/themeeditor/gui/findreplacedialog.cpp new file mode 100644 index 0000000..234c6f6 --- /dev/null +++ b/utils/themeeditor/gui/findreplacedialog.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 Robert Bieber + * + * 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. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "findreplacedialog.h" +#include "ui_findreplacedialog.h" + +#include <QTextBlock> + +FindReplaceDialog::FindReplaceDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::FindReplaceDialog), editor(0) +{ + ui->setupUi(this); + setupUI(); +} + +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::closeEvent(QCloseEvent* event) +{ + ui->statusLabel->setText(""); + event->accept(); +} + +void FindReplaceDialog::setupUI() +{ + QObject::connect(ui->findButton, SIGNAL(pressed()), + this, SLOT(find())); + QObject::connect(ui->replaceButton, SIGNAL(pressed()), + this, SLOT(replace())); + QObject::connect(ui->replaceAllButton, SIGNAL(pressed()), + this, SLOT(replaceAll())); + QObject::connect(ui->closeButton, SIGNAL(pressed()), + this, SLOT(close())); + QObject::connect(ui->findBox, SIGNAL(textChanged(QString)), + this, SLOT(textChanged())); + + textChanged(); +} + +void FindReplaceDialog::find() +{ + + if(!editor) + return; + + editor->setTextCursor(editor->document()->find(ui->findBox->text())); + +} + +void FindReplaceDialog::replace() +{ + +} + +void FindReplaceDialog::replaceAll() +{ + +} + +void FindReplaceDialog::textChanged() +{ + bool enabled = ui->findBox->text() != ""; + + ui->findButton->setEnabled(enabled); + ui->replaceButton->setEnabled(enabled); + ui->replaceAllButton->setEnabled(enabled); +} |