summarylogtreecommitdiffstats
path: root/about-archlinux.patch
blob: 0fd57b7e1f7ca25da1e4e4499bbc3adb2b98804b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
diff -rupN switchboard-plug-about.orig/src/Plug.vala switchboard-plug-about/src/Plug.vala
--- switchboard-plug-about.orig/src/Plug.vala	2015-05-28 11:30:40.451605900 +0200
+++ switchboard-plug-about/src/Plug.vala	2015-05-28 11:31:21.864015570 +0200
@@ -20,19 +20,12 @@ public class About.Plug : Switchboard.Pl
     private string os;
     private string website_url;
     private string bugtracker_url;
-    private string codename;
-    private string version;
     private string arch;
     private string processor;
     private string memory;
     private string graphics;
     private string hdd;
     private Gtk.Label based_off;
-
-
-    private string is_ubuntu;
-    private string ubuntu_version;
-    private string ubuntu_codename;
     private Gtk.EventBox main_grid;
 
     public Plug () {
@@ -93,75 +86,11 @@ public class About.Plug : Switchboard.Pl
     private void setup_info () {
 
         // Operating System
-
-        File file = File.new_for_path("/etc/lsb-release");
-        try {
-            var dis = new DataInputStream (file.read ());
-            string line;
-            // Read lines until end of file (null) is reached
-            while ((line = dis.read_line (null)) != null) {
-                if ("DISTRIB_ID=" in line) {
-                    os = line.replace ("DISTRIB_ID=", "");
-                    if ("\"" in os) {
-                        os = os.replace ("\"", "");
-                    }
-                } else if ("DISTRIB_RELEASE=" in line) {
-                    version = line.replace ("DISTRIB_RELEASE=", "");
-                } else if ("DISTRIB_CODENAME=" in line) {
-                    codename = line.replace ("DISTRIB_CODENAME=", "");
-                    codename = capitalize (codename);
-                }
-            }
-        } catch (Error e) {
-            warning("Couldn't read lsb-release file, assuming elementary OS 0.3");
-            os = "elementary OS";
-            version = "0.3";
-            codename = "Freya";
-        }
-
-        file = File.new_for_path("/etc/upstream-release/lsb-release");
-        try {
-            var dis = new DataInputStream (file.read ());
-            string line;
-            // Read lines until end of file (null) is reached
-            while ((line = dis.read_line (null)) != null) {
-                if ("DISTRIB_ID=" in line) {
-                    is_ubuntu = line.replace ("DISTRIB_ID=", "");
-                } else if ("DISTRIB_RELEASE=" in line) {
-                    ubuntu_version = line.replace ("DISTRIB_RELEASE=", "");
-                } else if ("DISTRIB_CODENAME=" in line) {
-                    ubuntu_codename = line.replace ("DISTRIB_CODENAME=", "");
-                    ubuntu_codename = capitalize (ubuntu_codename);
-                }
-            }
-        } catch (Error e) {
-            warning("Couldn't read upstream lsb-release file, assuming none");
-            is_ubuntu = null;
-            ubuntu_version = null;
-            ubuntu_codename = null;
-        }
+        os = "Arch Linux";
 
         //Bugtracker and website
-        file = File.new_for_path("/etc/dpkg/origins/"+os);
-        bugtracker_url = "";
-        website_url = "";
-        try {
-            var dis = new DataInputStream (file.read ());
-            string line;
-            // Read lines until end of file (null) is reached
-            while ((line = dis.read_line (null)) != null) {
-                if (line.has_prefix("Bugs:")) {
-                    bugtracker_url = line.replace ("Bugs: ", "");
-                }
-            }
-        } catch (Error e) {
-            warning(e.message);
-            warning("Couldn't find bugtracker/website, using elementary OS defaults");
-            if (website_url == "")
-                website_url = "http://elementary.io";
-            if (bugtracker_url == "")
-                bugtracker_url = "https://bugs.launchpad.net/elementaryos/+filebug";
-        }
+        bugtracker_url = "https://bugs.archlinux.org/";
+        website_url = "https://www.archlinux.org/";
 
         // Architecture
         try {
@@ -272,18 +201,12 @@ public class About.Plug : Switchboard.Pl
         var logo = new Gtk.Image.from_icon_name ("distributor-logo", Gtk.icon_size_register ("LOGO", 128, 128));
 
         var title = new Gtk.Label (null);
-        title.set_markup (("%s %s %s <sup><small>(%s)</small></sup>").printf (os, version, codename, arch));
+        title.set_markup (("%s <sup><small>(%s)</small></sup>").printf (os, arch));
         title.get_style_context ().add_class ("h2");
         title.set_alignment (0, 0);
         title.set_selectable (true);
 
-        if (is_ubuntu != null) {
-            based_off = new Gtk.Label (_("Built on %s %s").printf (is_ubuntu, ubuntu_version));
-            based_off.set_alignment (0, 0);
-            based_off.set_selectable (true);
-        }
-
-        var website_label = new Gtk.LinkButton.with_label ("http://elementary.io", _("Website"));
+        var website_label = new Gtk.LinkButton.with_label ("https://www.archlinux.org", _("Website"));
         website_label.set_alignment (0, 0);
 
         var details = new Gtk.Box (Gtk.Orientation.VERTICAL, 5);
@@ -352,34 +275,28 @@ public class About.Plug : Switchboard.Pl
         hardware_grid.attach (graphics_info, 100, 120, 100, 25);
         hardware_grid.attach (hdd_info, 100, 160, 100, 25);
 
-        var help_button = new Gtk.Button.with_label ("?");
-        help_button.get_style_context ().add_class ("help_button");
-        help_button.halign = Gtk.Align.CENTER;
-
-        help_button.clicked.connect (() => {
+        // Forums button
+        var bbs_button = new Gtk.Button.with_label (_("Forums"));
+        bbs_button.clicked.connect (() => {
             try {
-                AppInfo.launch_default_for_uri ("http://elementary.io/support", null);
+                AppInfo.launch_default_for_uri ("https://bbs.archlinux.org", null);
             } catch (Error e) {
                 warning (e.message);
             }
         });
 
-        help_button.size_allocate.connect ( (alloc) => {
-            help_button.set_size_request (alloc.height, -1);
-        });
-
-        // Translate button
-        var translate_button = new Gtk.Button.with_label (_("Suggest Translations"));
-        translate_button.clicked.connect (() => {
+        // Wiki button
+        var wiki_button = new Gtk.Button.with_label (_("Wiki"));
+        wiki_button.clicked.connect (() => {
             try {
-                AppInfo.launch_default_for_uri ("https://translations.launchpad.net/elementary", null);
+                AppInfo.launch_default_for_uri ("https://wiki.archlinux.org", null);
             } catch (Error e) {
                 warning (e.message);
             }
         });
 
         // Bug button
-        var bug_button = new Gtk.Button.with_label (_("Report a Problem"));
+        var bug_button = new Gtk.Button.with_label (_("Bugs"));
         bug_button.clicked.connect (() => {
             try {
                 AppInfo.launch_default_for_uri (bugtracker_url, null);
@@ -388,29 +305,23 @@ public class About.Plug : Switchboard.Pl
             }
         });
 
-        // Update button
-        var update_button = new Gtk.Button.with_label (_("Check for Updates"));
-        update_button.clicked.connect (() => {
+        // Packages button
+        var pkg_button = new Gtk.Button.with_label (_("Packages"));
+        pkg_button.clicked.connect (() => {
             try {
-                Process.spawn_command_line_async("update-manager");
+                AppInfo.launch_default_for_uri ("https://archlinux.org/packages/", null);
             } catch (Error e) {
                 warning (e.message);
             }
         });
 
-        // Restore settings button
-        var settings_restore_button = new Gtk.Button.with_label (_("Restore Default Settings"));
-        settings_restore_button.clicked.connect (settings_restore_clicked);
-
         // Create a box for the buttons
         var button_box = new Gtk.ButtonBox (Gtk.Orientation.HORIZONTAL);
         button_box.spacing = 6;
-        button_box.pack_start (help_button, false, false, 0);
-        button_box.set_child_non_homogeneous (help_button, true);
-        button_box.pack_end (settings_restore_button, false, false, 0);
-        button_box.pack_end (translate_button, false, false, 0);
+        button_box.pack_start (bbs_button, false, false, 0);
+        button_box.pack_end (wiki_button, false, false, 0);
         button_box.pack_end (bug_button, false, false, 0);
-        button_box.pack_end (update_button, false, false, 0);
+        button_box.pack_end (pkg_button, false, false, 0);
 
         // Fit everything in a box
         var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 5);
@@ -450,50 +361,6 @@ private uint64 get_mem_info_for(string n
     return result;
 }
 
-private void reset_all_keys (GLib.Settings settings) {
-    var keys = settings.list_keys ();
-    foreach (var key in keys) {
-        settings.reset (key);
-    }
-}
-
-private string[] get_pantheon_schemas () {
-    string[] schemas = {};
-    string[] pantheon_schemas = {};
-    string[] prefixes = { "org.pantheon.desktop", "org.gnome.desktop" };
-
-    var sss = SettingsSchemaSource.get_default ();
-
-    sss.list_schemas (true, out schemas, null);
-
-    foreach (var schema in schemas) {
-        foreach (var prefix in prefixes) {
-            if (schema.has_prefix (prefix)) {
-                pantheon_schemas += schema;
-            }
-        }
-    }
-    return pantheon_schemas;
-}
-
-private void reset_recursively (string schema) {
-    var settings = new GLib.Settings (schema);
-    // change into delay mode
-	// so changes take place when apply () is called
-    settings.delay ();
-
-    reset_all_keys (settings);
-
-    var children = settings.list_children ();
-    foreach (var child in children) {
-        var child_settings = settings.get_child (child);
-
-        reset_all_keys (child_settings);
-    }
-    settings.apply ();
-    GLib.Settings.sync ();
-}
-
 /**
  * returns true to continue, false to cancel
  */
@@ -549,18 +416,6 @@ private bool confirm_restore_action () {
     }
 }
 
-private void settings_restore_clicked () {
-    var should_display = confirm_restore_action ();
-
-    if (should_display) {
-        var all_schemas = get_pantheon_schemas ();
-
-        foreach (var schema in all_schemas) {
-            reset_recursively (schema);
-        }
-    }
-}
-
 public Switchboard.Plug get_plug (Module module) {
     debug ("Activating About plug");
     var plug = new About.Plug ();