KDevelop API Documentation

bookmarks_settings.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Jens Dagerbo                                    *
00003  *   jens.dagerbo@swipnet.se                                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include <qradiobutton.h>
00013 #include <qcheckbox.h>
00014 #include <qspinbox.h>
00015 #include <qlineedit.h>
00016 
00017 #include "bookmarks_part.h"
00018 #include "bookmarks_config.h"
00019 #include "bookmarks_settings.h"
00020 
00021 
00022 BookmarkSettings::BookmarkSettings( BookmarksPart * part, QWidget* parent, const char* name, WFlags fl )
00023 : BookmarkSettingsBase( parent, name, fl ), m_part( part )
00024 {
00025     m_part->config()->readConfig();
00026     
00027     if ( m_part->config()->codeline() == BookmarksConfig::Never )
00028     {
00029         radioButton1->setChecked( true );
00030     }
00031     else if ( m_part->config()->codeline() == BookmarksConfig::Token )
00032     {
00033         radioButton2->setChecked( true );
00034     }
00035     else 
00036     {
00037         radioButton3->setChecked( true );
00038     }
00039     
00040     checkBox1->setChecked( m_part->config()->toolTip() );
00041     spinBox1->setValue( m_part->config()->context() );
00042     lineEdit1->setText( m_part->config()->token() );
00043 }
00044 
00045 BookmarkSettings::~BookmarkSettings()
00046 {
00047 }
00048 
00049 void BookmarkSettings::slotAccept()
00050 {
00051     BookmarksConfig::CodeLineType codeline = BookmarksConfig::Never;
00052     codeline = radioButton1->isChecked() ? BookmarksConfig::Never : codeline;
00053     codeline = radioButton2->isChecked() ? BookmarksConfig::Token : codeline;
00054     codeline = radioButton3->isChecked() ? BookmarksConfig::Always : codeline;
00055     m_part->config()->setCodeline( codeline );
00056     m_part->config()->setToolTip( checkBox1->isChecked() );
00057     m_part->config()->setContext( spinBox1->value() );
00058     m_part->config()->setToken( lineEdit1->text() );
00059     
00060     m_part->config()->writeConfig();
00061 }
00062 
00063 
00064 #include "bookmarks_settings.moc"
00065 
00066 // kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:54 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003