+ fix a few minor issues in DlgWorkbenchesImp and QListWidgetCustom
This commit is contained in:
parent
d5ae1988b8
commit
dbfedbdeae
|
@ -42,7 +42,7 @@ using namespace Gui::Dialog;
|
||||||
|
|
||||||
const QString DlgWorkbenchesImp::all_workbenches = QString::fromAscii("ALL");
|
const QString DlgWorkbenchesImp::all_workbenches = QString::fromAscii("ALL");
|
||||||
|
|
||||||
/* TRANSLATOR Gui::Dialog::DlgWorkbenches */
|
/* TRANSLATOR Gui::Dialog::DlgWorkbenchesImp */
|
||||||
|
|
||||||
DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
|
DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
|
||||||
: CustomizeActionPage(parent)
|
: CustomizeActionPage(parent)
|
||||||
|
@ -59,16 +59,14 @@ DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
|
||||||
|
|
||||||
for (QStringList::Iterator it = enabled_wbs_list.begin(); it != enabled_wbs_list.end(); ++it) {
|
for (QStringList::Iterator it = enabled_wbs_list.begin(); it != enabled_wbs_list.end(); ++it) {
|
||||||
if (workbenches.contains(*it)) {
|
if (workbenches.contains(*it)) {
|
||||||
QString wb = *it;
|
add_workbench(lw_enabled_workbenches, *it);
|
||||||
add_workbench(lw_enabled_workbenches, wb);
|
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "Ignoring unknown " << it->toLatin1() << " workbench found in user preferences.";
|
qDebug() << "Ignoring unknown" << *it << "workbench found in user preferences.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
|
for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
|
||||||
if (!enabled_wbs_list.contains(*it)){
|
if (!enabled_wbs_list.contains(*it)){
|
||||||
QString wb = *it;
|
add_workbench(lw_disabled_workbenches, *it);
|
||||||
add_workbench(lw_disabled_workbenches, wb);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lw_enabled_workbenches->setCurrentRow(0);
|
lw_enabled_workbenches->setCurrentRow(0);
|
||||||
|
@ -90,7 +88,7 @@ void DlgWorkbenchesImp::set_lw_properties(QListWidgetCustom *lw)
|
||||||
lw->setDefaultDropAction(Qt::MoveAction);
|
lw->setDefaultDropAction(Qt::MoveAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgWorkbenchesImp::add_workbench(QListWidgetCustom *lw, QString it)
|
void DlgWorkbenchesImp::add_workbench(QListWidgetCustom *lw, const QString& it)
|
||||||
{
|
{
|
||||||
QPixmap px = Application::Instance->workbenchIcon(it);
|
QPixmap px = Application::Instance->workbenchIcon(it);
|
||||||
QString mt = Application::Instance->workbenchMenuText(it);
|
QString mt = Application::Instance->workbenchMenuText(it);
|
||||||
|
@ -139,7 +137,7 @@ void DlgWorkbenchesImp::on_add_to_enabled_workbenches_btn_clicked()
|
||||||
{
|
{
|
||||||
QListWidgetItem* ci = lw_disabled_workbenches->currentItem();
|
QListWidgetItem* ci = lw_disabled_workbenches->currentItem();
|
||||||
if (ci) {
|
if (ci) {
|
||||||
move_workbench(lw_enabled_workbenches, ci);
|
move_workbench(lw_enabled_workbenches, ci);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +145,7 @@ void DlgWorkbenchesImp::on_remove_from_enabled_workbenches_btn_clicked()
|
||||||
{
|
{
|
||||||
QListWidgetItem* ci = lw_enabled_workbenches->currentItem();
|
QListWidgetItem* ci = lw_enabled_workbenches->currentItem();
|
||||||
if (ci) {
|
if (ci) {
|
||||||
move_workbench(lw_disabled_workbenches, ci);
|
move_workbench(lw_disabled_workbenches, ci);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ protected Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_lw_properties(QListWidgetCustom *lw);
|
void set_lw_properties(QListWidgetCustom *lw);
|
||||||
void add_workbench(QListWidgetCustom *lw, QString it);
|
void add_workbench(QListWidgetCustom *lw, const QString& it);
|
||||||
void move_workbench(QListWidgetCustom *lwc_dest,
|
void move_workbench(QListWidgetCustom *lwc_dest,
|
||||||
QListWidgetItem *wi);
|
QListWidgetItem *wi);
|
||||||
void save_enabled_workbenches();
|
void save_enabled_workbenches();
|
||||||
|
|
|
@ -60,3 +60,5 @@ void QListWidgetCustom::dragMoveEvent(QDragMoveEvent *e)
|
||||||
e->ignore();
|
e->ignore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "moc_QListWidgetCustom.cpp"
|
||||||
|
|
|
@ -28,11 +28,13 @@
|
||||||
#include <QDragMoveEvent>
|
#include <QDragMoveEvent>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class QListWidgetCustom : public QListWidget {
|
class QListWidgetCustom : public QListWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QListWidgetCustom (QWidget *parent);
|
QListWidgetCustom (QWidget *parent);
|
||||||
~QListWidgetCustom ();
|
virtual ~QListWidgetCustom ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void dragMoveEvent(QDragMoveEvent *e);
|
void dragMoveEvent(QDragMoveEvent *e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user