Changeset View
Changeset View
Standalone View
Standalone View
kimeshell.cpp
Show All 31 Lines | |||||
32 | #include <kedittoolbar.h> | 32 | #include <kedittoolbar.h> | ||
33 | #include "kimagemapeditor_debug.h" | 33 | #include "kimagemapeditor_debug.h" | ||
34 | #include <kxmlguifactory.h> | 34 | #include <kxmlguifactory.h> | ||
35 | #include <kstandardaction.h> | 35 | #include <kstandardaction.h> | ||
36 | #include <ktoolbar.h> | 36 | #include <ktoolbar.h> | ||
37 | #include <kactioncollection.h> | 37 | #include <kactioncollection.h> | ||
38 | #include <KSharedConfig> | 38 | #include <KSharedConfig> | ||
39 | #include <KConfigGroup> | 39 | #include <KConfigGroup> | ||
40 | #include <KWindowConfig> | ||||
40 | 41 | | |||
41 | #include "drawzone.h" | 42 | #include "drawzone.h" | ||
42 | #include "kimagemapeditor.h" // the KPart | 43 | #include "kimagemapeditor.h" // the KPart | ||
43 | #include "kimeshell.moc" | 44 | #include "kimeshell.moc" | ||
44 | 45 | | |||
45 | KimeShell::KimeShell(const char * ) | 46 | KimeShell::KimeShell(const char * ) | ||
46 | : KParts::MainWindow() | 47 | : KParts::MainWindow() | ||
47 | { | 48 | { | ||
Show All 27 Lines | |||||
75 | 76 | | |||
76 | // createGUI( part ); | 77 | // createGUI( part ); | ||
77 | createShellGUI( true ); | 78 | createShellGUI( true ); | ||
78 | guiFactory()->addClient( m_part ); | 79 | guiFactory()->addClient( m_part ); | ||
79 | KParts::GUIActivateEvent ev( true ); | 80 | KParts::GUIActivateEvent ev( true ); | ||
80 | QApplication::sendEvent( m_part, &ev ); | 81 | QApplication::sendEvent( m_part, &ev ); | ||
81 | //setCentralWidget(part->widget()); | 82 | //setCentralWidget(part->widget()); | ||
82 | qCDebug(KIMAGEMAPEDITOR_LOG) << "KimeShell starting 3"; | 83 | qCDebug(KIMAGEMAPEDITOR_LOG) << "KimeShell starting 3"; | ||
83 | if (!initialGeometrySet()) | | |||
84 | resize( QSize(725, 525).expandedTo(minimumSizeHint())); | 84 | resize( QSize(725, 525).expandedTo(minimumSizeHint())); | ||
85 | 85 | | |||
86 | connect( m_part, SIGNAL(setStatusBarText(QString)), | 86 | connect( m_part, SIGNAL(setStatusBarText(QString)), | ||
87 | this, SLOT(slotSetStatusBarText(QString))); | 87 | this, SLOT(slotSetStatusBarText(QString))); | ||
88 | 88 | | |||
89 | connect( m_part, SIGNAL(setWindowCaption(QString)), | 89 | connect( m_part, SIGNAL(setWindowCaption(QString)), | ||
90 | this, SLOT(setWindowTitle(QString))); | 90 | this, SLOT(setWindowTitle(QString))); | ||
91 | 91 | | |||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 142 | { | |||
152 | { | 152 | { | ||
153 | KimeShell * newShell = new KimeShell(); | 153 | KimeShell * newShell = new KimeShell(); | ||
154 | 154 | | |||
155 | newShell->show(); | 155 | newShell->show(); | ||
156 | newShell->readConfig(); | 156 | newShell->readConfig(); | ||
157 | }; | 157 | }; | ||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | void KimeShell::openFile(const KUrl & url) | 160 | void KimeShell::openFile(const QUrl & url) | ||
161 | { | 161 | { | ||
162 | m_part->openFile(url); | 162 | m_part->openFile(url); | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | void KimeShell::openLastFile() | 165 | void KimeShell::openLastFile() | ||
166 | { | 166 | { | ||
167 | #ifdef __GNUC__ | 167 | #ifdef __GNUC__ | ||
168 | #warning there is no group defined | 168 | #warning there is no group defined | ||
169 | #endif | 169 | #endif | ||
170 | KConfigGroup cg( m_part->config(), QString() ); | 170 | KConfigGroup cg( m_part->config(), QString() ); | ||
171 | if (cg.readEntry("start-with-last-used-document",true)) | 171 | if (cg.readEntry("start-with-last-used-document",true)) | ||
172 | m_part->openLastURL( cg ); | 172 | m_part->openLastURL( cg ); | ||
173 | } | 173 | } | ||
174 | 174 | | |||
175 | void KimeShell::fileOpen() | 175 | void KimeShell::fileOpen() | ||
176 | { | 176 | { | ||
177 | KUrl url = QFileDialog::getOpenFileUrl(this, i18n("Choose Picture to Open"), QString(), | 177 | QUrl url = QFileDialog::getOpenFileUrl(this, i18n("Choose Picture to Open"), QString(), | ||
178 | i18n("Web File (*.png *.jpg *.jpeg *.gif *.htm *.html);;Images (*.png *.jpg *.jpeg *.gif *.bmp *.xbm *.xpm *.pnm *.mng);;" | 178 | i18n("Web File (*.png *.jpg *.jpeg *.gif *.htm *.html);;Images (*.png *.jpg *.jpeg *.gif *.bmp *.xbm *.xpm *.pnm *.mng);;" | ||
179 | "HTML Files (*.htm *.html);;All Files (*)")); | 179 | "HTML Files (*.htm *.html);;All Files (*)")); | ||
180 | if (!url.isEmpty()) { | 180 | if (!url.isEmpty()) { | ||
181 | // About this function, the style guide ( | 181 | // About this function, the style guide ( | ||
182 | // http://developer.kde.org/documentation/standards/kde/style/basics/index.html ) | 182 | // http://developer.kde.org/documentation/standards/kde/style/basics/index.html ) | ||
183 | // says that it should open a new window if the document is _not_ | 183 | // says that it should open a new window if the document is _not_ | ||
184 | // in its initial state. This is what we do here.. | 184 | // in its initial state. This is what we do here.. | ||
185 | if ( m_part->url().isEmpty() && ! m_part->isModified() ) | 185 | if ( m_part->url().isEmpty() && ! m_part->isModified() ) | ||
Show All 26 Lines | |||||
212 | 212 | | |||
213 | void KimeShell::writeConfig() { | 213 | void KimeShell::writeConfig() { | ||
214 | KConfigGroup config( KSharedConfig::openConfig(), "General Options"); | 214 | KConfigGroup config( KSharedConfig::openConfig(), "General Options"); | ||
215 | writeConfig( config ); | 215 | writeConfig( config ); | ||
216 | } | 216 | } | ||
217 | 217 | | |||
218 | void KimeShell::writeConfig(KConfigGroup &config) { | 218 | void KimeShell::writeConfig(KConfigGroup &config) { | ||
219 | saveMainWindowSettings(config); | 219 | saveMainWindowSettings(config); | ||
220 | saveWindowSize(config); | 220 | KWindowConfig::saveWindowSize(windowHandle(), config); | ||
221 | // writeDockConfig(config); | 221 | // writeDockConfig(config); | ||
222 | config.sync(); | 222 | config.sync(); | ||
223 | 223 | | |||
224 | } | 224 | } | ||
225 | 225 | | |||
226 | 226 | | |||
227 | void KimeShell::saveProperties(KConfigGroup &config) | 227 | void KimeShell::saveProperties(KConfigGroup &config) | ||
228 | { | 228 | { | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |