Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
c4e6e50b
Commit
c4e6e50b
authored
Jun 19, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Colors): supports colors override with linphonerc
parent
c579092e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
13 deletions
+25
-13
Colors.cpp
src/components/other/colors/Colors.cpp
+23
-1
Colors.hpp
src/components/other/colors/Colors.hpp
+2
-12
No files found.
src/components/other/colors/Colors.cpp
View file @
c4e6e50b
...
...
@@ -20,8 +20,30 @@
* Author: Ronan Abhamon
*/
#include <QMetaProperty>
#include "../../../utils/Utils.hpp"
#include "../../core/CoreManager.hpp"
#include "Colors.hpp"
#define COLORS_SECTION "ui_colors"
using
namespace
std
;
// =============================================================================
Colors
::
Colors
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
Colors
::
Colors
(
QObject
*
parent
)
:
QObject
(
parent
)
{
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
const
QMetaObject
*
info
=
metaObject
();
for
(
int
i
=
info
->
propertyOffset
();
i
<
info
->
propertyCount
();
++
i
)
{
const
QMetaProperty
&
metaProperty
=
info
->
property
(
i
);
string
colorName
=
metaProperty
.
name
();
string
colorValue
=
config
->
getString
(
COLORS_SECTION
,
colorName
,
""
);
if
(
!
colorValue
.
empty
())
setProperty
(
colorName
.
c_str
(),
QColor
(
::
Utils
::
coreStringToAppString
(
colorValue
)));
}
}
src/components/other/colors/Colors.hpp
View file @
c4e6e50b
...
...
@@ -29,12 +29,9 @@
// =============================================================================
#define ADD_COLOR(COLOR, VALUE) \
signals: \
void COLOR ## Changed(const QColor &color); \
private: \
Q_PROPERTY(QColor COLOR MEMBER m ## COLOR WRITE set ## COLOR NOTIFY colorT ## COLOR ## Changed); \
void set ## COLOR(const QColor &color) { \
m ## COLOR =
QColor(color.rgb())
; \
m ## COLOR =
color
; \
emit colorT ## COLOR ## Changed(m ## COLOR); \
} \
QColor m ## COLOR = VALUE;
...
...
@@ -102,19 +99,11 @@ signals:
void
colorTeChanged
(
const
QColor
&
color
);
void
colorTfChanged
(
const
QColor
&
color
);
void
colorTgChanged
(
const
QColor
&
color
);
void
colorTg10Changed
(
const
QColor
&
color
);
void
colorTg20Changed
(
const
QColor
&
color
);
void
colorTg90Changed
(
const
QColor
&
color
);
void
colorThChanged
(
const
QColor
&
color
);
void
colorTiChanged
(
const
QColor
&
color
);
void
colorTi30Changed
(
const
QColor
&
color
);
void
colorTjChanged
(
const
QColor
&
color
);
void
colorTj75Changed
(
const
QColor
&
color
);
void
colorTkChanged
(
const
QColor
&
color
);
void
colorTk50Changed
(
const
QColor
&
color
);
void
colorTlChanged
(
const
QColor
&
color
);
void
colorTl50Changed
(
const
QColor
&
color
);
void
colorTl80Changed
(
const
QColor
&
color
);
void
colorTmChanged
(
const
QColor
&
color
);
void
colorTnChanged
(
const
QColor
&
color
);
void
colorToChanged
(
const
QColor
&
color
);
...
...
@@ -129,6 +118,7 @@ signals:
void
colorTxChanged
(
const
QColor
&
color
);
void
colorTyChanged
(
const
QColor
&
color
);
void
colorTzChanged
(
const
QColor
&
color
);
void
colorTerrorChanged
(
const
QColor
&
color
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment