|
|
@ -105,7 +105,7 @@ TopLevel::TopLevel(const char *name)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
_statusbar->addWidget(_statusLabel, 1);
|
|
|
|
_statusbar->addWidget(_statusLabel, 1);
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* kconfig = KGlobal::config();
|
|
|
|
KConfig* kconfig = TDEGlobal::config();
|
|
|
|
Configuration::readOptions( kconfig );
|
|
|
|
Configuration::readOptions( kconfig );
|
|
|
|
_openRecent->loadEntries( kconfig );
|
|
|
|
_openRecent->loadEntries( kconfig );
|
|
|
|
|
|
|
|
|
|
|
@ -201,7 +201,7 @@ void TopLevel::setupPartSelection(PartSelection* ps)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void TopLevel::saveCurrentState(TQString postfix)
|
|
|
|
void TopLevel::saveCurrentState(TQString postfix)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* kconfig = KGlobal::config();
|
|
|
|
KConfig* kconfig = TDEGlobal::config();
|
|
|
|
TQCString pf = postfix.ascii();
|
|
|
|
TQCString pf = postfix.ascii();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup psConfig(kconfig, TQCString("PartOverview")+pf);
|
|
|
|
KConfigGroup psConfig(kconfig, TQCString("PartOverview")+pf);
|
|
|
@ -225,7 +225,7 @@ void TopLevel::saveTraceSettings()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup pConfig(KGlobal::config(), TQCString("TracePositions"));
|
|
|
|
KConfigGroup pConfig(TDEGlobal::config(), TQCString("TracePositions"));
|
|
|
|
pConfig.writeEntry(TQString("CostType%1").arg(key),
|
|
|
|
pConfig.writeEntry(TQString("CostType%1").arg(key),
|
|
|
|
_costType ? _costType->name() : TQString("?"));
|
|
|
|
_costType ? _costType->name() : TQString("?"));
|
|
|
|
pConfig.writeEntry(TQString("CostType2%1").arg(key),
|
|
|
|
pConfig.writeEntry(TQString("CostType2%1").arg(key),
|
|
|
@ -235,7 +235,7 @@ void TopLevel::saveTraceSettings()
|
|
|
|
|
|
|
|
|
|
|
|
if (!_data) return;
|
|
|
|
if (!_data) return;
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup aConfig(KGlobal::config(), TQCString("Layouts"));
|
|
|
|
KConfigGroup aConfig(TDEGlobal::config(), TQCString("Layouts"));
|
|
|
|
aConfig.writeEntry(TQString("Count%1").arg(key), _layoutCount);
|
|
|
|
aConfig.writeEntry(TQString("Count%1").arg(key), _layoutCount);
|
|
|
|
aConfig.writeEntry(TQString("Current%1").arg(key), _layoutCurrent);
|
|
|
|
aConfig.writeEntry(TQString("Current%1").arg(key), _layoutCurrent);
|
|
|
|
|
|
|
|
|
|
|
@ -253,7 +253,7 @@ void TopLevel::saveTraceSettings()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void TopLevel::restoreCurrentState(TQString postfix)
|
|
|
|
void TopLevel::restoreCurrentState(TQString postfix)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* kconfig = KGlobal::config();
|
|
|
|
KConfig* kconfig = TDEGlobal::config();
|
|
|
|
TQStringList gList = kconfig->groupList();
|
|
|
|
TQStringList gList = kconfig->groupList();
|
|
|
|
TQCString pf = postfix.ascii();
|
|
|
|
TQCString pf = postfix.ascii();
|
|
|
|
|
|
|
|
|
|
|
@ -388,7 +388,7 @@ void TopLevel::createDocks()
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Restore QT Dock positions...
|
|
|
|
// Restore QT Dock positions...
|
|
|
|
KConfigGroup dockConfig(KGlobal::config(), TQCString("Docks"));
|
|
|
|
KConfigGroup dockConfig(TDEGlobal::config(), TQCString("Docks"));
|
|
|
|
TQString str = dockConfig.readEntry("Position", TQString());
|
|
|
|
TQString str = dockConfig.readEntry("Position", TQString());
|
|
|
|
if (0) tqDebug("Docks/Position: '%s'", str.ascii());
|
|
|
|
if (0) tqDebug("Docks/Position: '%s'", str.ascii());
|
|
|
|
if (str.isEmpty()) {
|
|
|
|
if (str.isEmpty()) {
|
|
|
@ -1023,7 +1023,7 @@ void TopLevel::loadTrace(const KURL& url)
|
|
|
|
if(KIO::NetAccess::download( url, tmpFile )) {
|
|
|
|
if(KIO::NetAccess::download( url, tmpFile )) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
_openRecent->addURL(url);
|
|
|
|
_openRecent->addURL(url);
|
|
|
|
_openRecent->saveEntries( KGlobal::config() );
|
|
|
|
_openRecent->saveEntries( TDEGlobal::config() );
|
|
|
|
|
|
|
|
|
|
|
|
loadTrace(tmpFile);
|
|
|
|
loadTrace(tmpFile);
|
|
|
|
KIO::NetAccess::removeTempFile( tmpFile );
|
|
|
|
KIO::NetAccess::removeTempFile( tmpFile );
|
|
|
@ -1072,7 +1072,7 @@ void TopLevel::addTrace(const KURL& url)
|
|
|
|
if(KIO::NetAccess::download( url, tmpFile )) {
|
|
|
|
if(KIO::NetAccess::download( url, tmpFile )) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
_openRecent->addURL(url);
|
|
|
|
_openRecent->addURL(url);
|
|
|
|
_openRecent->saveEntries( KGlobal::config() );
|
|
|
|
_openRecent->saveEntries( TDEGlobal::config() );
|
|
|
|
|
|
|
|
|
|
|
|
addTrace(tmpFile);
|
|
|
|
addTrace(tmpFile);
|
|
|
|
KIO::NetAccess::removeTempFile( tmpFile );
|
|
|
|
KIO::NetAccess::removeTempFile( tmpFile );
|
|
|
@ -1721,8 +1721,8 @@ void TopLevel::restoreTraceTypes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup cConfig(KGlobal::config(), TQCString("CurrentState"));
|
|
|
|
KConfigGroup cConfig(TDEGlobal::config(), TQCString("CurrentState"));
|
|
|
|
KConfigGroup pConfig(KGlobal::config(), TQCString("TracePositions"));
|
|
|
|
KConfigGroup pConfig(TDEGlobal::config(), TQCString("TracePositions"));
|
|
|
|
|
|
|
|
|
|
|
|
TQString groupType, costType, costType2;
|
|
|
|
TQString groupType, costType, costType2;
|
|
|
|
groupType = pConfig.readEntry(TQString("GroupType%1").arg(key));
|
|
|
|
groupType = pConfig.readEntry(TQString("GroupType%1").arg(key));
|
|
|
@ -1741,7 +1741,7 @@ void TopLevel::restoreTraceTypes()
|
|
|
|
if (!_costType && !_saCost->items().isEmpty())
|
|
|
|
if (!_costType && !_saCost->items().isEmpty())
|
|
|
|
costTypeSelected(_saCost->items().first());
|
|
|
|
costTypeSelected(_saCost->items().first());
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup aConfig(KGlobal::config(), TQCString("Layouts"));
|
|
|
|
KConfigGroup aConfig(TDEGlobal::config(), TQCString("Layouts"));
|
|
|
|
_layoutCount = aConfig.readNumEntry(TQString("Count%1").arg(key), 0);
|
|
|
|
_layoutCount = aConfig.readNumEntry(TQString("Count%1").arg(key), 0);
|
|
|
|
_layoutCurrent = aConfig.readNumEntry(TQString("Current%1").arg(key), 0);
|
|
|
|
_layoutCurrent = aConfig.readNumEntry(TQString("Current%1").arg(key), 0);
|
|
|
|
if (_layoutCount == 0) layoutRestore();
|
|
|
|
if (_layoutCount == 0) layoutRestore();
|
|
|
@ -1760,7 +1760,7 @@ void TopLevel::restoreTraceSettings()
|
|
|
|
|
|
|
|
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup pConfig(KGlobal::config(), TQCString("TracePositions"));
|
|
|
|
KConfigGroup pConfig(TDEGlobal::config(), TQCString("TracePositions"));
|
|
|
|
TQString group = pConfig.readEntry(TQString("Group%1").arg(key));
|
|
|
|
TQString group = pConfig.readEntry(TQString("Group%1").arg(key));
|
|
|
|
if (!group.isEmpty()) setGroup(group);
|
|
|
|
if (!group.isEmpty()) setGroup(group);
|
|
|
|
|
|
|
|
|
|
|
@ -1781,7 +1781,7 @@ void TopLevel::restoreTraceSettings()
|
|
|
|
void TopLevel::layoutDuplicate()
|
|
|
|
void TopLevel::layoutDuplicate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// save current and allocate a new slot
|
|
|
|
// save current and allocate a new slot
|
|
|
|
_multiView->saveViewConfig(KGlobal::config(),
|
|
|
|
_multiView->saveViewConfig(TDEGlobal::config(),
|
|
|
|
TQString("Layout%1-MainView").arg(_layoutCurrent),
|
|
|
|
TQString("Layout%1-MainView").arg(_layoutCurrent),
|
|
|
|
traceKey(), false);
|
|
|
|
traceKey(), false);
|
|
|
|
_layoutCurrent = _layoutCount;
|
|
|
|
_layoutCurrent = _layoutCount;
|
|
|
@ -1799,7 +1799,7 @@ void TopLevel::layoutRemove()
|
|
|
|
int from = _layoutCount-1;
|
|
|
|
int from = _layoutCount-1;
|
|
|
|
if (_layoutCurrent == from) { _layoutCurrent--; from--; }
|
|
|
|
if (_layoutCurrent == from) { _layoutCurrent--; from--; }
|
|
|
|
// restore from last and decrement count
|
|
|
|
// restore from last and decrement count
|
|
|
|
_multiView->readViewConfig(KGlobal::config(),
|
|
|
|
_multiView->readViewConfig(TDEGlobal::config(),
|
|
|
|
TQString("Layout%1-MainView").arg(from),
|
|
|
|
TQString("Layout%1-MainView").arg(from),
|
|
|
|
traceKey(), false);
|
|
|
|
traceKey(), false);
|
|
|
|
_layoutCount--;
|
|
|
|
_layoutCount--;
|
|
|
@ -1811,7 +1811,7 @@ void TopLevel::layoutNext()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_layoutCount <2) return;
|
|
|
|
if (_layoutCount <2) return;
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* config = KGlobal::config();
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
@ -1832,7 +1832,7 @@ void TopLevel::layoutPrevious()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_layoutCount <2) return;
|
|
|
|
if (_layoutCount <2) return;
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* config = KGlobal::config();
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
@ -1851,7 +1851,7 @@ void TopLevel::layoutPrevious()
|
|
|
|
|
|
|
|
|
|
|
|
void TopLevel::layoutSave()
|
|
|
|
void TopLevel::layoutSave()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = KGlobal::config();
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TQString key = traceKey();
|
|
|
|
TQString key = traceKey();
|
|
|
|
|
|
|
|
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
|
_multiView->saveViewConfig(config,
|
|
|
@ -1878,7 +1878,7 @@ void TopLevel::layoutSave()
|
|
|
|
|
|
|
|
|
|
|
|
void TopLevel::layoutRestore()
|
|
|
|
void TopLevel::layoutRestore()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = KGlobal::config();
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
KConfigGroup aConfig(config, TQCString("Layouts"));
|
|
|
|
KConfigGroup aConfig(config, TQCString("Layouts"));
|
|
|
|
_layoutCount = aConfig.readNumEntry("DefaultCount", 0);
|
|
|
|
_layoutCount = aConfig.readNumEntry("DefaultCount", 0);
|
|
|
|
_layoutCurrent = aConfig.readNumEntry("DefaultCurrent", 0);
|
|
|
|
_layoutCurrent = aConfig.readNumEntry("DefaultCurrent", 0);
|
|
|
@ -1963,12 +1963,12 @@ void TopLevel::updateStatusBar()
|
|
|
|
void TopLevel::configure()
|
|
|
|
void TopLevel::configure()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ConfigDlg::configure(Configuration::config(), _data, this)) {
|
|
|
|
if (ConfigDlg::configure(Configuration::config(), _data, this)) {
|
|
|
|
Configuration::saveOptions(KGlobal::config());
|
|
|
|
Configuration::saveOptions(TDEGlobal::config());
|
|
|
|
|
|
|
|
|
|
|
|
configChanged();
|
|
|
|
configChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
Configuration::readOptions(KGlobal::config());
|
|
|
|
Configuration::readOptions(TDEGlobal::config());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool TopLevel::queryClose()
|
|
|
|
bool TopLevel::queryClose()
|
|
|
@ -1984,7 +1984,7 @@ bool TopLevel::queryExit()
|
|
|
|
Configuration::setShowPercentage(_showPercentage);
|
|
|
|
Configuration::setShowPercentage(_showPercentage);
|
|
|
|
Configuration::setShowExpanded(_showExpanded);
|
|
|
|
Configuration::setShowExpanded(_showExpanded);
|
|
|
|
Configuration::setShowCycles(_showCycles);
|
|
|
|
Configuration::setShowCycles(_showCycles);
|
|
|
|
Configuration::saveOptions(KGlobal::config());
|
|
|
|
Configuration::saveOptions(TDEGlobal::config());
|
|
|
|
|
|
|
|
|
|
|
|
saveCurrentState(TQString());
|
|
|
|
saveCurrentState(TQString());
|
|
|
|
|
|
|
|
|
|
|
@ -1994,7 +1994,7 @@ bool TopLevel::queryExit()
|
|
|
|
// Its already stored.
|
|
|
|
// Its already stored.
|
|
|
|
delete toolBar();
|
|
|
|
delete toolBar();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup dockConfig(KGlobal::config(), TQCString("Docks"));
|
|
|
|
KConfigGroup dockConfig(TDEGlobal::config(), TQCString("Docks"));
|
|
|
|
TQString str;
|
|
|
|
TQString str;
|
|
|
|
TQTextStream ts( &str, IO_WriteOnly );
|
|
|
|
TQTextStream ts( &str, IO_WriteOnly );
|
|
|
|
ts << *this;
|
|
|
|
ts << *this;
|
|
|
|