• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Generic Shell
 

KDevelop Generic Shell

  • src
kdevideextension.cpp
1/***************************************************************************
2 * Copyright (C) 2004 by Alexander Dymo *
3 * adymo@kdevelop.org *
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 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20#include "kdevideextension.h"
21
22#include <tqvbox.h>
23#include <tqcheckbox.h>
24#include <tqbuttongroup.h>
25#include <tqradiobutton.h>
26#include <tqcombobox.h>
27#include <klineedit.h>
28
29#include <tdelocale.h>
30#include <tdeconfig.h>
31#include <kdialogbase.h>
32#include <kiconloader.h>
33#include <kurlrequester.h>
34#include <tdeapplication.h>
35#include <tdefontrequester.h>
36
37#include <kdevplugin.h>
38#include <kdevmakefrontend.h>
39#include <kdevplugincontroller.h>
40
41#include "api.h"
42#include "settingswidget.h"
43
44KDevIDEExtension::KDevIDEExtension()
45 : ShellExtension()
46{
47}
48
49void KDevIDEExtension::init()
50{
51 s_instance = new KDevIDEExtension();
52}
53
54void KDevIDEExtension::createGlobalSettingsPage(KDialogBase *dlg)
55{
56 TDEConfig* config = kapp->config();
57 TQVBox *vbox = dlg->addVBoxPage(i18n("General"), i18n("General"), BarIcon("tdevelop", TDEIcon::SizeMedium) );
58 gsw = new SettingsWidget(vbox, "general settings widget");
59
60 gsw->projectsURL->setMode((int)KFile::Directory);
61
62 config->setGroup("General Options");
63 gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true));
64 gsw->outputFont->setFont( config->readFontEntry( "OutputViewFont" ) );
65 config->setGroup("MakeOutputView");
66 gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true));
67 gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false));
68 gsw->compileOutputCombo->setCurrentItem(config->readNumEntry("CompilerOutputLevel",2));
69 gsw->forceCLocaleRadio->setChecked( config->readBoolEntry( "ForceCLocale", true ) );
70 gsw->userLocaleRadio->setChecked( !config->readBoolEntry( "ForceCLocale", true ) );
71
72 config->setGroup("General Options");
73 gsw->projectsURL->setURL(config->readPathEntry("DefaultProjectsDir", TQDir::homeDirPath()+"/"));
74 gsw->designerButtonGroup->setButton( config->readNumEntry( "DesignerApp", 0 ) );
75
76 TQString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
77 gsw->qtDesignerRadioButton->setChecked( DesignerSetting == "ExternalDesigner" );
78 gsw->seperateAppRadioButton->setChecked( DesignerSetting == "ExternalKDevDesigner" );
79 gsw->embeddedDesignerRadioButton->setChecked( DesignerSetting == "EmbeddedKDevDesigner" );
80
81 config->setGroup("TerminalEmulator");
82 gsw->terminalEdit->setText( config->readEntry( "TerminalApplication", TQString::fromLatin1("konsole") ) );
83 bool useKDESetting = config->readBoolEntry( "UseKDESetting", true );
84 gsw->useKDETerminal->setChecked( useKDESetting );
85 gsw->useOtherTerminal->setChecked( !useKDESetting );
86}
87
88void KDevIDEExtension::acceptGlobalSettingsPage(KDialogBase *dlg)
89{
90 TDEConfig* config = kapp->config();
91
92 config->setGroup("General Options");
93 config->writeEntry("DesignerApp", gsw->designerButtonGroup->selectedId());
94 config->writeEntry("Read Last Project On Startup",gsw->lastProjectCheckbox->isChecked());
95 config->writePathEntry("DefaultProjectsDir", gsw->projectsURL->url());
96 config->writeEntry("OutputViewFont", gsw->outputFont->font());
97
98 TQString DesignerSetting;
99 if ( gsw->qtDesignerRadioButton->isChecked() ) DesignerSetting = "ExternalDesigner";
100 if ( gsw->seperateAppRadioButton->isChecked() ) DesignerSetting = "ExternalKDevDesigner";
101 if ( gsw->embeddedDesignerRadioButton->isChecked() ) DesignerSetting = "EmbeddedKDevDesigner";
102 config->writeEntry( "DesignerSetting", DesignerSetting );
103
104 config->setGroup("MakeOutputView");
105 config->writeEntry("LineWrapping",gsw->lineWrappingCheckBox->isChecked());
106 config->writeEntry("ShowDirNavigMsg",gsw->dirNavigMsgCheckBox->isChecked());
107 config->writeEntry( "ForceCLocale", gsw->forceCLocaleRadio->isChecked() );
108 //current item id must be in sync with the enum!
109 config->writeEntry("CompilerOutputLevel",gsw->compileOutputCombo->currentItem());
110 config->sync();
111 if( KDevPlugin *makeExt = API::getInstance()->pluginController()->extension("TDevelop/MakeFrontend"))
112 {
113 static_cast<KDevMakeFrontend*>(makeExt)->updateSettingsFromConfig();
114 }
115
116 config->setGroup("TerminalEmulator");
117 config->writeEntry("UseKDESetting", gsw->useKDETerminal->isChecked() );
118 config->writeEntry("TerminalApplication", gsw->terminalEdit->text().stripWhiteSpace() );
119}
120
121TQString KDevIDEExtension::xmlFile()
122{
123 return "tdevelopui.rc";
124}
125
126TQString KDevIDEExtension::defaultProfile()
127{
128 return "IDE";
129}
ShellExtension
Shell extension.
Definition shellextension.h:32

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Generic Shell by doxygen 1.9.8
This website is maintained by Timothy Pearson.