[Pkg-owncloud-commits] [owncloud-client] 39/484: Settings: Move synclog widget to a seperate dialog.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit afd081f40b7569d1fb7f4ac17945a946a7cf2818
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Oct 1 16:57:37 2015 +0200
Settings: Move synclog widget to a seperate dialog.
This a first step to integrate the server activity view, see #3732
---
src/gui/generalsettings.cpp | 12 +++++++++-
src/gui/generalsettings.h | 4 ++++
src/gui/synclogdialog.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++
src/gui/synclogdialog.h | 51 +++++++++++++++++++++++++++++++++++++++++++
src/gui/synclogdialog.ui | 38 ++++++++++++++++++++++++++++++++
5 files changed, 157 insertions(+), 1 deletion(-)
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp
index 45f19b3..515a7de 100644
--- a/src/gui/generalsettings.cpp
+++ b/src/gui/generalsettings.cpp
@@ -21,6 +21,8 @@
#include "configfile.h"
#include "owncloudsetupwizard.h"
#include "accountmanager.h"
+#include "synclogdialog.h"
+#include "protocolwidget.h"
#include "updater/updater.h"
#include "updater/ocupdater.h"
@@ -69,6 +71,8 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
_ui->crashreporterCheckBox->setVisible(false);
#endif
+ _protocolWidget = new ProtocolWidget;
+
/* Set the left contents margin of the layout to zero to make the checkboxes
* align properly vertically , fixes bug #3758
*/
@@ -153,7 +157,13 @@ void GeneralSettings::slotToggleOptionalDesktopNotifications(bool enable)
void GeneralSettings::slotOpenSyncLog()
{
-
+ if (_syncLogDialog.isNull()) {
+ _syncLogDialog = new SyncLogDialog(this, _protocolWidget);
+ _syncLogDialog->setAttribute( Qt::WA_DeleteOnClose, true );
+ _syncLogDialog->open();
+ } else {
+ ownCloudGui::raiseDialog(_syncLogDialog);
+ }
}
void GeneralSettings::slotIgnoreFilesEditor()
diff --git a/src/gui/generalsettings.h b/src/gui/generalsettings.h
index 53dd245..d4ac274 100644
--- a/src/gui/generalsettings.h
+++ b/src/gui/generalsettings.h
@@ -19,6 +19,8 @@
namespace OCC {
class IgnoreListEditor;
+class SyncLogDialog;
+class ProtocolWidget;
namespace Ui {
class GeneralSettings;
@@ -53,6 +55,8 @@ private:
Ui::GeneralSettings *_ui;
QPointer<IgnoreListEditor> _ignoreEditor;
+ QPointer<SyncLogDialog> _syncLogDialog;
+ ProtocolWidget *_protocolWidget;
};
diff --git a/src/gui/synclogdialog.cpp b/src/gui/synclogdialog.cpp
new file mode 100644
index 0000000..d7b8720
--- /dev/null
+++ b/src/gui/synclogdialog.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) by Roeland Jago Douma <roeland at famdouma.nl>
+ * Copyright (C) 2015 by Klaas Freitag <freitag at owncloud.com>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#include "synclogdialog.h"
+#include "ui_synclogdialog.h"
+#include "theme.h"
+#include "syncresult.h"
+#include "configfile.h"
+#include "capabilities.h"
+
+#include "QProgressIndicator.h"
+
+#include <QPushButton>
+
+
+namespace OCC {
+
+SyncLogDialog::SyncLogDialog(QWidget *parent, ProtocolWidget *protoWidget) :
+ QDialog(parent),
+ _ui(new Ui::SyncLogDialog)
+{
+ setAttribute(Qt::WA_DeleteOnClose);
+ setObjectName("SyncLogDialog"); // required as group for saveGeometry call
+
+ _ui->setupUi(this);
+
+ if( protoWidget) {
+ _ui->logWidgetLayout->addWidget(protoWidget);
+ }
+
+ QPushButton *closeButton = _ui->buttonBox->button(QDialogButtonBox::Close);
+ if( closeButton ) {
+ connect( closeButton, SIGNAL(clicked()), this, SLOT(close()) );
+ }
+}
+
+SyncLogDialog::~SyncLogDialog()
+{
+
+}
+
+}
diff --git a/src/gui/synclogdialog.h b/src/gui/synclogdialog.h
new file mode 100644
index 0000000..10c349c
--- /dev/null
+++ b/src/gui/synclogdialog.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) by Roeland Jago Douma <roeland at famdouma.nl>
+ * Copyright (C) 2015 by Klaas Freitag <freitag at owncloud.com>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ */
+
+#ifndef SyncLogDialog_H
+#define SyncLogDialog_H
+
+#include "protocolwidget.h"
+
+#include <QDialog>
+
+namespace OCC {
+
+
+namespace Ui {
+class SyncLogDialog;
+}
+
+
+/**
+ * @brief The SyncLogDialog class
+ * @ingroup gui
+ */
+class SyncLogDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit SyncLogDialog(QWidget *parent = 0, ProtocolWidget *protoWidget = 0);
+ ~SyncLogDialog();
+
+private slots:
+
+private:
+
+ Ui::SyncLogDialog *_ui;
+};
+
+}
+
+#endif // SyncLogDialog_H
diff --git a/src/gui/synclogdialog.ui b/src/gui/synclogdialog.ui
new file mode 100644
index 0000000..d8f9e21
--- /dev/null
+++ b/src/gui/synclogdialog.ui
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>OCC::SyncLogDialog</class>
+ <widget class="QDialog" name="OCC::SyncLogDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>372</width>
+ <height>247</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Synchronisation Log</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QVBoxLayout" name="logWidgetLayout"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list