1
/***************************************************************************
2
* Copyright (C) 2003 by Jens Dagerbo *
3
* jens.dagerbo@swipnet.se *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#include <qradiobutton.h>
13
#include <qcheckbox.h>
15
#include <klineedit.h>
17
#include "bookmarks_part.h"
18
#include "bookmarks_config.h"
19
#include "bookmarks_settings.h"
22
BookmarkSettings::BookmarkSettings( BookmarksPart * part, QWidget* parent, const char* name, WFlags fl )
23
: BookmarkSettingsBase( parent, name, fl ), m_part( part )
25
m_part->config()->readConfig();
27
if ( m_part->config()->codeline() == BookmarksConfig::Never )
29
radioButton1->setChecked( true );
31
else if ( m_part->config()->codeline() == BookmarksConfig::Token )
33
radioButton2->setChecked( true );
37
radioButton3->setChecked( true );
40
checkBox1->setChecked( m_part->config()->toolTip() );
41
spinBox1->setValue( m_part->config()->context() );
42
lineEdit1->setText( m_part->config()->token() );
45
BookmarkSettings::~BookmarkSettings()
49
void BookmarkSettings::slotAccept()
51
BookmarksConfig::CodeLineType codeline = BookmarksConfig::Never;
52
codeline = radioButton1->isChecked() ? BookmarksConfig::Never : codeline;
53
codeline = radioButton2->isChecked() ? BookmarksConfig::Token : codeline;
54
codeline = radioButton3->isChecked() ? BookmarksConfig::Always : codeline;
55
m_part->config()->setCodeline( codeline );
56
m_part->config()->setToolTip( checkBox1->isChecked() );
57
m_part->config()->setContext( spinBox1->value() );
58
m_part->config()->setToken( lineEdit1->text() );
60
m_part->config()->writeConfig();
64
#include "bookmarks_settings.moc"
66
// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;