Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/radialMap/widgetEvents.cpp
Show All 15 Lines | |||||
16 | * * | 16 | * * | ||
17 | * You should have received a copy of the GNU General Public License * | 17 | * You should have received a copy of the GNU General Public License * | ||
18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | 18 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | ||
19 | *****************************************************************************/ | 19 | *****************************************************************************/ | ||
20 | 20 | | |||
21 | #include "fileTree.h" | 21 | #include "fileTree.h" | ||
22 | #include "radialMap.h" //class Segment | 22 | #include "radialMap.h" //class Segment | ||
23 | #include "widget.h" | 23 | #include "widget.h" | ||
24 | #include "../../icon.h" | ||||
24 | 25 | | |||
25 | #include <cmath> | 26 | #include <cmath> | ||
26 | 27 | | |||
27 | // QtCore | 28 | // QtCore | ||
28 | #include <QTimer> //::resizeEvent() | 29 | #include <QTimer> //::resizeEvent() | ||
29 | // QtGui | 30 | // QtGui | ||
30 | #include <QMouseEvent> | 31 | #include <QMouseEvent> | ||
31 | #include <QPainter> | 32 | #include <QPainter> | ||
32 | #include <QPaintEvent> | 33 | #include <QPaintEvent> | ||
33 | #include <QResizeEvent> | 34 | #include <QResizeEvent> | ||
34 | // QtWidgets | 35 | // QtWidgets | ||
35 | #include <QApplication> //QApplication::setOverrideCursor() | 36 | #include <QApplication> //QApplication::setOverrideCursor() | ||
36 | #include <QMenu> | 37 | #include <QMenu> | ||
37 | 38 | | |||
38 | #include <KI18n/KLocalizedString> | 39 | #include <KI18n/KLocalizedString> | ||
39 | #include <KIconThemes/KIconLoader> | | |||
40 | #include <KIconThemes/KIconEffect> | 40 | #include <KIconThemes/KIconEffect> | ||
41 | #include <KIO/DeleteJob> | 41 | #include <KIO/DeleteJob> | ||
42 | #include <KIO/JobUiDelegate> | 42 | #include <KIO/JobUiDelegate> | ||
43 | #include <KIOWidgets/KRun> | 43 | #include <KIOWidgets/KRun> | ||
44 | #include <KWidgetsAddons/KCursor> | 44 | #include <KWidgetsAddons/KCursor> | ||
45 | #include <KWidgetsAddons/KMessageBox> | 45 | #include <KWidgetsAddons/KMessageBox> | ||
46 | 46 | | |||
47 | 47 | | |||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 165 | if (m_focus && !m_focus->isFake()) { | |||
168 | 168 | | |||
169 | if (e->button() == Qt::RightButton) { | 169 | if (e->button() == Qt::RightButton) { | ||
170 | QMenu popup; | 170 | QMenu popup; | ||
171 | popup.setTitle(m_focus->file()->fullPath(m_tree)); | 171 | popup.setTitle(m_focus->file()->fullPath(m_tree)); | ||
172 | 172 | | |||
173 | QAction * actKonq = 0, * actKonsole = 0, *actViewMag = 0, * actFileOpen = 0, * actEditDel = 0; | 173 | QAction * actKonq = 0, * actKonsole = 0, *actViewMag = 0, * actFileOpen = 0, * actEditDel = 0; | ||
174 | 174 | | |||
175 | if (isDir) { | 175 | if (isDir) { | ||
176 | actKonq = popup.addAction(QIcon::fromTheme("system-file-manager"), i18n("Open File Manager Here")); | 176 | actKonq = popup.addAction(Icon("system-file-manager"), i18n("Open File Manager Here")); | ||
177 | if (url.scheme() == "file") | 177 | if (url.scheme() == "file") | ||
178 | actKonsole = popup.addAction(QIcon::fromTheme("utilities-terminal"), i18n("Open Terminal Here")); | 178 | actKonsole = popup.addAction(Icon("utilities-terminal"), i18n("Open Terminal Here")); | ||
179 | 179 | | |||
180 | if (m_focus->file() != m_tree) { | 180 | if (m_focus->file() != m_tree) { | ||
181 | popup.addSeparator(); | 181 | popup.addSeparator(); | ||
182 | actViewMag = popup.addAction(QIcon::fromTheme("zoom-original"), i18n("&Center Map Here")); | 182 | actViewMag = popup.addAction(Icon("zoom-original"), i18n("&Center Map Here")); | ||
183 | } | 183 | } | ||
184 | } else | 184 | } else | ||
185 | actFileOpen = popup.addAction(QIcon::fromTheme("document-open"), i18n("&Open")); | 185 | actFileOpen = popup.addAction(Icon("document-open"), i18n("&Open")); | ||
186 | 186 | | |||
187 | popup.addSeparator(); | 187 | popup.addSeparator(); | ||
188 | actEditDel = popup.addAction(QIcon::fromTheme("edit-delete"), i18n("&Delete")); | 188 | actEditDel = popup.addAction(Icon("edit-delete"), i18n("&Delete")); | ||
189 | 189 | | |||
190 | QAction * result = popup.exec(e->globalPos()); | 190 | QAction * result = popup.exec(e->globalPos()); | ||
191 | if (result == 0) | 191 | if (result == 0) | ||
192 | result = (QAction *) - 1; // sanity | 192 | result = (QAction *) - 1; // sanity | ||
193 | 193 | | |||
194 | if (result == actKonq) | 194 | if (result == actKonq) | ||
195 | //KRun::runCommand will show an error message if there was trouble | 195 | //KRun::runCommand will show an error message if there was trouble | ||
196 | KRun::runCommand(QString("kfmclient openURL '%1'").arg(url.url()), this); | 196 | KRun::runCommand(QString("kfmclient openURL '%1'").arg(url.url()), this); | ||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |