diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-12-28 14:24:43 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-12-28 17:44:22 +0900 |
commit | f793d1d31f12851284213c645d45276936bba2a3 (patch) | |
tree | a7206970a776bfccf32bbdae54816245281a61d3 /src/knowitpref.cpp | |
parent | d05ea4d721a7b2d782cc6d20d22be46dd2a27603 (diff) | |
download | knowit-f793d1d3.tar.gz knowit-f793d1d3.zip |
Add dockOnStart option to control window show status on startup.
Knowit could already be docked, but on startup the window would
annoyingly show up minimized in the taskbar instead of being fully docked.
The new option allows to choose the window status when starting up in
docked mode: either the window shows in normal state or is fully docked.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 988a55785b3f7afa934eb7d5c7c4debd2fba8d0a)
Diffstat (limited to 'src/knowitpref.cpp')
-rw-r--r-- | src/knowitpref.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/knowitpref.cpp b/src/knowitpref.cpp index e698bb8..4ce1725 100644 --- a/src/knowitpref.cpp +++ b/src/knowitpref.cpp @@ -46,6 +46,7 @@ void KnowitOptions::save(TDEConfig* config) const config->writeEntry("MultipleInstances", multipleInstances); config->setGroup("General"); config->writeEntry("Docked", docked); + config->writeEntry("DockOnStart", dockOnStart); config->writeEntry("Autosave", autosave); config->writeEntry("Reopen", reopen); config->writeEntry("HorizontalSplit", horizontalSplit); @@ -90,6 +91,7 @@ void KnowitOptions::read(TDEConfig* config) multipleInstances = config->readBoolEntry("MultipleInstances", true); config->setGroup("General"); docked = config->readBoolEntry("Docked", false); + dockOnStart = config->readBoolEntry("DockOnStart", false); autosave = config->readNumEntry("Autosave", 0); reopen = config->readBoolEntry("Reopen", true); horizontalSplit = config->readNumEntry("HorizontalSplit", true); @@ -139,8 +141,10 @@ KnowitPreferences::KnowitPreferences() TDEGlobal::iconLoader()->loadIcon(TQString("configure"), TDEIcon::Toolbar, TDEIcon::SizeMedium)); layout = new TQVBoxLayout(page, 0, spacingHint()); layout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock")); + layout->addWidget(dockOnStart = new TQCheckBox(i18n("&Dock on start"), page, "DockOnStart")); layout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen")); - + connect(docked, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateOptions())); + TQHBox* autosaveBox = new TQHBox(page); layout->addWidget(autosaveBox); new TQLabel(i18n("Autosave:"), autosaveBox); @@ -288,12 +292,20 @@ KnowitPreferences::KnowitPreferences() insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->sizeHint().width()); layout->addStretch(1); + connect(insertDateColorButton, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotUpdateDatePreview())); + connect(insertDateFormatEdit, TQ_SIGNAL(textChanged (const TQString &)), this, TQ_SLOT(slotUpdateDatePreview())); + connect(insertDateItalicButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); + connect(insertDateBoldButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); + connect(insertDateUnderlineButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); + setIconListAllVisible(true); } void KnowitPreferences::setOptions(const KnowitOptions& Options) { docked->setChecked(Options.docked); + dockOnStart->setEnabled(Options.docked); + dockOnStart->setChecked(Options.dockOnStart); reopen->setChecked(Options.reopen); autosave->setValue(Options.autosave); unconditionalSave->setChecked(Options.unconditionalSave); @@ -323,11 +335,6 @@ void KnowitPreferences::setOptions(const KnowitOptions& Options) insertDateItalicButton->setOn(Options.insertDateItalic); insertDateUnderlineButton->setOn(Options.insertDateUnderline); slotUpdateDatePreview(); - connect(insertDateColorButton, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotUpdateDatePreview())); - connect(insertDateFormatEdit, TQ_SIGNAL(textChanged (const TQString &)), this, TQ_SLOT(slotUpdateDatePreview())); - connect(insertDateItalicButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); - connect(insertDateBoldButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); - connect(insertDateUnderlineButton, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotUpdateDatePreview())); /* non-GUI options */ firstLink = Options.firstLink; @@ -338,6 +345,7 @@ KnowitOptions KnowitPreferences::getOptions() const { KnowitOptions Options; Options.docked = docked->isChecked(); + Options.dockOnStart = dockOnStart->isChecked(); Options.reopen = reopen->isChecked(); Options.autosave = autosave->value(); Options.unconditionalSave = unconditionalSave->isChecked(); @@ -372,6 +380,11 @@ KnowitOptions KnowitPreferences::getOptions() const return Options; } +void KnowitPreferences::slotUpdateOptions() +{ + dockOnStart->setEnabled(docked->isChecked()); +} + void KnowitPreferences::slotUpdateDatePreview() { TQString str = "<html><p align=\"center\">"; |