From 4e6290d985612fa57cd4cda499e6f98e0bc279dd Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 2 Feb 2010 00:01:17 +0000 Subject: [PATCH] design improvements for AddLinksDialog git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2172 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/AddLinksDialog.cpp | 25 ++ retroshare-gui/src/gui/AddLinksDialog.h | 2 + retroshare-gui/src/gui/AddLinksDialog.ui | 482 +++++++++++++--------- 3 files changed, 304 insertions(+), 205 deletions(-) diff --git a/retroshare-gui/src/gui/AddLinksDialog.cpp b/retroshare-gui/src/gui/AddLinksDialog.cpp index adb3c2943..3e4dca483 100644 --- a/retroshare-gui/src/gui/AddLinksDialog.cpp +++ b/retroshare-gui/src/gui/AddLinksDialog.cpp @@ -43,6 +43,8 @@ AddLinksDialog::AddLinksDialog(QString url, QWidget *parent) /* add button */ connect(ui.addLinkButton, SIGNAL(clicked()), this, SLOT(addLinkComment())); connect(ui.closepushButton, SIGNAL(clicked()), this, SLOT(close())); + + connect( ui.anonBox, SIGNAL( stateChanged ( int ) ), this, SLOT( load ( void ) ) ); ui.linkLineEdit->setReadOnly(true); ui.linkLineEdit->setText(url); @@ -50,6 +52,7 @@ AddLinksDialog::AddLinksDialog(QString url, QWidget *parent) RetroShareLinkAnalyzer analyzer(url); QVector linkList; analyzer.getFileInformation(linkList); + if (!linkList.isEmpty()) { /* set title as first name from list */ RetroShareLinkData item = linkList.first(); @@ -60,6 +63,8 @@ AddLinksDialog::AddLinksDialog(QString url, QWidget *parent) ui.titleLineEdit->setText("New File"); } + load(); + /* Hide platform specific features */ #ifdef Q_WS_WIN @@ -106,3 +111,23 @@ void AddLinksDialog::addLinkComment() close(); } + +void AddLinksDialog::load() +{ + if (ui.anonBox->isChecked()) + { + + /* disable comment + score */ + ui.scoreBox->setEnabled(false); + ui.linkTextEdit->setEnabled(false); + + /* done! */ + return; + } + else + { + /* enable comment + score */ + ui.scoreBox->setEnabled(true); + ui.linkTextEdit->setEnabled(true); + } +} \ No newline at end of file diff --git a/retroshare-gui/src/gui/AddLinksDialog.h b/retroshare-gui/src/gui/AddLinksDialog.h index b53e47328..9e4451117 100644 --- a/retroshare-gui/src/gui/AddLinksDialog.h +++ b/retroshare-gui/src/gui/AddLinksDialog.h @@ -37,6 +37,8 @@ public: public slots: void addLinkComment(); + + void load(); private: /** Qt Designer generated object */ diff --git a/retroshare-gui/src/gui/AddLinksDialog.ui b/retroshare-gui/src/gui/AddLinksDialog.ui index 4cf77c2d9..1b0591455 100644 --- a/retroshare-gui/src/gui/AddLinksDialog.ui +++ b/retroshare-gui/src/gui/AddLinksDialog.ui @@ -6,7 +6,7 @@ 0 0 - 568 + 614 429 @@ -18,250 +18,322 @@ :/images/rstray3.png:/images/rstray3.png - - + + 0 + + + 0 + + + - 32 - 32 + 16777215 + 52 - - + + QFrame#frame{background-image: url(:/images/connect/connectFriendBanner.png);} + - - :/images/ktorrent32.png + + QFrame::NoFrame - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + QFrame::Raised + + + + + + + 32 + 32 + + + + + + + :/images/irkick.png + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:18pt; font-weight:600; color:#00aa00;">Add Link to Cloud</span></p></body></html> - +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:18pt; font-weight:600; color:#ffffff;">Add Link to Cloud</span></p></body></html> + + + + - - - Add a new Link + + + QFrame::NoFrame - - - - - - - - 12 - 75 - true - - - - Title: - - - - - - - - 12 - - - - - - - - - - - - - 12 - 75 - true - - - - Url: - - - - - - - - 12 - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - + + QFrame::Raised + + + + - 12 - - - - - - - - - 12 - 75 - true + 10 - Score: + Cancel - - - - - +2 Great! - - - - :/images/filerating5.png:/images/filerating5.png - - - - - +1 Good - - - - :/images/filerating4.png:/images/filerating4.png - - - - - 0 Okay - - - - :/images/filerating3.png:/images/filerating3.png - - - - - -1 Sux - - - - :/images/filerating2.png:/images/filerating2.png - - - - - -2 Bad Link - - - - :/images/filerating1.png:/images/filerating1.png - - - - - - + + - 12 - 50 - false + 10 - Add Anonymous Link + Add Link + + + false + + + true - - + + Qt::Horizontal - 196 - 23 + 375 + 20 + + + + Add a new Link + + + + 1 + + + + + + + + + + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:400;">Title:</span></p></body></html> + + + + + + + + 10 + 75 + true + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:400;">Url:</span></p></body></html> + + + + + + + + + + + + 10 + + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + + + + + 16777215 + 40 + + + + QFrame#frame_3{ +background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, +stop:0 #FEFEFE, stop:1 #E8E8E8); + +border: 1px solid #CCCCCC;} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 10 + 50 + false + + + + Add Anonymous Link + + + + + + + + +2 Great! + + + + :/images/filerating5.png:/images/filerating5.png + + + + + +1 Good + + + + :/images/filerating4.png:/images/filerating4.png + + + + + 0 Okay + + + + :/images/filerating3.png:/images/filerating3.png + + + + + -1 Sux + + + + :/images/filerating2.png:/images/filerating2.png + + + + + -2 Bad Link + + + + :/images/filerating1.png:/images/filerating1.png + + + + + + + + Qt::Horizontal + + + + 299 + 20 + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 12 + + + + + + + - - - - Qt::Horizontal - - - - 375 - 20 - - - - - - - - - 12 - - - - Cancel - - - - - - - - 12 - - - - Add Link - - - false - - - true - - -