~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/bookmarks/bookmarks_settings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2003 by Jens Dagerbo                                    *
3
 
 *   jens.dagerbo@swipnet.se                                               *
4
 
 *                                                                         *
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.                                   *
9
 
 *                                                                         *
10
 
 ***************************************************************************/
11
 
 
12
 
#include <qradiobutton.h>
13
 
#include <qcheckbox.h>
14
 
#include <qspinbox.h>
15
 
#include <klineedit.h>
16
 
 
17
 
#include "bookmarks_part.h"
18
 
#include "bookmarks_config.h"
19
 
#include "bookmarks_settings.h"
20
 
 
21
 
 
22
 
BookmarkSettings::BookmarkSettings( BookmarksPart * part, QWidget* parent, const char* name, WFlags fl )
23
 
: BookmarkSettingsBase( parent, name, fl ), m_part( part )
24
 
{
25
 
        m_part->config()->readConfig();
26
 
        
27
 
        if ( m_part->config()->codeline() == BookmarksConfig::Never )
28
 
        {
29
 
                radioButton1->setChecked( true );
30
 
        }
31
 
        else if ( m_part->config()->codeline() == BookmarksConfig::Token )
32
 
        {
33
 
                radioButton2->setChecked( true );
34
 
        }
35
 
        else 
36
 
        {
37
 
                radioButton3->setChecked( true );
38
 
        }
39
 
        
40
 
        checkBox1->setChecked( m_part->config()->toolTip() );
41
 
        spinBox1->setValue( m_part->config()->context() );
42
 
        lineEdit1->setText( m_part->config()->token() );
43
 
}
44
 
 
45
 
BookmarkSettings::~BookmarkSettings()
46
 
{
47
 
}
48
 
 
49
 
void BookmarkSettings::slotAccept()
50
 
{
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() );
59
 
        
60
 
        m_part->config()->writeConfig();
61
 
}
62
 
 
63
 
 
64
 
#include "bookmarks_settings.moc"
65
 
 
66
 
// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;