Changeset View
Changeset View
Standalone View
Standalone View
src/Gui/KSMainWindow.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | #include <KLocalizedString> | 49 | #include <KLocalizedString> | ||
50 | #include <KStandardAction> | 50 | #include <KStandardAction> | ||
51 | #include <KWindowSystem> | 51 | #include <KWindowSystem> | ||
52 | 52 | | |||
53 | static const int DEFAULT_WINDOW_HEIGHT = 420; | 53 | static const int DEFAULT_WINDOW_HEIGHT = 420; | ||
54 | static const int DEFAULT_WINDOW_WIDTH = 840; | 54 | static const int DEFAULT_WINDOW_WIDTH = 840; | ||
55 | static const int MAXIMUM_WINDOW_WIDTH = 1000; | 55 | static const int MAXIMUM_WINDOW_WIDTH = 1000; | ||
56 | 56 | | |||
57 | KSMainWindow::KSMainWindow(const Platform::GrabModes &theGrabModes, const Platform::ShutterModes &theShutterModes, QWidget *parent) : | 57 | KSMainWindow::KSMainWindow(const GrabModes &theGrabModes, const ShutterModes &theShutterModes, QWidget *parent) : | ||
58 | QDialog(parent), | 58 | QDialog(parent), | ||
59 | mKSWidget(new KSWidget(theGrabModes, this)), | 59 | mKSWidget(new KSWidget(theGrabModes, this)), | ||
60 | mDivider(new QFrame(this)), | 60 | mDivider(new QFrame(this)), | ||
61 | mDialogButtonBox(new QDialogButtonBox(this)), | 61 | mDialogButtonBox(new QDialogButtonBox(this)), | ||
62 | mConfigureButton(new QToolButton(this)), | 62 | mConfigureButton(new QToolButton(this)), | ||
63 | mToolsButton(new QPushButton(this)), | 63 | mToolsButton(new QPushButton(this)), | ||
64 | mSendToButton(new QPushButton(this)), | 64 | mSendToButton(new QPushButton(this)), | ||
65 | mClipboardButton(new QToolButton(this)), | 65 | mClipboardButton(new QToolButton(this)), | ||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Line(s) | 115 | { | |||
203 | layout->addWidget(mDialogButtonBox); | 203 | layout->addWidget(mDialogButtonBox); | ||
204 | mMessageWidget->hide(); | 204 | mMessageWidget->hide(); | ||
205 | 205 | | |||
206 | // populate our send-to actions | 206 | // populate our send-to actions | ||
207 | mSendToButton->setMenu(mExportMenu); | 207 | mSendToButton->setMenu(mExportMenu); | ||
208 | connect(mExportMenu, &ExportMenu::imageShared, this, &KSMainWindow::showImageSharedFeedback); | 208 | connect(mExportMenu, &ExportMenu::imageShared, this, &KSMainWindow::showImageSharedFeedback); | ||
209 | 209 | | |||
210 | // lock down the onClick mode depending on available shutter modes | 210 | // lock down the onClick mode depending on available shutter modes | ||
211 | if (!mShutterModes.testFlag(Platform::ShutterMode::OnClick)) { | 211 | if (!mShutterModes.testFlag(ShutterMode::OnClick)) { | ||
212 | mKSWidget->lockOnClickDisabled(); | 212 | mKSWidget->lockOnClickDisabled(); | ||
213 | } else if (!mShutterModes.testFlag(Platform::ShutterMode::Immediate)) { | 213 | } else if (!mShutterModes.testFlag(ShutterMode::Immediate)) { | ||
214 | mKSWidget->lockOnClickEnabled(); | 214 | mKSWidget->lockOnClickEnabled(); | ||
215 | } | 215 | } | ||
216 | resize(QSize(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT).expandedTo(minimumSize())); | 216 | resize(QSize(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT).expandedTo(minimumSize())); | ||
217 | 217 | | |||
218 | // Allow Ctrl+Q to quit the app | 218 | // Allow Ctrl+Q to quit the app | ||
219 | QAction *actionQuit = KStandardAction::quit(qApp, &QApplication::quit, this); | 219 | QAction *actionQuit = KStandardAction::quit(qApp, &QApplication::quit, this); | ||
220 | actionQuit->setShortcut(QKeySequence::Quit); | 220 | actionQuit->setShortcut(QKeySequence::Quit); | ||
221 | addAction(actionQuit); | 221 | addAction(actionQuit); | ||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |