You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdewebdev/quanta/dialogs/settings/previewoptions.cpp

128 lines
3.7 KiB

/***************************************************************************
previewoptions.cpp - description
-------------------
begin : Fri Aug 4 2000
copyright : (C) 2000 by Dmitry Poplavsky & Alexander Yakovlev & Eric Laffoon <pdima@users.sourceforge.net,yshurik@penguinpowered.com,sequitur@easystreet.com>
(C) 2002, 2004 Andras Mantia <amantia@kde.org>
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#include "previewoptions.h"
#include "previewoptions.moc"
// qt includes
#include <tqradiobutton.h>
#include <tqcheckbox.h>
// kde includes
#include <klocale.h>
#include <kmessagebox.h>
PreviewOptions::PreviewOptions(TQWidget *tqparent, const char *name)
: PreviewOptionsS(tqparent,name)
{
}
PreviewOptions::~PreviewOptions(){
}
void PreviewOptions::setWindowLayout(const TQString& tqlayout )
{
if ( tqlayout == "Default") resetLayout->setChecked(true);
else resetLayout->setChecked(false);
}
void PreviewOptions::setPosition(const TQString& position )
{
radioEditor->setChecked(true);
if ( position == "Toolview" ) radioToolview->setChecked(true);
}
TQString PreviewOptions::position()
{
TQString position = "Editor";
if ( radioToolview->isChecked() )
position = "Toolview";
return position;
}
void PreviewOptions::setDocPosition(const TQString &position)
{
radioNewDocTab->setChecked(true);
if (position == "Toolview") radioSeparateDocView->setChecked(true);
}
TQString PreviewOptions::docPosition()
{
TQString position = "Tab";
if (radioSeparateDocView->isChecked()) position = "Toolview";
return position;
}
TQString PreviewOptions::tqlayout()
{
TQString tqlayout = "Custom";
if ( resetLayout->isChecked() )
tqlayout = "Default";
return tqlayout;
}
TQString PreviewOptions::closeButtons()
{
TQString closeButtonState = "ShowAlways";
if (radioDelayedCloseButtons->isChecked())
closeButtonState = "ShowDelayed";
if (radioNoCloseButtons->isChecked())
closeButtonState = "Disabled";
return closeButtonState;
}
void PreviewOptions::setCloseButtons(const TQString &state)
{
if (state == "ShowAlways") radioShowCloseButtons->setChecked(true);
if (state == "ShowDelayed") radioDelayedCloseButtons->setChecked(true);
if (state == "Disabled") radioNoCloseButtons->setChecked(true);
}
void PreviewOptions::setToolviewTabs(uint state)
{
radioIcon->setChecked(true);
if (state == 3) radioIconText->setChecked(true);
if (state == 1) radioText->setChecked(true);
m_toolviewTabs = state;
}
uint PreviewOptions::toolviewTabs()
{
uint state = 0;
if (radioIconText->isChecked()) state = 3;
if (radioText->isChecked()) state = 1;
return state;
}
void PreviewOptions::setHiddenFiles(bool show)
{
showHidden->setChecked(show);
}
bool PreviewOptions::hiddenFiles()
{
return showHidden->isChecked();
}
void PreviewOptions::setSaveTrees(bool show)
{
saveLocalTrees->setChecked(show);
}
bool PreviewOptions::saveTrees()
{
return saveLocalTrees->isChecked();
}