[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/network/videocatcher/src
From:       Jonas Emanuel Müller <zanoi () zanoi ! net>
Date:       2011-08-18 20:26:28
Message-ID: 20110818202628.86AA4AC876 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1247964 by jonasemuller:

Improve add channel dialog


 M  +7 -1      addchanneldialog.cpp  
 M  +22 -10    addchanneldialog.ui  


--- trunk/playground/network/videocatcher/src/addchanneldialog.cpp #1247963:1247964
@@ -21,19 +21,25 @@
 #include <QWidget>
 #include <QClipboard>
 #include <QDialog>
+#include <KLocale>
+#include <QPushButton>
 
 namespace Videocatcher {
 
 AddChannelDialog::AddChannelDialog(QWidget *parent) : QDialog(parent)
 {
     setupUi(this);
+    QPushButton *addChannelButton = new QPushButton(i18n("&Add channel"));
+    addChannelButton->setCheckable(true);
+    addChannelButton->setAutoDefault(true);
+    buttonBox->addButton(addChannelButton, QDialogButtonBox::AcceptRole);
 
     QClipboard *cb = QApplication::clipboard();
     QString text = cb->text(QClipboard::Clipboard);
 
     KUrl url(text);
 
-    if (url.isValid()) {
+    if (url.isValid() && text.startsWith("http://")) {
         m_url->setText(text);
     }
 }
--- trunk/playground/network/videocatcher/src/addchanneldialog.ui #1247963:1247964
@@ -6,31 +6,43 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>298</width>
-    <height>113</height>
+    <width>321</width>
+    <height>163</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>Add new channel</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
     <layout class="QVBoxLayout" name="verticalLayout">
      <item>
-      <widget class="QLabel" name="label">
+      <widget class="QLabel" name="text1">
        <property name="text">
-        <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:'Ubuntu'; \
                font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'DejaVu Sans'; \
font-size:12pt;&quot;&gt;Channel \
Url:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> +        \
<string>Please add a new channel URL here:</string>  </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
       </widget>
      </item>
      <item>
       <widget class="KLineEdit" name="m_url"/>
      </item>
      <item>
+      <widget class="QLabel" name="text2">
+       <property name="text">
+        <string>The easiest way to do this is to copy &amp; paste a RSS, Atom or RDF \
link from your web browser.</string> +       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
       <widget class="QDialogButtonBox" name="buttonBox">
        <property name="layoutDirection">
         <enum>Qt::LeftToRight</enum>
@@ -39,7 +51,7 @@
         <enum>Qt::Horizontal</enum>
        </property>
        <property name="standardButtons">
-        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+        <set>QDialogButtonBox::Cancel</set>
        </property>
       </widget>
      </item>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic