Fix previous commit
[debian/pino.git] / src / pref_dialog.vala
index 1cf7e18..d1d11f5 100644 (file)
@@ -29,6 +29,7 @@ public class PrefDialog : Dialog {
        private SpinButton updateInterval;
        private SpinButton numberStatuses;
        private ComboBox urlShorten;
+       private CheckButton enableSpell;
        private CheckButton startMin;
        private CheckButton showTray;
        private CheckButton showTimelineNotify;
@@ -44,6 +45,7 @@ public class PrefDialog : Dialog {
        private HScale opacityTweets;
        private CheckButton rtlSupport;
        private CheckButton fullNames;
+       private CheckButton nativeLinkColor;
        private FontButton deFont;
        private ColorButton freshColor;
        private Entry login;
@@ -75,6 +77,10 @@ public class PrefDialog : Dialog {
                urlShorten = new ComboBox.text();
                urlShorten.append_text("goo.gl");
                urlShorten.append_text("is.gd");
+               urlShorten.append_text("ur1.ca");
+               
+               //enabling spell checking
+               enableSpell = new CheckButton.with_label(_("Enable spell checking"));
                
                //start in tray
                startMin = new CheckButton.with_label(_("Starting up in tray"));
@@ -112,6 +118,7 @@ public class PrefDialog : Dialog {
                table_int.add_two_widgets(updateLabel, updateInterval);
                table_int.add_two_widgets(numberStatusesLabel, numberStatuses);
                table_int.add_two_widgets(urlShortenLabel, urlShorten);
+               table_int.add_widget(enableSpell);
                
                var table_re = new HigTable(_("Retweets"));
                table_re.add_two_widgets(reLabel, retweetStyle);
@@ -179,6 +186,9 @@ public class PrefDialog : Dialog {
                //full names or nicks in tweets
                fullNames = new CheckButton.with_label(_("Full names instead of nicknames"));
                
+               //link color
+               nativeLinkColor = new CheckButton.with_label(_("Native links color"));
+               
                //default font in statuses
                var deFontLabel = new Label(_("Default font"));
                deFont = new FontButton();
@@ -198,6 +208,7 @@ public class PrefDialog : Dialog {
                table_tweets.add_widget(roundedAvatars);
                table_tweets.add_widget(rtlSupport);
                table_tweets.add_widget(fullNames);
+               table_tweets.add_widget(nativeLinkColor);
                table_tweets.add_two_widgets(deFontLabel, deFont);
                table_tweets.add_two_widgets(freshColorLabel, freshColor);
                table_tweets.add_two_widgets(opacityTweetsLabel, opacityTweets);
@@ -245,6 +256,10 @@ public class PrefDialog : Dialog {
                                urlShorten.set_active(1);
                                break;
                        
+                       case "ur1.ca":
+                               urlShorten.set_active(2);
+                               break;
+                       
                        default:
                                urlShorten.set_active(0);
                                break;
@@ -271,6 +286,7 @@ public class PrefDialog : Dialog {
                updateInterval.value = prefs.updateInterval;
                numberStatuses.value = prefs.numberStatuses;
                setup_urlshorten(prefs);
+               enableSpell.active = prefs.enableSpell;
                startMin.active = prefs.startMin;
                showTray.active = prefs.showTray;
                showTimelineNotify.active = prefs.showTimelineNotify;
@@ -287,6 +303,7 @@ public class PrefDialog : Dialog {
                opacityTweets.set_value((int)(prefs.opacityTweets.to_double() * 100));
                rtlSupport.active = prefs.rtlSupport;
                fullNames.active = prefs.fullNames;
+               nativeLinkColor.active = prefs.nativeLinkColor;
                deFont.set_font_name("%s %d".printf(prefs.deFontName, prefs.deFontSize));
                
                //colorFrsh setup
@@ -315,9 +332,17 @@ public class PrefDialog : Dialog {
                                case 1:
                                        prefs.urlShorten = "is.gd";
                                        break;
+                               
+                               case 2:
+                                       prefs.urlShorten = "ur1.ca";
+                                       break;
                        }
                });
                
+               enableSpell.toggled.connect(() => {
+                       prefs.enableSpell = enableSpell.active;
+               });
+               
                startMin.toggled.connect(() => {
                        prefs.startMin = startMin.active;
                        
@@ -361,6 +386,10 @@ public class PrefDialog : Dialog {
                        prefs.fullNames = fullNames.active;
                });
                
+               nativeLinkColor.toggled.connect(() => {
+                       prefs.nativeLinkColor = nativeLinkColor.active;
+               });
+               
                deFont.font_set.connect(() => {
                        //warning(deFont.get_font_name());
                        prefs.deFont = deFont.get_font_name();