Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
61e8987e
Commit
61e8987e
authored
Jan 29, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move settings in own class. Add storage service support
parent
b6ba5691
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
29 deletions
+127
-29
blogilo/src/CMakeLists.txt
blogilo/src/CMakeLists.txt
+2
-0
blogilo/src/configuredialog.cpp
blogilo/src/configuredialog.cpp
+66
-1
blogilo/src/configuredialog.h
blogilo/src/configuredialog.h
+31
-2
blogilo/src/mainwindow.cpp
blogilo/src/mainwindow.cpp
+21
-26
blogilo/src/mainwindow.h
blogilo/src/mainwindow.h
+7
-0
No files found.
blogilo/src/CMakeLists.txt
View file @
61e8987e
...
...
@@ -24,6 +24,7 @@ set(blogilo_SRCS
uploadmediadialog.cpp
syncuploader.cpp
poststabwidget.cpp
configuredialog.cpp
composer/htmleditor.cpp
composer/stylegetter.cpp
...
...
@@ -31,6 +32,7 @@ set(blogilo_SRCS
composer/blogilocomposereditor.cpp
composer/bilbobrowser.cpp
composer/blogilocomposerwidget.cpp
storageservice/storageservicemanagersettingsjob.cpp
)
...
...
blogilo/src/configuredialog.cpp
View file @
61e8987e
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "configuredialog.h"
ConfigureDialog
::
ConfigureDialog
()
#include "ui_advancedsettingsbase.h"
#include "ui_settingsbase.h"
#include "ui_editorsettingsbase.h"
#include "settings.h"
#include "blogsettings.h"
#include <KLocalizedString>
ConfigureDialog
::
ConfigureDialog
(
QWidget
*
parent
,
const
QString
&
name
,
KConfigSkeleton
*
config
)
:
KConfigDialog
(
parent
,
name
,
config
)
{
QWidget
*
generalSettingsDlg
=
new
QWidget
;
generalSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
Ui
::
SettingsBase
ui_prefs_base
;
Ui
::
EditorSettingsBase
ui_editorsettings_base
;
ui_prefs_base
.
setupUi
(
generalSettingsDlg
);
BlogSettings
*
blogSettingsDlg
=
new
BlogSettings
;
blogSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
connect
(
blogSettingsDlg
,
SIGNAL
(
blogAdded
(
BilboBlog
)),
this
,
SIGNAL
(
blogAdded
(
BilboBlog
))
);
connect
(
blogSettingsDlg
,
SIGNAL
(
blogEdited
(
BilboBlog
)),
this
,
SIGNAL
(
blogEdited
(
BilboBlog
))
);
connect
(
blogSettingsDlg
,
SIGNAL
(
blogRemoved
(
int
)),
this
,
SIGNAL
(
blogRemoved
(
int
))
);
QWidget
*
editorSettingsDlg
=
new
QWidget
;
editorSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
ui_editorsettings_base
.
setupUi
(
editorSettingsDlg
);
QWidget
*
advancedSettingsDlg
=
new
QWidget
;
advancedSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
Ui
::
AdvancedSettingsBase
ui_advancedsettings_base
;
ui_advancedsettings_base
.
setupUi
(
advancedSettingsDlg
);
addPage
(
generalSettingsDlg
,
i18nc
(
"Configure Page"
,
"General"
),
QLatin1String
(
"configure"
)
);
addPage
(
blogSettingsDlg
,
i18nc
(
"Configure Page"
,
"Blogs"
),
QLatin1String
(
"document-properties"
));
addPage
(
editorSettingsDlg
,
i18nc
(
"Configure Page"
,
"Editor"
),
QLatin1String
(
"accessories-text-editor"
));
addPage
(
advancedSettingsDlg
,
i18nc
(
"Configure Page"
,
"Advanced"
),
QLatin1String
(
"applications-utilities"
));
connect
(
this
,
SIGNAL
(
settingsChanged
(
QString
)),
this
,
SIGNAL
(
settingsChanged
())
);
connect
(
this
,
SIGNAL
(
destroyed
(
QObject
*
)),
this
,
SIGNAL
(
dialogDestroyed
(
QObject
*
)));
setAttribute
(
Qt
::
WA_DeleteOnClose
);
resize
(
Settings
::
configWindowSize
()
);
show
();
}
ConfigureDialog
::~
ConfigureDialog
()
{
}
blogilo/src/configuredialog.h
View file @
61e8987e
/*
Copyright (c) 2014 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CONFIGUREDIALOG_H
#define CONFIGUREDIALOG_H
class
ConfigureDialog
#include <KConfigDialog>
#include "bilboblog.h"
class
ConfigureDialog
:
public
KConfigDialog
{
Q_OBJECT
public:
ConfigureDialog
();
explicit
ConfigureDialog
(
QWidget
*
parent
,
const
QString
&
name
,
KConfigSkeleton
*
config
);
~
ConfigureDialog
();
Q_SIGNALS:
void
blogRemoved
(
int
);
void
blogAdded
(
const
BilboBlog
&
);
void
blogEdited
(
const
BilboBlog
&
);
void
dialogDestroyed
(
QObject
*
);
void
settingsChanged
();
};
#endif // CONFIGUREDIALOG_H
blogilo/src/mainwindow.cpp
View file @
61e8987e
...
...
@@ -36,11 +36,17 @@
#include "blogsettings.h"
#include "poststabwidget.h"
#include "uploadmediadialog.h"
#include "configuredialog.h"
#include "storageservice/storageservicemanagersettingsjob.h"
#include "ui_advancedsettingsbase.h"
#include "ui_settingsbase.h"
#include "ui_editorsettingsbase.h"
#include "pimcommon/storageservice/storageservicemanager.h"
#include "pimcommon/storageservice/storageservicejobconfig.h"
#include "pimcommon/storageservice/storageserviceabstract.h"
#include <ktabwidget.h>
#include <KStatusNotifierItem>
#include <kstatusbar.h>
...
...
@@ -124,12 +130,22 @@ MainWindow::MainWindow()
}
connect
(
blogs
,
SIGNAL
(
triggered
(
QAction
*
)),
this
,
SLOT
(
currentBlogChanged
(
QAction
*
))
);
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
loadTempPosts
())
);
initStorageService
();
}
MainWindow
::~
MainWindow
()
{
}
void
MainWindow
::
initStorageService
()
{
StorageServiceManagerSettingsJob
*
settingsJob
=
new
StorageServiceManagerSettingsJob
(
this
);
PimCommon
::
StorageServiceJobConfig
*
configJob
=
PimCommon
::
StorageServiceJobConfig
::
self
();
configJob
->
registerConfigIf
(
settingsJob
);
mStorageManager
=
new
PimCommon
::
StorageServiceManager
(
this
);
}
void
MainWindow
::
slotCloseTabClicked
()
{
const
int
currentIndex
=
tabPosts
->
currentIndex
();
...
...
@@ -287,36 +303,15 @@ void MainWindow::optionsPreferences()
if
(
KConfigDialog
::
showDialog
(
QLatin1String
(
"settings"
)
)
)
{
return
;
}
KConfigDialog
*
dialog
=
new
KConfigDialog
(
this
,
QLatin1String
(
"settings"
),
Settings
::
self
()
);
QWidget
*
generalSettingsDlg
=
new
QWidget
;
generalSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
Ui
::
SettingsBase
ui_prefs_base
;
Ui
::
EditorSettingsBase
ui_editorsettings_base
;
ui_prefs_base
.
setupUi
(
generalSettingsDlg
);
BlogSettings
*
blogSettingsDlg
=
new
BlogSettings
;
blogSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
connect
(
blogSettingsDlg
,
SIGNAL
(
blogAdded
(
BilboBlog
)),
ConfigureDialog
*
dialog
=
new
ConfigureDialog
(
this
,
QLatin1String
(
"settings"
),
Settings
::
self
()
);
connect
(
dialog
,
SIGNAL
(
blogAdded
(
BilboBlog
)),
this
,
SLOT
(
slotBlogAdded
(
BilboBlog
))
);
connect
(
blogSettingsDl
g
,
SIGNAL
(
blogEdited
(
BilboBlog
)),
connect
(
dialo
g
,
SIGNAL
(
blogEdited
(
BilboBlog
)),
this
,
SLOT
(
slotBlogEdited
(
BilboBlog
))
);
connect
(
blogSettingsDlg
,
SIGNAL
(
blogRemoved
(
int
)),
this
,
SLOT
(
slotBlogRemoved
(
int
))
);
QWidget
*
editorSettingsDlg
=
new
QWidget
;
editorSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
ui_editorsettings_base
.
setupUi
(
editorSettingsDlg
);
QWidget
*
advancedSettingsDlg
=
new
QWidget
;
advancedSettingsDlg
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
Ui
::
AdvancedSettingsBase
ui_advancedsettings_base
;
ui_advancedsettings_base
.
setupUi
(
advancedSettingsDlg
);
dialog
->
addPage
(
generalSettingsDlg
,
i18nc
(
"Configure Page"
,
"General"
),
QLatin1String
(
"configure"
)
);
dialog
->
addPage
(
blogSettingsDlg
,
i18nc
(
"Configure Page"
,
"Blogs"
),
QLatin1String
(
"document-properties"
));
dialog
->
addPage
(
editorSettingsDlg
,
i18nc
(
"Configure Page"
,
"Editor"
),
QLatin1String
(
"accessories-text-editor"
));
dialog
->
addPage
(
advancedSettingsDlg
,
i18nc
(
"Configure Page"
,
"Advanced"
),
QLatin1String
(
"applications-utilities"
));
connect
(
dialog
,
SIGNAL
(
blogRemoved
(
int
)),
this
,
SLOT
(
slotBlogRemoved
(
int
))
);
connect
(
dialog
,
SIGNAL
(
settingsChanged
(
QString
)),
this
,
SIGNAL
(
settingsChanged
())
);
connect
(
dialog
,
SIGNAL
(
settingsChanged
(
QString
)),
this
,
SLOT
(
slotSettingsChanged
())
);
connect
(
dialog
,
SIGNAL
(
destroyed
(
QObject
*
)),
this
,
SLOT
(
slotDialogDestroyed
(
QObject
*
)));
dialog
->
setAttribute
(
Qt
::
WA_DeleteOnClose
);
dialog
->
resize
(
Settings
::
configWindowSize
()
);
connect
(
dialog
,
SIGNAL
(
dialogDestroyed
(
QObject
*
)),
this
,
SLOT
(
slotDialogDestroyed
(
QObject
*
)));
dialog
->
show
();
}
...
...
blogilo/src/mainwindow.h
View file @
61e8987e
...
...
@@ -46,6 +46,11 @@ Main window of blogilo...
@author Mehrdad Momeny <mehrdad.momeny@gmail.com>
@author Golnaz Nilieh <g382nilieh@gmail.com>
*/
namespace
PimCommon
{
class
StorageServiceManager
;
}
class
MainWindow
:
public
KXmlGuiWindow
{
Q_OBJECT
...
...
@@ -111,6 +116,7 @@ private:
void
setupActions
();
void
setupSystemTray
();
void
writeConfigs
();
void
initStorageService
();
/**
Create a new post entry,
and return pointer to it's widget (Actually return value is a PostEntry instance)
...
...
@@ -132,5 +138,6 @@ private:
int
&
mCurrentBlogId
;
QToolButton
*
mCloseTabButton
;
QToolButton
*
mNewTabButton
;
PimCommon
::
StorageServiceManager
*
mStorageManager
;
};
#endif
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