Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
lifo
Nicolas Ollinger
OpenBoard
Commits
a9ba75ac
Commit
a9ba75ac
authored
Apr 11, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed globalStyleSheet()
parent
5a6de660
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
81 additions
and
56 deletions
+81
-56
UBApplication.cpp
src/core/UBApplication.cpp
+5
-21
UBApplication.h
src/core/UBApplication.h
+0
-1
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+1
-2
UBGlobals.h
src/globals/UBGlobals.h
+31
-4
UBCachePropertiesWidget.cpp
src/gui/UBCachePropertiesWidget.cpp
+5
-4
UBDockDownloadWidget.cpp
src/gui/UBDockDownloadWidget.cpp
+3
-2
UBDockTeacherGuideWidget.cpp
src/gui/UBDockTeacherGuideWidget.cpp
+1
-2
UBDownloadWidget.cpp
src/gui/UBDownloadWidget.cpp
+4
-3
UBLibItemProperties.cpp
src/gui/UBLibItemProperties.cpp
+4
-3
UBLibNavigatorWidget.cpp
src/gui/UBLibNavigatorWidget.cpp
+4
-3
UBLibWebView.cpp
src/gui/UBLibWebView.cpp
+6
-3
UBLibWidget.cpp
src/gui/UBLibWidget.cpp
+4
-3
UBPageNavigationWidget.cpp
src/gui/UBPageNavigationWidget.cpp
+6
-3
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+5
-2
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+2
-0
No files found.
src/core/UBApplication.cpp
View file @
a9ba75ac
...
...
@@ -257,10 +257,10 @@ int UBApplication::exec(const QString& pFileToImport)
applicationController
=
new
UBApplicationController
(
boardController
->
controlView
(),
boardController
->
displayView
(),
mainWindow
,
staticMemoryCleaner
);
connect
(
applicationController
,
SIGNAL
(
mainModeChanged
(
UBApplicationController
::
MainMode
)),
connect
(
applicationController
,
SIGNAL
(
mainModeChanged
(
UBApplicationController
::
MainMode
)),
boardController
->
paletteManager
(),
SLOT
(
slot_changeMainMode
(
UBApplicationController
::
MainMode
)));
connect
(
applicationController
,
SIGNAL
(
desktopMode
(
bool
)),
connect
(
applicationController
,
SIGNAL
(
desktopMode
(
bool
)),
boardController
->
paletteManager
(),
SLOT
(
slot_changeDesktopMode
(
bool
)));
...
...
@@ -283,8 +283,8 @@ int UBApplication::exec(const QString& pFileToImport)
connect
(
mainWindow
->
actionSankoreEditor
,
SIGNAL
(
triggered
()),
applicationController
,
SLOT
(
showSankoreEditor
()));
connect
(
mainWindow
->
actionCheckUpdate
,
SIGNAL
(
triggered
()),
applicationController
,
SLOT
(
checkUpdateRequest
()));
toolBarPositionChanged
(
UBSettings
::
settings
()
->
appToolBarPositionedAtTop
->
get
());
bool
bUseMultiScreen
=
UBSettings
::
settings
()
->
appUseMultiscreen
->
get
().
toBool
();
...
...
@@ -645,29 +645,13 @@ void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment,
painter
->
setPen
(
savedPen
);
}
QString
UBApplication
::
globalStyleSheet
()
{
QString
style
;
QFile
f
(
":style.qss"
);
if
(
f
.
exists
())
{
if
(
f
.
open
(
QIODevice
::
ReadOnly
))
{
style
=
QString
(
f
.
readAll
());
}
}
return
style
;
}
QString
UBApplication
::
urlFromHtml
(
QString
html
)
{
QString
_html
;
QRegExp
comments
(
"
\\
<![
\r\n\t
]*(--([^
\\
-]|[
\r\n
]|-[^
\\
-])*--[
\r\n\t
]*)
\\
>"
);
QString
url
;
QDomDocument
domDoc
;
// We remove all the comments & CRLF of this html
_html
=
html
.
remove
(
comments
);
domDoc
.
setContent
(
_html
.
remove
(
QRegExp
(
"[
\\
0]"
)));
...
...
src/core/UBApplication.h
View file @
a9ba75ac
...
...
@@ -78,7 +78,6 @@ class UBApplication : public QtSingleApplication
static
void
setDisabled
(
bool
disable
);
static
QObject
*
staticMemoryCleaner
;
static
QString
globalStyleSheet
();
void
decorateActionMenu
(
QAction
*
action
);
void
insertSpaceToToolbarBeforeAction
(
QToolBar
*
toolbar
,
QAction
*
action
,
int
width
=
-
1
);
...
...
src/customWidgets/UBMediaWidget.cpp
View file @
a9ba75ac
...
...
@@ -35,8 +35,7 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
,
mpMediaContainer
(
NULL
)
,
mpCover
(
NULL
)
{
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
addAction
(
eAction_Close
);
mType
=
type
;
...
...
src/globals/UBGlobals.h
View file @
a9ba75ac
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBGLOBALS_H
#define UBGLOBALS_H
#include <QString>
#include <QFile>
#define DELETEPTR(ptr) if(NULL != ptr){ \
delete ptr; \
ptr = NULL; \
}
#define SET_STYLE_SHEET() {\
setAttribute(Qt::WA_StyledBackground, true);\
QString style;\
QFile f(":style.qss");\
if(f.exists() && f.open(QIODevice::ReadOnly))\
style = QString(f.readAll());\
setStyleSheet(style);\
}
#ifdef Q_WS_WIN
#define WARNINGS_DISABLE __pragma(warning(push, 0));
...
...
@@ -14,7 +41,7 @@
#ifdef NO_THIRD_PARTY_WARNINGS
// disabling warning level to 0 and save old state
#define THIRD_PARTY_WARNINGS_DISABLE WARNINGS_DISABLE
#else
#else
// just save old state (needs for not empty define)
#define THIRD_PARTY_WARNINGS_DISABLE __pragma(warning(push));
#endif //#ifdef NO_THIRD_PARTY_WARNINGS
...
...
@@ -24,9 +51,9 @@
#define WARNINGS_DISABLE _Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\""); \
_Pragma("GCC diagnostic ignored \"-Wunused-variable\""); \
_Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
_Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#define WARNINGS_ENABLE _Pragma("GCC diagnostic pop");
#define WARNINGS_ENABLE _Pragma("GCC diagnostic pop");
#ifdef NO_THIRD_PARTY_WARNINGS
//disabling some warnings
...
...
@@ -43,4 +70,4 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE
#endif // UBGLOBALS_H
src/gui/UBCachePropertiesWidget.cpp
View file @
a9ba75ac
...
...
@@ -7,6 +7,7 @@
#include "core/UBApplication.h"
#include "core/UBApplicationController.h"
#include "globals/UBGlobals.h"
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
...
...
@@ -34,8 +35,8 @@ UBCachePropertiesWidget::UBCachePropertiesWidget(QWidget *parent, const char *na
,
mpCurrentCache
(
NULL
)
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
()
);
SET_STYLE_SHEET
(
);
mName
=
"CachePropWidget"
;
mVisibleState
=
false
;
...
...
@@ -283,7 +284,7 @@ void UBCachePropertiesWidget::updateCurrentCache()
if
(
UBApplication
::
applicationController
!=
NULL
)
{
// if app controller is available, and current mode is Board, and no show desktop, than all ok, just process
if
(
UBApplication
::
applicationController
->
displayMode
()
==
UBApplicationController
::
Board
&&
if
(
UBApplication
::
applicationController
->
displayMode
()
==
UBApplicationController
::
Board
&&
!
UBApplication
::
applicationController
->
isShowingDesktop
())
isBoardMode
=
true
;
}
...
...
@@ -348,4 +349,4 @@ void UBCachePropertiesWidget::onCacheEnabled()
{
emit
showTab
(
this
);
}
src/gui/UBDockDownloadWidget.cpp
View file @
a9ba75ac
...
...
@@ -15,6 +15,8 @@
#include "UBDockDownloadWidget.h"
#include "core/UBApplication.h"
#include "globals/UBGlobals.h"
UBDockDownloadWidget
::
UBDockDownloadWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
,
mpLayout
(
NULL
)
,
mpDLWidget
(
NULL
)
...
...
@@ -22,8 +24,7 @@ UBDockDownloadWidget::UBDockDownloadWidget(QWidget *parent, const char *name):UB
mName
=
"DownloadWidget"
;
mVisibleState
=
false
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
mIconToLeft
=
QPixmap
(
":images/download_open.png"
);
mIconToRight
=
QPixmap
(
":images/download_close.png"
);
...
...
src/gui/UBDockTeacherGuideWidget.cpp
View file @
a9ba75ac
...
...
@@ -26,8 +26,7 @@ UBDockTeacherGuideWidget::UBDockTeacherGuideWidget(QWidget* parent, const char*
{
mName
=
"TeacherGuide"
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
mIconToLeft
=
QPixmap
(
":images/teacher_open.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close.png"
);
...
...
src/gui/UBDownloadWidget.cpp
View file @
a9ba75ac
...
...
@@ -18,8 +18,10 @@
#include <QApplication>
#include "UBDownloadWidget.h"
#include "core/UBApplication.h"
#include "globals/UBGlobals.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
/**
...
...
@@ -36,8 +38,7 @@ UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(pa
{
setObjectName
(
name
);
setWindowTitle
(
tr
(
"Downloading files"
));
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
resize
(
400
,
300
);
mpLayout
=
new
QVBoxLayout
(
this
);
...
...
src/gui/UBLibItemProperties.cpp
View file @
a9ba75ac
...
...
@@ -18,10 +18,12 @@
#include "core/UBApplication.h"
#include "core/UBDownloadManager.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
/**
* \brief Constructor
...
...
@@ -43,8 +45,7 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
// Create the GUI
mpLayout
=
new
QVBoxLayout
(
this
);
...
...
src/gui/UBLibNavigatorWidget.cpp
View file @
a9ba75ac
...
...
@@ -18,6 +18,8 @@
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
static
int
lowBoundForSlider
=
40
;
static
int
topBoundForSlider
=
120
;
static
int
tickIntervalForSlider
=
10
;
...
...
@@ -35,8 +37,7 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
setAcceptDrops
(
true
);
...
...
@@ -62,7 +63,7 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
connect
(
mLibWidget
,
SIGNAL
(
propertiesRequested
(
UBLibElement
*
)),
this
,
SLOT
(
onPropertiesRequested
(
UBLibElement
*
)));
connect
(
mLibWidget
,
SIGNAL
(
displaySearchEngine
(
UBLibElement
*
)),
this
,
SLOT
(
onDisplaySearchEngine
(
UBLibElement
*
)));
connect
(
mLibWidget
,
SIGNAL
(
displaySearchEngine
(
UBLibElement
*
)),
this
,
SLOT
(
onDisplaySearchEngine
(
UBLibElement
*
)));
connect
(
mSlider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
updateThumbnailsSize
(
int
)));
connect
(
libWidget
->
pathViewer
(),
SIGNAL
(
mouseClick
(
UBChainedLibElement
*
)),
this
,
SLOT
(
onPathItemClicked
(
UBChainedLibElement
*
)));
connect
(
libWidget
->
pathViewer
(),
SIGNAL
(
elementsDropped
(
QList
<
QString
>
,
UBLibElement
*
)),
mLibWidget
,
SLOT
(
onElementsDropped
(
QList
<
QString
>
,
UBLibElement
*
)));
...
...
src/gui/UBLibWebView.cpp
View file @
a9ba75ac
#include <QDomDocument>
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "globals/UBGlobals.h"
#include "UBLibWebView.h"
#include "core/memcheck.h"
UBLibWebView
::
UBLibWebView
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpView
(
NULL
)
...
...
@@ -15,8 +19,7 @@ UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
mpLayout
=
new
QVBoxLayout
();
setLayout
(
mpLayout
);
...
...
src/gui/UBLibWidget.cpp
View file @
a9ba75ac
...
...
@@ -15,10 +15,12 @@
#include <QDebug>
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
@@ -37,8 +39,7 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget(
mName
=
"LibWidget"
;
mVisibleState
=
true
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
SET_STYLE_SHEET
();
mIconToLeft
=
QPixmap
(
":images/library_open.png"
);
mIconToRight
=
QPixmap
(
":images/library_close.png"
);
...
...
src/gui/UBPageNavigationWidget.cpp
View file @
a9ba75ac
...
...
@@ -14,9 +14,12 @@
*/
#include "UBPageNavigationWidget.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "globals/UBGlobals.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
@@ -32,8 +35,8 @@ UBPageNavigationWidget::UBPageNavigationWidget(QWidget *parent, const char *name
setObjectName
(
name
);
mName
=
"PageNavigator"
;
mVisibleState
=
true
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
()
);
SET_STYLE_SHEET
(
);
mIconToRight
=
QPixmap
(
":images/pages_open.png"
);
mIconToLeft
=
QPixmap
(
":images/pages_close.png"
);
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
a9ba75ac
...
...
@@ -87,7 +87,8 @@ UBTeacherGuideEditionWidget::UBTeacherGuideEditionWidget(QWidget *parent, const
mpTreeWidget
->
setColumnCount
(
2
);
mpTreeWidget
->
header
()
->
setStretchLastSection
(
false
);
mpTreeWidget
->
header
()
->
setResizeMode
(
0
,
QHeaderView
::
Stretch
);
mpTreeWidget
->
header
()
->
setResizeMode
(
1
,
QHeaderView
::
Custom
);
mpTreeWidget
->
header
()
->
setResizeMode
(
1
,
QHeaderView
::
Fixed
);
mpTreeWidget
->
header
()
->
setDefaultSectionSize
(
32
);
connect
(
mpTreeWidget
,
SIGNAL
(
itemClicked
(
QTreeWidgetItem
*
,
int
)),
this
,
SLOT
(
onAddItemClicked
(
QTreeWidgetItem
*
,
int
)));
...
...
@@ -158,7 +159,9 @@ QVector<tUBGEElementNode*> UBTeacherGuideEditionWidget::getData()
children
<<
getChildrenList
(
mpAddALinkItem
);
result
<<
getPageAndCommentData
();
foreach
(
QTreeWidgetItem
*
widgetItem
,
children
){
result
<<
dynamic_cast
<
iUBTGSavableData
*>
(
mpTreeWidget
->
itemWidget
(
widgetItem
,
0
))
->
saveData
();
tUBGEElementNode
*
node
=
dynamic_cast
<
iUBTGSavableData
*>
(
mpTreeWidget
->
itemWidget
(
widgetItem
,
0
))
->
saveData
();
if
(
node
)
result
<<
node
;
}
return
result
;
}
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
a9ba75ac
...
...
@@ -198,6 +198,8 @@ UBTGMediaWidget::~UBTGMediaWidget()
tUBGEElementNode
*
UBTGMediaWidget
::
saveData
()
{
if
(
!
mpTitle
)
return
0
;
tUBGEElementNode
*
result
=
new
tUBGEElementNode
();
result
->
type
=
"media"
;
result
->
attributes
.
insert
(
"title"
,
mpTitle
->
toPlainText
());
...
...
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