GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
|
#include <TextEdit.h>
Public Slots | |
PlainTextEditorPage * | SlotCurPageTextEdit () const |
FilePage * | SlotCurPageFileTreeView () const |
void | SlotQuote () const |
void | SlotFillTextEditWithText (const QString &text) const |
void | SlotSave () |
bool | SlotSaveAs () |
void | SlotOpen () |
void | SlotPrint () |
void | SlotNewTab () |
void | SlotOpenFile (QString &path) |
void | slotNewHelpTab (const QString &title, const QString &path) const |
void | SlotNewFileTab () const |
void | SlotShowModified () const |
void | SlotCloseTab () |
void | SlotSwitchTabUp () const |
void | SlotSwitchTabDown () const |
void | SlotCut () const |
void | SlotCopy () const |
void | SlotPaste () const |
void | SlotUndo () const |
void | SlotRedo () const |
redo last change in current text page More... | |
void | SlotZoomIn () const |
void | SlotZoomOut () const |
void | SlotSelectAll () const |
select all in current text page More... | |
Public Member Functions | |
TextEdit (QWidget *parent) | |
void | LoadFile (const QString &fileName) |
bool | MaybeSaveAnyTab () |
int | TabCount () const |
PlainTextEditorPage * | CurTextPage () const |
FilePage * | CurFilePage () const |
QHash< int, QString > | UnsavedDocuments () const |
Public Attributes | |
QTabWidget * | tab_widget_ |
Protected Member Functions | |
bool | save_file (const QString &fileName) |
Saves the content of currentTab to the file filename. More... | |
Private Slots | |
void | slot_file_page_path_changed (const QString &path) const |
void | slot_remove_tab (int index) |
Private Member Functions | |
bool | maybe_save_current_tab (bool askToSave) |
Static Private Member Functions | |
static QString | stripped_name (const QString &full_file_name) |
Private Attributes | |
int | count_page_ |
int containing the number of added tabs | |
TextEdit class.
FilePage * GpgFrontend::UI::TextEdit::CurFilePage | ( | ) | const |
Referenced by GpgFrontend::UI::MainWindow::slot_disable_tab_actions().
PlainTextEditorPage * GpgFrontend::UI::TextEdit::CurTextPage | ( | ) | const |
textpage of the currently activated tab
Referenced by GpgFrontend::UI::MainWindow::Init(), LoadFile(), GpgFrontend::UI::MainWindow::slot_add_pgp_header(), GpgFrontend::UI::MainWindow::slot_append_selected_keys(), GpgFrontend::UI::MainWindow::slot_clean_double_line_breaks(), GpgFrontend::UI::MainWindow::slot_cut_pgp_header(), GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), GpgFrontend::UI::MainWindow::slot_find(), GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), GpgFrontend::UI::MainWindow::slot_sign(), GpgFrontend::UI::MainWindow::slot_verify(), SlotCopy(), SlotCut(), SlotFillTextEditWithText(), SlotPaste(), SlotPrint(), SlotQuote(), SlotRedo(), SlotSelectAll(), SlotShowModified(), and SlotUndo().
void GpgFrontend::UI::TextEdit::LoadFile | ( | const QString & | fileName | ) |
Load the content of file into the current textpage
fileName | QString containing the filename to load |
References CurTextPage(), GpgFrontend::UI::PlainTextEditorPage::GetTextPage(), GpgFrontend::UI::PlainTextEditorPage::SetFilePath(), SlotCurPageTextEdit(), and stripped_name().
Referenced by GpgFrontend::UI::MainWindow::Init().
|
private |
askToSave | Check if current may need to be saved. Call this function before closing the currently active tab- |
If it returns false, the close event should be aborted.
References GpgFrontend::UI::PlainTextEditorPage::GetFilePath(), GpgFrontend::UI::PlainTextEditorPage::GetTextPage(), GpgFrontend::UI::PlainTextEditorPage::ReadDone(), save_file(), SlotCurPageTextEdit(), and SlotSaveAs().
Referenced by MaybeSaveAnyTab(), and slot_remove_tab().
bool GpgFrontend::UI::TextEdit::MaybeSaveAnyTab | ( | ) |
Checks if there are unsaved documents in any tab, which may need to be saved. Call this function before closing the programme or all tabs.
References GpgFrontend::UI::QuitDialog::GetTabIdsToSave(), GpgFrontend::UI::QuitDialog::IsDiscarded(), maybe_save_current_tab(), and UnsavedDocuments().
Referenced by GpgFrontend::UI::MainWindow::closeEvent(), and GpgFrontend::UI::MainWindow::slot_open_settings_dialog().
|
protected |
Saves the content of currentTab to the file filename.
fileName |
References GpgFrontend::UI::PlainTextEditorPage::GetTextPage(), GpgFrontend::UI::PlainTextEditorPage::NotifyFileSaved(), GpgFrontend::UI::PlainTextEditorPage::SetFilePath(), SlotCurPageTextEdit(), stripped_name(), and GpgFrontend::UI::PlainTextEditorPage::WillCharsetChange().
Referenced by maybe_save_current_tab(), SlotSave(), and SlotSaveAs().
|
privateslot |
Remove the tab with given index
index | Tab-number to remove |
References maybe_save_current_tab().
Referenced by SlotCloseTab().
|
slot |
close the current tab and decrease TabWidget->count by 1
References GpgFrontend::UI::PlainTextEditorPage::GetTextPage(), slot_remove_tab(), and SlotCurPageTextEdit().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Copy selected text of current text page to clipboard.
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Return pointer to the currently activated file tree view tab page.
Referenced by GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), GpgFrontend::UI::MainWindow::slot_sign(), GpgFrontend::UI::MainWindow::slot_verify(), GpgFrontend::UI::MainWindow::SlotFileDecrypt(), GpgFrontend::UI::MainWindow::SlotFileDecryptVerify(), GpgFrontend::UI::MainWindow::SlotFileEncrypt(), GpgFrontend::UI::MainWindow::SlotFileEncryptSign(), GpgFrontend::UI::MainWindow::SlotFileSign(), and GpgFrontend::UI::MainWindow::SlotFileVerify().
|
slot |
Widget containing the tabs of the editor
Return pointer to the currently activated text edit tab page.
Referenced by LoadFile(), maybe_save_current_tab(), save_file(), GpgFrontend::UI::MainWindow::slot_add_pgp_header(), GpgFrontend::UI::MainWindow::slot_append_selected_keys(), GpgFrontend::UI::MainWindow::slot_clean_double_line_breaks(), GpgFrontend::UI::MainWindow::slot_cut_pgp_header(), GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), GpgFrontend::UI::MainWindow::slot_find(), GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), GpgFrontend::UI::MainWindow::slot_sign(), GpgFrontend::UI::MainWindow::slot_verify(), SlotCloseTab(), SlotSave(), and SlotSaveAs().
|
slot |
Cut selected text in current text page.
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
replace the text of currently active textedit with given text.
text | to fill on. |
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::slot_add_pgp_header(), GpgFrontend::UI::MainWindow::slot_clean_double_line_breaks(), GpgFrontend::UI::MainWindow::slot_cut_pgp_header(), GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), and GpgFrontend::UI::MainWindow::slot_sign().
|
slot |
New File Tab to do file operation
References GpgFrontend::UI::FilePage::SignalPathChanged().
Referenced by GpgFrontend::UI::MainWindow::slot_open_file_tab().
|
slot |
Adds a new tab with the given title and opens given html file. Increase Tab-Count by one
title | title for the tab |
path | path for html file to show |
|
slot |
Adds a new tab with the title "untitled"+countpage+".txt" Sets the focus to the new tab. Increase Tab-Count by one
References count_page_, and SlotShowModified().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Show an OpenFileDoalog and open the file in a new tab. Shows an error dialog, if the open fails. Set the focus to the tab of the opened file.
References SlotShowModified(), and stripped_name().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Adds a new tab with opening file by path
References SlotShowModified(), and stripped_name().
Referenced by GpgFrontend::UI::MainWindow::SlotOpenFile().
|
slot |
Paste text from clipboard to current text page.
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Open a print-dialog for the current tab
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Insert a ">" at the beginning of every line of current textedit.
References CurTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
redo last change in current text page
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Saves the content of the current tab, if it has a filepath otherwise it calls saveAs for the current tab
References GpgFrontend::UI::PlainTextEditorPage::GetFilePath(), save_file(), SlotCurPageTextEdit(), and SlotSaveAs().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Opens a savefiledialog and calls save_file with the choosen filename.
References GpgFrontend::UI::PlainTextEditorPage::GetFilePath(), save_file(), and SlotCurPageTextEdit().
Referenced by GpgFrontend::UI::MainWindow::create_actions(), maybe_save_current_tab(), and SlotSave().
|
slot |
select all in current text page
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
put a * in front of current tabs title, if current textedit is modified
References CurTextPage().
Referenced by SlotNewTab(), SlotOpen(), and SlotOpenFile().
|
slot |
Switch to the previous tab.
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Switch to the next tab.
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
slot |
Undo last change in current textpage.
References CurTextPage(), and GpgFrontend::UI::PlainTextEditorPage::GetTextPage().
Referenced by GpgFrontend::UI::MainWindow::create_actions().
|
staticprivate |
return just a filename stripped of a whole path
a | filename path |
Referenced by LoadFile(), save_file(), SlotOpen(), and SlotOpenFile().
int GpgFrontend::UI::TextEdit::TabCount | ( | ) | const |
Referenced by GpgFrontend::UI::MainWindow::slot_add_pgp_header(), GpgFrontend::UI::MainWindow::slot_append_selected_keys(), GpgFrontend::UI::MainWindow::slot_clean_double_line_breaks(), GpgFrontend::UI::MainWindow::slot_cut_pgp_header(), GpgFrontend::UI::MainWindow::slot_decrypt(), GpgFrontend::UI::MainWindow::slot_decrypt_verify(), GpgFrontend::UI::MainWindow::slot_encrypt(), GpgFrontend::UI::MainWindow::slot_encrypt_sign(), GpgFrontend::UI::MainWindow::slot_find(), GpgFrontend::UI::MainWindow::slot_import_key_from_edit(), GpgFrontend::UI::MainWindow::slot_sign(), and GpgFrontend::UI::MainWindow::slot_verify().
QHash< int, QString > GpgFrontend::UI::TextEdit::UnsavedDocuments | ( | ) | const |
List of currently unsaved tabs.
Referenced by MaybeSaveAnyTab().