Settings: Move synclog widget to a seperate dialog.

This a first step to integrate the server activity view, see #3732
This commit is contained in:
Klaas Freitag 2015-10-01 16:57:37 +02:00
parent 0c148025a3
commit afd081f40b
5 changed files with 157 additions and 1 deletions

View file

@ -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()

View file

@ -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;
};

53
src/gui/synclogdialog.cpp Normal file
View file

@ -0,0 +1,53 @@
/*
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
* Copyright (C) 2015 by Klaas Freitag <freitag@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()
{
}
}

51
src/gui/synclogdialog.h Normal file
View file

@ -0,0 +1,51 @@
/*
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
* Copyright (C) 2015 by Klaas Freitag <freitag@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

38
src/gui/synclogdialog.ui Normal file
View file

@ -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>