Remove tabs

merge-requests/64/head
Hugo Posnic 2016-12-16 23:59:10 +01:00
parent 10f0f7946c
commit 62d3dc2d3f
2 changed files with 41 additions and 140 deletions

View File

@ -99,7 +99,7 @@ class ManjaroHello():
# Load pages # Load pages
for page in ("readme", "release", "involved"): for page in ("readme", "release", "involved"):
self.builder.get_object(page + "text").set_markup(self.read_page(page)) self.builder.get_object(page + "label").set_markup(self.read_page(page))
# Set autostart switcher state # Set autostart switcher state
self.builder.get_object("autostart").set_active(self.preferences["autostart"]) self.builder.get_object("autostart").set_active(self.preferences["autostart"])
@ -125,10 +125,6 @@ class ManjaroHello():
# TODO: Find a better solution # TODO: Find a better solution
elts = { elts = {
"welcometitle": "label", "welcometitle": "label",
"welcomelabel": "label",
"readmelabel": "label",
"releaselabel": "label",
"involvedlabel": "label",
"firstcategory": "label", "firstcategory": "label",
"secondcategory": "label", "secondcategory": "label",
"thirdcategory": "label", "thirdcategory": "label",
@ -152,11 +148,6 @@ class ManjaroHello():
self.default_texts[elt] = getattr(self.builder.get_object(elt), "get_" + elts[elt])() self.default_texts[elt] = getattr(self.builder.get_object(elt), "get_" + elts[elt])()
getattr(self.builder.get_object(elt), "set_" + elts[elt])(_(self.default_texts[elt])) getattr(self.builder.get_object(elt), "set_" + elts[elt])(_(self.default_texts[elt]))
for stack in ("welcome", "documentation", "project"):
if stack not in self.default_texts:
self.default_texts[stack] = self.builder.get_object("stack").child_get_property(self.builder.get_object(stack), "title")
self.builder.get_object("stack").child_set_property(self.builder.get_object(stack), "title", _(self.default_texts[stack]))
def change_autostart(self, state): def change_autostart(self, state):
if state and not os.path.isfile(self.autostart_path): if state and not os.path.isfile(self.autostart_path):
try: try:
@ -213,16 +204,13 @@ class ManjaroHello():
def on_action_btn_clicked(self, btn): def on_action_btn_clicked(self, btn):
name = btn.get_name() name = btn.get_name()
if name == "home": if name == "home":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("welcome")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("welcomepage"))
elif name == "readme": elif name == "readme":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("readmepage"))
self.builder.get_object("documentation").set_current_page(0)
elif name == "release": elif name == "release":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("documentation")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("releasepage"))
self.builder.get_object("documentation").set_current_page(1)
elif name == "involved": elif name == "involved":
self.builder.get_object("stack").set_visible_child(self.builder.get_object("project")) self.builder.get_object("stack").set_visible_child(self.builder.get_object("involvedpage"))
self.builder.get_object("project").set_current_page(0)
elif name == "installgui": elif name == "installgui":
subprocess.call(["sudo", "-E", "calamares"]) subprocess.call(["sudo", "-E", "calamares"])
elif name == "installcli": elif name == "installcli":

View File

@ -71,7 +71,7 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="transition_type">crossfade</property> <property name="transition_type">crossfade</property>
<child> <child>
<object class="GtkGrid" id="welcome"> <object class="GtkGrid" id="welcomepage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="row_spacing">20</property> <property name="row_spacing">20</property>
@ -486,96 +486,23 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkNotebook" id="documentation"> <object class="GtkScrolledWindow" id="readmepage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child> <child>
<object class="GtkLabel" id="readmetext">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="wrap">True</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="tab_expand">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="readmelabel"> <object class="GtkLabel" id="readmelabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Read me</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkLabel" id="releasetext">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="wrap">True</property> <property name="wrap">True</property>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
<packing>
<property name="position">1</property>
<property name="tab_expand">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="releaselabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Release info</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
</object>
<packing> <packing>
<property name="name">page1</property> <property name="name">page1</property>
<property name="title" translatable="yes">Documentation</property> <property name="title" translatable="yes">Documentation</property>
@ -583,28 +510,17 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkNotebook" id="project"> <object class="GtkScrolledWindow" id="releasepage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child> <child>
<object class="GtkLabel" id="involvedtext"> <object class="GtkLabel" id="releaselabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="valign">start</property>
<property name="margin_left">10</property>
<property name="margin_right">10</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="wrap">True</property> <property name="wrap">True</property>
</object> </object>
</child> </child>
@ -612,36 +528,33 @@ We, the Manjaro Developers, hope that you will enjoy using Manjaro as much as we
</child> </child>
</object> </object>
<packing> <packing>
<property name="tab_expand">True</property> <property name="name">page2</property>
<property name="title" translatable="yes">page2</property>
<property name="position">2</property>
</packing> </packing>
</child> </child>
<child type="tab"> <child>
<object class="GtkScrolledWindow" id="involvedpage">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="involvedlabel"> <object class="GtkLabel" id="involvedlabel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Get involved</property> <property name="wrap">True</property>
</object> </object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child> </child>
<child> </object>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child type="tab">
<placeholder/>
</child> </child>
</object> </object>
<packing> <packing>
<property name="name">page2</property> <property name="name">page3</property>
<property name="title" translatable="yes">Project</property> <property name="title" translatable="yes">page3</property>
<property name="position">2</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
</object> </object>