Changeset View
Changeset View
Standalone View
Standalone View
krusader/Locate/locate.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 "locate.h" | 21 | #include "locate.h" | ||
22 | #include "../kractions.h" | 22 | #include "../kractions.h" | ||
23 | #include "../krglobal.h" | 23 | #include "../krglobal.h" | ||
24 | #include "../filelisticon.h" | ||||
24 | #include "../krslots.h" | 25 | #include "../krslots.h" | ||
25 | #include "../krusaderview.h" | 26 | #include "../krusaderview.h" | ||
26 | #include "../Panel/krpanel.h" | 27 | #include "../Panel/krpanel.h" | ||
27 | #include "../Panel/panelfunc.h" | 28 | #include "../Panel/panelfunc.h" | ||
28 | #include "../GUI/krtreewidget.h" | 29 | #include "../GUI/krtreewidget.h" | ||
29 | #include "../defaults.h" | 30 | #include "../defaults.h" | ||
30 | #include "../krservices.h" | 31 | #include "../krservices.h" | ||
31 | #include "../FileSystem/filesystem.h" | 32 | #include "../FileSystem/filesystem.h" | ||
32 | #include "../FileSystem/virtualfilesystem.h" | 33 | #include "../FileSystem/virtualfilesystem.h" | ||
33 | #include "../KViewer/krviewer.h" | 34 | #include "../KViewer/krviewer.h" | ||
34 | #include "../panelmanager.h" | 35 | #include "../panelmanager.h" | ||
35 | #include "../kicons.h" | | |||
36 | 36 | | |||
37 | // QtCore | 37 | // QtCore | ||
38 | #include <QRegExp> | 38 | #include <QRegExp> | ||
39 | #include <QEventLoop> | 39 | #include <QEventLoop> | ||
40 | #include <QDir> | 40 | #include <QDir> | ||
41 | #include <QMimeData> | 41 | #include <QMimeData> | ||
42 | // QtGui | 42 | // QtGui | ||
43 | #include <QFontMetrics> | 43 | #include <QFontMetrics> | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 87 | void startDrag(Qt::DropActions supportedActs) { | |||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | if (urls.count() == 0) | 101 | if (urls.count() == 0) | ||
102 | return; | 102 | return; | ||
103 | 103 | | |||
104 | 104 | | |||
105 | QDrag *drag = new QDrag(this); | 105 | QDrag *drag = new QDrag(this); | ||
106 | QMimeData *mimeData = new QMimeData; | 106 | QMimeData *mimeData = new QMimeData; | ||
107 | mimeData->setImageData(FL_LOADICON("file")); | 107 | mimeData->setImageData(FileListIcon("file").pixmap()); | ||
108 | mimeData->setUrls(urls); | 108 | mimeData->setUrls(urls); | ||
109 | drag->setMimeData(mimeData); | 109 | drag->setMimeData(mimeData); | ||
110 | drag->start(); | 110 | drag->start(); | ||
111 | } | 111 | } | ||
112 | }; | 112 | }; | ||
113 | 113 | | |||
114 | KProcess * LocateDlg::updateProcess = 0; | 114 | KProcess * LocateDlg::updateProcess = 0; | ||
115 | LocateDlg * LocateDlg::LocateDialog = 0; | 115 | LocateDlg * LocateDlg::LocateDialog = 0; | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 118 | { | |||
204 | grid->addWidget(line2, 4, 0); | 204 | grid->addWidget(line2, 4, 0); | ||
205 | 205 | | |||
206 | mainLayout->addLayout(grid); | 206 | mainLayout->addLayout(grid); | ||
207 | 207 | | |||
208 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | 208 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | ||
209 | mainLayout->addWidget(buttonBox); | 209 | mainLayout->addWidget(buttonBox); | ||
210 | 210 | | |||
211 | locateButton = new QPushButton(i18n("Locate")); | 211 | locateButton = new QPushButton(i18n("Locate")); | ||
212 | locateButton->setIcon(QIcon::fromTheme(QStringLiteral("system-search"))); | 212 | locateButton->setIcon(Icon(QStringLiteral("system-search"))); | ||
213 | locateButton->setDefault(true); | 213 | locateButton->setDefault(true); | ||
214 | buttonBox->addButton(locateButton, QDialogButtonBox::ActionRole); | 214 | buttonBox->addButton(locateButton, QDialogButtonBox::ActionRole); | ||
215 | 215 | | |||
216 | updateDbButton = new QPushButton(i18n("Update DB")); | 216 | updateDbButton = new QPushButton(i18n("Update DB")); | ||
217 | updateDbButton->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh"))); | 217 | updateDbButton->setIcon(Icon(QStringLiteral("view-refresh"))); | ||
218 | buttonBox->addButton(updateDbButton, QDialogButtonBox::ActionRole); | 218 | buttonBox->addButton(updateDbButton, QDialogButtonBox::ActionRole); | ||
219 | 219 | | |||
220 | feedStopButton = new QPushButton; | 220 | feedStopButton = new QPushButton; | ||
221 | buttonBox->addButton(feedStopButton, QDialogButtonBox::ActionRole); | 221 | buttonBox->addButton(feedStopButton, QDialogButtonBox::ActionRole); | ||
222 | 222 | | |||
223 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | 223 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | ||
224 | connect(locateButton, SIGNAL(clicked()), this, SLOT(slotLocate())); | 224 | connect(locateButton, SIGNAL(clicked()), this, SLOT(slotLocate())); | ||
225 | connect(updateDbButton, SIGNAL(clicked()), this, SLOT(slotUpdateDb())); | 225 | connect(updateDbButton, SIGNAL(clicked()), this, SLOT(slotUpdateDb())); | ||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Line(s) | 582 | while (*it) { | |||
585 | 585 | | |||
586 | it++; | 586 | it++; | ||
587 | } | 587 | } | ||
588 | 588 | | |||
589 | if (urls.count() == 0) | 589 | if (urls.count() == 0) | ||
590 | return; | 590 | return; | ||
591 | 591 | | |||
592 | QMimeData *mimeData = new QMimeData; | 592 | QMimeData *mimeData = new QMimeData; | ||
593 | mimeData->setImageData(FL_LOADICON("file")); | 593 | mimeData->setImageData(FileListIcon("file").pixmap()); | ||
594 | mimeData->setUrls(urls); | 594 | mimeData->setUrls(urls); | ||
595 | 595 | | |||
596 | QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard); | 596 | QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard); | ||
597 | } | 597 | } | ||
598 | break; | 598 | break; | ||
599 | } | 599 | } | ||
600 | } | 600 | } | ||
601 | 601 | | |||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
671 | 671 | | |||
672 | void LocateDlg::updateButtons(bool locateIsRunning) | 672 | void LocateDlg::updateButtons(bool locateIsRunning) | ||
673 | { | 673 | { | ||
674 | locateButton->setEnabled(!locateIsRunning); | 674 | locateButton->setEnabled(!locateIsRunning); | ||
675 | 675 | | |||
676 | if (locateIsRunning) { | 676 | if (locateIsRunning) { | ||
677 | feedStopButton->setEnabled(true); | 677 | feedStopButton->setEnabled(true); | ||
678 | feedStopButton->setText(i18n("Stop")); | 678 | feedStopButton->setText(i18n("Stop")); | ||
679 | feedStopButton->setIcon(QIcon::fromTheme(QStringLiteral("process-stop"))); | 679 | feedStopButton->setIcon(Icon(QStringLiteral("process-stop"))); | ||
680 | } else { | 680 | } else { | ||
681 | if (resultList->topLevelItemCount() == 0) { | 681 | if (resultList->topLevelItemCount() == 0) { | ||
682 | feedStopButton->setEnabled(false); | 682 | feedStopButton->setEnabled(false); | ||
683 | feedStopButton->setText(i18n("Stop")); | 683 | feedStopButton->setText(i18n("Stop")); | ||
684 | feedStopButton->setIcon(QIcon::fromTheme(QStringLiteral("process-stop"))); | 684 | feedStopButton->setIcon(Icon(QStringLiteral("process-stop"))); | ||
685 | } else { | 685 | } else { | ||
686 | feedStopButton->setEnabled(true); | 686 | feedStopButton->setEnabled(true); | ||
687 | feedStopButton->setText(i18n("Feed to listbox")); | 687 | feedStopButton->setText(i18n("Feed to listbox")); | ||
688 | feedStopButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); | 688 | feedStopButton->setIcon(Icon(QStringLiteral("list-add"))); | ||
689 | } | 689 | } | ||
690 | } | 690 | } | ||
691 | } | 691 | } | ||
692 | 692 | |