removed not used Export Button

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2155 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-30 11:25:41 +00:00
parent f12bad3d51
commit 353a93df62
3 changed files with 63 additions and 123 deletions

View file

@ -43,7 +43,6 @@ CryptoPage::CryptoPage(QWidget * parent, Qt::WFlags flags)
_settings = new RshareSettings(); _settings = new RshareSettings();
connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey())); connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey()));
connect(ui.exportkeyButton, SIGNAL(clicked()), this, SLOT(exportPublicKey()));
connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs())); connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs()));
@ -81,7 +80,7 @@ CryptoPage::load()
void void
CryptoPage::loadPublicKey() CryptoPage::loadPublicKey()
{ {
ui.certtextEdit->setText(QString::fromStdString(rsPeers->GetRetroshareInvite())); ui.certtextEdit->setPlainText(QString::fromStdString(rsPeers->GetRetroshareInvite()));
ui.certtextEdit->setReadOnly(true); ui.certtextEdit->setReadOnly(true);
ui.certtextEdit->setMinimumHeight(200); ui.certtextEdit->setMinimumHeight(200);
} }
@ -91,37 +90,13 @@ CryptoPage::copyPublicKey()
{ {
QMessageBox::information(this, QMessageBox::information(this,
tr("RetroShare"), tr("RetroShare"),
tr("Your Public Key is copied to Clipbard, 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.certtextEdit->toPlainText());
} }
void
CryptoPage::exportPublicKey()
{
qDebug() << " exportPulicKey";
QString qdir = QFileDialog::getSaveFileName(this,
"Please choose a filename",
QDir::homePath(),
"RetroShare Certificate (*.pqi)");
if ( rsPeers->saveCertificateToFile(rsPeers->getOwnId(), qdir.toStdString()) )
{
QMessageBox::information(this, tr("RetroShare"),
tr("Certificate file successfully created"),
QMessageBox::Ok, QMessageBox::Ok);
}
else
{
QMessageBox::information(this, tr("RetroShare"),
tr("Sorry, certificate file creation failed"),
QMessageBox::Ok, QMessageBox::Ok);
}
}
bool CryptoPage::fileSave() bool CryptoPage::fileSave()
{ {
if (fileName.isEmpty()) if (fileName.isEmpty())
@ -140,7 +115,7 @@ bool CryptoPage::fileSave()
bool CryptoPage::fileSaveAs() bool CryptoPage::fileSaveAs()
{ {
QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."), QString fn = QFileDialog::getSaveFileName(this, tr("Save as..."),
QString(), tr("TXT-Files (*.pqi *.pem *.txt);;All Files (*)")); QString(), tr("RetroShare Certificate (*.retroshare );;All Files (*)"));
if (fn.isEmpty()) if (fn.isEmpty())
return false; return false;
setCurrentFileName(fn); setCurrentFileName(fn);

View file

@ -53,8 +53,6 @@ class CryptoPage : public ConfigPage
void copyPublicKey(); void copyPublicKey();
void exportPublicKey();
bool fileSave(); bool fileSave();
bool fileSaveAs(); bool fileSaveAs();

View file

@ -499,10 +499,8 @@
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum> <enum>Qt::NoContextMenu</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Public Key</string> <string>Public Key</string>
@ -512,34 +510,18 @@
<widget class="QTextEdit" name="certtextEdit"> <widget class="QTextEdit" name="certtextEdit">
<property name="font"> <property name="font">
<font> <font>
<pointsize>7</pointsize>
<kerning>false</kerning> <kerning>false</kerning>
</font> </font>
</property> </property>
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="0">
<widget class="QPushButton" name="exportkeyButton">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Export my Key as file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Export Key</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="copykeyButton"> <widget class="QPushButton" name="copykeyButton">
<property name="toolTip"> <property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
@ -553,49 +535,34 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="saveButton"> <widget class="QPushButton" name="saveButton">
<property name="toolTip">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Save Key into a file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text"> <property name="text">
<string>Save Key</string> <string>Save Key</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="1" column="2">
</item> <spacer name="horizontalSpacer">
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>58</width> <width>278</width>
<height>298</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</item>
</layout>
</widget> </widget>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>