mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
Fixed online time in profile widget.
Fixed width of settings dialog. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6329 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fea35e1e3c
commit
dd0ef691c5
@ -27,6 +27,7 @@
|
|||||||
#include "StatusMessage.h"
|
#include "StatusMessage.h"
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
|
#include "rshare.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
@ -44,7 +45,7 @@ ProfileWidget::ProfileWidget(QWidget *parent, Qt::WFlags flags)
|
|||||||
connect(ui.CopyCertButton,SIGNAL(clicked()), this, SLOT(copyCert()));
|
connect(ui.CopyCertButton,SIGNAL(clicked()), this, SLOT(copyCert()));
|
||||||
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
|
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
|
||||||
|
|
||||||
ui.onlinesince->setText(DateTime::formatLongDateTime(QDateTime::currentDateTime()));
|
ui.onlinesince->setText(DateTime::formatLongDateTime(Rshare::startupTime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileWidget::showEvent ( QShowEvent * /*event*/ )
|
void ProfileWidget::showEvent ( QShowEvent * /*event*/ )
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
|
#include "rshare.h"
|
||||||
#include "CryptoPage.h"
|
#include "CryptoPage.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
@ -57,8 +58,9 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags)
|
|||||||
#endif
|
#endif
|
||||||
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
|
connect(ui.profile_Button,SIGNAL(clicked()), this, SLOT(profilemanager()));
|
||||||
|
|
||||||
ui.onlinesince->setText(DateTime::formatLongDateTime(QDateTime::currentDateTime()));
|
ui.onlinesince->setText(DateTime::formatLongDateTime(Rshare::startupTime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CryptoPage::profilemanager()
|
void CryptoPage::profilemanager()
|
||||||
{
|
{
|
||||||
ProfileManager profilemanager;
|
ProfileManager profilemanager;
|
||||||
@ -111,12 +113,7 @@ void
|
|||||||
CryptoPage::load()
|
CryptoPage::load()
|
||||||
{
|
{
|
||||||
/* Loads ouer default Puplickey */
|
/* Loads ouer default Puplickey */
|
||||||
QFont font("Courier New",9,50,false) ;
|
ui.certplainTextEdit->setPlainText(QString::fromUtf8(rsPeers->GetRetroshareInvite(ui._includeSignatures_CB->isChecked(),ui._useOldFormat_CB->isChecked()).c_str()));
|
||||||
ui.certtextEdit->setFont(font) ;
|
|
||||||
|
|
||||||
ui.certtextEdit->setPlainText(QString::fromUtf8(rsPeers->GetRetroshareInvite(ui._includeSignatures_CB->isChecked(),ui._useOldFormat_CB->isChecked()).c_str()));
|
|
||||||
ui.certtextEdit->setReadOnly(true);
|
|
||||||
ui.certtextEdit->setMinimumHeight(200);
|
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
CryptoPage::copyRSLink()
|
CryptoPage::copyRSLink()
|
||||||
@ -148,7 +145,7 @@ CryptoPage::copyPublicKey()
|
|||||||
tr("Your Public Key is copied to Clipboard, paste and send it to your"
|
tr("Your Public Key is copied to Clipboard, paste and send it to your"
|
||||||
" friend via email or some other way"));
|
" friend via email or some other way"));
|
||||||
QClipboard *clipboard = QApplication::clipboard();
|
QClipboard *clipboard = QApplication::clipboard();
|
||||||
clipboard->setText(ui.certtextEdit->toPlainText());
|
clipboard->setText(ui.certplainTextEdit->toPlainText());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CryptoPage::fileSave()
|
bool CryptoPage::fileSave()
|
||||||
@ -161,8 +158,7 @@ bool CryptoPage::fileSave()
|
|||||||
return false;
|
return false;
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
ts.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
ts << ui.certtextEdit->document()->toPlainText();
|
ts << ui.certplainTextEdit->document()->toPlainText();
|
||||||
ui.certtextEdit->document()->setModified(false);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,16 +166,8 @@ bool CryptoPage::fileSaveAs()
|
|||||||
{
|
{
|
||||||
QString fn;
|
QString fn;
|
||||||
if (misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT, tr("Save as..."), tr("RetroShare Certificate (*.rsc );;All Files (*)"), fn)) {
|
if (misc::getSaveFileName(this, RshareSettings::LASTDIR_CERT, tr("Save as..."), tr("RetroShare Certificate (*.rsc );;All Files (*)"), fn)) {
|
||||||
setCurrentFileName(fn);
|
fileName = fn;
|
||||||
return fileSave();
|
return fileSave();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CryptoPage::setCurrentFileName(const QString &fileName)
|
|
||||||
{
|
|
||||||
this->fileName = fileName;
|
|
||||||
ui.certtextEdit->document()->setModified(false);
|
|
||||||
|
|
||||||
setWindowModified(false);
|
|
||||||
}
|
|
||||||
|
@ -52,8 +52,6 @@ class CryptoPage : public ConfigPage
|
|||||||
bool fileSaveAs();
|
bool fileSaveAs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setCurrentFileName(const QString &fileName);
|
|
||||||
|
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
|
@ -440,17 +440,60 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="certtextEdit">
|
<widget class="QPlainTextEdit" name="certplainTextEdit">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<kerning>false</kerning>
|
<family>Courier New</family>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="acceptRichText">
|
<property name="tabChangesFocus">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="lineWrapMode">
|
||||||
|
<enum>QPlainTextEdit::NoWrap</enum>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_includeSignatures_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Include signatures</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_useOldFormat_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use old key format</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
@ -471,21 +514,17 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="_useOldFormat_CB">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="text">
|
<property name="orientation">
|
||||||
<string>Use old key format</string>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
<property name="sizeHint" stdset="0">
|
||||||
<bool>true</bool>
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</spacer>
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="_includeSignatures_CB">
|
|
||||||
<property name="text">
|
|
||||||
<string>Include signatures</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
@ -61,6 +61,7 @@ QString Rshare::_dateformat; /**< The format of dates in feed items etc
|
|||||||
Log Rshare::_log;
|
Log Rshare::_log;
|
||||||
bool Rshare::useConfigDir;
|
bool Rshare::useConfigDir;
|
||||||
QString Rshare::configDir;
|
QString Rshare::configDir;
|
||||||
|
QDateTime Rshare::mStartupTime;
|
||||||
|
|
||||||
/** Catches debugging messages from Qt and sends them to RetroShare's logs. If Qt
|
/** Catches debugging messages from Qt and sends them to RetroShare's logs. If Qt
|
||||||
* emits a QtFatalMsg, we will write the message to the log and then abort().
|
* emits a QtFatalMsg, we will write the message to the log and then abort().
|
||||||
@ -95,6 +96,8 @@ Rshare::qt_msg_handler(QtMsgType type, const char *s)
|
|||||||
Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir)
|
Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir)
|
||||||
: QApplication(argc, argv)
|
: QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
mStartupTime = QDateTime::currentDateTime();
|
||||||
|
|
||||||
qInstallMsgHandler(qt_msg_handler);
|
qInstallMsgHandler(qt_msg_handler);
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
@ -162,6 +165,11 @@ Rshare::run()
|
|||||||
return rApp->exec();
|
return rApp->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDateTime Rshare::startupTime()
|
||||||
|
{
|
||||||
|
return mStartupTime;
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when the application's main event loop has started. This method
|
/** Called when the application's main event loop has started. This method
|
||||||
* will emit the running() signal to indicate that the application's event
|
* will emit the running() signal to indicate that the application's event
|
||||||
* loop is running. */
|
* loop is running. */
|
||||||
|
@ -108,6 +108,8 @@ public:
|
|||||||
static QString stylesheet() { return _stylesheet; }
|
static QString stylesheet() { return _stylesheet; }
|
||||||
/** Returns Rshare's application version. */
|
/** Returns Rshare's application version. */
|
||||||
static QString version() { return RSHARE_VERSION; }
|
static QString version() { return RSHARE_VERSION; }
|
||||||
|
/** Returns Rshare's application startup time. */
|
||||||
|
static QDateTime startupTime();
|
||||||
|
|
||||||
/** Returns the location Rshare uses for its data files. */
|
/** Returns the location Rshare uses for its data files. */
|
||||||
static QString dataDirectory();
|
static QString dataDirectory();
|
||||||
@ -173,6 +175,7 @@ private:
|
|||||||
static QString _language; /**< The current language. */
|
static QString _language; /**< The current language. */
|
||||||
static QString _dateformat; /**< The format for dates in feed items etc. */
|
static QString _dateformat; /**< The format for dates in feed items etc. */
|
||||||
static Log _log; /**< Logs debugging messages to file or stdout. */
|
static Log _log; /**< Logs debugging messages to file or stdout. */
|
||||||
|
static QDateTime mStartupTime; // startup time
|
||||||
|
|
||||||
static bool useConfigDir;
|
static bool useConfigDir;
|
||||||
static QString configDir;
|
static QString configDir;
|
||||||
@ -180,4 +183,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user