|
|
|
@ -44,6 +44,7 @@
|
|
|
|
|
#include <kinputdialog.h>
|
|
|
|
|
#include <tdefiledialog.h>
|
|
|
|
|
#include <kdesktopfile.h>
|
|
|
|
|
#include <tdeapplication.h>
|
|
|
|
|
#include "konqsidebar.h"
|
|
|
|
|
|
|
|
|
|
#include "sidebar_widget.h"
|
|
|
|
@ -65,10 +66,19 @@ addBackEnd::addBackEnd(TQWidget *parent, class TQPopupMenu *addmenu,
|
|
|
|
|
|
|
|
|
|
void addBackEnd::aboutToShowAddMenu()
|
|
|
|
|
{
|
|
|
|
|
TQStringList m_restrictedViews( dynamic_cast<Sidebar_Widget *>( m_parent )->getRestrictedViews() );
|
|
|
|
|
if (!menu)
|
|
|
|
|
return;
|
|
|
|
|
TDEStandardDirs *dirs = TDEGlobal::dirs();
|
|
|
|
|
TQStringList list = dirs->findAllResources("data","konqsidebartng/add/*.desktop",true,true);
|
|
|
|
|
TQStringList list;
|
|
|
|
|
|
|
|
|
|
if ( ! m_restrictedViews.empty() ) {
|
|
|
|
|
for ( TQStringList::Iterator it = m_restrictedViews.begin(); it != m_restrictedViews.end(); ++it ) {
|
|
|
|
|
list += dirs->findAllResources("data","konqsidebartng/add/" + *it + ".desktop",true,true);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
list = dirs->findAllResources( "data","konqsidebartng/add/*.desktop",true,true );
|
|
|
|
|
}
|
|
|
|
|
libNames.setAutoDelete(true);
|
|
|
|
|
libNames.resize(0);
|
|
|
|
|
libParam.setAutoDelete(true);
|
|
|
|
@ -647,15 +657,14 @@ void Sidebar_Widget::readConfig()
|
|
|
|
|
{
|
|
|
|
|
m_disableConfig = m_config->readBoolEntry("DisableConfig",false);
|
|
|
|
|
m_singleWidgetMode = m_config->readBoolEntry("SingleWidgetMode",true);
|
|
|
|
|
m_immutableSingleWidgetMode =
|
|
|
|
|
m_config->entryIsImmutable("SingleWidgetMode");
|
|
|
|
|
m_immutableSingleWidgetMode = m_config->entryIsImmutable("SingleWidgetMode");
|
|
|
|
|
m_showExtraButtons = m_config->readBoolEntry("ShowExtraButtons",false);
|
|
|
|
|
m_immutableShowExtraButtons =
|
|
|
|
|
m_config->entryIsImmutable("ShowExtraButtons");
|
|
|
|
|
m_immutableShowExtraButtons = m_config->entryIsImmutable("ShowExtraButtons");
|
|
|
|
|
m_showTabsLeft = m_config->readBoolEntry("ShowTabsLeft", true);
|
|
|
|
|
m_immutableShowTabsLeft = m_config->entryIsImmutable("ShowTabsLeft");
|
|
|
|
|
m_hideTabs = m_config->readBoolEntry("HideTabs", false);
|
|
|
|
|
m_immutableHideTabs = m_config->entryIsImmutable("HideTabs");
|
|
|
|
|
m_restrictedViews = m_config->readListEntry( "RestrictViews" );
|
|
|
|
|
|
|
|
|
|
if (m_initial) {
|
|
|
|
|
m_openViews = m_config->readListEntry("OpenViews");
|
|
|
|
@ -722,9 +731,19 @@ void Sidebar_Widget::createButtons()
|
|
|
|
|
{
|
|
|
|
|
kdDebug()<<"m_path: "<<m_path<<endl;
|
|
|
|
|
TQDir dir(m_path);
|
|
|
|
|
TQStringList list=dir.entryList("*.desktop");
|
|
|
|
|
TQStringList list;
|
|
|
|
|
|
|
|
|
|
if ( ! m_restrictedViews.empty() ) {
|
|
|
|
|
for ( TQStringList::Iterator it = m_restrictedViews.begin(); it != m_restrictedViews.end(); ++it ) {
|
|
|
|
|
list += dir.entryList( *it + ".desktop");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
list = dir.entryList("*.desktop");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (TQStringList::Iterator it=list.begin(); it!=list.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
kdDebug() << "Sidebar buttons: " << *it << endl;
|
|
|
|
|
addButton(*it);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -833,7 +852,7 @@ bool Sidebar_Widget::addButton(const TQString &desktoppath,int pos)
|
|
|
|
|
|
|
|
|
|
bool Sidebar_Widget::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if ( kapp->authorize( "action/konqsidebarmenu" ) ) {
|
|
|
|
|
if (ev->type()==TQEvent::MouseButtonPress && ((TQMouseEvent *)ev)->button()==Qt::RightButton)
|
|
|
|
|
{
|
|
|
|
|
KMultiTabBarTab *bt=tqt_dynamic_cast<KMultiTabBarTab*>(obj);
|
|
|
|
@ -876,15 +895,17 @@ bool Sidebar_Widget::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Sidebar_Widget::mousePressEvent(TQMouseEvent *ev)
|
|
|
|
|
{
|
|
|
|
|
if (ev->type()==TQEvent::MouseButtonPress &&
|
|
|
|
|
((TQMouseEvent *)ev)->button()==Qt::RightButton &&
|
|
|
|
|
!m_disableConfig)
|
|
|
|
|
{ m_menu->exec(TQCursor::pos()); }
|
|
|
|
|
if ( kapp->authorize( "action/konqsidebarmenu" ) ) {
|
|
|
|
|
if (ev->type()==TQEvent::MouseButtonPress && ((TQMouseEvent *)ev)->button()==Qt::RightButton) {
|
|
|
|
|
m_menu->exec(TQCursor::pos());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KonqSidebarPlugin *Sidebar_Widget::loadModule(TQWidget *par,TQString &desktopName,TQString lib_name,ButtonInfo* bi)
|
|
|
|
|