diff --git a/README.rst b/README.rst index e1244608..b31a18bb 100644 --- a/README.rst +++ b/README.rst @@ -67,7 +67,8 @@ the gtk-2 version: Ubuntu ------ -Under Debian/Ubuntu, the following command should install all the build +Under Debian/Ubuntu, make sure you have source code repositories +enabled, then the following command should install all the build dependencies:: sudo apt-get build-dep guake diff --git a/data/prefs.glade b/data/prefs.glade index 8b7e79a2..d9ac3f97 100644 --- a/data/prefs.glade +++ b/data/prefs.glade @@ -674,7 +674,7 @@ True False 6 - <b>Main Window height</b> + <b>Main Window Height</b> True @@ -688,6 +688,139 @@ 3 + + + True + False + 0 + none + + + True + False + 12 + + + True + True + discontinuous + 50 10 110 10 10 10 + 0 + False + right + + + + + + + + True + False + 6 + <b>Main Window Width</b> + True + + + label_item + + + + + True + True + 4 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + Left + True + True + False + False + True + + + + False + False + 0 + + + + + Center + True + True + False + False + True + True + radiobutton_align_left + + + + False + False + 1 + + + + + Right + True + True + False + False + True + radiobutton_align_left + + + + False + False + 2 + + + + + + + + + True + False + 6 + <b>Main Window Horizontal Alignment</b> + True + + + label_item + + + + + True + True + 5 + + diff --git a/src/prefs.py b/src/prefs.py index 1f2a3ae2..b47dabfc 100644 --- a/src/prefs.py +++ b/src/prefs.py @@ -33,6 +33,9 @@ from guake.common import get_binaries_from_path from guake.common import gladefile from guake.common import hexify_color from guake.common import pixmapfile +from guake.globals import ALIGN_CENTER +from guake.globals import ALIGN_LEFT +from guake.globals import ALIGN_RIGHT from guake.globals import GCONF_PATH from guake.globals import KEY from guake.globals import LOCALE_DIR @@ -270,6 +273,23 @@ class PrefsCallbacks(object): val = hscale.get_value() self.client.set_int(KEY('/general/window_height'), int(val)) + def on_window_width_value_changed(self, wscale): + """Changes the value of window_width in gconf + """ + val = wscale.get_value() + self.client.set_int(KEY('/general/window_width'), int(val)) + + def on_window_halign_value_changed(self, halign_button): + """Changes the value of window_halignment in gconf + """ + if halign_button.get_active(): + which_align = { + 'radiobutton_align_left': ALIGN_LEFT, + 'radiobutton_align_right': ALIGN_RIGHT, + 'radiobutton_align_center': ALIGN_CENTER + } + self.client.set_int(KEY('/general/window_halignment'), which_align[halign_button.get_name()]) + # scrolling tab def on_use_scrollbar_toggled(self, chk): @@ -585,6 +605,17 @@ class PrefsDialog(SimpleGladeApp): value = self.client.get_int(KEY('/general/window_height')) self.get_widget('window_height').set_value(value) + value = self.client.get_int(KEY('/general/window_width')) + self.get_widget('window_width').set_value(value) + + value = self.client.get_int(KEY('/general/window_halignment')) + which_button = { + ALIGN_RIGHT: 'radiobutton_align_right', + ALIGN_LEFT: 'radiobutton_align_left', + ALIGN_CENTER: 'radiobutton_align_center' + } + self.get_widget(which_button[value]).set_active(True) + value = self.client.get_bool(KEY('/general/open_tab_cwd')) self.get_widget('open_tab_cwd').set_active(value)