~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/widgets/dentry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Eric Hedekar, Eric Hedekar, Fabrice Coutadeur
  • Date: 2010-01-26 02:32:14 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126023214-8ez2g5d26d9p584j
Tags: 1.0.1-0ubuntu1
[ Eric Hedekar ]
* New upstream version (LP: #479688)
* Removed patches that were fixed in upstream source
  -[10_64bit_memcorruption_fix]
  -[10_gcc43_build_fixes]
  -[10_lash_private_api_fix]
  -[10_log2f_aliasing_fix]
  -[10_vamgui_init_fix]
  -[20_fix_const]

[ Fabrice Coutadeur ]
* debian/watch: added watch file
* debian/muse.desktop: deleted deprecated Encoding key, Application category
  and icon extension. This fix several warning with lintian and
  desktop-file-validate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//=========================================================
2
2
//  MusE
3
3
//  Linux Music Editor
4
 
//    $Id: dentry.cpp,v 1.1.1.1 2003/10/27 18:54:30 wschweer Exp $
 
4
//    $Id: dentry.cpp,v 1.1.1.1.2.3 2008/08/18 00:15:26 terminator356 Exp $
5
5
//  (C) Copyright 1999 Werner Schweer (ws@seh.de)
6
6
//=========================================================
7
7
 
25
25
 
26
26
Dentry::Dentry(QWidget* parent, const char* name) : QLineEdit(parent, name)
27
27
      {
 
28
      _slider = 0;      
28
29
      _id = -1;
29
30
      drawFrame = false;
30
31
      QLineEdit::setFrame(drawFrame);
37
38
      }
38
39
 
39
40
//---------------------------------------------------------
 
41
//   contextMenuEvent
 
42
//---------------------------------------------------------
 
43
 
 
44
void Dentry::contextMenuEvent(QContextMenuEvent * e)
 
45
{
 
46
  e->accept();
 
47
}
 
48
 
 
49
//---------------------------------------------------------
40
50
//   setFrame
41
51
//---------------------------------------------------------
42
52
 
85
95
 
86
96
void Dentry::wheelEvent(QWheelEvent* event)
87
97
      {
 
98
      // Avoid unwanted wheel events from outside the control.
 
99
      // Tested: No go, can't seem to determine where event came from.
 
100
      /*
 
101
      const QPoint gp = mapToGlobal(event->pos());
 
102
      const QRect gr = QRect(mapToGlobal(rect().topLeft()), mapToGlobal(rect().bottomRight()));
 
103
      if(!gr.contains(gp))
 
104
      */
 
105
      //if(sender() != this)
 
106
      //{
 
107
      //  event->ignore();
 
108
      //  return;
 
109
      //}
 
110
      
 
111
      event->accept();
 
112
      
88
113
      int delta = event->delta();
89
114
 
90
115
      if (delta < 0)
91
 
            decValue(-1.0);
 
116
      {
 
117
        if(_slider)
 
118
          _slider->stepPages(-1);
 
119
        else
 
120
          decValue(-1.0);
 
121
      }      
92
122
      else if (delta > 0)
93
 
            incValue(1.0);
 
123
      {
 
124
        if(_slider)
 
125
          _slider->stepPages(1);
 
126
        else
 
127
          incValue(1.0);
 
128
      }      
94
129
      }
95
130
 
96
131
//---------------------------------------------------------
119
154
            case QMouseEvent::LeftButton:
120
155
                  return;
121
156
            case QMouseEvent::MidButton:
122
 
                  decValue(evx);
 
157
                  if(_slider)
 
158
                    _slider->stepPages(-1);
 
159
                  else  
 
160
                    decValue(evx);
123
161
                  break;
124
162
            case QMouseEvent::RightButton:
125
 
                  incValue(evx);
 
163
                  if(_slider)
 
164
                    _slider->stepPages(1);
 
165
                  else  
 
166
                    incValue(evx);
126
167
                  break;
127
168
            default:
128
169
                  break;
170
211
      setFocus();
171
212
      QLineEdit::setFrame(true);
172
213
      update();
 
214
      emit doubleClicked(_id);
173
215
      }
174
216
 
175
217
//---------------------------------------------------------