[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdewebdev/quanta
From: Andras Mantia <amantia () kde ! org>
Date: 2008-04-15 10:01:41
Message-ID: 1208253701.663541.4003.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 797276 by amantia:
Config dialog now saves the values correctly, the plugin uses them correctly as well. \
At least for the Actions menu setting. Needs a restart of KDevelop though.
M +18 -6 plugins/usertoolbars/usertoolbarsglobalconfig.cpp
M +3 -2 plugins/usertoolbars/usertoolbarsglobalconfig.h
M +4 -69 plugins/usertoolbars/usertoolbarspart.cpp
M +0 -8 plugins/usertoolbars/usertoolbarspart.h
M +19 -19 quanta.kdevelop
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/usertoolbarsglobalconfig.cpp \
#797275:797276 @@ -31,11 +31,8 @@
{
m_ui = new Ui::UserToolbarsGlobalConfigBase;
m_ui->setupUi(this);
- KConfigGroup config( KGlobal::config(), "General" );
- bool separateToolbars = config.readEntry("Separate toolbars", true);
- bool createActionsMenu = config.readEntry("Create Actions menu", true);
- m_ui->separateToolbars->setChecked(separateToolbars);
- m_ui->createActionsMenu->setChecked(createActionsMenu);
+ connect(m_ui->separateToolbars, SIGNAL(stateChanged(int)), this, SLOT(changed()));
+ connect(m_ui->createActionsMenu, SIGNAL(stateChanged(int)), this, \
SLOT(changed())); }
UserToolbarsGlobalConfig::~UserToolbarsGlobalConfig()
@@ -44,12 +41,27 @@
m_ui = 0L;
}
-void UserToolbarsGlobalConfig::accept()
+void UserToolbarsGlobalConfig::load()
{
KConfigGroup config( KGlobal::config(), "General" );
+ bool separateToolbars = config.readEntry("Separate toolbars", false);
+ bool createActionsMenu = config.readEntry("Create Actions menu", true);
+ m_ui->separateToolbars->setChecked(separateToolbars);
+ m_ui->createActionsMenu->setChecked(createActionsMenu);
+}
+
+void UserToolbarsGlobalConfig::save()
+{
+ KConfigGroup config( KGlobal::config(), "General" );
config.writeEntry("Separate toolbars", m_ui->separateToolbars->isChecked());
config.writeEntry("Create Actions menu", (m_ui->createActionsMenu->isChecked()));
config.sync();
}
+void UserToolbarsGlobalConfig::defaults()
+{
+ m_ui->separateToolbars->setChecked(false);
+ m_ui->createActionsMenu->setChecked(true);
+}
+
#include "usertoolbarsglobalconfig.moc"
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/usertoolbarsglobalconfig.h \
#797275:797276 @@ -27,8 +27,9 @@
~UserToolbarsGlobalConfig();
public slots:
- void accept();
-
+ void load();
+ void save();
+ void defaults();
private:
Ui::UserToolbarsGlobalConfigBase *m_ui;
};
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/usertoolbarspart.cpp \
#797275:797276 @@ -96,14 +96,7 @@
setXMLFile("kdevusertoolbars.rc");
setupActions();
-//FIXME: New KCM modules need to be created for each config page
- /*
- m_configProxy = new ConfigWidgetProxy(core());
- m_configProxy->createGlobalConfigPage(i18n("UserToolbars"), GLOBALDOC_OPTIONS, \
info()->icon());
- m_configProxy->createProjectConfigPage(i18n("UserToolbars"), PROJECTDOC_OPTIONS, \
info()->icon());
- connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialog*, QWidget*, \
unsigned int )),
- this, SLOT(insertConfigWidget(const KDialog*, QWidget*, unsigned int)));
- */
+
connect(KDevelop::Core::self()->uiController()->activeMainWindow(), \
SIGNAL(contextMenu(KMenu *, const Koncrete::Context *)), this, \
SLOT(contextMenu(KMenu *, const KDevelop::Context *)));
connect(KDevelop::Core::self()->projectController(), SIGNAL(projectOpened()), \
this, SLOT(projectOpened())); @@ -111,7 +104,6 @@
//setup some member variables
m_userToolbarsCount = 0;
- m_actionsMenuId = -1;
m_outputPlugin = 0L;
QStringList tmpDirs = KGlobal::dirs()->resourceDirs("tmp");
kDebug(24000) << "tmpDirs: " << tmpDirs;
@@ -180,8 +172,8 @@
void UserToolbarsPart::init()
{
- KConfigGroup config( UserToolbarsFactory::componentData().config(), "General" );
- m_separateToolbars = config.readEntry("Separate toolbars", true);
+ KConfigGroup config( KGlobal::config(), "General" );
+ m_separateToolbars = config.readEntry("Separate toolbars", false);
m_createActionsMenu = config.readEntry("Create Actions menu", true);
slotAdjustActions();
ToolbarGUIBuilder::ref(KDevelop::Core::self()->uiController()->activeMainWindow())->setSeparateToolbars(m_separateToolbars);
@@ -191,19 +183,6 @@
{
actionsMenu->menuAction()->setVisible(false);
}
-
-// I keep this for reference for the moment. Jens
- KMenuBar *menuBar = \
KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar();
- for (int i = 0; i < menuBar->count(); i++)
- {
- QMenuItem *it = menuBar->findItem(menuBar->idAt(i));
- if (it->menu() == actionsMenu)
- {
- m_actionsMenuId = menuBar->idAt(i);
- menuBar->setItemVisible(m_actionsMenuId, false);
- break;
- }
- }
}
void UserToolbarsPart::slotAdjustActions()
@@ -264,20 +243,6 @@
connect(action, SIGNAL(triggered(bool)), SLOT(slotConfigureActions()));
}
-void UserToolbarsPart::insertConfigWidget(const KDialog *dlg, QWidget *page, \
unsigned int pageNo)
-{
-// create configuraton dialogs here
-/* switch (pageNo)
- {
- case GLOBALDOC_OPTIONS:
- {
- UserToolbarsGlobalConfig *w = new UserToolbarsGlobalConfig(this, page);
- connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
- break;
- }
- }*/
-}
-
void UserToolbarsPart::contextMenu(KMenu *popup, const KDevelop::Context *context)
{
Q_UNUSED(popup);
@@ -1207,8 +1172,8 @@
ToolbarEntry *p_toolbar = m_toolbarList.value(id);
if (!p_toolbar || !m_createActionsMenu)
return;
+
QMenu *actionsMenu = static_cast<QMenu*>(factory()->container("actions", this));
-// actionsMenu->show();
//Plug in the actions & build the menu
QMenu *menu = new QMenu(actionsMenu);
menu->hide();
@@ -1227,24 +1192,8 @@
}
}
-
actionsMenu->addMenu(menu);
- if (m_actionsMenuId == -1)
- {
- KMenuBar *menuBar = \
KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar();
- for (uint i = 0; i < menuBar->count(); i++)
- {
- QMenuItem *it = menuBar->findItem(menuBar->idAt(i));
- if (it->menu() == actionsMenu)
- {
- m_actionsMenuId = menuBar->idAt(i);
- break;
- }
- }
- }
actionsMenu->menuAction()->setVisible(true);
- /* if (m_actionsMenuId != -1)
- KDevelop::Core::self()->uiController()->activeMainWindow()->menuBar()->setItemVisible(m_actionsMenuId, \
true);*/ p_toolbar->menu = menu;
}
@@ -1394,18 +1343,4 @@
}*/
}
-void UserToolbarsPart::saveConfig()
-{
- KConfigGroup config( UserToolbarsFactory::componentData().config(), "General" );
- config.writeEntry("Separate toolbars", m_separateToolbars);
- config.writeEntry("Create Actions menu", m_createActionsMenu);
- config.sync();
-}
-
-
-void UserToolbarsPart::go()
-{
- QMessageBox::information(0, "test", "go go go");
-}
-
#include "usertoolbarspart.moc"
--- trunk/KDE/kdewebdev/quanta/plugins/usertoolbars/usertoolbarspart.h #797275:797276
@@ -61,13 +61,7 @@
*/
void setSeparateToolbars(bool separate);
bool separateToolbars() {return m_separateToolbars;}
- /**
- * Saves the configuration in the plugin's rc file.
- */
- void saveConfig();
- void go();
-
public slots:
/**
* Delete an action
@@ -79,7 +73,6 @@
private slots:
void init();
- void insertConfigWidget(const KDialog *dlg, QWidget *page, unsigned int pageNo);
void contextMenu(KMenu *popup, const KDevelop::Context *context);
void projectOpened();
void projectClosed();
@@ -251,7 +244,6 @@
int m_currentTabPage; ///< the index of the currently visible toolbar tab
bool m_separateToolbars; ///< if true, the toolbars are created as standalone \
toolbars, not as part of a tabwidget
bool m_createActionsMenu; ///< if true a menu is created with the user actions, \
grouped by toolbars in submenus
- int m_actionsMenuId; ///< the id of the Actions menu in the menubar
KDevelop::IPlugin *m_outputPlugin;
};
--- trunk/KDE/kdewebdev/quanta/quanta.kdevelop #797275:797276
@@ -14,8 +14,8 @@
<secondaryLanguages>
<language>C</language>
</secondaryLanguages>
- <description></description>
- <defaultencoding></defaultencoding>
+ <description/>
+ <defaultencoding/>
<versioncontrol/>
<projectname>quanta</projectname>
</general>
@@ -38,7 +38,7 @@
<envvar value="/opt/qt4" name="QTDIR" />
<envvar value="/opt/kde4/share:$XDG_DATA_DIRS" name="XDG_DATA_DIRS" />
</envvars>
- <globaldebugarguments></globaldebugarguments>
+ <globaldebugarguments/>
<globalcwd>/data/development/build/kde-trunk/kdewebdev</globalcwd>
<useglobalprogram>false</useglobalprogram>
<autoinstall>false</autoinstall>
@@ -52,7 +52,7 @@
<abortonerror>true</abortonerror>
<numberofjobs>2</numberofjobs>
<dontact>false</dontact>
- <makebin></makebin>
+ <makebin/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default>
@@ -63,8 +63,8 @@
</default>
</environments>
<prio>0</prio>
- <defaulttarget></defaulttarget>
- <makeoptions></makeoptions>
+ <defaulttarget/>
+ <makeoptions/>
</make>
<general>
<projectmanagement>KDevCustomProject</projectmanagement>
@@ -91,9 +91,9 @@
<blacklist/>
<other>
<prio>0</prio>
- <otherbin></otherbin>
- <defaulttarget></defaulttarget>
- <otheroptions></otheroptions>
+ <otherbin/>
+ <defaulttarget/>
+ <otheroptions/>
<selectedenvironment>default</selectedenvironment>
<environments>
<default/>
@@ -102,16 +102,16 @@
</kdevcustomproject>
<kdevfilecreate>
<filetypes>
- <type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
+ <type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<descr>A new empty C++ file.</descr>
</type>
- <type icon="source_h" ext="h" name="C/C++ Header" create="template" >
+ <type icon="source_h" ext="h" create="template" name="C/C++ Header" >
<descr>A new empty header file for C or C++.</descr>
</type>
- <type icon="source_cpp" ext="cpp" name="C++ Source" create="template" >
+ <type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<descr>A new empty C++ file.</descr>
</type>
- <type icon="source_f" ext="for" name="Preprocessed Fortran" create="template" \
> + <type icon="source_f" ext="for" create="template" name="Preprocessed \
> Fortran" >
<descr>A new empty preprocessed Fortran file.</descr>
</type>
</filetypes>
@@ -181,7 +181,7 @@
<designerpluginpaths/>
</qt>
<creategettersetter>
- <prefixGet></prefixGet>
+ <prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@@ -214,11 +214,11 @@
<projectdirectory>/data/development/sources/kde-trunk/kdewebdev</projectdirectory>
<absoluteprojectpath>true</absoluteprojectpath>
<programargs/>
- <gdbpath></gdbpath>
- <dbgshell></dbgshell>
- <configGdbScript></configGdbScript>
- <runShellScript></runShellScript>
- <runGdbScript></runGdbScript>
+ <gdbpath/>
+ <dbgshell/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic