You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
566 lines
20 KiB
566 lines
20 KiB
15 years ago
|
/***************************************************************************
|
||
|
* Copyright (C) 2004 by Alexander Dymo *
|
||
|
* cloudtemple@mksat.net *
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License as published by *
|
||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||
|
* (at your option) any later version. *
|
||
|
* *
|
||
|
* This program is distributed in the hope that it will be useful, *
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||
|
* GNU General Public License for more details. *
|
||
|
* *
|
||
|
* You should have received a copy of the GNU General Public License *
|
||
|
* along with this program; if not, write to the *
|
||
|
* Free Software Foundation, Inc., *
|
||
15 years ago
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||
15 years ago
|
***************************************************************************/
|
||
|
|
||
11 years ago
|
#include "tdevdesigner_part.h"
|
||
15 years ago
|
|
||
|
#include <kinstance.h>
|
||
12 years ago
|
#include <tdeaction.h>
|
||
|
#include <tdeactionclasses.h>
|
||
15 years ago
|
#include <kstdaction.h>
|
||
12 years ago
|
#include <tdefiledialog.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <kiconloader.h>
|
||
|
|
||
15 years ago
|
#include <tqfile.h>
|
||
13 years ago
|
#include <tqtextstream.h>
|
||
15 years ago
|
#include <tqtoolbar.h>
|
||
|
#include <tqmenubar.h>
|
||
|
#include <tqptrlist.h>
|
||
|
#include <tqstatusbar.h>
|
||
15 years ago
|
|
||
|
#include "mainwindow.h"
|
||
|
#include "designeraction.h"
|
||
|
#include "formwindow.h"
|
||
|
|
||
11 years ago
|
TDevDesignerPart::TDevDesignerPart( TQWidget *parentWidget, const char *// widgetName
|
||
15 years ago
|
,
|
||
14 years ago
|
TQObject *parent, const char *name, const TQStringList &args )
|
||
|
: KInterfaceDesigner::Designer(parent, name)
|
||
15 years ago
|
{
|
||
11 years ago
|
setInstance( TDevDesignerPartFactory::instance() );
|
||
15 years ago
|
|
||
|
m_widget = new MainWindow( this, true );
|
||
14 years ago
|
m_widget->reparent(parentWidget, TQPoint(0,0));
|
||
15 years ago
|
setupDesignerWindow();
|
||
|
|
||
|
setWidget(m_widget);
|
||
|
|
||
|
setupActions();
|
||
14 years ago
|
if (args.contains("in shell"))
|
||
11 years ago
|
setXMLFile("tdevdesigner_part_sh.rc");
|
||
15 years ago
|
else
|
||
11 years ago
|
setXMLFile("tdevdesigner_part.rc");
|
||
15 years ago
|
|
||
|
setReadWrite(true);
|
||
|
setModified(false);
|
||
|
|
||
15 years ago
|
connect(m_widget, TQT_SIGNAL(formModified(bool )), this, TQT_SLOT(formModified(bool)));
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setupDesignerWindow()
|
||
15 years ago
|
{
|
||
|
m_widget->menuBar()->hide();
|
||
14 years ago
|
m_widget->layoutToolBar->hide();
|
||
15 years ago
|
m_widget->projectToolBar->hide();
|
||
|
m_widget->toolsToolBar->hide();
|
||
|
m_widget->statusBar()->hide();
|
||
|
}
|
||
|
|
||
15 years ago
|
static TQIconSet createPartIconSet( const TQString &name )
|
||
15 years ago
|
{
|
||
11 years ago
|
TQIconSet ic( BarIcon( "" + name, TDevDesignerPartFactory::instance() ) );
|
||
15 years ago
|
TQString prefix = "designer_";
|
||
15 years ago
|
int right = name.length() - prefix.length();
|
||
11 years ago
|
ic.setPixmap( BarIcon( prefix + "d_" + name.right( right ), TDevDesignerPartFactory::instance() ),
|
||
15 years ago
|
TQIconSet::Small, TQIconSet::Disabled );
|
||
15 years ago
|
return ic;
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setupActions( )
|
||
15 years ago
|
{
|
||
12 years ago
|
TDEAction *action;
|
||
15 years ago
|
action = KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection());
|
||
|
action = KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
|
||
|
action = KStdAction::close(this, TQT_SLOT(fileClose()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionFileClose);
|
||
15 years ago
|
action = KStdAction::save(this, TQT_SLOT(save()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionFileSave);
|
||
15 years ago
|
action = KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionFileSaveAs);
|
||
12 years ago
|
action = new TDEAction(i18n("Save Al&l"), 0, this, TQT_SLOT(fileSaveAs()), actionCollection(), "file_saveall");
|
||
15 years ago
|
stateSync(action, m_widget->actionFileSaveAll);
|
||
12 years ago
|
new TDEAction(i18n("Create &Template..."), 0, this, TQT_SLOT(fileCreateTemplate()), actionCollection(), "file_createtemplate");
|
||
15 years ago
|
|
||
15 years ago
|
action = KStdAction::undo(this, TQT_SLOT(editUndo()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditUndo);
|
||
15 years ago
|
action = KStdAction::redo(this, TQT_SLOT(editRedo()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditRedo);
|
||
15 years ago
|
action = KStdAction::cut(this, TQT_SLOT(editCut()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditCut);
|
||
15 years ago
|
action = KStdAction::copy(this, TQT_SLOT(editCopy()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditCopy);
|
||
15 years ago
|
action = KStdAction::paste(this, TQT_SLOT(editPaste()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditPaste);
|
||
12 years ago
|
action = new TDEAction(i18n("&Delete"), Key_Delete, this, TQT_SLOT(editDelete()), actionCollection(), "edit_delete");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditDelete);
|
||
15 years ago
|
action = KStdAction::selectAll(this, TQT_SLOT(editSelectAll()), actionCollection());
|
||
15 years ago
|
stateSync(action, m_widget->actionEditSelectAll);
|
||
12 years ago
|
action = new TDEAction(i18n("Chec&k Accelerators"), ALT + Key_R, this, TQT_SLOT(editAccels()), actionCollection(), "edit_accels");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditAccels);
|
||
12 years ago
|
action = new TDEAction(i18n("S&lots..."), createPartIconSet("designer_editslots.png"), 0, this, TQT_SLOT(editFunctions()), actionCollection(), "edit_functions");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditFunctions);
|
||
12 years ago
|
action = new TDEAction(i18n("Co&nnections..."), createPartIconSet("designer_connecttool.png"), 0, this, TQT_SLOT(editConnections()), actionCollection(), "edit_connections");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditConnections);
|
||
12 years ago
|
action = new TDEAction(i18n("&Form Settings..."), 0, this, TQT_SLOT(editFormSettings()), actionCollection(), "edit_formsettings");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditFormSettings);
|
||
|
|
||
12 years ago
|
action = new TDEAction(i18n("&Add File..."), 0, this, TQT_SLOT(projectAddFile()), actionCollection(), "project_addfile");
|
||
15 years ago
|
stateSync(action, m_widget->actionProjectAddFile);
|
||
12 years ago
|
action = new TDEAction(i18n("&Image Collection..."), 0, this, TQT_SLOT(projectImageCollection()), actionCollection(), "project_imagecollection");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditPixmapCollection);
|
||
12 years ago
|
action = new TDEAction(i18n("&Database Connections..."), 0, this, TQT_SLOT(projectDatabaseCollections()), actionCollection(), "project_databasecollections");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditDatabaseConnections);
|
||
12 years ago
|
action = new TDEAction(i18n("&Designer Project Settings..."), 0, this, TQT_SLOT(projectSettings()), actionCollection(), "project_settings");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditProjectSettings);
|
||
|
|
||
12 years ago
|
TDERadioAction *toggle;
|
||
|
toggle = new TDERadioAction(i18n("&Pointer"), createPartIconSet("designer_pointer.png"), Key_F2, actionCollection(), "tools_pointer");
|
||
15 years ago
|
setupToolsAction(toggle, m_widget->actionPointerTool);
|
||
|
pointerAction = toggle;
|
||
12 years ago
|
toggle = new TDERadioAction(i18n("&Connect Signal/Slots"), createPartIconSet("designer_connecttool.png"), Key_F3, actionCollection(), "tools_connect");
|
||
15 years ago
|
setupToolsAction(toggle, m_widget->actionConnectTool);
|
||
12 years ago
|
toggle = new TDERadioAction(i18n("Tab &Order"), createPartIconSet("designer_ordertool.png"), Key_F4, actionCollection(), "tools_taborder");
|
||
15 years ago
|
setupToolsAction(toggle, m_widget->actionOrderTool);
|
||
12 years ago
|
toggle = new TDERadioAction(i18n("Set &Buddy"), createPartIconSet("designer_setbuddy.png"), Key_F12, actionCollection(), "tools_setbuddy");
|
||
15 years ago
|
setupToolsAction(toggle, m_widget->actionBuddyTool);
|
||
12 years ago
|
new TDEAction(i18n("Configure Toolbox..."), 0, this, TQT_SLOT(toolsConfigureToolbox()), actionCollection(), "tools_toolbox");
|
||
|
new TDEAction(i18n("Edit &Custom Widgets..."), 0, this, TQT_SLOT(toolsEditCustomWidgets()), actionCollection(), "tools_editcustomwidgets");
|
||
15 years ago
|
|
||
12 years ago
|
action = new TDEAction(i18n("Adjust &Size"), createPartIconSet("designer_adjustsize.png"), CTRL + Key_J, this, TQT_SLOT(layoutAdjustSize()), actionCollection(), "layout_adjustsize");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditAdjustSize);
|
||
12 years ago
|
action = new TDEAction(i18n("Lay Out &Horizontally"), createPartIconSet("designer_edithlayout.png"), CTRL + Key_H, this, TQT_SLOT(layoutHLayout()), actionCollection(), "layout_h");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditHLayout);
|
||
12 years ago
|
action = new TDEAction(i18n("Lay Out &Vertically"), createPartIconSet("designer_editvlayout.png"), CTRL + Key_V, this, TQT_SLOT(layoutVLayout()), actionCollection(), "layout_v");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditVLayout);
|
||
12 years ago
|
action = new TDEAction(i18n("Lay Out in &Grid"), createPartIconSet("designer_editgrid.png"), CTRL + Key_G, this, TQT_SLOT(layoutGridLayout()), actionCollection(), "layout_grid");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditGridLayout);
|
||
12 years ago
|
action = new TDEAction(i18n("Lay OutQt::Horizontally (in S&plitter)"), createPartIconSet("designer_editvlayoutsplit.png"), 0, this, TQT_SLOT(layoutSplitHLayout()), actionCollection(), "layout_splith");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditSplitHorizontal);
|
||
12 years ago
|
action = new TDEAction(i18n("Lay OutQt::Vertically (in Sp&litter)"), createPartIconSet("designer_edithlayoutsplit.png"), 0, this, TQT_SLOT(layoutSplitVLayout()), actionCollection(), "layout_splitv");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditSplitVertical);
|
||
12 years ago
|
action = new TDEAction(i18n("&Break Layout"), createPartIconSet("designer_editbreaklayout.png"), CTRL + Key_B, this, TQT_SLOT(layoutBreak()), actionCollection(), "layout_break");
|
||
15 years ago
|
stateSync(action, m_widget->actionEditBreakLayout);
|
||
12 years ago
|
toggle = new TDERadioAction(i18n("Add Spacer"), createPartIconSet("designer_spacer.png"), 0, actionCollection(), "layout_spacer");
|
||
15 years ago
|
setupToolsAction(toggle, m_widget->actionInsertSpacer);
|
||
|
|
||
12 years ago
|
action = new TDEAction(i18n("Preview &Form"), CTRL + Key_T, this, TQT_SLOT(windowPreview()), actionCollection(), "window_preview");
|
||
15 years ago
|
stateSync(action, m_widget->actionPreview);
|
||
12 years ago
|
action = new TDEAction(i18n("Ne&xt Form"), CTRL + Key_F6, this, TQT_SLOT(windowNext()), actionCollection(), "window_next");
|
||
15 years ago
|
stateSync(action, m_widget->actionWindowNext);
|
||
12 years ago
|
action = new TDEAction(i18n("Pre&vious Form"), CTRL + SHIFT + Key_F6, this, TQT_SLOT(windowPrev()), actionCollection(), "window_prev");
|
||
15 years ago
|
stateSync(action, m_widget->actionWindowPrevious);
|
||
|
|
||
15 years ago
|
action = KStdAction::preferences(this, TQT_SLOT(editPreferences()), actionCollection());
|
||
11 years ago
|
action->setText(i18n("Configure &TDevDesigner..."));
|
||
15 years ago
|
stateSync(action, m_widget->actionEditPreferences);
|
||
|
}
|
||
|
|
||
11 years ago
|
TDevDesignerPart::~TDevDesignerPart()
|
||
15 years ago
|
{
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setReadWrite(bool rw)
|
||
15 years ago
|
{
|
||
|
ReadWritePart::setReadWrite(rw);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setModified(bool modified)
|
||
15 years ago
|
{
|
||
12 years ago
|
/* TDEAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
|
||
15 years ago
|
if (!save)
|
||
|
return;
|
||
|
if (modified)
|
||
|
save->setEnabled(true);
|
||
|
else
|
||
|
save->setEnabled(false);*/
|
||
|
|
||
|
ReadWritePart::setModified(modified);
|
||
|
}
|
||
|
|
||
11 years ago
|
bool TDevDesignerPart::openFile()
|
||
15 years ago
|
{
|
||
|
m_widget->fileOpen("", "", m_file);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
11 years ago
|
bool TDevDesignerPart::saveFile()
|
||
15 years ago
|
{
|
||
|
if (isReadWrite() == false)
|
||
|
return false;
|
||
|
m_widget->actionFileSaveAll->activate();
|
||
|
return true;
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::stateSync( TDEAction * tdeaction, TQAction * qaction )
|
||
15 years ago
|
{
|
||
|
if (!qaction)
|
||
|
return;
|
||
12 years ago
|
tdeaction->setEnabled(qaction->isEnabled());
|
||
15 years ago
|
DesignerAction *ac = dynamic_cast<DesignerAction*>(qaction);
|
||
|
if (!ac)
|
||
|
return;
|
||
12 years ago
|
connect(ac, TQT_SIGNAL(actionEnabled(bool )), tdeaction, TQT_SLOT(setEnabled(bool )));
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setupToolsAction( TDERadioAction * toggle, TQAction * action )
|
||
15 years ago
|
{
|
||
|
if (!action)
|
||
|
return;
|
||
|
|
||
|
toggle->setGroup("tools");
|
||
|
toggle->setExclusiveGroup("tools");
|
||
15 years ago
|
connect(action, TQT_SIGNAL(toggled(bool )), this, TQT_SLOT(setToggleActionChecked(bool )));
|
||
|
connect(toggle, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setToggleActionOn(bool)));
|
||
15 years ago
|
toggle->setChecked(action->isOn());
|
||
|
m_actionMap[action] = toggle;
|
||
|
m_actionMap2[toggle] = action;
|
||
|
}
|
||
|
|
||
|
|
||
|
// It's usually safe to leave the factory code alone.. with the
|
||
12 years ago
|
// notable exception of the TDEAboutData data
|
||
12 years ago
|
#include <tdeaboutdata.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
|
||
11 years ago
|
TDEInstance* TDevDesignerPartFactory::s_instance = 0L;
|
||
|
TDEAboutData* TDevDesignerPartFactory::s_about = 0L;
|
||
15 years ago
|
|
||
11 years ago
|
TDevDesignerPartFactory::TDevDesignerPartFactory()
|
||
15 years ago
|
: KParts::Factory()
|
||
|
{
|
||
|
}
|
||
|
|
||
11 years ago
|
TDevDesignerPartFactory::~TDevDesignerPartFactory()
|
||
15 years ago
|
{
|
||
|
delete s_instance;
|
||
|
delete s_about;
|
||
|
|
||
|
s_instance = 0L;
|
||
|
}
|
||
|
|
||
11 years ago
|
KParts::Part* TDevDesignerPartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName,
|
||
14 years ago
|
TQObject *parent, const char *name,
|
||
15 years ago
|
const char *classname, const TQStringList &args )
|
||
15 years ago
|
{
|
||
|
// Create an instance of our Part
|
||
11 years ago
|
TDevDesignerPart* obj = new TDevDesignerPart( parentWidget, widgetName, parent, name, args );
|
||
15 years ago
|
|
||
|
// See if we are to be read-write or not
|
||
15 years ago
|
if (TQCString(classname) == "KParts::ReadOnlyPart")
|
||
15 years ago
|
obj->setReadWrite(false);
|
||
|
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
11 years ago
|
TDEInstance* TDevDesignerPartFactory::instance()
|
||
15 years ago
|
{
|
||
|
if( !s_instance )
|
||
|
{
|
||
11 years ago
|
s_about = new TDEAboutData("tdevdesignerpart", I18N_NOOP("TDevDesignerPart"), "0.1");
|
||
15 years ago
|
s_about->addAuthor("Alexander Dymo", 0, "cloudtemple@mksat.net");
|
||
|
s_about->addAuthor("Trolltech AS", 0, "info@trolltech.com");
|
||
12 years ago
|
s_instance = new TDEInstance(s_about);
|
||
15 years ago
|
}
|
||
|
return s_instance;
|
||
|
}
|
||
|
|
||
|
extern "C"
|
||
|
{
|
||
11 years ago
|
void* init_libtdevdesignerpart()
|
||
15 years ago
|
{
|
||
11 years ago
|
return new TDevDesignerPartFactory;
|
||
15 years ago
|
}
|
||
|
}
|
||
|
|
||
|
//actions
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::fileNew( )
|
||
15 years ago
|
{
|
||
|
if (!m_widget->actionNewFile)
|
||
|
{
|
||
13 years ago
|
tqWarning("wrong m_widget->actionNewFile");
|
||
15 years ago
|
return;
|
||
|
}
|
||
|
m_widget->actionNewFile->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::fileOpen()
|
||
15 years ago
|
{
|
||
|
m_widget->fileOpen();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::fileSaveAs()
|
||
15 years ago
|
{
|
||
|
m_widget->actionFileSaveAs->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::fileClose( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionFileClose->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::fileCreateTemplate( )
|
||
15 years ago
|
{
|
||
|
m_widget->fileCreateTemplate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editUndo( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditUndo->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editRedo( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditRedo->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editCut( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditCut->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editPaste( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditPaste->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editCopy( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditCopy->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editDelete( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditDelete->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editSelectAll( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditSelectAll->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editAccels( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditAccels->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editFunctions( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditFunctions->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editConnections( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditConnections->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editFormSettings( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditFormSettings->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::editPreferences( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditPreferences->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::projectAddFile( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionProjectAddFile->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::projectImageCollection( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditPixmapCollection->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::projectDatabaseCollections( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditDatabaseConnections->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::projectSettings( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditProjectSettings->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::toolsConfigureToolbox( )
|
||
15 years ago
|
{
|
||
|
m_widget->toolsConfigure();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutAdjustSize( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditAdjustSize->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutHLayout( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditHLayout->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutVLayout( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditVLayout->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutGridLayout( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditGridLayout->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutSplitHLayout( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditSplitHorizontal->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutSplitVLayout( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditSplitVertical->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::layoutBreak( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionEditBreakLayout->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::windowPreview( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionPreview->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::windowNext( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionWindowNext->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::windowPrev( )
|
||
15 years ago
|
{
|
||
|
m_widget->actionWindowPrevious->activate();
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::statusMessage( const TQString & msg )
|
||
15 years ago
|
{
|
||
|
emit setStatusBarText(msg);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setToggleActionChecked( bool b)
|
||
15 years ago
|
{
|
||
|
if (!sender())
|
||
|
return;
|
||
15 years ago
|
const TQAction *action = dynamic_cast<const TQAction*>(sender());
|
||
15 years ago
|
if (!action)
|
||
|
return;
|
||
|
if (b)
|
||
|
{
|
||
|
if (action == m_widget->actionPointerTool)
|
||
|
pointerAction->setChecked(true);
|
||
|
return;
|
||
|
}
|
||
12 years ago
|
TDERadioAction *tdeaction = m_actionMap[action];
|
||
|
if (!tdeaction)
|
||
15 years ago
|
return;
|
||
12 years ago
|
// kdDebug() << "untoggle action: " << tdeaction->text() << endl;
|
||
|
tdeaction->blockSignals(true);
|
||
|
tdeaction->setChecked(b);
|
||
|
tdeaction->blockSignals(false);
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::setToggleActionOn( bool b )
|
||
15 years ago
|
{
|
||
|
if (!sender())
|
||
|
return;
|
||
12 years ago
|
const TDERadioAction *action = dynamic_cast<const TDERadioAction *>(sender());
|
||
15 years ago
|
if (!action)
|
||
|
return;
|
||
15 years ago
|
// kdDebug() << (b?TQString("toggle"):TQString("untoggle")) << " action: " << action->text() << endl;
|
||
|
TQAction *qaction = m_actionMap2[action];
|
||
15 years ago
|
if (!qaction)
|
||
|
return;
|
||
15 years ago
|
disconnect(qaction, TQT_SIGNAL(toggled(bool )), this, TQT_SLOT(setToggleActionChecked(bool )));
|
||
15 years ago
|
qaction->setOn(b);
|
||
15 years ago
|
connect(qaction, TQT_SIGNAL(toggled(bool )), this, TQT_SLOT(setToggleActionChecked(bool )));
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::openProject( const TQString & // projectFile
|
||
15 years ago
|
)
|
||
|
{
|
||
|
//TODO: implement
|
||
|
return;
|
||
|
}
|
||
|
|
||
11 years ago
|
KInterfaceDesigner::DesignerType TDevDesignerPart::designerType( )
|
||
15 years ago
|
{
|
||
14 years ago
|
return KInterfaceDesigner::TQtDesigner;
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitAddedFunction( const TQString & form, KInterfaceDesigner::Function func )
|
||
15 years ago
|
{
|
||
11 years ago
|
kdDebug() << "TDevDesignerPart::emitAddedFunction: form " << form << ", function: " << func.function << endl;
|
||
15 years ago
|
emit addedFunction(designerType(), form, func);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitRemovedFunction( const TQString & form, KInterfaceDesigner::Function func )
|
||
15 years ago
|
{
|
||
11 years ago
|
kdDebug() << "TDevDesignerPart::emitRemovedFunction: form " << form << ", function: " << func.function << endl;
|
||
15 years ago
|
emit removedFunction(designerType(), form, func);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitEditedFunction( const TQString & form, KInterfaceDesigner::Function oldFunc, KInterfaceDesigner::Function func )
|
||
15 years ago
|
{
|
||
11 years ago
|
kdDebug() << "TDevDesignerPart::emitEditedFunction: form " << form
|
||
15 years ago
|
<< ", old function: " << oldFunc.function
|
||
|
<< ", function: " << func.function << endl;
|
||
|
|
||
|
// m_widget->formWindow()->clearSelection(false);
|
||
|
emit editedFunction(designerType(), form, oldFunc, func);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitEditFunction(const TQString &formName, const TQString &functionName)
|
||
15 years ago
|
{
|
||
11 years ago
|
kdDebug() << "TDevDesignerPart::emitEditedFunction: form " << formName
|
||
15 years ago
|
<< ", function: " << functionName << endl;
|
||
|
emit editFunction(designerType(), formName, functionName);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::formModified(bool b)
|
||
15 years ago
|
{
|
||
11 years ago
|
kdDebug() << "TDevDesignerPart::formModified " << b << endl;
|
||
15 years ago
|
setModified(b);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitEditSource(const TQString &formName)
|
||
15 years ago
|
{
|
||
|
emit editSource(designerType(), formName);
|
||
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::emitNewStatus(const TQString &formName, int status)
|
||
15 years ago
|
{
|
||
13 years ago
|
emit newStatus(formName, status);
|
||
15 years ago
|
}
|
||
|
|
||
11 years ago
|
void TDevDesignerPart::toolsEditCustomWidgets( )
|
||
15 years ago
|
{
|
||
|
m_widget->toolsCustomWidget();
|
||
|
}
|
||
|
|
||
11 years ago
|
#include "tdevdesigner_part.moc"
|