Skip to content

Commit

Permalink
widgets: pack all widgets into dcc::widgets
Browse files Browse the repository at this point in the history
Change-Id: I3ead86c7f54c074c4f2d03ea5f0dbed05cb6bf86
  • Loading branch information
hualet committed Dec 12, 2016
1 parent 8c88db8 commit 46ce72e
Show file tree
Hide file tree
Showing 121 changed files with 298 additions and 146 deletions.
2 changes: 1 addition & 1 deletion frame/framewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// FrameWidget can auto adjust size to fit parent Frame
///

using namespace dcc;
using namespace dcc::widgets;

class Frame;
class FrameWidget : public TranslucentFrame
Expand Down
2 changes: 1 addition & 1 deletion frame/moduleinitthread.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "moduleinitthread.h"
#include "modulewidget.h"

ModuleInitThread::ModuleInitThread(ModuleInterface *inter, QObject *parent)
ModuleInitThread::ModuleInitThread(dcc::ModuleInterface *inter, QObject *parent)
: QThread(parent),

m_module(inter)
Expand Down
6 changes: 3 additions & 3 deletions frame/moduleinitthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class ModuleInitThread : public QThread
Q_OBJECT

public:
explicit ModuleInitThread(ModuleInterface *inter, QObject *parent = 0);
explicit ModuleInitThread(dcc::ModuleInterface *inter, QObject *parent = 0);

signals:
void moduleInitFinished(ModuleInterface *inter) const;
void moduleInitFinished(dcc::ModuleInterface *inter) const;

protected:
void run();

private:
ModuleInterface *m_module;
dcc::ModuleInterface *m_module;
};

#endif // MODULEINITTHREAD_H
2 changes: 1 addition & 1 deletion frame/pluginscontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <QObject>

using namespace dde;
using namespace dcc;

class PluginsController : public QObject, public FrameProxyInterface
{
Expand Down
2 changes: 1 addition & 1 deletion frame/quick_control/basicsettingspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <QVBoxLayout>

using namespace dcc;
using namespace dcc::widgets;

BasicSettingsPage::BasicSettingsPage(QWidget *parent)
: QWidget(parent),
Expand Down
4 changes: 2 additions & 2 deletions frame/quick_control/basicsettingspage.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class BasicSettingsPage : public QWidget
explicit BasicSettingsPage(QWidget *parent = 0);

private:
dcc::DCCSlider *m_soundSlider;
dcc::DCCSlider *m_lightSlider;
dcc::widgets::DCCSlider *m_soundSlider;
dcc::widgets::DCCSlider *m_lightSlider;
};

#endif // BASICSETTINGSPAGE_H
1 change: 1 addition & 0 deletions frame/settingswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QPushButton>

using namespace dcc;
using namespace dcc::widgets;

class Frame;
class SettingsWidget : public ContentWidget, public FrameProxyInterface
Expand Down
4 changes: 3 additions & 1 deletion interfaces/frameproxyinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
#ifndef FRAMEPROXYINTERFACE_H
#define FRAMEPROXYINTERFACE_H

namespace dcc {
class ContentWidget;
class ModuleInterface;
}

namespace dde {
namespace dcc {

class FrameProxyInterface
{
Expand Down
8 changes: 6 additions & 2 deletions interfaces/moduleinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@

#include <QtCore>

using namespace dde;

namespace dcc {
class ModuleWidget;
class ContentWidget;
}
//struct ModuleMetadata {
// QString icon;
// QString title;
//};

namespace dcc {

// ModuleInterface作为每个规范每个Module的接口,每个Module实现必须实现其所有虚函数。
class ModuleInterface
{
Expand Down Expand Up @@ -76,4 +78,6 @@ class ModuleInterface
FrameProxyInterface *m_frameProxy = nullptr;
};

}

#endif // MODULEINTERFACE_H
2 changes: 1 addition & 1 deletion interfaces/plugininterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <QtCore>

using namespace dde;
using namespace dcc;

struct ModuleMetadata {
QString icon;
Expand Down
2 changes: 1 addition & 1 deletion modules/accounts/accountsdetailwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "removeuserdialog.h"

using namespace dcc;
using namespace dcc::widgets;
using namespace dcc::accounts;

AccountsDetailWidget::AccountsDetailWidget(User *user, QWidget *parent)
Expand Down
8 changes: 4 additions & 4 deletions modules/accounts/accountsdetailwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ private slots:

private:
User *m_user;
dcc::SettingsGroup *m_accountSettings;
dcc::NextPageWidget *m_modifyAvatar;
dcc::NextPageWidget *m_modifyPassword;
dcc::SwitchWidget *m_autoLogin;
dcc::widgets::SettingsGroup *m_accountSettings;
dcc::widgets::NextPageWidget *m_modifyAvatar;
dcc::widgets::NextPageWidget *m_modifyPassword;
dcc::widgets::SwitchWidget *m_autoLogin;
QPushButton *m_deleteAccount;
};

Expand Down
2 changes: 2 additions & 0 deletions modules/accounts/accountsmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "modifyavatarpage.h"
#include "createpage.h"

using namespace dcc;
using namespace dcc::widgets;
using namespace dcc::accounts;

AccountsModule::AccountsModule(FrameProxyInterface *frame, QObject *parent)
Expand Down
4 changes: 2 additions & 2 deletions modules/accounts/accountswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include <QPushButton>
#include <QDebug>

using namespace dcc;
using namespace dcc::widgets;
using namespace dcc::accounts;

AccountsWidget::AccountsWidget()
: ModuleWidget(),

m_userGroup(new SettingsGroup),
m_userGroup(new dcc::widgets::SettingsGroup),
m_createBtn(new QPushButton(tr("Create Account")))
{
setObjectName("Accounts");
Expand Down
2 changes: 1 addition & 1 deletion modules/accounts/accountswidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public slots:
void removeUser(User *user);

private:
dcc::SettingsGroup *m_userGroup;
dcc::widgets::SettingsGroup *m_userGroup;

QPushButton *m_createBtn;
};
Expand Down
2 changes: 2 additions & 0 deletions modules/accounts/createpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include "translucentframe.h"

using namespace dcc::widgets;

namespace dcc {
namespace accounts {

Expand Down
8 changes: 4 additions & 4 deletions modules/accounts/createpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public slots:

private:
AvatarWidget *m_avatar;
SettingsGroup *m_group;
LineEditWidget *m_username;
LineEditWidget *m_password;
LineEditWidget *m_repeatpass;
dcc::widgets::SettingsGroup *m_group;
dcc::widgets::LineEditWidget *m_username;
dcc::widgets::LineEditWidget *m_password;
dcc::widgets::LineEditWidget *m_repeatpass;
QPushButton *m_confirmBtn;
QPushButton *m_cancelBtn;

Expand Down
2 changes: 1 addition & 1 deletion modules/accounts/modifyavatarpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <dimagebutton.h>

using namespace dcc;
using namespace dcc::widgets;
using namespace dcc::accounts;

DWIDGET_USE_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion modules/accounts/modifypasswordpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QVBoxLayout>
#include <QDebug>

using namespace dcc;
using namespace dcc::widgets;
using namespace dcc::accounts;

ModifyPasswordPage::ModifyPasswordPage(User *user, QWidget *parent)
Expand Down
4 changes: 2 additions & 2 deletions modules/accounts/modifypasswordpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ private slots:
private:
User *m_userInter;

dcc::LineEditWidget *m_pwdEdit;
dcc::LineEditWidget *m_pwdEditRepeat;
dcc::widgets::LineEditWidget *m_pwdEdit;
dcc::widgets::LineEditWidget *m_pwdEditRepeat;
QPushButton *m_cancel;
QPushButton *m_accept;
};
Expand Down
2 changes: 2 additions & 0 deletions modules/bluetooth/adapterwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "switchwidget.h"
#include "settingsgroup.h"

using namespace dcc::widgets;

namespace dcc {
namespace bluetooth {

Expand Down
2 changes: 1 addition & 1 deletion modules/bluetooth/detailpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DetailPage::DetailPage(const Adapter *adapter, const Device *device) :
{
setTitle(device->name());

TranslucentFrame *frame = new TranslucentFrame;
dcc::widgets::TranslucentFrame *frame = new dcc::widgets::TranslucentFrame;
QVBoxLayout *layout = new QVBoxLayout(frame);
layout->setSpacing(0);
layout->setMargin(0);
Expand Down
2 changes: 2 additions & 0 deletions modules/bluetooth/devicesettingsitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "labels/normallabel.h"
#include "nextbutton.h"

using namespace dcc::widgets;

namespace dcc {
namespace bluetooth {

Expand Down
9 changes: 4 additions & 5 deletions modules/bluetooth/devicesettingsitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "settingsitem.h"
#include "device.h"

class NormalLabel;

namespace Dtk {
namespace Widget {
Expand All @@ -22,14 +21,14 @@ class DLoadingIndicator;
}

namespace dcc {

namespace widgets {
class NormalLabel;
class NextButton;
}

namespace bluetooth {

class DeviceSettingsItem : public SettingsItem
class DeviceSettingsItem : public dcc::widgets::SettingsItem
{
Q_OBJECT
public:
Expand All @@ -54,8 +53,8 @@ private slots:
private:
const Device *m_device;

NormalLabel *m_titleLabel;
NormalLabel *m_tipLabel;
dcc::widgets::NormalLabel *m_titleLabel;
dcc::widgets::NormalLabel *m_tipLabel;
Dtk::Widget::DLoadingIndicator *m_loadingIndicator;
dcc::widgets::NextButton *m_nextButton;
};
Expand Down
4 changes: 3 additions & 1 deletion modules/bluetooth/pincodedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

#include "labels/largelabel.h"

using namespace dcc::widgets;

namespace dcc {
namespace bluetooth {

PinCodeDialog::PinCodeDialog(const QString &pinCode, const bool &cancelable) :
DDialog(),
m_pinCodeLabel(new LargeLabel)
m_pinCodeLabel(new dcc::widgets::LargeLabel)
{
setTitle(tr("The PIN for connecting to the Bluetooth device is:"));
setIcon(QIcon::fromTheme("notification-bluetooth-connected"));
Expand Down
7 changes: 5 additions & 2 deletions modules/bluetooth/pincodedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@

DWIDGET_USE_NAMESPACE

class LargeLabel;

namespace dcc {
namespace widgets {
class LargeLabel;
}

namespace bluetooth {

class PinCodeDialog : public DDialog
Expand All @@ -29,7 +32,7 @@ class PinCodeDialog : public DDialog
void setPinCode(const QString &pinCode);

private:
LargeLabel *m_pinCodeLabel;
dcc::widgets::LargeLabel *m_pinCodeLabel;
};

} // namespace bluetooth
Expand Down
2 changes: 2 additions & 0 deletions modules/datetime/chosedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <QJsonObject>
#include <QJsonDocument>

using namespace dcc::widgets;

namespace dcc {
namespace datetime {

Expand Down
2 changes: 1 addition & 1 deletion modules/datetime/chosedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public slots:
private:
bool m_flag;
MapWidget* m_widget;
SearchInput* m_search;
dcc::widgets::SearchInput* m_search;
QPushButton* m_cancel;
QPushButton* m_add;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/datetime/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace dcc;
namespace dcc {
namespace datetime {

class Clock: public SettingsItem
class Clock: public widgets::SettingsItem
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion modules/datetime/datetimewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "settingsitem.h"

DWIDGET_USE_NAMESPACE
using namespace dcc;
using namespace dcc::widgets;

namespace dcc {
namespace datetime {
Expand Down
2 changes: 1 addition & 1 deletion modules/datetime/timezoneitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DWIDGET_USE_NAMESPACE
namespace dcc {
namespace datetime {

class TimezoneItem : public SettingsItem
class TimezoneItem : public dcc::widgets::SettingsItem
{
Q_OBJECT

Expand Down
4 changes: 2 additions & 2 deletions modules/defapp/defappviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ QWidget* DefAppViewer::defappDetail() {
m_modSoftware = new DefCategoryWidget(tr("Software"), this);
m_modSoftware->hide();

m_switchWidget = new dcc::SwitchWidget();
connect(m_switchWidget, &dcc::SwitchWidget::checkedChanegd, this, &DefAppViewer::autoOpenChanged);
m_switchWidget = new dcc::widgets::SwitchWidget();
connect(m_switchWidget, &dcc::widgets::SwitchWidget::checkedChanegd, this, &DefAppViewer::autoOpenChanged);

m_mainlayout->addWidget(m_modBrowser);
m_mainlayout->addWidget(m_modMail);
Expand Down
Loading

0 comments on commit 46ce72e

Please sign in to comment.