Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3867 → Rev 3868

/branches/Version13x/Scribus/scribus/story.cpp
2025,6 → 2025,7
Editor->setFocus();
Editor->setFarbe(false);
blockUpdate = false;
loadPrefs();
}
 
/* Main Story Editor Class, no current document */
2047,8 → 2048,37
Editor->setFocus();
Editor->setFarbe(false);
blockUpdate = false;
loadPrefs();
}
 
StoryEditor::~StoryEditor()
{
savePrefs();
}
 
void StoryEditor::savePrefs()
{
// save prefs
prefs->set("left", x());
prefs->set("top", y());
prefs->set("width", width());
prefs->set("height", height());
}
 
void StoryEditor::loadPrefs()
{
prefs = PrefsManager::instance()->prefsFile->getPluginContext("StoryEditor");
int vleft = QMAX(-80, prefs->getInt("left", 10));
#ifndef QT_MAC
int vtop = QMAX(-80, prefs->getInt("top", 10));
#else
int vtop = QMAX(64, prefs->getInt("top", 10));
#endif
int vwidth = QMAX(600, prefs->getInt("width", 600));
int vheight = QMAX(400, prefs->getInt("height", 400));
setGeometry(vleft, vtop, vwidth, vheight);
}
 
void StoryEditor::buildGUI()
{
setIcon(loadIcon("AppIcon.png"));
2361,6 → 2391,7
else
result = QDialog::Rejected;
setCurrentDocumentAndItem(currDoc, NULL);
savePrefs();
hide();
blockUpdate = false;
}
/branches/Version13x/Scribus/scribus/story.h
45,7 → 45,9
class FontCombo;
class ShadeButton;
class PrefsManager;
class PrefsContext;
 
 
struct PtiSmall {
int csize;
short cshade;
316,7 → 318,7
public:
StoryEditor( QWidget* parent );
StoryEditor( QWidget* parent, ScribusDoc *docc, PageItem* ite );
~StoryEditor() {};
~StoryEditor();
void closeEvent(QCloseEvent *);
void keyPressEvent (QKeyEvent * e);
bool eventFilter( QObject* ob, QEvent* ev );
434,12 → 436,18
void buildGUI();
void connectSignals();
void disconnectSignals();
/*! \brief Loading the preferences (position).
It's in separate method due the 2 constructors. */
void loadPrefs();
/*! \brief Saving the preferences (position). */
void savePrefs();
 
QHBoxLayout* StoryEd2Layout;
QGridLayout* ButtonGroup1Layout;
QGridLayout* ButtonGroup2Layout;
 
PrefsManager* prefsManager;
PrefsContext* prefs;
};
 
#endif