|
|
@ -93,8 +93,8 @@ Kima::Kima(const TQString& inConfigFile, Type inType, int inActions, TQWidget* i
|
|
|
|
mPrefs = 0; // the prefs ui is created in the preferences() method
|
|
|
|
mPrefs = 0; // the prefs ui is created in the preferences() method
|
|
|
|
|
|
|
|
|
|
|
|
// Get the current application configuration handle
|
|
|
|
// Get the current application configuration handle
|
|
|
|
mKConfig = config();
|
|
|
|
mTDEConfig = config();
|
|
|
|
mKConfig->setGroup("Kima");
|
|
|
|
mTDEConfig->setGroup("Kima");
|
|
|
|
|
|
|
|
|
|
|
|
// automatically delete pointers
|
|
|
|
// automatically delete pointers
|
|
|
|
mSources.setAutoDelete(TRUE);
|
|
|
|
mSources.setAutoDelete(TRUE);
|
|
|
@ -128,7 +128,7 @@ Kima::Kima(const TQString& inConfigFile, Type inType, int inActions, TQWidget* i
|
|
|
|
++itSync;
|
|
|
|
++itSync;
|
|
|
|
registerSource(source);
|
|
|
|
registerSource(source);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mLayout->updatePositions(mKConfig);
|
|
|
|
mLayout->updatePositions(mTDEConfig);
|
|
|
|
|
|
|
|
|
|
|
|
// create the menu
|
|
|
|
// create the menu
|
|
|
|
mMenu = new KPopupMenu(this);
|
|
|
|
mMenu = new KPopupMenu(this);
|
|
|
@ -292,14 +292,14 @@ void Kima::savePreferences(){
|
|
|
|
while((source = it.current()) != 0){
|
|
|
|
while((source = it.current()) != 0){
|
|
|
|
++it;
|
|
|
|
++it;
|
|
|
|
source->applyPrefs();
|
|
|
|
source->applyPrefs();
|
|
|
|
source->savePrefs(mKConfig);
|
|
|
|
source->savePrefs(mTDEConfig);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// save the position of all sources because they might have changed.
|
|
|
|
// save the position of all sources because they might have changed.
|
|
|
|
mLayout->updatePositions(mKConfig);
|
|
|
|
mLayout->updatePositions(mTDEConfig);
|
|
|
|
// update the source widgets
|
|
|
|
// update the source widgets
|
|
|
|
updateSourceWidgets();
|
|
|
|
updateSourceWidgets();
|
|
|
|
// write config
|
|
|
|
// write config
|
|
|
|
mKConfig->sync();
|
|
|
|
mTDEConfig->sync();
|
|
|
|
// reset cached witdh for height to force recalculation of the applets width
|
|
|
|
// reset cached witdh for height to force recalculation of the applets width
|
|
|
|
mCachedWFH = 0;
|
|
|
|
mCachedWFH = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -367,9 +367,9 @@ void Kima::mouseMoveEvent( TQMouseEvent* inEvent ) {
|
|
|
|
TQRect crect = c->rect();
|
|
|
|
TQRect crect = c->rect();
|
|
|
|
double relPos = c->mapFromGlobal(inEvent->globalPos()).y() * mDragFactor;
|
|
|
|
double relPos = c->mapFromGlobal(inEvent->globalPos()).y() * mDragFactor;
|
|
|
|
if(mLayout->moveItem(mDraggedSourceItem, it.current(), crect.height()/2.0 > relPos ? FlowLayout::ABOVE : FlowLayout::BELOW)){
|
|
|
|
if(mLayout->moveItem(mDraggedSourceItem, it.current(), crect.height()/2.0 > relPos ? FlowLayout::ABOVE : FlowLayout::BELOW)){
|
|
|
|
mLayout->updatePositions(mKConfig);
|
|
|
|
mLayout->updatePositions(mTDEConfig);
|
|
|
|
updateGeometry();
|
|
|
|
updateGeometry();
|
|
|
|
mKConfig->sync(); // write config
|
|
|
|
mTDEConfig->sync(); // write config
|
|
|
|
updateSourceWidgets();
|
|
|
|
updateSourceWidgets();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -404,7 +404,7 @@ void Kima::registerSource(Source* source) {
|
|
|
|
|
|
|
|
|
|
|
|
// load prefs from the configuration
|
|
|
|
// load prefs from the configuration
|
|
|
|
// this call also emits enabledChanged
|
|
|
|
// this call also emits enabledChanged
|
|
|
|
source->loadPrefs(mKConfig);
|
|
|
|
source->loadPrefs(mTDEConfig);
|
|
|
|
|
|
|
|
|
|
|
|
// add the source to the layout if necessary
|
|
|
|
// add the source to the layout if necessary
|
|
|
|
displaySource(source->isEnabled() && source->showOnApplet(), source);
|
|
|
|
displaySource(source->isEnabled() && source->showOnApplet(), source);
|
|
|
|