public CUpdateWindow(CConfiguration config)
     : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     initializeWidgets();
     UpdateProgressBar.Hide();
     UpdateStatusButton.IsFocus = true;
 }
 public CFirstTimeAssistant(CConfiguration config) : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     FtaCloseButton.Clicked    += new EventHandler(onCancelClicked);
     FtaApplyButton.Clicked    += new EventHandler(onApplyClicked);
     FtaHeadlineLabel.Text      = "<span size=\"x-large\" weight=\"bold\">" + FtaHeadlineLabel.Text + "</span>";
     FtaHeadlineLabel.UseMarkup = true;
     ShowModal();
 }
Beispiel #3
0
 public CGdmTheme(CConfiguration config) : base(config)
 {
     installationIsPossible = config.GrepIsAvailable && config.TarIsAvailable && config.SedIsAvailable;
     installationSteps      = 4;
     gdmconf           = config.GdmPath + config.GdmFile;
     gdmconfcustom     = config.GdmPath + config.GdmCustomFile;
     gdmconfcustomtemp = "/tmp/" + config.GdmCustomFile;
 }
 public CGdmTheme(CConfiguration config)
     : base(config)
 {
     installationIsPossible=config.GrepIsAvailable && config.TarIsAvailable && config.SedIsAvailable;
     installationSteps=4;
     gdmconf=config.GdmPath+config.GdmFile;
     gdmconfcustom=config.GdmPath+config.GdmCustomFile;
     gdmconfcustomtemp="/tmp/"+config.GdmCustomFile;
 }
Beispiel #5
0
 public CBackgroundTheme(CConfiguration config) : base(config)
 {
     installationSteps = 3;
     ImgStyle          = (ImageStyle)0;
     useUrlAsPreview   = true;
     PngResolutionList = new ArrayList();
     JpgResolutionList = new ArrayList();
     SvgResolutionList = new ArrayList();
 }
 public CAboutWindow(CConfiguration config,bool ShowWindow)
     : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     AboutVersion.Text = CConfiguration.Version;
     AboutCloseButton.Clicked+=new EventHandler(OnAboutCloseButtonClicked);
     AboutImage.Pixbuf = CUtility.GetPixbuf("./images/gnome.png", config);
     if(ShowWindow)
         mainWindow.ShowAll();
 }
 public CFirstTimeAssistant(CConfiguration config)
     : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     FtaCloseButton.Clicked += new EventHandler(onCancelClicked);
     FtaApplyButton.Clicked += new EventHandler(onApplyClicked);
     FtaHeadlineLabel.Text = "<span size=\"x-large\" weight=\"bold\">"+FtaHeadlineLabel.Text+"</span>";
     FtaHeadlineLabel.UseMarkup = true;
     ShowModal();
 }
 public static Gdk.Pixbuf GetPixbuf(string Filename, CConfiguration config)
 {
     Gdk.Pixbuf pic;
     try{
         pic = new Gdk.Pixbuf(Filename);
     } catch {
         pic = new Gdk.Pixbuf(config.NoThumb);
     }
     return(pic);
 }
 public CBackgroundTheme(CConfiguration config)
     : base(config)
 {
     installationSteps = 3;
     ImgStyle = (ImageStyle)0;
     useUrlAsPreview = true;
     PngResolutionList = new ArrayList();
     JpgResolutionList = new ArrayList();
     SvgResolutionList = new ArrayList();
 }
Beispiel #10
0
 public CAboutWindow(CConfiguration config, bool ShowWindow) : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     AboutVersion.Text         = CConfiguration.Version;
     AboutCloseButton.Clicked += new EventHandler(OnAboutCloseButtonClicked);
     AboutImage.Pixbuf         = CUtility.GetPixbuf("./images/gnome.png", config);
     if (ShowWindow)
     {
         mainWindow.ShowAll();
     }
 }
 public static System.Text.StringBuilder ExecuteSu(CConfiguration config, string Arguments)
 {
     if (config != null)
     {
         return(Execute(config.SudoCommand, config.AttribPrep + "\"" + Arguments + "\""));
     }
     else
     {
         throw new Exception("You have to supply a valid configuration object");
     }
 }
 public CFileDownloader(CConfiguration config)
 {
     ProxyAttrStruct ProxyAttr = config.Proxy;
     if (config.ProxyKind != CConfiguration.ProxyType.None){
         proxy = new WebProxy(ProxyAttr.Ip, ProxyAttr.Port);
         if ((ProxyAttr.BypassList!=null) && (ProxyAttr.BypassList.Length > 0)) {
             for (int i = 0; i < ProxyAttr.BypassList.Length; i++)
                 ProxyAttr.BypassList[i] = "http://" + ProxyAttr.BypassList[i];
             proxy.BypassList = ProxyAttr.BypassList;
         }
         proxy.Credentials = new NetworkCredential (ProxyAttr.User, ProxyAttr.Password);
     }
 }
Beispiel #13
0
        public CArtManager(CConfiguration config)
        {
            //Konfigurationsobjekt: Enthält Pfade und Hilfsmethoden
            this.config = config;

            //Listen zum speichern der Themes anlegen
            SplashThemeList              = new ArrayList();
            Gnome_BackgroundThemeList    = new ArrayList();
            Other_BackgroundThemeList    = new ArrayList();
            Nature_BackgroundThemeList   = new ArrayList();
            Abstract_BackgroundThemeList = new ArrayList();
            GdmGreeterThemeList          = new ArrayList();
            GtkThemeList              = new ArrayList();
            ApplicationThemeList      = new ArrayList();
            WindowDecorationThemeList = new ArrayList();
            IconThemeList             = new ArrayList();
        }
        public CArtManager(CConfiguration config)
        {
            //Konfigurationsobjekt: Enthält Pfade und Hilfsmethoden
            this.config=config;

            //Listen zum speichern der Themes anlegen
            SplashThemeList = new ArrayList();
            Gnome_BackgroundThemeList=new ArrayList();
            Other_BackgroundThemeList=new ArrayList();
            Nature_BackgroundThemeList=new ArrayList();
            Abstract_BackgroundThemeList=new ArrayList();
            GdmGreeterThemeList=new ArrayList();
            GtkThemeList=new ArrayList();
            ApplicationThemeList=new ArrayList();
            WindowDecorationThemeList=new ArrayList();
            IconThemeList = new ArrayList();
        }
Beispiel #15
0
        public CFileDownloader(CConfiguration config)
        {
            ProxyAttrStruct ProxyAttr = config.Proxy;

            if (config.ProxyKind != CConfiguration.ProxyType.None)
            {
                proxy = new WebProxy(ProxyAttr.Ip, ProxyAttr.Port);
                if ((ProxyAttr.BypassList != null) && (ProxyAttr.BypassList.Length > 0))
                {
                    for (int i = 0; i < ProxyAttr.BypassList.Length; i++)
                    {
                        ProxyAttr.BypassList[i] = "http://" + ProxyAttr.BypassList[i];
                    }
                    proxy.BypassList = ProxyAttr.BypassList;
                }
                proxy.Credentials = new NetworkCredential(ProxyAttr.User, ProxyAttr.Password);
            }
        }
        public CSettingsWindow(CConfiguration config, bool ShowWindow)
        {
            ProxyAttrStruct proxy;

            this.config = config;
            string settingsW = "SettingsWindow";

            Glade.XML settingsXml = new Glade.XML(null, "gui.glade", settingsW, null);
            settingsXml.Autoconnect(this);
            mainWindow       = (Gtk.Window)settingsXml.GetWidget(settingsW);
            mainWindow.Title = Catalog.GetString("Settings");
            SettingsGeneralHeadlineLabel.Text      = "<b>" + Catalog.GetString("General settings") + "</b>";
            SettingsGeneralHeadlineLabel.UseMarkup = true;
            SettingsNetworkHeadlineLabel.Text      = "<b>" + Catalog.GetString("Network settings") + "</b>";
            SettingsNetworkHeadlineLabel.UseMarkup = true;
            SettingsXmlCb.Active = config.XmlRefreshInterval;
            SettingsLocationFc.SetCurrentFolder(config.ThemesDownloadPath);
            //Events
            SettingsCancelButton.Clicked  += new EventHandler(OnCancelButtonClicked);
            SettingsOkButton.Clicked      += new EventHandler(OnOkButtonClicked);
            SettingsNoProxyRb.Clicked     += new EventHandler(OnProxyClicked);
            SettingsProxyActiveRb.Clicked += new EventHandler(OnProxyClicked);
            //Proxies
            proxy = config.GetProxy(CConfiguration.ProxyType.Gang);
            SettingsProxyAddress.Text = proxy.Ip;
            SettingsProxyPort.Text    = proxy.Port.ToString();
            proxy = config.GetProxy(CConfiguration.ProxyType.System);
            SettingsProxySystemAddress.Text      = proxy.Ip;
            SettingsProxySystemPort.Text         = proxy.Port.ToString();
            SettingsProxySystemPort.Sensitive    = false;
            SettingsProxySystemAddress.Sensitive = false;
            SettingsProxySystemActiveRb.Active   = (config.ProxyKind == CConfiguration.ProxyType.System);
            SettingsNoProxyRb.Active             = (config.ProxyKind == CConfiguration.ProxyType.None);
            SettingsProxyActiveRb.Active         = (config.ProxyKind == CConfiguration.ProxyType.Gang);

            SettingsUpdateCb.Active = !(config.DontBotherForUpdates);
            config.GConfClient.AddNotify(config.GConfPath + "themesDownloadPath", OnThemesPathChangedEventHandler);
            if (ShowWindow)
            {
                Show();
            }
        }
        public CWindow(CConfiguration config, string WindowName, string WindowTitle, WindowShowType ShowType)
        {
            this.config = config;
            string win = WindowName;

            Glade.XML settingsXml = new Glade.XML(null, "gui.glade", win, null);
            settingsXml.Autoconnect(this);
            mainWindow              = (Gtk.Window)settingsXml.GetWidget(win);
            mainWindow.Title        = WindowTitle;
            mainWindow.DeleteEvent += new DeleteEventHandler(OnWindowDeleteEvent);
            IsShownModal            = (ShowType == WindowShowType.wstModal);
            switch (ShowType)
            {
            case WindowShowType.wstModal: ShowModal(); break;

            case WindowShowType.wstNormal: Show(); break;

            case WindowShowType.wstNo: break;
            }
        }
        public CSettingsWindow(CConfiguration config, bool ShowWindow)
        {
            ProxyAttrStruct proxy;
            this.config=config;
            string settingsW="SettingsWindow";
            Glade.XML settingsXml= new Glade.XML (null, "gui.glade", settingsW, null);
            settingsXml.Autoconnect (this);
            mainWindow = (Gtk.Window) settingsXml.GetWidget (settingsW);
            mainWindow.Title = Catalog.GetString("Settings");
            SettingsGeneralHeadlineLabel.Text = "<b>"+Catalog.GetString("General settings")+"</b>";
            SettingsGeneralHeadlineLabel.UseMarkup = true;
            SettingsNetworkHeadlineLabel.Text = "<b>"+Catalog.GetString("Network settings")+"</b>";
            SettingsNetworkHeadlineLabel.UseMarkup = true;
            SettingsXmlCb.Active = config.XmlRefreshInterval;
            SettingsLocationFc.SetCurrentFolder(config.ThemesDownloadPath);
            //Events
            SettingsCancelButton.Clicked+=new EventHandler(OnCancelButtonClicked);
            SettingsOkButton.Clicked+=new EventHandler(OnOkButtonClicked);
            SettingsNoProxyRb.Clicked+=new EventHandler(OnProxyClicked);
            SettingsProxyActiveRb.Clicked+=new EventHandler(OnProxyClicked);
            //Proxies
            proxy = config.GetProxy(CConfiguration.ProxyType.Gang);
            SettingsProxyAddress.Text = proxy.Ip;
            SettingsProxyPort.Text = proxy.Port.ToString();
            proxy = config.GetProxy(CConfiguration.ProxyType.System);
            SettingsProxySystemAddress.Text = proxy.Ip;
            SettingsProxySystemPort.Text = proxy.Port.ToString();
            SettingsProxySystemPort.Sensitive = false;
            SettingsProxySystemAddress.Sensitive = false;
            SettingsProxySystemActiveRb.Active =  (config.ProxyKind == CConfiguration.ProxyType.System);
            SettingsNoProxyRb.Active = (config.ProxyKind == CConfiguration.ProxyType.None);
            SettingsProxyActiveRb.Active = (config.ProxyKind == CConfiguration.ProxyType.Gang);

            SettingsUpdateCb.Active = !(config.DontBotherForUpdates);
            config.GConfClient.AddNotify(config.GConfPath+"themesDownloadPath",OnThemesPathChangedEventHandler);
            if(ShowWindow) Show();
        }
Beispiel #19
0
 public CIconTheme(CConfiguration config) : base(config)
 {
     installationSteps = 6;
 }
 public void GetAllThumbs(CConfiguration.ArtType Type)
 {
     ArtType=Type;
     GetAllThumbs();
 }
 public CWindowDecorationTheme(CConfiguration config)
     : base(config)
 {
     installationSteps=4;
 }
 public CIconTheme(CConfiguration config)
     : base(config)
 {
     installationSteps=6;
 }
Beispiel #23
0
 public CGtkTheme(CConfiguration config) : base(config)
 {
 }
Beispiel #24
0
    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng","./locale");
        config=new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";
        Glade.XML gxml = new Glade.XML (null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window) gxml.GetWidget (mainW);
        gxml.Autoconnect (this);

        //Connect all events
        mainWindow.DeleteEvent+=new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked  += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked  += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked  += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed += new EventHandler(OnFilterEntriesChanged);
        //		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
        //		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
        //		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
        //		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp= false;
        if (config.NeverStartedBefore)
            new CFirstTimeAssistant(config);
        else if (config.DontBotherForUpdates==false) {
            if (config.UpdateAvailable) {
                Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
                RestartApp = ShowUpdateWindow();
            }
        }

        if (!RestartApp) {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk) {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for(int i=0;i<ListStoreCount;i++){
                sWins[i] = (Gtk.ScrolledWindow)(gxml.GetWidget("swin"+i));
                stores[i]= new ListStore (typeof(Pixbuf),typeof (string), typeof (string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active=0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox,1,2,2,3);
            LowerTable.Attach(imageResolutionsBox,1,2,3,4);
            LowerTable.Attach(imageStyleBox,1,2,4,5);

            OnSwitchPage(MainNotebook,new SwitchPageArgs());
            Gtk.Application.Run ();

        }
    }
Beispiel #25
0
 public CTheme(CConfiguration config)
 {
     this.config = config;
 }
 public static Gdk.Pixbuf GetPixbuf(string Filename,CConfiguration config)
 {
     Gdk.Pixbuf pic;
     try{
         pic = new Gdk.Pixbuf(Filename);
     } catch{
         pic = new Gdk.Pixbuf(config.NoThumb);
     }
     return pic;
 }
 public CTheme(CConfiguration config)
 {
     this.config = config;
 }
 public CSplashTheme(CConfiguration config) : base(config)
 {
     useUrlAsPreview   = true;
     installationSteps = 3;
 }
 //true if an update is available; false if not or an error occured
 public static bool IsAnUpdateAvailable(string UpdateUrl, Gtk.ProgressBar bar, out string NewestVersionNumberOnServer, out string DownloadLocation, CConfiguration config)
 {
     NewestVersionNumberOnServer = CConfiguration.Version;
     DownloadLocation            = "";
     try {
         string localUpdateFile = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + Path.DirectorySeparatorChar + Path.GetFileName(UpdateUrl);
         new CFileDownloader(config).DownloadFile(UpdateUrl, localUpdateFile, bar);
         // version information contains the text "x.x.x" (without the quotes) and the download location in the second row
         if (File.Exists(localUpdateFile))
         {
             TextReader tr        = new StreamReader(localUpdateFile);
             string     newestVer = tr.ReadLine();
             //Get the appropriate download location (Releasename@Location)
             while (true)
             {
                 DownloadLocation = tr.ReadLine();
                 if (DownloadLocation != null)
                 {
                     if (DownloadLocation.ToLower().Contains(config.DistributionVersion.ToString().ToLower() + '@'))
                     {
                         int pos = DownloadLocation.IndexOf('@') + 1;
                         DownloadLocation = DownloadLocation.Substring(pos);
                         break;
                     }
                 }
                 else
                 {
                     break;
                 }
             }
             System.Console.WriteLine(DownloadLocation);
             tr.Close();
             tr = null;
             File.Delete(localUpdateFile);
             string shortVersionFromFile = newestVer.Replace(".", String.Empty);
             string shortVersionFromApp  = CConfiguration.Version.Replace(".", String.Empty);
             NewestVersionNumberOnServer = newestVer;
             return(Convert.ToInt32(shortVersionFromApp) < Convert.ToInt32(shortVersionFromFile));
         }
         else
         {
             return(false);
         }
     } catch {
         Console.WriteLine("Unable to get version information from " + UpdateUrl);
         return(false);
     }
 }
 public static System.Text.StringBuilder ExecuteSu(CConfiguration config, string Arguments)
 {
     if (config != null)
         return Execute(config.SudoCommand,config.AttribPrep+"\""+Arguments+"\"");
     else
         throw new Exception("You have to supply a valid configuration object");
 }
 public CApplicationTheme(CConfiguration config)
     : base(config)
 {
     installationSteps=4;
 }
 public CApplicationTheme(CConfiguration config) : base(config)
 {
     installationSteps = 4;
 }
 public CUpdateWindow(CConfiguration config) : base(config, windowName, windowTitle, WindowShowType.wstNo)
 {
     initializeWidgets();
     UpdateProgressBar.Hide();
     UpdateStatusButton.IsFocus = true;
 }
 //true if an update is available; false if not or an error occured
 public static bool IsAnUpdateAvailable(string UpdateUrl, Gtk.ProgressBar bar, out string NewestVersionNumberOnServer, out string DownloadLocation,CConfiguration config)
 {
     NewestVersionNumberOnServer = CConfiguration.Version;
     DownloadLocation = "";
     try {
         string localUpdateFile = Environment.GetFolderPath(Environment.SpecialFolder.Personal)+Path.DirectorySeparatorChar+ Path.GetFileName(UpdateUrl);
         new CFileDownloader(config).DownloadFile(UpdateUrl, localUpdateFile, bar);
         // version information contains the text "x.x.x" (without the quotes) and the download location in the second row
         if (File.Exists(localUpdateFile))
         {
             TextReader tr = new StreamReader(localUpdateFile);
             string newestVer = tr.ReadLine();
             //Get the appropriate download location (Releasename@Location)
             while (true) {
                 DownloadLocation = tr.ReadLine();
                 if (DownloadLocation != null) {
                     if (DownloadLocation.ToLower().Contains(config.DistributionVersion.ToString().ToLower()+'@')){
                         int pos = DownloadLocation.IndexOf('@')+1;
                         DownloadLocation = DownloadLocation.Substring(pos);
                         break;
                     }
                 } else
                     break;
             }
             System.Console.WriteLine(DownloadLocation);
             tr.Close();
             tr = null;
             File.Delete(localUpdateFile);
             string shortVersionFromFile = newestVer.Replace(".", String.Empty);
             string shortVersionFromApp = CConfiguration.Version.Replace(".", String.Empty);
             NewestVersionNumberOnServer=newestVer;
             return (Convert.ToInt32(shortVersionFromApp) < Convert.ToInt32(shortVersionFromFile));
         } else
             return false;
     } catch {
         Console.WriteLine("Unable to get version information from "+UpdateUrl);
         return false;
     }
 }
 public CWindowDecorationTheme(CConfiguration config) : base(config)
 {
     installationSteps = 4;
 }
 public CSplashTheme(CConfiguration config)
     : base(config)
 {
     useUrlAsPreview = true;
     installationSteps=3;
 }
 public CGtkTheme(CConfiguration config)
     : base(config)
 {
 }