The main window. More...
#include <mainwindow.h>


Public Member Functions | |
| void | handle_signal (int signo) |
| MainWindow (unsigned int timeout, bool fsecurity) throw (YAPET::UI::UIException) | |
| void | resize () throw (YAPET::UI::UIException) |
| void | run (std::string fn) |
| void | run () throw (YAPET::UI::UIException) |
| virtual | ~MainWindow () |
Protected Member Functions | |
| void | addNewRecord () |
| void | bottomRightWinContent () throw (YAPET::UI::UIException) |
| void | changePassword () throw (YAPET::UI::UIException) |
| void | closeFile () |
| void | createFile (std::string &filename) throw (YAPET::UI::UIException) |
| void | createWindow () throw (YAPET::UI::UIException) |
| void | deleteSelectedRecord () throw (YAPET::UI::UIException) |
| void | editSelectedRecord () |
| void | lockScreen () const throw (YAPET::UI::UIException) |
| void | openFile (std::string filename) throw (YAPET::UI::UIException) |
| void | printTitle () throw (YAPET::UI::UIException) |
| bool | quit () |
| void | refresh () throw (YAPET::UI::UIException) |
| void | saveFile () |
| void | searchNext () |
| void | searchTerm () |
| void | setSortOrder () |
| void | topRightWinContent () throw (YAPET::UI::UIException) |
Private Member Functions | |
| MainWindow (const MainWindow &) | |
| const MainWindow & | operator= (const MainWindow &) |
Private Attributes | |
| WINDOW * | bottomrightwin |
| YAPET::File * | file |
| YAPET::Key * | key |
| unsigned int | locktimeout |
| YAPET::UI::ListWidget < YAPET::PartDec > * | recordlist |
| bool | records_changed |
| StatusBar | statusbar |
| WINDOW * | toprightwin |
| bool | usefsecurity |
This is the main window class which shows the main menu in top right window, some information in the lower right window and the passwords stored in the file currently open in the left window.
It handles the menu key strokes and provides a screen locking function which is called after a certain number of seconds using the BaseWindow::setTimeout() method.
Definition at line 59 of file mainwindow.h.
| MainWindow::MainWindow | ( | const MainWindow & | ) | [inline, private] |
Definition at line 74 of file mainwindow.h.
| MainWindow::MainWindow | ( | unsigned int | timeout, | |
| bool | fsecurity | |||
| ) | throw (YAPET::UI::UIException) |
Definition at line 1095 of file mainwindow.cc.
| MainWindow::~MainWindow | ( | ) | [virtual] |
Definition at line 1110 of file mainwindow.cc.
References bottomrightwin, file, key, recordlist, and toprightwin.
| void MainWindow::addNewRecord | ( | ) | [protected] |
Definition at line 620 of file mainwindow.cc.
References PasswordRecord::entryChanged(), file, PasswordRecord::getEncEntry(), YAPET::UI::ListWidget< T >::getList(), key, StatusBar::putMsg(), recordlist, records_changed, refresh(), YAPET::UI::MessageBox::run(), PasswordRecord::run(), YAPET::UI::ListWidget< T >::setSortOrder(), and statusbar.
Referenced by run().


| void MainWindow::bottomRightWinContent | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 256 of file mainwindow.cc.
References bottomrightwin, file, YAPET::File::getFileVersion(), YAPET::File::getMasterPWSet(), key, locktimeout, StatusBar::putMsg(), recordlist, records_changed, YAPET::UI::ListWidget< T >::size(), statusbar, usefsecurity, and YAPET::YAPETException::what().
Referenced by createWindow(), refresh(), and saveFile().


| void MainWindow::changePassword | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 990 of file mainwindow.cc.
References YAPET::UI::ANSWER_OK, file, YAPET::UI::DialogBox::getAnswer(), YAPET::File::getFilename(), PasswordDialog::getKey(), key, NEW_PW, StatusBar::putMsg(), YAPET::File::read(), recordlist, records_changed, refresh(), YAPET::UI::MessageBox::run(), PasswordDialog::run(), YAPET::UI::DialogBox::run(), saveFile(), YAPET::UI::ListWidget< T >::setList(), YAPET::File::setNewKey(), statusbar, and YAPET::YAPETException::what().
Referenced by run().


| void MainWindow::closeFile | ( | ) | [protected] |
Definition at line 602 of file mainwindow.cc.
References file, YAPET::UI::ListWidget< T >::getList(), key, recordlist, and records_changed.

| void MainWindow::createFile | ( | std::string & | filename | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 418 of file mainwindow.cc.
References PasswordDialog::getKey(), NEW_PW, YAPET::UI::MessageBox::run(), PasswordDialog::run(), and YAPET::YAPETException::what().

| void MainWindow::createWindow | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 309 of file mainwindow.cc.
References bottomrightwin, bottomRightWinContent(), box(), YAPET::UI::DEFAULT, YAPET::UI::BaseWindow::maxX(), YAPET::UI::BaseWindow::maxY(), printTitle(), recordlist, YAPET::UI::Colors::setcolor(), toprightwin, and topRightWinContent().
Referenced by resize().


| void MainWindow::deleteSelectedRecord | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 721 of file mainwindow.cc.
References YAPET::UI::ANSWER_OK, YAPET::UI::ListWidget< T >::deleteSelectedItem(), YAPET::UI::DialogBox::getAnswer(), StatusBar::putMsg(), recordlist, records_changed, refresh(), YAPET::UI::ListWidget< T >::refresh(), YAPET::UI::MessageBox::run(), YAPET::UI::DialogBox::run(), YAPET::UI::ListWidget< T >::size(), and statusbar.
Referenced by run().


| void MainWindow::editSelectedRecord | ( | ) | [protected] |
Definition at line 669 of file mainwindow.cc.
References PasswordRecord::entryChanged(), file, PasswordRecord::getEncEntry(), YAPET::UI::ListWidget< T >::getSelectedItem(), key, StatusBar::putMsg(), recordlist, records_changed, refresh(), YAPET::UI::ListWidget< T >::replaceCurrentItem(), YAPET::UI::MessageBox::run(), PasswordRecord::run(), YAPET::UI::ListWidget< T >::setSortOrder(), YAPET::UI::ListWidget< T >::size(), and statusbar.
Referenced by run().


| void MainWindow::handle_signal | ( | int | signo | ) |
Definition at line 1329 of file mainwindow.cc.
References lockScreen(), refresh(), and YAPET::UI::BaseWindow::refreshAll().
Referenced by Alarm::process().


| void MainWindow::lockScreen | ( | ) | const throw (YAPET::UI::UIException) [protected] |
Definition at line 889 of file mainwindow.cc.
References EXISTING_PW, file, YAPET::GLOBALS::Globals::getAllowLockQuit(), YAPET::File::getFilename(), PasswordDialog::getKey(), YAPET::GLOBALS::Globals::getPwInputTimeout(), key, records_changed, YAPET::UI::BaseWindow::resizeAll(), YAPET::UI::MessageBox::run(), PasswordDialog::run(), setTerminalTitle(), and PasswordDialog::wantsQuit().
Referenced by handle_signal(), and run().


| void MainWindow::openFile | ( | std::string | filename | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 463 of file mainwindow.cc.
References YAPET::UI::ANSWER_OK, EXISTING_PW, YAPET::UI::DialogBox::getAnswer(), PasswordDialog::getKey(), refresh(), PasswordDialog::run(), YAPET::UI::MessageBox::run(), YAPET::UI::DialogBox::run(), and YAPET::YAPETException::what().
Referenced by run().


| const MainWindow& MainWindow::operator= | ( | const MainWindow & | ) | [inline, private] |
Definition at line 75 of file mainwindow.h.
| void MainWindow::printTitle | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 173 of file mainwindow.cc.
References YAPET::UI::DEFAULT, file, YAPET::File::getFilename(), YAPET::UI::BaseWindow::maxX(), YAPET::UI::Colors::setcolor(), and setTerminalTitle().
Referenced by createWindow(), and refresh().


| bool MainWindow::quit | ( | ) | [protected] |
Definition at line 856 of file mainwindow.cc.
References YAPET::UI::ANSWER_OK, YAPET::UI::DialogBox::getAnswer(), StatusBar::putMsg(), records_changed, refresh(), YAPET::UI::DialogBox::run(), saveFile(), and statusbar.
Referenced by run().


| void MainWindow::refresh | ( | ) | throw (YAPET::UI::UIException) [protected, virtual] |
Implements YAPET::UI::BaseWindow.
Definition at line 384 of file mainwindow.cc.
References bottomrightwin, bottomRightWinContent(), box(), printTitle(), recordlist, StatusBar::refresh(), YAPET::UI::ListWidget< T >::refresh(), statusbar, toprightwin, and topRightWinContent().
Referenced by addNewRecord(), changePassword(), deleteSelectedRecord(), editSelectedRecord(), handle_signal(), quit(), run(), and searchTerm().


| void MainWindow::resize | ( | ) | throw (YAPET::UI::UIException) [virtual] |
Implements YAPET::UI::BaseWindow.
Definition at line 366 of file mainwindow.cc.
References bottomrightwin, createWindow(), YAPET::UI::BaseWindow::maxX(), YAPET::UI::BaseWindow::maxY(), recordlist, YAPET::UI::ListWidget< T >::resize(), and toprightwin.

| void MainWindow::run | ( | std::string | fn | ) |
Definition at line 1300 of file mainwindow.cc.
References file, key, openFile(), StatusBar::putMsg(), refresh(), run(), and statusbar.

| void MainWindow::run | ( | ) | throw (YAPET::UI::UIException) |
Definition at line 1125 of file mainwindow.cc.
References addNewRecord(), YAPET::UI::ANSWER_OK, changePassword(), deleteSelectedRecord(), editSelectedRecord(), file, YAPET::UI::ListWidget< T >::focus(), YAPET::UI::DialogBox::getAnswer(), YAPET::File::getFilename(), FileOpen::getFilepath(), FileOpen::isCanceled(), key, KEY_REFRESH, lockScreen(), locktimeout, openFile(), StatusBar::putMsg(), quit(), recordlist, records_changed, refresh(), YAPET::UI::BaseWindow::refreshAll(), YAPET::UI::BaseWindow::resizeAll(), PWGenDialog::run(), FileOpen::run(), YAPET::UI::DialogBox::run(), saveFile(), searchNext(), searchTerm(), setSortOrder(), setTerminalTitle(), YAPET::UI::BaseWindow::setTimeout(), statusbar, and YAPET::UI::BaseWindow::suspendTimeout().
Referenced by main(), and run().


| void MainWindow::saveFile | ( | ) | [protected] |
Definition at line 571 of file mainwindow.cc.
References bottomrightwin, bottomRightWinContent(), file, YAPET::File::getFilename(), YAPET::UI::ListWidget< T >::getList(), key, StatusBar::putMsg(), recordlist, records_changed, YAPET::UI::MessageBox::run(), YAPET::File::save(), statusbar, and YAPET::YAPETException::what().
Referenced by changePassword(), quit(), and run().


| void MainWindow::searchNext | ( | ) | [protected] |
Definition at line 842 of file mainwindow.cc.
References file, key, StatusBar::putMsg(), recordlist, YAPET::UI::ListWidget< T >::searchNext(), YAPET::UI::ListWidget< T >::size(), and statusbar.
Referenced by run().


| void MainWindow::searchTerm | ( | ) | [protected] |
Definition at line 795 of file mainwindow.cc.
References file, SearchDialog::getSearchTerm(), SearchDialog::isCanceled(), key, StatusBar::putMsg(), recordlist, refresh(), YAPET::UI::MessageBox::run(), SearchDialog::run(), YAPET::UI::ListWidget< T >::searchTerm(), YAPET::UI::ListWidget< T >::size(), statusbar, and YAPET::UI::UIException::what().
Referenced by run().


| void MainWindow::setSortOrder | ( | ) | [protected] |
Definition at line 764 of file mainwindow.cc.
References YAPET::UI::ListWidget< T >::getSortOrder(), StatusBar::putMsg(), recordlist, YAPET::UI::ListWidget< T >::refresh(), YAPET::UI::MessageBox::run(), YAPET::UI::ListWidget< T >::setSortOrder(), and statusbar.
Referenced by run().


| void MainWindow::topRightWinContent | ( | ) | throw (YAPET::UI::UIException) [protected] |
Definition at line 211 of file mainwindow.cc.
References KeyDesc::desc, KeyDesc::key, toprightwin, KeyDesc::x, and KeyDesc::y.
Referenced by createWindow(), and refresh().

WINDOW* MainWindow::bottomrightwin [private] |
Definition at line 62 of file mainwindow.h.
Referenced by bottomRightWinContent(), createWindow(), refresh(), resize(), saveFile(), and ~MainWindow().
YAPET::File* MainWindow::file [private] |
Definition at line 68 of file mainwindow.h.
Referenced by addNewRecord(), bottomRightWinContent(), changePassword(), closeFile(), editSelectedRecord(), lockScreen(), printTitle(), run(), saveFile(), searchNext(), searchTerm(), and ~MainWindow().
YAPET::Key* MainWindow::key [private] |
Definition at line 67 of file mainwindow.h.
Referenced by addNewRecord(), bottomRightWinContent(), changePassword(), closeFile(), editSelectedRecord(), lockScreen(), run(), saveFile(), searchNext(), searchTerm(), and ~MainWindow().
unsigned int MainWindow::locktimeout [private] |
Definition at line 70 of file mainwindow.h.
Referenced by bottomRightWinContent(), and run().
Definition at line 63 of file mainwindow.h.
Referenced by addNewRecord(), bottomRightWinContent(), changePassword(), closeFile(), createWindow(), deleteSelectedRecord(), editSelectedRecord(), refresh(), resize(), run(), saveFile(), searchNext(), searchTerm(), setSortOrder(), and ~MainWindow().
bool MainWindow::records_changed [private] |
Definition at line 65 of file mainwindow.h.
Referenced by addNewRecord(), bottomRightWinContent(), changePassword(), closeFile(), deleteSelectedRecord(), editSelectedRecord(), lockScreen(), quit(), run(), and saveFile().
StatusBar MainWindow::statusbar [private] |
Definition at line 64 of file mainwindow.h.
Referenced by addNewRecord(), bottomRightWinContent(), changePassword(), deleteSelectedRecord(), editSelectedRecord(), quit(), refresh(), run(), saveFile(), searchNext(), searchTerm(), and setSortOrder().
WINDOW* MainWindow::toprightwin [private] |
Definition at line 61 of file mainwindow.h.
Referenced by createWindow(), refresh(), resize(), topRightWinContent(), and ~MainWindow().
bool MainWindow::usefsecurity [private] |
Definition at line 72 of file mainwindow.h.
Referenced by bottomRightWinContent().
1.7.1