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);
@ -153,4 +128,4 @@ void CryptoPage::setCurrentFileName(const QString &fileName)
ui.certtextEdit->document()->setModified(false); ui.certtextEdit->document()->setModified(false);
setWindowModified(false); setWindowModified(false);
} }

View file

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

View file

@ -499,101 +499,68 @@
<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"> <widget class="QGroupBox" name="groupBox">
<item row="0" column="0"> <property name="title">
<widget class="QGroupBox" name="groupBox"> <string>Public Key</string>
<property name="title"> </property>
<string>Public Key</string> <layout class="QGridLayout" name="gridLayout">
</property> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout"> <widget class="QTextEdit" name="certtextEdit">
<item row="0" column="0"> <property name="font">
<widget class="QTextEdit" name="certtextEdit"> <font>
<property name="font"> <kerning>false</kerning>
<font> </font>
<pointsize>7</pointsize> </property>
<kerning>false</kerning> <property name="acceptRichText">
</font> <bool>false</bool>
</property> </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"> <widget class="QPushButton" name="copykeyButton">
<item row="0" column="0"> <property name="toolTip">
<layout class="QGridLayout" name="gridLayout_2"> <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;
<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">
<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; &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; } 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;/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;Copy my Key to Clipboard&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &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;Copy my Key to Clipboard&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Copy Key</string> <string>Copy Key</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="1">
<spacer name="verticalSpacer_2"> <widget class="QPushButton" name="saveButton">
<property name="orientation"> <property name="toolTip">
<enum>Qt::Vertical</enum> <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;
</property> &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;
<property name="sizeType"> p, li { white-space: pre-wrap; }
<enum>QSizePolicy::Fixed</enum> &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
</property> &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 name="sizeHint" stdset="0"> </property>
<size> <property name="text">
<width>10</width> <string>Save Key</string>
<height>20</height> </property>
</size> </widget>
</property> </item>
</spacer> <item row="1" column="2">
</item> <spacer name="horizontalSpacer">
<item row="3" column="0"> <property name="orientation">
<widget class="QPushButton" name="saveButton"> <enum>Qt::Horizontal</enum>
<property name="text"> </property>
<string>Save Key</string> <property name="sizeHint" stdset="0">
</property> <size>
</widget> <width>278</width>
</item> <height>20</height>
</layout> </size>
</item> </property>
<item row="1" column="0"> </spacer>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>58</width>
<height>298</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>