diff --git a/data/meson.build b/data/meson.build index 6c6b1a9c..975205fa 100644 --- a/data/meson.build +++ b/data/meson.build @@ -6,6 +6,4 @@ if get_option('gtk-frontend') subdir('icons') subdir('misc') subdir('man') -elif get_option('theme-manager') - subdir('misc') endif diff --git a/data/misc/meson.build b/data/misc/meson.build index 89b7b9b5..fa337a8f 100644 --- a/data/misc/meson.build +++ b/data/misc/meson.build @@ -49,27 +49,6 @@ if get_option('gtk-frontend') endif endif -if get_option('theme-manager') - htm_desktop = i18n.merge_file( - input: 'net.zoite.Zoitechat.ThemeManager.desktop.in', - output: 'net.zoite.Zoitechat.ThemeManager.desktop', - po_dir: '../../po', - type: 'desktop', - install: true, - install_dir: appdir - ) - - if desktop_utils.found() - test('Validate net.zoite.Zoitechat.ThemeManager.desktop', desktop_utils, - args: [htm_desktop] - ) - endif - - install_data('net.zoite.Zoitechat.ThemeManager.xml', - install_dir: join_paths(get_option('datadir'), 'mime/packages') - ) -endif - if get_option('plugin') plugin_metainfo = [] diff --git a/meson.build b/meson.build index 78809ac0..1258c954 100644 --- a/meson.build +++ b/meson.build @@ -165,9 +165,7 @@ if cc.get_id() != 'msvc' subdir('data') subdir('po') # FIXME: build xgettext - meson.add_install_script('meson_post_install.py', - '@0@'.format(get_option('theme-manager')) - ) + meson.add_install_script('meson_post_install.py') endif if meson.version().version_compare('>= 0.53.0') diff --git a/meson_options.txt b/meson_options.txt index c2ca54a2..8120c030 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,9 +5,6 @@ option('gtk-frontend', type: 'boolean', option('text-frontend', type: 'boolean', value: false, description: 'Text interface (not generally useful)' ) -option('theme-manager', type: 'boolean', value: false, - description: 'Utility to help manage themes, requires mono/.net' -) # Features option('tls', type: 'feature', value: 'enabled', diff --git a/meson_post_install.py b/meson_post_install.py index 6944242a..ba0063fe 100644 --- a/meson_post_install.py +++ b/meson_post_install.py @@ -6,7 +6,6 @@ import subprocess prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') datadir = os.path.join(prefix, 'share') -with_thememan = sys.argv[1] == 'true' # Packaging tools define DESTDIR and this isn't needed for them if 'DESTDIR' not in os.environ: @@ -17,8 +16,3 @@ if 'DESTDIR' not in os.environ: print('Updating desktop database...') subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'applications')]) - - if with_thememan: - print('Updating mime database...') - subprocess.call(['update-mime-database', - os.path.join(datadir, 'mime')]) diff --git a/src/htm/Main.Designer.cs b/src/htm/Main.Designer.cs deleted file mode 100644 index 7eb6cd0c..00000000 --- a/src/htm/Main.Designer.cs +++ /dev/null @@ -1,337 +0,0 @@ -/** - * ZoiteChat Theme Manager - * - * Copyright (C) 2012 Patrick Griffs - * Copyright (C) 2012 Berke Viktor - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -namespace thememan -{ - partial class HTM - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HTM)); - this.themelist = new System.Windows.Forms.ListBox(); - this.themecolor0 = new System.Windows.Forms.Label(); - this.themecolor1 = new System.Windows.Forms.Label(); - this.themecolor2 = new System.Windows.Forms.Label(); - this.themecolor3 = new System.Windows.Forms.Label(); - this.themecolor4 = new System.Windows.Forms.Label(); - this.themecolor5 = new System.Windows.Forms.Label(); - this.themecolor6 = new System.Windows.Forms.Label(); - this.themecolor7 = new System.Windows.Forms.Label(); - this.themecolor8 = new System.Windows.Forms.Label(); - this.themecolor9 = new System.Windows.Forms.Label(); - this.themecolora = new System.Windows.Forms.Label(); - this.themecolorb = new System.Windows.Forms.Label(); - this.themecolorc = new System.Windows.Forms.Label(); - this.themecolord = new System.Windows.Forms.Label(); - this.themecolore = new System.Windows.Forms.Label(); - this.themecolorf = new System.Windows.Forms.Label(); - this.themecolorfg = new System.Windows.Forms.Label(); - this.themecolortextbg = new System.Windows.Forms.Label(); - this.importbutton = new System.Windows.Forms.Button(); - this.applybutton = new System.Windows.Forms.Button(); - this.themecolorfgmarked = new System.Windows.Forms.Label(); - this.deleteButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // themelist - // - this.themelist.FormattingEnabled = true; - this.themelist.Location = new System.Drawing.Point(12, 12); - this.themelist.Name = "themelist"; - this.themelist.Size = new System.Drawing.Size(160, 199); - this.themelist.TabIndex = 0; - this.themelist.SelectedIndexChanged += new System.EventHandler(this.theme_selected); - // - // themecolor0 - // - this.themecolor0.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor0.Location = new System.Drawing.Point(189, 36); - this.themecolor0.Name = "themecolor0"; - this.themecolor0.Size = new System.Drawing.Size(40, 40); - this.themecolor0.TabIndex = 6; - // - // themecolor1 - // - this.themecolor1.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor1.Location = new System.Drawing.Point(239, 36); - this.themecolor1.Name = "themecolor1"; - this.themecolor1.Size = new System.Drawing.Size(40, 40); - this.themecolor1.TabIndex = 10; - // - // themecolor2 - // - this.themecolor2.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor2.Location = new System.Drawing.Point(289, 36); - this.themecolor2.Name = "themecolor2"; - this.themecolor2.Size = new System.Drawing.Size(40, 40); - this.themecolor2.TabIndex = 14; - // - // themecolor3 - // - this.themecolor3.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor3.Location = new System.Drawing.Point(339, 36); - this.themecolor3.Name = "themecolor3"; - this.themecolor3.Size = new System.Drawing.Size(40, 40); - this.themecolor3.TabIndex = 18; - // - // themecolor4 - // - this.themecolor4.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor4.Location = new System.Drawing.Point(189, 87); - this.themecolor4.Name = "themecolor4"; - this.themecolor4.Size = new System.Drawing.Size(40, 40); - this.themecolor4.TabIndex = 4; - // - // themecolor5 - // - this.themecolor5.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor5.Location = new System.Drawing.Point(239, 87); - this.themecolor5.Name = "themecolor5"; - this.themecolor5.Size = new System.Drawing.Size(40, 40); - this.themecolor5.TabIndex = 8; - // - // themecolor6 - // - this.themecolor6.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor6.Location = new System.Drawing.Point(289, 87); - this.themecolor6.Name = "themecolor6"; - this.themecolor6.Size = new System.Drawing.Size(40, 40); - this.themecolor6.TabIndex = 12; - // - // themecolor7 - // - this.themecolor7.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor7.Location = new System.Drawing.Point(339, 87); - this.themecolor7.Name = "themecolor7"; - this.themecolor7.Size = new System.Drawing.Size(40, 40); - this.themecolor7.TabIndex = 16; - // - // themecolor8 - // - this.themecolor8.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor8.Location = new System.Drawing.Point(189, 138); - this.themecolor8.Name = "themecolor8"; - this.themecolor8.Size = new System.Drawing.Size(40, 40); - this.themecolor8.TabIndex = 5; - // - // themecolor9 - // - this.themecolor9.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolor9.Location = new System.Drawing.Point(239, 138); - this.themecolor9.Name = "themecolor9"; - this.themecolor9.Size = new System.Drawing.Size(40, 40); - this.themecolor9.TabIndex = 9; - // - // themecolora - // - this.themecolora.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolora.Location = new System.Drawing.Point(289, 138); - this.themecolora.Name = "themecolora"; - this.themecolora.Size = new System.Drawing.Size(40, 40); - this.themecolora.TabIndex = 13; - // - // themecolorb - // - this.themecolorb.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolorb.Location = new System.Drawing.Point(339, 138); - this.themecolorb.Name = "themecolorb"; - this.themecolorb.Size = new System.Drawing.Size(40, 40); - this.themecolorb.TabIndex = 17; - // - // themecolorc - // - this.themecolorc.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolorc.Location = new System.Drawing.Point(189, 189); - this.themecolorc.Name = "themecolorc"; - this.themecolorc.Size = new System.Drawing.Size(40, 40); - this.themecolorc.TabIndex = 7; - // - // themecolord - // - this.themecolord.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolord.Location = new System.Drawing.Point(239, 189); - this.themecolord.Name = "themecolord"; - this.themecolord.Size = new System.Drawing.Size(40, 40); - this.themecolord.TabIndex = 11; - // - // themecolore - // - this.themecolore.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolore.Location = new System.Drawing.Point(289, 189); - this.themecolore.Name = "themecolore"; - this.themecolore.Size = new System.Drawing.Size(40, 40); - this.themecolore.TabIndex = 15; - // - // themecolorf - // - this.themecolorf.BackColor = System.Drawing.SystemColors.HotTrack; - this.themecolorf.Location = new System.Drawing.Point(339, 189); - this.themecolorf.Name = "themecolorf"; - this.themecolorf.Size = new System.Drawing.Size(40, 40); - this.themecolorf.TabIndex = 19; - // - // themecolorfg - // - this.themecolorfg.AutoSize = true; - this.themecolorfg.BackColor = System.Drawing.Color.Transparent; - this.themecolorfg.Location = new System.Drawing.Point(190, 18); - this.themecolorfg.Name = "themecolorfg"; - this.themecolorfg.Size = new System.Drawing.Size(66, 13); - this.themecolorfg.TabIndex = 21; - this.themecolorfg.Text = "Sample Text"; - // - // themecolortextbg - // - this.themecolortextbg.Location = new System.Drawing.Point(180, 15); - this.themecolortextbg.Name = "themecolortextbg"; - this.themecolortextbg.Size = new System.Drawing.Size(208, 223); - this.themecolortextbg.TabIndex = 20; - // - // importbutton - // - this.importbutton.Location = new System.Drawing.Point(12, 217); - this.importbutton.Name = "importbutton"; - this.importbutton.Size = new System.Drawing.Size(52, 23); - this.importbutton.TabIndex = 1; - this.importbutton.Text = "Add..."; - this.importbutton.UseVisualStyleBackColor = true; - this.importbutton.Click += new System.EventHandler(this.importbutton_Click_1); - // - // applybutton - // - this.applybutton.Location = new System.Drawing.Point(120, 217); - this.applybutton.Name = "applybutton"; - this.applybutton.Size = new System.Drawing.Size(52, 23); - this.applybutton.TabIndex = 3; - this.applybutton.Text = "Apply"; - this.applybutton.UseVisualStyleBackColor = true; - this.applybutton.Click += new System.EventHandler(this.applybutton_Click_1); - // - // themecolorfgmarked - // - this.themecolorfgmarked.AutoSize = true; - this.themecolorfgmarked.Location = new System.Drawing.Point(313, 18); - this.themecolorfgmarked.Name = "themecolorfgmarked"; - this.themecolorfgmarked.Size = new System.Drawing.Size(67, 13); - this.themecolorfgmarked.TabIndex = 22; - this.themecolorfgmarked.Text = "Marked Text"; - // - // deleteButton - // - this.deleteButton.Location = new System.Drawing.Point(66, 217); - this.deleteButton.Name = "deleteButton"; - this.deleteButton.Size = new System.Drawing.Size(52, 23); - this.deleteButton.TabIndex = 2; - this.deleteButton.Text = "Delete"; - this.deleteButton.UseVisualStyleBackColor = true; - this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click); - // - // HTM - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(397, 248); - this.Controls.Add(this.deleteButton); - this.Controls.Add(this.themecolorfgmarked); - this.Controls.Add(this.themecolorfg); - this.Controls.Add(this.themecolorf); - this.Controls.Add(this.themecolor3); - this.Controls.Add(this.themecolorb); - this.Controls.Add(this.themecolor7); - this.Controls.Add(this.themecolore); - this.Controls.Add(this.themecolor2); - this.Controls.Add(this.themecolora); - this.Controls.Add(this.themecolor6); - this.Controls.Add(this.themecolord); - this.Controls.Add(this.themecolor1); - this.Controls.Add(this.themecolor9); - this.Controls.Add(this.themecolor5); - this.Controls.Add(this.themecolorc); - this.Controls.Add(this.themecolor0); - this.Controls.Add(this.themecolor8); - this.Controls.Add(this.themecolor4); - this.Controls.Add(this.importbutton); - this.Controls.Add(this.applybutton); - this.Controls.Add(this.themelist); - this.Controls.Add(this.themecolortextbg); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "HTM"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "ZoiteChat Theme Manager"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ListBox themelist; - private System.Windows.Forms.Label themecolor0; - private System.Windows.Forms.Label themecolor1; - private System.Windows.Forms.Label themecolor2; - private System.Windows.Forms.Label themecolor3; - private System.Windows.Forms.Label themecolor4; - private System.Windows.Forms.Label themecolor5; - private System.Windows.Forms.Label themecolor6; - private System.Windows.Forms.Label themecolor7; - private System.Windows.Forms.Label themecolor8; - private System.Windows.Forms.Label themecolor9; - private System.Windows.Forms.Label themecolora; - private System.Windows.Forms.Label themecolorb; - private System.Windows.Forms.Label themecolorc; - private System.Windows.Forms.Label themecolord; - private System.Windows.Forms.Label themecolore; - private System.Windows.Forms.Label themecolorf; - private System.Windows.Forms.Label themecolorfg; - private System.Windows.Forms.Label themecolortextbg; - private System.Windows.Forms.Button importbutton; - private System.Windows.Forms.Button applybutton; - private System.Windows.Forms.Label themecolorfgmarked; - private System.Windows.Forms.Button deleteButton; - } -} - diff --git a/src/htm/Main.cs b/src/htm/Main.cs deleted file mode 100644 index f99e8dc8..00000000 --- a/src/htm/Main.cs +++ /dev/null @@ -1,381 +0,0 @@ -/** - * ZoiteChat Theme Manager - * - * Copyright (C) 2012 Patrick Griffs - * Copyright (C) 2012 Berke Viktor - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -using System; -using System.Collections.Generic; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -/* using System.IO.Compression; */ -using System.IO.Packaging; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using System.Net; - -namespace thememan -{ - public partial class HTM : Form - { - public string zoitechatdir; - public string themedir; - - OpenFileDialog importDialog; - - static bool IsPortable(out string directory) - { - System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly(); - directory = asm != null ? asm.Location : string.Empty; - if (string.IsNullOrEmpty(directory)) - { - directory = string.Empty; - return File.Exists("portable-mode"); - } - directory = Path.GetDirectoryName(directory); - return File.Exists(Path.Combine(directory, "portable-mode")); - } - - public HTM () - { - InitializeComponent (); - string portableDir; - - if (RunningOnWindows() && IsPortable(out portableDir)) - { - zoitechatdir = Path.Combine(portableDir, "config\\"); - - if (!Directory.Exists(zoitechatdir)) - { - MessageBox.Show("ZoiteChat installation not found!\nCheck your .\\config folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - Environment.Exit(1); - } - } - else - { - /* Environment.SpecialFolder.ApplicationData - * Windows: %APPDATA% - * Unix: ~/.config - * Windows is case-insensitive so 'zoitechat' should be fine for both - */ - zoitechatdir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "zoitechat"); - - if (!Directory.Exists(zoitechatdir)) - { - if (RunningOnWindows()) - { - MessageBox.Show("ZoiteChat installation not found!\nCheck your %APPDATA%\\ZoiteChat folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - else - { - MessageBox.Show("ZoiteChat installation not found!\nCheck your ~/.config/zoitechat folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - Environment.Exit(1); - } - } - - themedir = Path.Combine(zoitechatdir, "themes"); - ListThemes(); - - String[] arguments = Environment.GetCommandLineArgs(); - if (arguments.Length > 1) - { - FileInfo fi = new FileInfo(arguments[1]); - attemptImport(fi); - } - } - - private bool RunningOnWindows() - { - if (Environment.OSVersion.ToString().ToLower().Contains("windows")) - { - return true; - } - else - { - return false; - } - } - - private void ListThemes() - { - themelist.Items.Clear(); - - if (Directory.Exists(themedir)) - { - foreach (string theme in Directory.GetDirectories(themedir)) - { - themelist.Items.Add(theme.Remove(0, themedir.Length + 1)); - } - } - else - { - Directory.CreateDirectory(themedir); - } - - if (themelist.Items.Count == 0) - { - applybutton.Enabled = false; - deleteButton.Enabled = false; - } - else - { - themelist.SetSelected(0, true); - } - } - - private void ShowColors(List> themecolors) - { - List labels = this.Controls.OfType