Changeset View
Changeset View
Standalone View
Standalone View
mainWindow/kpMainWindow_Colors.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | // private | 54 | // private | ||
55 | void kpMainWindow::setupColorsMenuActions () | 55 | void kpMainWindow::setupColorsMenuActions () | ||
56 | { | 56 | { | ||
57 | KActionCollection *ac = actionCollection (); | 57 | KActionCollection *ac = actionCollection (); | ||
58 | 58 | | |||
59 | 59 | | |||
60 | d->actionColorsDefault = ac->addAction ("colors_default"); | 60 | d->actionColorsDefault = ac->addAction ("colors_default"); | ||
61 | d->actionColorsDefault->setText (i18n ("Use KolourPaint Defaults")); | 61 | d->actionColorsDefault->setText (i18n ("Use KolourPaint Defaults")); | ||
62 | connect (d->actionColorsDefault, SIGNAL (triggered(bool)), | 62 | connect (d->actionColorsDefault, &QAction::triggered, | ||
63 | SLOT (slotColorsDefault())); | 63 | this, &kpMainWindow::slotColorsDefault); | ||
64 | 64 | | |||
65 | d->actionColorsKDE = ac->add <KSelectAction> ("colors_kde"); | 65 | d->actionColorsKDE = ac->add <KSelectAction> ("colors_kde"); | ||
66 | d->actionColorsKDE->setText (i18nc ("@item:inmenu colors", "Use KDE's")); | 66 | d->actionColorsKDE->setText (i18nc ("@item:inmenu colors", "Use KDE's")); | ||
67 | // TODO: Will this slot be called spuriously if there are no colors | 67 | // TODO: Will this slot be called spuriously if there are no colors | ||
68 | // installed? | 68 | // installed? | ||
69 | connect (d->actionColorsKDE, SIGNAL (triggered(QAction*)), | 69 | connect (d->actionColorsKDE, | ||
70 | SLOT (slotColorsKDE())); | 70 | static_cast<void (KSelectAction::*)(QAction*)>(&KSelectAction::triggered), | ||
71 | this, &kpMainWindow::slotColorsKDE); | ||||
72 | | ||||
71 | foreach (const QString &colName, ::KDEColorCollectionNames ()) | 73 | foreach (const QString &colName, ::KDEColorCollectionNames ()) | ||
72 | d->actionColorsKDE->addAction (colName); | 74 | d->actionColorsKDE->addAction (colName); | ||
73 | 75 | | |||
74 | d->actionColorsOpen = ac->addAction ("colors_open"); | 76 | d->actionColorsOpen = ac->addAction ("colors_open"); | ||
75 | d->actionColorsOpen->setText (i18nc ("@item:inmenu colors", "&Open...")); | 77 | d->actionColorsOpen->setText (i18nc ("@item:inmenu colors", "&Open...")); | ||
76 | connect (d->actionColorsOpen, SIGNAL (triggered(bool)), | 78 | connect (d->actionColorsOpen, &QAction::triggered, this, &kpMainWindow::slotColorsOpen); | ||
77 | SLOT (slotColorsOpen())); | | |||
78 | 79 | | |||
79 | d->actionColorsReload = ac->addAction ("colors_reload"); | 80 | d->actionColorsReload = ac->addAction ("colors_reload"); | ||
80 | d->actionColorsReload->setText (i18nc ("@item:inmenu colors", "Reloa&d")); | 81 | d->actionColorsReload->setText (i18nc ("@item:inmenu colors", "Reloa&d")); | ||
81 | connect (d->actionColorsReload, SIGNAL (triggered(bool)), | 82 | connect (d->actionColorsReload, &QAction::triggered, | ||
82 | SLOT (slotColorsReload())); | 83 | this, &kpMainWindow::slotColorsReload); | ||
83 | | ||||
84 | 84 | | |||
85 | d->actionColorsSave = ac->addAction ("colors_save"); | 85 | d->actionColorsSave = ac->addAction ("colors_save"); | ||
86 | d->actionColorsSave->setText (i18nc ("@item:inmenu colors", "&Save")); | 86 | d->actionColorsSave->setText (i18nc ("@item:inmenu colors", "&Save")); | ||
87 | connect (d->actionColorsSave, SIGNAL (triggered(bool)), | 87 | connect (d->actionColorsSave, &QAction::triggered, | ||
88 | SLOT (slotColorsSave())); | 88 | this, &kpMainWindow::slotColorsSave); | ||
89 | 89 | | |||
90 | d->actionColorsSaveAs = ac->addAction ("colors_save_as"); | 90 | d->actionColorsSaveAs = ac->addAction ("colors_save_as"); | ||
91 | d->actionColorsSaveAs->setText (i18nc ("@item:inmenu colors", "Save &As...")); | 91 | d->actionColorsSaveAs->setText (i18nc ("@item:inmenu colors", "Save &As...")); | ||
92 | connect (d->actionColorsSaveAs, SIGNAL (triggered(bool)), | 92 | connect (d->actionColorsSaveAs, &QAction::triggered, | ||
93 | SLOT (slotColorsSaveAs())); | 93 | this, &kpMainWindow::slotColorsSaveAs); | ||
94 | | ||||
95 | 94 | | |||
96 | d->actionColorsAppendRow = ac->addAction ("colors_append_row"); | 95 | d->actionColorsAppendRow = ac->addAction ("colors_append_row"); | ||
97 | d->actionColorsAppendRow->setText (i18nc ("@item:inmenu colors", "Add Row")); | 96 | d->actionColorsAppendRow->setText (i18nc ("@item:inmenu colors", "Add Row")); | ||
98 | connect (d->actionColorsAppendRow, SIGNAL (triggered(bool)), | 97 | connect (d->actionColorsAppendRow, &QAction::triggered, | ||
99 | SLOT (slotColorsAppendRow())); | 98 | this, &kpMainWindow::slotColorsAppendRow); | ||
100 | 99 | | |||
101 | d->actionColorsDeleteRow = ac->addAction ("colors_delete_row"); | 100 | d->actionColorsDeleteRow = ac->addAction ("colors_delete_row"); | ||
102 | d->actionColorsDeleteRow->setText (i18nc ("@item:inmenu colors", "Delete Last Row")); | 101 | d->actionColorsDeleteRow->setText (i18nc ("@item:inmenu colors", "Delete Last Row")); | ||
103 | connect (d->actionColorsDeleteRow, SIGNAL (triggered(bool)), | 102 | connect (d->actionColorsDeleteRow, &QAction::triggered, | ||
104 | SLOT (slotColorsDeleteRow())); | 103 | this, &kpMainWindow::slotColorsDeleteRow); | ||
105 | 104 | | |||
106 | 105 | | |||
107 | enableColorsMenuDocumentActions (false); | 106 | enableColorsMenuDocumentActions (false); | ||
108 | } | 107 | } | ||
109 | 108 | | |||
110 | //--------------------------------------------------------------------- | 109 | //--------------------------------------------------------------------- | ||
111 | 110 | | |||
112 | // private | 111 | // private | ||
113 | void kpMainWindow::createColorBox () | 112 | void kpMainWindow::createColorBox () | ||
114 | { | 113 | { | ||
115 | d->colorToolBar = new kpColorToolBar (i18n ("Color Box"), this); | 114 | d->colorToolBar = new kpColorToolBar (i18n ("Color Box"), this); | ||
116 | 115 | | |||
117 | // (needed for QMainWindow::saveState()) | 116 | // (needed for QMainWindow::saveState()) | ||
118 | d->colorToolBar->setObjectName ( QLatin1String("Color Box" )); | 117 | d->colorToolBar->setObjectName ( QLatin1String("Color Box" )); | ||
119 | 118 | | |||
120 | connect (colorCells (), SIGNAL (rowCountChanged(int)), | 119 | connect (colorCells (), &kpColorCells::rowCountChanged, | ||
121 | SLOT (slotUpdateColorsDeleteRowActionEnabled())); | 120 | this, &kpMainWindow::slotUpdateColorsDeleteRowActionEnabled); | ||
122 | } | 121 | } | ||
123 | 122 | | |||
124 | //--------------------------------------------------------------------- | 123 | //--------------------------------------------------------------------- | ||
125 | 124 | | |||
126 | // private | 125 | // private | ||
127 | void kpMainWindow::enableColorsMenuDocumentActions (bool enable) | 126 | void kpMainWindow::enableColorsMenuDocumentActions (bool enable) | ||
128 | { | 127 | { | ||
129 | d->actionColorsDefault->setEnabled (enable); | 128 | d->actionColorsDefault->setEnabled (enable); | ||
▲ Show 20 Lines • Show All 361 Lines • Show Last 20 Lines |