~teemperor/switchboard-plug-keyboard/fix-layouts

« back to all changes in this revision

Viewing changes to src/Pages/Layout/settings.vala

  • Committer: Raphael Isemann
  • Date: 2014-08-10 17:57:01 UTC
  • Revision ID: teemperor@googlemail.com-20140810175701-8h1fltku4b60xpd0
Ok, MVC is finished, only variants are left

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
                if (_active >= length)
115
115
                    _active = length - 1;
116
116
                active_changed ();
117
 
 
118
117
            }
119
118
 
120
119
        }
149
148
        }
150
149
 
151
150
        public void move_active_layout_up () {
152
 
            if (length == 0) return;
 
151
            if (length == 0)
 
152
                return;
153
153
 
154
154
            // check that the active item is not the first one
155
155
            if (active > 0) {
158
158
        }
159
159
 
160
160
        public void move_active_layout_down () {
161
 
            if (length == 0) return;
 
161
            if (length == 0)
 
162
                return;
162
163
 
163
164
            // check that the active item is not the last one
164
165
            if (active < length - 1) {
176
177
        }
177
178
 
178
179
        public void remove_active_layout () {
179
 
            if (length == 0) return;
180
 
 
181
180
            layouts.remove (get_layout (active));
182
181
 
183
182
            if (active >= length)
194
193
         * This method does not need call layouts_changed in any situation
195
194
         * as a Layout-Object is immutable.
196
195
         */
197
 
        public Layout get_layout (uint index) {
 
196
        public Layout? get_layout (uint index) {
 
197
            if (index >= length)
 
198
                return null;
 
199
 
198
200
            return layouts.nth_data (index);
199
201
        }
200
202