~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/libksane/libksane/ksane_device_dialog.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <KPushButton>
45
45
 
46
46
#include <QScrollArea>
 
47
#include <QLabel>
 
48
 
47
49
namespace KSaneIface
48
50
{
49
51
 
55
57
    setButtonText(User1, i18n("Reload devices list"));
56
58
    
57
59
    m_btnGroup = new QButtonGroup(this);
58
 
    
 
60
 
59
61
    m_btnBox = new QGroupBox;
60
 
    m_btnLayout = new QVBoxLayout;
61
62
    QVBoxLayout *layout = new QVBoxLayout;
62
63
    m_btnContainer = new QWidget;
63
64
    m_btnLayout = new QVBoxLayout(m_btnContainer);
64
65
    QScrollArea *area = new QScrollArea;
65
66
    
66
67
    m_btnBox->setLayout(layout);
67
 
    
 
68
 
 
69
    QLabel *explanation =
 
70
      new QLabel(i18n("<html>The SANE (Scanner Access Now Easy) system could not find any device.<br>"
 
71
                      "Check that the scanner is plugged in and turned on<br>"
 
72
                      "or check your systems scanner setup.<br>"
 
73
                      "For details about SANE see the "
 
74
                      "<a href='http://www.sane-project.org/'>SANE homepage</a>.</html>"));
 
75
    explanation->setOpenExternalLinks(true);
 
76
    int l,t,r,b;
 
77
    layout->getContentsMargins(&l, &t, &r, &b);
 
78
    explanation->setContentsMargins(l, t, r, b);
 
79
 
 
80
    layout->addWidget(explanation);
 
81
    m_btnBox->adjustSize();  // make sure to see the complete explanation text
68
82
    layout->addWidget(area);
69
83
    layout->setContentsMargins(0,0,0,0);
70
84
 
71
85
    area->setWidgetResizable(true);
72
86
    area->setFrameShape(QFrame::NoFrame);
73
87
    area->setWidget(m_btnContainer);
74
 
    
 
88
 
75
89
    setMainWidget(m_btnBox);
76
90
    setMinimumHeight(200);
77
91
    m_findDevThread = FindSaneDevicesThread::getInstance();
93
107
        delete m_btnGroup->buttons().takeFirst();
94
108
    }
95
109
    m_btnBox->setTitle(i18n("Looking for devices. Please wait."));
 
110
    m_btnBox->layout()->itemAt(0)->widget()->hide();  // explanation
96
111
    enableButton(KDialog::User1, false);
97
112
 
98
113
    if(!m_findDevThread->isRunning()) {
131
146
    const QList<KSaneWidget::DeviceInfo> list = m_findDevThread->devicesList();
132
147
    if (list.isEmpty()) {
133
148
        m_btnBox->setTitle(i18n("Sorry. No devices found."));
 
149
        m_btnBox->layout()->itemAt(0)->widget()->show();  // explanation
 
150
        m_btnBox->layout()->itemAt(1)->widget()->hide();  // scroll area
134
151
        enableButton(KDialog::User1, true);
135
152
        return;
136
153
    }
139
156
    m_btnLayout = new QVBoxLayout;
140
157
    m_btnContainer->setLayout(m_btnLayout);
141
158
    m_btnBox->setTitle(i18n("Found devices:"));
142
 
    
 
159
    m_btnBox->layout()->itemAt(0)->widget()->hide();  // explanation
 
160
    m_btnBox->layout()->itemAt(1)->widget()->show();  // scroll area
 
161
 
143
162
    for (int i=0; i< list.size(); i++) {
144
163
        QRadioButton *b = new QRadioButton(this);
145
164
        b->setObjectName(list[i].name);