diff options
Diffstat (limited to 'src/MainWidget.cpp')
-rw-r--r-- | src/MainWidget.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/MainWidget.cpp b/src/MainWidget.cpp index 0ca175b..80a2b31 100644 --- a/src/MainWidget.cpp +++ b/src/MainWidget.cpp @@ -516,12 +516,14 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const bool fnt_autores = cfg->readBoolEntry("autoresfont",true); m->setItemChecked(mnu_autores, fnt_autores); - mnu_dock = m->insertItem ( "Dock widget", this, TQT_SLOT ( showDock() ) ); bool show_dock = cfg->readBoolEntry("showdock",false); - m->setItemChecked(mnu_dock, show_dock); + mnu_lock = m->insertItem(i18n("Lock on screen"), this, TQT_SLOT(toggleLock())); + bool is_locked = cfg->readBoolEntry("locked", false); + m->setItemChecked(mnu_lock, is_locked); + //m->insertItem("Configure", this, TQT_SLOT(config())); m->insertSeparator(); m->insertItem ( "Help", h->menu() ); @@ -728,6 +730,7 @@ void MainWidget::chooseFont() if (c)show(); updateFont(); } + void MainWidget::quitClicked() { if (stand_alone) @@ -735,6 +738,19 @@ void MainWidget::quitClicked() else hide(); } + +void MainWidget::toggleLock() +{ + bool c = isLocked(); + + tray->contextMenu()->setItemChecked(mnu_lock, !c); + setLocked(!c); + + TDEConfig *cfg = TDEApplication::kApplication()->config(); + cfg->writeEntry("locked", !c); + cfg->sync(); +} + void MainWidget::showDock() { bool c = dock->isShown(); |